summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2017-10-07 07:59:01 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2017-10-07 07:59:01 +0200
commitbfa4dba15485b4192f8bbe13345e9658c97ecf76 (patch)
treefb9c6e5860881fbde902f7cbdbd41dc4a3a9fb5d
parentf7bdc2acff3c13a6d632c28c4569690ab106eed7 (diff)
New upstream version 0.6.0+dfsg
-rw-r--r--CHANGELOG.rst56
-rw-r--r--LICENSE29
-rw-r--r--MANIFEST.in5
-rw-r--r--PKG-INFO87
-rw-r--r--README.rst87
-rwxr-xr-xbuild-deb.sh239
-rw-r--r--copyright41
-rw-r--r--doc/source/Tutorials/fitconfig.rst2
-rw-r--r--doc/source/Tutorials/img/silx_view_edf.pngbin0 -> 42917 bytes
-rw-r--r--doc/source/Tutorials/io.rst289
-rw-r--r--doc/source/Tutorials/specfile_to_hdf5.rst57
-rw-r--r--doc/source/conf.py59
-rw-r--r--doc/source/description/img/sift_frame_ROI.pngbin0 -> 57727 bytes
-rw-r--r--doc/source/description/img/sift_match2.pngbin0 -> 496462 bytes
-rw-r--r--doc/source/description/sift.rst4
-rw-r--r--doc/source/ext/sphinxext-archive.py184
-rw-r--r--doc/source/index.rst15
-rw-r--r--doc/source/license.rst4
-rw-r--r--doc/source/modules/gui/data/img/ArrayTableWidget.pngbin0 -> 29088 bytes
-rw-r--r--doc/source/modules/gui/fit/backgroundwidget.rst7
-rw-r--r--doc/source/modules/gui/fit/img/BackgroundDialog.pngbin0 -> 52076 bytes
-rw-r--r--doc/source/modules/gui/fit/img/FitWidget.pngbin0 -> 43479 bytes
-rw-r--r--doc/source/modules/gui/fit/img/bgwidget.pngbin68544 -> 0 bytes
-rw-r--r--doc/source/modules/gui/fit/index.rst4
-rw-r--r--doc/source/modules/gui/gallery.rst273
-rw-r--r--doc/source/modules/gui/icons.rst54
-rw-r--r--doc/source/modules/gui/img/IPythonDockWidget.pngbin0 -> 27683 bytes
-rw-r--r--doc/source/modules/gui/img/IPythonWidget.pngbin0 -> 28980 bytes
-rw-r--r--doc/source/modules/gui/index.rst8
-rw-r--r--doc/source/modules/gui/plot/actions/control.rst5
-rw-r--r--doc/source/modules/gui/plot/actions/examples.rst (renamed from doc/source/modules/gui/plot/plotactions_examples.rst)6
-rw-r--r--doc/source/modules/gui/plot/actions/fit.rst5
-rw-r--r--doc/source/modules/gui/plot/actions/histogram.rst5
-rw-r--r--doc/source/modules/gui/plot/actions/img/fftAction0.png (renamed from doc/source/modules/gui/plot/img/fftAction0.png)bin91165 -> 91165 bytes
-rw-r--r--doc/source/modules/gui/plot/actions/img/fftAction1.png (renamed from doc/source/modules/gui/plot/img/fftAction1.png)bin38847 -> 38847 bytes
-rw-r--r--doc/source/modules/gui/plot/actions/img/shiftAction0.png (renamed from doc/source/modules/gui/plot/img/shiftAction0.png)bin29092 -> 29092 bytes
-rw-r--r--doc/source/modules/gui/plot/actions/img/shiftAction3.png (renamed from doc/source/modules/gui/plot/img/shiftAction3.png)bin25949 -> 25949 bytes
-rw-r--r--doc/source/modules/gui/plot/actions/index.rst30
-rw-r--r--doc/source/modules/gui/plot/actions/io.rst6
-rw-r--r--doc/source/modules/gui/plot/actions/medfilt.rst5
-rw-r--r--doc/source/modules/gui/plot/colormap.rst16
-rw-r--r--doc/source/modules/gui/plot/compleximageview.rst19
-rw-r--r--doc/source/modules/gui/plot/dev.rst20
-rw-r--r--doc/source/modules/gui/plot/getting_started.rst52
-rw-r--r--doc/source/modules/gui/plot/imageview.rst6
-rw-r--r--doc/source/modules/gui/plot/img/ComplexImageView.pngbin0 -> 72268 bytes
-rw-r--r--doc/source/modules/gui/plot/img/printPreviewMultiPlot.pngbin0 -> 25948 bytes
-rw-r--r--doc/source/modules/gui/plot/index.rst92
-rw-r--r--doc/source/modules/gui/plot/items.rst83
-rw-r--r--doc/source/modules/gui/plot/plot.rst16
-rw-r--r--doc/source/modules/gui/plot/plotactions.rst20
-rw-r--r--doc/source/modules/gui/plot/plotwidget.rst138
-rw-r--r--doc/source/modules/gui/plot/printpreviewtoolbutton.rst8
-rw-r--r--doc/source/modules/gui/plot/stackview.rst4
-rw-r--r--doc/source/modules/gui/plot3d/actions.rst17
-rw-r--r--doc/source/modules/gui/plot3d/dev.rst8
-rw-r--r--doc/source/modules/gui/plot3d/index.rst39
-rw-r--r--doc/source/modules/gui/plot3d/scalarfieldview.rst7
-rw-r--r--doc/source/modules/gui/plot3d/toolbars.rst29
-rw-r--r--doc/source/modules/gui/plot3d/tools.rst40
-rw-r--r--doc/source/modules/gui/widgets/img/FrameBrowser.pngbin0 -> 3731 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.pngbin0 -> 4215 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/PeriodicCombo.pngbin0 -> 3464 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/PeriodicList.pngbin0 -> 12035 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/PeriodicTable.pngbin0 -> 35124 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/TableWidget.pngbin0 -> 4058 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/ThreadPoolPushButton.pngbin0 -> 2729 bytes
-rw-r--r--doc/source/modules/gui/widgets/img/WaitingPushButton.pngbin0 -> 1962 bytes
-rw-r--r--doc/source/modules/gui/widgets/index.rst1
-rw-r--r--doc/source/modules/gui/widgets/printpreview.rst60
-rw-r--r--doc/source/modules/image/backprojection.rst8
-rw-r--r--doc/source/modules/image/index.rst1
-rw-r--r--doc/source/modules/image/projection.rst15
-rw-r--r--doc/source/modules/image/reconstruction.rst14
-rw-r--r--doc/source/modules/io/convert.rst8
-rw-r--r--doc/source/modules/io/index.rst7
-rw-r--r--doc/source/modules/io/spech5.rst36
-rw-r--r--doc/source/modules/io/spectoh5.rst8
-rw-r--r--doc/source/modules/utils/decorators.rst6
-rw-r--r--doc/source/sample_code/img/animatedicons.pngbin0 -> 7594 bytes
-rw-r--r--doc/source/sample_code/img/customHdf5TreeModel.pngbin0 -> 51980 bytes
-rw-r--r--doc/source/sample_code/img/fftPlotAction.pngbin0 -> 105383 bytes
-rw-r--r--doc/source/sample_code/img/hdf5widget.pngbin0 -> 58367 bytes
-rw-r--r--doc/source/sample_code/img/icons.pngbin0 -> 103832 bytes
-rw-r--r--doc/source/sample_code/img/imageview.pngbin0 -> 49273 bytes
-rw-r--r--doc/source/sample_code/img/periodicTable.pngbin0 -> 33409 bytes
-rw-r--r--doc/source/sample_code/img/plotContextMenu.pngbin0 -> 32690 bytes
-rw-r--r--doc/source/sample_code/img/plotItemsSelector.pngbin0 -> 26989 bytes
-rw-r--r--doc/source/sample_code/img/plotLimits.pngbin0 -> 151285 bytes
-rw-r--r--doc/source/sample_code/img/plotUpdateFromThread.pngbin0 -> 62761 bytes
-rw-r--r--doc/source/sample_code/img/plotWidget.pngbin0 -> 78293 bytes
-rw-r--r--doc/source/sample_code/img/printPreview.pngbin0 -> 37076 bytes
-rw-r--r--doc/source/sample_code/img/scatterMask.pngbin0 -> 44803 bytes
-rw-r--r--doc/source/sample_code/img/shiftPlotAction.pngbin0 -> 38559 bytes
-rw-r--r--doc/source/sample_code/img/simplewidget.pngbin0 -> 9276 bytes
-rw-r--r--doc/source/sample_code/img/stackView.pngbin0 -> 56329 bytes
-rw-r--r--doc/source/sample_code/img/syncaxis.pngbin0 -> 133659 bytes
-rw-r--r--doc/source/sample_code/img/viewer3DVolume.pngbin0 -> 58235 bytes
-rw-r--r--doc/source/sample_code/index.rst232
-rw-r--r--doc/source/tutorials.rst12
-rw-r--r--examples/customHdf5TreeModel.py290
-rwxr-xr-xexamples/fftPlotAction.py20
-rw-r--r--examples/icons.py10
-rw-r--r--examples/plotContextMenu.py100
-rwxr-xr-x[-rw-r--r--]examples/plotItemsSelector.py (renamed from examples/colorbar.py)50
-rw-r--r--examples/plotLimits.py93
-rw-r--r--examples/plotUpdateFromThread.py128
-rw-r--r--examples/plotWidget.py121
-rwxr-xr-xexamples/printPreview.py82
-rwxr-xr-xexamples/shiftPlotAction.py2
-rw-r--r--examples/syncaxis.py101
-rw-r--r--examples/viewer3DVolume.py27
-rw-r--r--[-rwxr-xr-x]examples/writetoh5.py (renamed from examples/spectoh5.py)20
-rw-r--r--package/debian8/changelog22
-rw-r--r--package/debian8/clean1
-rw-r--r--package/debian8/compat1
-rw-r--r--package/debian8/control198
-rw-r--r--package/debian8/gbp.conf2
-rw-r--r--package/debian8/python-silx-doc.doc-base9
-rwxr-xr-xpackage/debian8/rules54
-rw-r--r--package/debian8/source/format1
-rw-r--r--package/debian8/source/options1
-rw-r--r--package/debian8/watch5
-rw-r--r--package/debian9/changelog22
-rw-r--r--package/debian9/clean1
-rw-r--r--package/debian9/compat1
-rw-r--r--package/debian9/control125
-rw-r--r--package/debian9/gbp.conf2
-rw-r--r--package/debian9/python-silx-doc.doc-base9
-rwxr-xr-xpackage/debian9/rules50
-rw-r--r--package/debian9/source/format1
-rw-r--r--package/debian9/source/options1
-rw-r--r--package/debian9/watch5
-rw-r--r--package/desktop/org.silx.SilxView.desktop9
-rw-r--r--package/desktop/silx.pngbin0 -> 3172 bytes
-rw-r--r--package/desktop/silx.svg118
-rw-r--r--requirements-dev.txt7
-rw-r--r--requirements.txt29
-rwxr-xr-xrun_tests.py84
-rw-r--r--setup.cfg1
-rw-r--r--setup.py74
-rw-r--r--silx.egg-info/PKG-INFO87
-rw-r--r--silx.egg-info/SOURCES.txt338
-rw-r--r--silx/__init__.py7
-rw-r--r--silx/__main__.py16
-rw-r--r--silx/app/convert.py283
-rw-r--r--silx/app/qtutils.py243
-rw-r--r--silx/app/test/__init__.py10
-rw-r--r--silx/app/test/test_convert.py182
-rw-r--r--silx/app/test/test_view.py33
-rw-r--r--silx/app/test_.py175
-rw-r--r--silx/app/view.py184
-rw-r--r--silx/gui/_glutils/FramebufferTexture.py78
-rw-r--r--silx/gui/_glutils/OpenGLWidget.py409
-rw-r--r--silx/gui/_glutils/VertexBuffer.py10
-rw-r--r--silx/gui/_glutils/__init__.py1
-rw-r--r--silx/gui/_glutils/font.py32
-rw-r--r--silx/gui/console.py4
-rw-r--r--silx/gui/data/ArrayTableModel.py7
-rw-r--r--silx/gui/data/ArrayTableWidget.py2
-rw-r--r--silx/gui/data/DataViewer.py10
-rw-r--r--silx/gui/data/DataViewerFrame.py12
-rw-r--r--silx/gui/data/DataViews.py209
-rw-r--r--silx/gui/data/Hdf5TableView.py76
-rw-r--r--silx/gui/data/HexaTableView.py278
-rw-r--r--silx/gui/data/NXdataWidgets.py22
-rw-r--r--silx/gui/data/RecordTableView.py10
-rw-r--r--silx/gui/data/TextFormatter.py168
-rw-r--r--silx/gui/data/test/test_dataviewer.py28
-rw-r--r--silx/gui/data/test/test_textformatter.py113
-rw-r--r--silx/gui/fit/BackgroundWidget.py16
-rw-r--r--silx/gui/fit/FitConfig.py6
-rw-r--r--silx/gui/fit/FitWidget.py2
-rw-r--r--silx/gui/hdf5/Hdf5Formatter.py229
-rw-r--r--silx/gui/hdf5/Hdf5HeaderView.py29
-rw-r--r--silx/gui/hdf5/Hdf5Item.py182
-rw-r--r--silx/gui/hdf5/Hdf5Node.py29
-rw-r--r--silx/gui/hdf5/Hdf5TreeModel.py78
-rw-r--r--silx/gui/hdf5/Hdf5TreeView.py85
-rw-r--r--silx/gui/hdf5/NexusSortFilterProxyModel.py5
-rw-r--r--silx/gui/hdf5/_utils.py184
-rw-r--r--silx/gui/hdf5/test/_mock.py130
-rw-r--r--silx/gui/hdf5/test/test_hdf5.py454
-rw-r--r--silx/gui/icons.py54
-rw-r--r--silx/gui/plot/ColorBar.py456
-rw-r--r--silx/gui/plot/Colormap.py410
-rw-r--r--silx/gui/plot/ColormapDialog.py78
-rw-r--r--silx/gui/plot/Colors.py217
-rw-r--r--silx/gui/plot/ComplexImageView.py670
-rw-r--r--silx/gui/plot/CurvesROIWidget.py20
-rw-r--r--silx/gui/plot/ImageView.py157
-rw-r--r--silx/gui/plot/ItemsSelectionDialog.py282
-rw-r--r--silx/gui/plot/LegendSelector.py21
-rw-r--r--silx/gui/plot/LimitsHistory.py83
-rw-r--r--silx/gui/plot/MPLColormap.py1062
-rw-r--r--silx/gui/plot/MaskToolsWidget.py87
-rw-r--r--silx/gui/plot/Plot.py2925
-rw-r--r--silx/gui/plot/PlotActions.py1399
-rw-r--r--silx/gui/plot/PlotInteraction.py79
-rw-r--r--silx/gui/plot/PlotToolButtons.py13
-rw-r--r--silx/gui/plot/PlotTools.py152
-rw-r--r--silx/gui/plot/PlotWidget.py3020
-rw-r--r--silx/gui/plot/PlotWindow.py193
-rw-r--r--silx/gui/plot/PrintPreviewToolButton.py350
-rw-r--r--silx/gui/plot/Profile.py77
-rw-r--r--silx/gui/plot/ScatterMaskToolsWidget.py13
-rw-r--r--silx/gui/plot/StackView.py479
-rw-r--r--silx/gui/plot/_BaseMaskToolsWidget.py124
-rw-r--r--silx/gui/plot/__init__.py7
-rw-r--r--silx/gui/plot/_utils/__init__.py11
-rw-r--r--silx/gui/plot/_utils/panzoom.py154
-rw-r--r--silx/gui/plot/actions/PlotAction.py79
-rw-r--r--silx/gui/plot/actions/__init__.py38
-rw-r--r--silx/gui/plot/actions/control.py549
-rw-r--r--silx/gui/plot/actions/fit.py189
-rw-r--r--silx/gui/plot/actions/histogram.py170
-rw-r--r--silx/gui/plot/actions/io.py538
-rw-r--r--silx/gui/plot/actions/medfilt.py145
-rw-r--r--silx/gui/plot/actions/mode.py100
-rw-r--r--silx/gui/plot/backends/BackendBase.py39
-rw-r--r--silx/gui/plot/backends/BackendMatplotlib.py104
-rw-r--r--silx/gui/plot/backends/BackendOpenGL.py144
-rw-r--r--silx/gui/plot/backends/glutils/GLPlotCurve.py2
-rw-r--r--silx/gui/plot/backends/glutils/GLPlotFrame.py24
-rw-r--r--silx/gui/plot/backends/glutils/GLPlotImage.py56
-rw-r--r--silx/gui/plot/backends/glutils/GLText.py43
-rw-r--r--silx/gui/plot/backends/glutils/PlotImageFile.py14
-rw-r--r--silx/gui/plot/items/__init__.py13
-rw-r--r--silx/gui/plot/items/axis.py477
-rw-r--r--silx/gui/plot/items/core.py182
-rw-r--r--silx/gui/plot/items/curve.py18
-rw-r--r--silx/gui/plot/items/histogram.py36
-rw-r--r--silx/gui/plot/items/image.py75
-rw-r--r--silx/gui/plot/items/marker.py11
-rw-r--r--silx/gui/plot/items/scatter.py10
-rw-r--r--silx/gui/plot/items/shape.py14
-rw-r--r--silx/gui/plot/matplotlib/Colormap.py282
-rw-r--r--silx/gui/plot/matplotlib/ModestImage.py (renamed from silx/gui/plot/backends/ModestImage.py)2
-rw-r--r--silx/gui/plot/matplotlib/__init__.py (renamed from silx/gui/plot/backends/_matplotlib.py)14
-rw-r--r--silx/gui/plot/setup.py5
-rw-r--r--silx/gui/plot/test/__init__.py80
-rw-r--r--silx/gui/plot/test/testColorBar.py227
-rw-r--r--silx/gui/plot/test/testColormap.py291
-rw-r--r--silx/gui/plot/test/testColors.py8
-rw-r--r--silx/gui/plot/test/testComplexImageView.py95
-rw-r--r--silx/gui/plot/test/testCurvesROIWidget.py3
-rw-r--r--silx/gui/plot/test/testItem.py231
-rw-r--r--silx/gui/plot/test/testLegendSelector.py3
-rw-r--r--silx/gui/plot/test/testLimitConstraints.py125
-rw-r--r--silx/gui/plot/test/testMaskToolsWidget.py38
-rw-r--r--silx/gui/plot/test/testPlotInteraction.py27
-rw-r--r--silx/gui/plot/test/testPlotTools.py23
-rw-r--r--silx/gui/plot/test/testPlotWidget.py775
-rw-r--r--silx/gui/plot/test/testPlotWidgetNoBackend.py (renamed from silx/gui/plot/test/testPlot.py)98
-rw-r--r--silx/gui/plot/test/testPlotWindow.py14
-rw-r--r--silx/gui/plot/test/testScatterMaskToolsWidget.py37
-rw-r--r--silx/gui/plot/test/testStackView.py33
-rw-r--r--silx/gui/plot/test/testUtilsAxis.py148
-rw-r--r--silx/gui/plot/test/utils.py194
-rw-r--r--silx/gui/plot/utils/__init__.py30
-rw-r--r--silx/gui/plot/utils/axis.py164
-rw-r--r--silx/gui/plot3d/Plot3DWidget.py203
-rw-r--r--silx/gui/plot3d/Plot3DWindow.py20
-rw-r--r--silx/gui/plot3d/SFViewParamTree.py142
-rw-r--r--silx/gui/plot3d/ScalarFieldView.py270
-rw-r--r--silx/gui/plot3d/__init__.py7
-rw-r--r--silx/gui/plot3d/actions/Plot3DAction.py69
-rw-r--r--silx/gui/plot3d/actions/__init__.py33
-rw-r--r--silx/gui/plot3d/actions/io.py (renamed from silx/gui/plot3d/Plot3DActions.py)44
-rw-r--r--silx/gui/plot3d/actions/mode.py126
-rw-r--r--silx/gui/plot3d/scene/axes.py19
-rw-r--r--silx/gui/plot3d/scene/function.py128
-rw-r--r--silx/gui/plot3d/scene/interaction.py29
-rw-r--r--silx/gui/plot3d/scene/primitives.py7
-rw-r--r--silx/gui/plot3d/scene/viewport.py15
-rw-r--r--silx/gui/plot3d/scene/window.py11
-rw-r--r--silx/gui/plot3d/setup.py2
-rw-r--r--silx/gui/plot3d/test/__init__.py4
-rw-r--r--silx/gui/plot3d/test/testGL.py84
-rw-r--r--silx/gui/plot3d/test/testScalarFieldView.py114
-rw-r--r--silx/gui/plot3d/tools/ViewpointTools.py (renamed from silx/gui/plot3d/ViewpointToolBar.py)29
-rw-r--r--silx/gui/plot3d/tools/__init__.py32
-rw-r--r--silx/gui/plot3d/tools/toolbars.py (renamed from silx/gui/plot3d/Plot3DToolBar.py)85
-rw-r--r--silx/gui/setup.py2
-rw-r--r--silx/gui/test/test_icons.py56
-rw-r--r--silx/gui/test/utils.py36
-rw-r--r--silx/gui/widgets/FloatEdit.py65
-rw-r--r--silx/gui/widgets/FrameBrowser.py4
-rw-r--r--silx/gui/widgets/PeriodicTable.py6
-rw-r--r--silx/gui/widgets/PrintGeometryDialog.py222
-rw-r--r--silx/gui/widgets/PrintPreview.py704
-rw-r--r--silx/gui/widgets/TableWidget.py162
-rw-r--r--silx/gui/widgets/ThreadPoolPushButton.py2
-rw-r--r--silx/gui/widgets/WaitingPushButton.py2
-rw-r--r--silx/gui/widgets/test/__init__.py4
-rw-r--r--silx/gui/widgets/test/test_printpreview.py74
-rw-r--r--silx/image/backprojection.py25
-rw-r--r--silx/image/bilinear.c9557
-rw-r--r--silx/image/bilinear.pyx2
-rw-r--r--silx/image/phantomgenerator.py160
-rw-r--r--silx/image/projection.py25
-rw-r--r--silx/image/reconstruction.py25
-rw-r--r--silx/image/shapes.c9927
-rw-r--r--silx/image/sift.py26
-rw-r--r--silx/image/test/__init__.py2
-rw-r--r--silx/image/test/test_bilinear.py4
-rw-r--r--silx/image/test/test_shapes.py4
-rw-r--r--silx/image/test/test_tomography.py66
-rw-r--r--silx/image/tomography.py159
-rw-r--r--silx/io/__init__.py14
-rw-r--r--silx/io/commonh5.py991
-rw-r--r--silx/io/convert.py302
-rw-r--r--silx/io/dictdump.py158
-rw-r--r--silx/io/fabioh5.py569
-rw-r--r--silx/io/nxdata.py114
-rw-r--r--silx/io/rawh5.py71
-rw-r--r--silx/io/setup.py4
-rw-r--r--silx/io/specfile.c (renamed from silx/io/specfile/specfile.c)14347
-rw-r--r--silx/io/specfile.pyx (renamed from silx/io/specfile/specfile.pyx)191
-rw-r--r--silx/io/specfile/include/Lists.h31
-rw-r--r--silx/io/specfile/include/SpecFile.h32
-rw-r--r--silx/io/specfile/include/SpecFileP.h31
-rw-r--r--silx/io/specfile/include/locale_management.h27
-rw-r--r--silx/io/specfile/src/locale_management.c31
-rw-r--r--silx/io/specfile/src/sfdata.c31
-rw-r--r--silx/io/specfile/src/sfheader.c31
-rw-r--r--silx/io/specfile/src/sfindex.c31
-rw-r--r--silx/io/specfile/src/sfinit.c31
-rw-r--r--silx/io/specfile/src/sflabel.c31
-rw-r--r--silx/io/specfile/src/sflists.c31
-rw-r--r--silx/io/specfile/src/sfmca.c31
-rw-r--r--silx/io/specfile/src/sftools.c31
-rw-r--r--silx/io/specfile/src/sfwrite.c31
-rw-r--r--silx/io/specfile_wrapper.pxd (renamed from silx/io/specfile/specfile_wrapper.pxd)0
-rw-r--r--silx/io/spech5.py1573
-rw-r--r--silx/io/spectoh5.py301
-rw-r--r--silx/io/test/__init__.py6
-rw-r--r--silx/io/test/test_commonh5.py306
-rw-r--r--silx/io/test/test_fabioh5.py93
-rw-r--r--silx/io/test/test_nxdata.py7
-rw-r--r--silx/io/test/test_rawh5.py96
-rw-r--r--silx/io/test/test_specfile.py9
-rw-r--r--silx/io/test/test_specfilewrapper.py3
-rw-r--r--silx/io/test/test_spech5.py123
-rw-r--r--silx/io/test/test_spectoh5.py23
-rw-r--r--silx/io/test/test_utils.py186
-rw-r--r--silx/io/utils.py141
-rw-r--r--silx/math/chistogramnd.c (renamed from silx/math/histogramnd/chistogramnd.c)17088
-rw-r--r--silx/math/chistogramnd.pyx (renamed from silx/math/histogramnd/chistogramnd.pyx)28
-rw-r--r--silx/math/chistogramnd_lut.c (renamed from silx/math/histogramnd/chistogramnd_lut.c)26584
-rw-r--r--silx/math/chistogramnd_lut.pyx (renamed from silx/math/histogramnd/chistogramnd_lut.pyx)23
-rw-r--r--silx/math/combo.c (renamed from silx/math/combo/combo.c)23088
-rw-r--r--silx/math/combo.pyx (renamed from silx/math/combo/combo.pyx)106
-rw-r--r--silx/math/fit/filters.c (renamed from silx/math/fit/filters/filters.c)11128
-rw-r--r--silx/math/fit/filters.pyx (renamed from silx/math/fit/filters/filters.pyx)3
-rw-r--r--silx/math/fit/filters_wrapper.pxd (renamed from silx/math/fit/filters/filters_wrapper.pxd)0
-rw-r--r--silx/math/fit/fittheories.py3
-rw-r--r--silx/math/fit/functions.c (renamed from silx/math/fit/functions/functions.c)16233
-rw-r--r--silx/math/fit/functions.pyx (renamed from silx/math/fit/functions/functions.pyx)41
-rw-r--r--silx/math/fit/functions_wrapper.pxd (renamed from silx/math/fit/functions/functions_wrapper.pxd)0
-rw-r--r--silx/math/fit/leastsq.py3
-rw-r--r--silx/math/fit/peaks.c (renamed from silx/math/fit/peaks/peaks.c)9310
-rw-r--r--silx/math/fit/peaks.pyx (renamed from silx/math/fit/peaks/peaks.pyx)5
-rw-r--r--silx/math/fit/peaks_wrapper.pxd (renamed from silx/math/fit/peaks/peaks_wrapper.pxd)0
-rw-r--r--silx/math/fit/setup.py41
-rw-r--r--silx/math/fit/test/test_fit.py5
-rw-r--r--silx/math/histogram.py6
-rw-r--r--silx/math/histogramnd_c.pxd (renamed from silx/math/histogramnd/histogramnd_c.pxd)2
-rw-r--r--silx/math/include/isnan.h (renamed from silx/math/combo/isnan.h)12
-rw-r--r--silx/math/marchingcubes.cpp (renamed from silx/math/marchingcubes/marchingcubes.cpp)12019
-rw-r--r--silx/math/marchingcubes.pyx (renamed from silx/math/marchingcubes/marchingcubes.pyx)4
-rw-r--r--silx/math/mc.pxd (renamed from silx/math/marchingcubes/mc.pxd)0
-rw-r--r--silx/math/medianfilter/__init__.py2
-rw-r--r--silx/math/medianfilter/include/median_filter.hpp154
-rw-r--r--silx/math/medianfilter/median_filter.pxd3
-rw-r--r--silx/math/medianfilter/medianfilter.cpp13266
-rw-r--r--silx/math/medianfilter/medianfilter.pyx145
-rw-r--r--silx/math/medianfilter/test/test_medianfilter.py446
-rw-r--r--silx/math/setup.py33
-rw-r--r--silx/math/test/benchmark_combo.py4
-rw-r--r--silx/math/test/test_HistogramndLut_nominal.py15
-rw-r--r--silx/math/test/test_combo.py141
-rw-r--r--silx/math/test/test_histogramnd_error.py25
-rw-r--r--silx/math/test/test_histogramnd_nominal.py21
-rw-r--r--silx/opencl/__init__.py2
-rw-r--r--silx/opencl/backprojection.py488
-rw-r--r--silx/opencl/common.py29
-rw-r--r--silx/opencl/linalg.py218
-rw-r--r--silx/opencl/medfilt.py8
-rw-r--r--silx/opencl/processing.py61
-rw-r--r--silx/opencl/projection.py419
-rw-r--r--silx/opencl/reconstruction.py381
-rw-r--r--silx/opencl/setup.py9
-rw-r--r--silx/opencl/test/__init__.py21
-rw-r--r--silx/opencl/test/test_array_utils.py161
-rw-r--r--silx/opencl/test/test_backprojection.py165
-rw-r--r--silx/opencl/test/test_linalg.py215
-rw-r--r--silx/opencl/test/test_projection.py139
-rw-r--r--silx/opencl/utils.py71
-rw-r--r--silx/resources/__init__.py231
-rw-r--r--silx/resources/gui/colormaps/inferno.npybin0 -> 3152 bytes
-rw-r--r--silx/resources/gui/colormaps/magma.npybin0 -> 3152 bytes
-rw-r--r--silx/resources/gui/colormaps/plasma.npybin0 -> 3152 bytes
-rw-r--r--silx/resources/gui/colormaps/viridis.npybin0 -> 3152 bytes
-rw-r--r--silx/resources/gui/icons/3d-plane-normal-x.svg23
-rw-r--r--silx/resources/gui/icons/3d-plane-normal-y.svg23
-rw-r--r--silx/resources/gui/icons/3d-plane-normal-z.svg27
-rw-r--r--silx/resources/gui/icons/3d-plane-pan.pngbin0 -> 1428 bytes
-rw-r--r--silx/resources/gui/icons/3d-plane-pan.svg14
-rw-r--r--silx/resources/gui/icons/3d-plane.svg19
-rw-r--r--silx/resources/gui/icons/arrow-keys.svg2
-rw-r--r--silx/resources/gui/icons/axis.pngbin0 -> 1740 bytes
-rw-r--r--silx/resources/gui/icons/axis.svg2
-rw-r--r--silx/resources/gui/icons/camera.svg23
-rw-r--r--silx/resources/gui/icons/close.svg70
-rw-r--r--silx/resources/gui/icons/colorbar.pngbin0 -> 657 bytes
-rw-r--r--silx/resources/gui/icons/colorbar.svg3
-rw-r--r--silx/resources/gui/icons/crosshair.svg42
-rw-r--r--silx/resources/gui/icons/cube-back.svg23
-rw-r--r--silx/resources/gui/icons/cube-bottom.svg23
-rw-r--r--silx/resources/gui/icons/cube-front.svg23
-rw-r--r--silx/resources/gui/icons/cube-left.svg23
-rw-r--r--silx/resources/gui/icons/cube-right.svg23
-rw-r--r--silx/resources/gui/icons/cube-top.svg23
-rw-r--r--silx/resources/gui/icons/cube.svg25
-rw-r--r--silx/resources/gui/icons/document-open.svg128
-rw-r--r--silx/resources/gui/icons/document-print.svg14
-rw-r--r--silx/resources/gui/icons/document-save.svg38
-rw-r--r--silx/resources/gui/icons/draw-brush.svg8
-rw-r--r--silx/resources/gui/icons/draw-pencil.svg41
-rw-r--r--silx/resources/gui/icons/draw-rubber.svg45
-rw-r--r--silx/resources/gui/icons/edit-copy.svg77
-rw-r--r--silx/resources/gui/icons/first.svg37
-rw-r--r--silx/resources/gui/icons/folder.svg122
-rw-r--r--silx/resources/gui/icons/image-mask.svg27
-rw-r--r--silx/resources/gui/icons/image-select-box.svg123
-rw-r--r--silx/resources/gui/icons/image-select-brush.svg125
-rw-r--r--silx/resources/gui/icons/image-select-erase-rubber.svg8
-rw-r--r--silx/resources/gui/icons/image-select-erase.svg4
-rw-r--r--silx/resources/gui/icons/item-0dim.svg2
-rw-r--r--silx/resources/gui/icons/item-1dim.svg2
-rw-r--r--silx/resources/gui/icons/item-2dim.svg2
-rw-r--r--silx/resources/gui/icons/item-3dim.svg10
-rw-r--r--silx/resources/gui/icons/item-ndim.svg46
-rw-r--r--silx/resources/gui/icons/item-none.pngbin0 -> 637 bytes
-rw-r--r--silx/resources/gui/icons/item-none.svg5
-rw-r--r--silx/resources/gui/icons/item-object.svg22
-rw-r--r--silx/resources/gui/icons/last.svg37
-rw-r--r--silx/resources/gui/icons/math-amplitude.pngbin0 -> 526 bytes
-rw-r--r--silx/resources/gui/icons/math-amplitude.svg3
-rw-r--r--silx/resources/gui/icons/math-derive.svg2
-rw-r--r--silx/resources/gui/icons/math-fit.svg35
-rw-r--r--silx/resources/gui/icons/math-imaginary.pngbin0 -> 630 bytes
-rw-r--r--silx/resources/gui/icons/math-imaginary.svg3
-rw-r--r--silx/resources/gui/icons/math-normalize.svg46
-rw-r--r--silx/resources/gui/icons/math-peak-reset.svg57
-rw-r--r--silx/resources/gui/icons/math-peak-search.svg58
-rw-r--r--silx/resources/gui/icons/math-peak.svg41
-rw-r--r--silx/resources/gui/icons/math-phase-color-log.pngbin0 -> 2256 bytes
-rw-r--r--silx/resources/gui/icons/math-phase-color-log.svg3
-rw-r--r--silx/resources/gui/icons/math-phase-color.pngbin0 -> 2127 bytes
-rw-r--r--silx/resources/gui/icons/math-phase-color.svg3
-rw-r--r--silx/resources/gui/icons/math-phase.pngbin0 -> 515 bytes
-rw-r--r--silx/resources/gui/icons/math-phase.svg3
-rw-r--r--silx/resources/gui/icons/math-real.pngbin0 -> 749 bytes
-rw-r--r--silx/resources/gui/icons/math-real.svg3
-rw-r--r--silx/resources/gui/icons/math-sigma.svg93
-rw-r--r--silx/resources/gui/icons/math-smooth.svg29
-rw-r--r--silx/resources/gui/icons/math-substract.svg56
-rw-r--r--silx/resources/gui/icons/math-swap-sign.svg59
-rw-r--r--silx/resources/gui/icons/math-ymin-to-zero.svg42
-rw-r--r--silx/resources/gui/icons/median-filter.svg76
-rw-r--r--silx/resources/gui/icons/next.svg33
-rw-r--r--silx/resources/gui/icons/normal.svg35
-rw-r--r--silx/resources/gui/icons/pan.pngbin0 -> 526 bytes
-rw-r--r--silx/resources/gui/icons/pan.svg9
-rw-r--r--silx/resources/gui/icons/pixel-intensities.svg39
-rw-r--r--silx/resources/gui/icons/plot-roi-above.svg2
-rw-r--r--silx/resources/gui/icons/plot-roi-below.svg2
-rw-r--r--silx/resources/gui/icons/plot-roi-between.svg2
-rw-r--r--silx/resources/gui/icons/plot-roi-reset.svg69
-rw-r--r--silx/resources/gui/icons/plot-roi.svg54
-rw-r--r--silx/resources/gui/icons/plot-toggle-points.svg54
-rw-r--r--silx/resources/gui/icons/plot-widget.svg2
-rw-r--r--silx/resources/gui/icons/plot-window-image.svg2
-rw-r--r--silx/resources/gui/icons/plot-window.svg2
-rw-r--r--silx/resources/gui/icons/plot-xauto.svg41
-rw-r--r--silx/resources/gui/icons/plot-xlog.svg47
-rw-r--r--silx/resources/gui/icons/plot-yauto.svg36
-rw-r--r--silx/resources/gui/icons/plot-ydown.svg32
-rw-r--r--silx/resources/gui/icons/plot-ylog.svg42
-rw-r--r--silx/resources/gui/icons/plot-yup.svg41
-rw-r--r--silx/resources/gui/icons/previous.svg33
-rw-r--r--silx/resources/gui/icons/process-working/00.png (renamed from silx/resources/gui/icons/animated/process-working-00.png)bin778 -> 778 bytes
-rw-r--r--silx/resources/gui/icons/process-working/01.png (renamed from silx/resources/gui/icons/animated/process-working-01.png)bin789 -> 789 bytes
-rw-r--r--silx/resources/gui/icons/process-working/02.png (renamed from silx/resources/gui/icons/animated/process-working-02.png)bin785 -> 785 bytes
-rw-r--r--silx/resources/gui/icons/process-working/03.png (renamed from silx/resources/gui/icons/animated/process-working-03.png)bin785 -> 785 bytes
-rw-r--r--silx/resources/gui/icons/process-working/04.png (renamed from silx/resources/gui/icons/animated/process-working-04.png)bin766 -> 766 bytes
-rw-r--r--silx/resources/gui/icons/process-working/05.png (renamed from silx/resources/gui/icons/animated/process-working-05.png)bin777 -> 777 bytes
-rw-r--r--silx/resources/gui/icons/process-working/06.png (renamed from silx/resources/gui/icons/animated/process-working-06.png)bin784 -> 784 bytes
-rw-r--r--silx/resources/gui/icons/process-working/07.png (renamed from silx/resources/gui/icons/animated/process-working-07.png)bin783 -> 783 bytes
-rw-r--r--silx/resources/gui/icons/process-working/08.png (renamed from silx/resources/gui/icons/animated/process-working-08.png)bin762 -> 762 bytes
-rw-r--r--silx/resources/gui/icons/process-working/09.png (renamed from silx/resources/gui/icons/animated/process-working-09.png)bin781 -> 781 bytes
-rw-r--r--silx/resources/gui/icons/process-working/10.png (renamed from silx/resources/gui/icons/animated/process-working-10.png)bin771 -> 771 bytes
-rw-r--r--silx/resources/gui/icons/process-working/11.png (renamed from silx/resources/gui/icons/animated/process-working-11.png)bin768 -> 768 bytes
-rw-r--r--silx/resources/gui/icons/process-working/12.png (renamed from silx/resources/gui/icons/animated/process-working-12.png)bin759 -> 759 bytes
-rw-r--r--silx/resources/gui/icons/process-working/13.png (renamed from silx/resources/gui/icons/animated/process-working-13.png)bin767 -> 767 bytes
-rw-r--r--silx/resources/gui/icons/process-working/14.png (renamed from silx/resources/gui/icons/animated/process-working-14.png)bin778 -> 778 bytes
-rw-r--r--silx/resources/gui/icons/process-working/15.png (renamed from silx/resources/gui/icons/animated/process-working-15.png)bin760 -> 760 bytes
-rw-r--r--silx/resources/gui/icons/process-working/16.png (renamed from silx/resources/gui/icons/animated/process-working-16.png)bin754 -> 754 bytes
-rw-r--r--silx/resources/gui/icons/process-working/17.png (renamed from silx/resources/gui/icons/animated/process-working-17.png)bin782 -> 782 bytes
-rw-r--r--silx/resources/gui/icons/process-working/18.png (renamed from silx/resources/gui/icons/animated/process-working-18.png)bin775 -> 775 bytes
-rw-r--r--silx/resources/gui/icons/process-working/19.png (renamed from silx/resources/gui/icons/animated/process-working-19.png)bin764 -> 764 bytes
-rw-r--r--silx/resources/gui/icons/process-working/20.png (renamed from silx/resources/gui/icons/animated/process-working-20.png)bin764 -> 764 bytes
-rw-r--r--silx/resources/gui/icons/process-working/21.png (renamed from silx/resources/gui/icons/animated/process-working-21.png)bin772 -> 772 bytes
-rw-r--r--silx/resources/gui/icons/process-working/22.png (renamed from silx/resources/gui/icons/animated/process-working-22.png)bin769 -> 769 bytes
-rw-r--r--silx/resources/gui/icons/process-working/23.png (renamed from silx/resources/gui/icons/animated/process-working-23.png)bin773 -> 773 bytes
-rw-r--r--silx/resources/gui/icons/process-working/24.png (renamed from silx/resources/gui/icons/animated/process-working-24.png)bin757 -> 757 bytes
-rw-r--r--silx/resources/gui/icons/process-working/25.png (renamed from silx/resources/gui/icons/animated/process-working-25.png)bin759 -> 759 bytes
-rw-r--r--silx/resources/gui/icons/process-working/26.png (renamed from silx/resources/gui/icons/animated/process-working-26.png)bin774 -> 774 bytes
-rw-r--r--silx/resources/gui/icons/process-working/27.png (renamed from silx/resources/gui/icons/animated/process-working-27.png)bin766 -> 766 bytes
-rw-r--r--silx/resources/gui/icons/process-working/28.png (renamed from silx/resources/gui/icons/animated/process-working-28.png)bin760 -> 760 bytes
-rw-r--r--silx/resources/gui/icons/process-working/29.png (renamed from silx/resources/gui/icons/animated/process-working-29.png)bin777 -> 777 bytes
-rw-r--r--silx/resources/gui/icons/process-working/30.png (renamed from silx/resources/gui/icons/animated/process-working-30.png)bin775 -> 775 bytes
-rw-r--r--silx/resources/gui/icons/profile-clear.svg45
-rw-r--r--silx/resources/gui/icons/profile1D.svg23
-rw-r--r--silx/resources/gui/icons/profile2D.svg29
-rw-r--r--silx/resources/gui/icons/remove.svg64
-rw-r--r--silx/resources/gui/icons/rotate-3d.pngbin0 -> 760 bytes
-rw-r--r--silx/resources/gui/icons/rotate-3d.svg7
-rw-r--r--silx/resources/gui/icons/rudder.svg26
-rw-r--r--silx/resources/gui/icons/selected.svg41
-rw-r--r--silx/resources/gui/icons/shape-polygon.svg24
-rw-r--r--silx/resources/gui/icons/shape-rectangle.svg27
-rw-r--r--silx/resources/gui/icons/shape-square.svg27
-rw-r--r--silx/resources/gui/icons/shape-vertical.svg31
-rw-r--r--silx/resources/gui/icons/silx.svg2
-rw-r--r--silx/resources/gui/icons/sliders-off.svg120
-rw-r--r--silx/resources/gui/icons/sliders-on.svg108
-rw-r--r--silx/resources/gui/icons/spec.svg58
-rw-r--r--silx/resources/gui/icons/test-png.pngbin233 -> 0 bytes
-rw-r--r--silx/resources/gui/icons/test-svg.svg15
-rw-r--r--silx/resources/gui/icons/view-1d.svg21
-rw-r--r--silx/resources/gui/icons/view-2d-stack.svg17
-rw-r--r--silx/resources/gui/icons/view-2d.svg13
-rw-r--r--silx/resources/gui/icons/view-3d.svg21
-rw-r--r--silx/resources/gui/icons/view-fullscreen.svg72
-rw-r--r--silx/resources/gui/icons/view-hdf5.svg15
-rw-r--r--silx/resources/gui/icons/view-nexus.svg72
-rw-r--r--silx/resources/gui/icons/view-nofullscreen.svg97
-rw-r--r--silx/resources/gui/icons/view-raw.svg29
-rw-r--r--silx/resources/gui/icons/view-refresh.svg36
-rw-r--r--silx/resources/gui/icons/view-text.svg25
-rw-r--r--silx/resources/gui/icons/window-new.svg41
-rw-r--r--silx/resources/gui/icons/zoom-back.pngbin0 -> 1432 bytes
-rw-r--r--silx/resources/gui/icons/zoom-back.svg2
-rw-r--r--silx/resources/gui/icons/zoom-in.svg109
-rw-r--r--silx/resources/gui/icons/zoom-original.svg109
-rw-r--r--silx/resources/gui/icons/zoom-out.svg103
-rw-r--r--silx/resources/gui/icons/zoom.svg97
-rw-r--r--silx/resources/gui/logo/silx.pngbin0 -> 21257 bytes
-rw-r--r--silx/resources/gui/logo/silx.svg118
-rw-r--r--silx/resources/opencl/addition.cl12
-rw-r--r--silx/resources/opencl/array_utils.cl33
-rw-r--r--silx/resources/opencl/backproj.cl485
-rw-r--r--silx/resources/opencl/backproj_helper.cl68
-rw-r--r--silx/resources/opencl/linalg.cl89
-rw-r--r--silx/resources/opencl/proj.cl345
-rw-r--r--silx/sx/__init__.py4
-rw-r--r--silx/sx/_plot.py27
-rw-r--r--silx/test/__init__.py6
-rw-r--r--silx/test/test_resources.py212
-rw-r--r--silx/test/utils.py10
-rw-r--r--silx/third_party/_local/enum.py877
-rw-r--r--silx/third_party/enum.py51
-rw-r--r--silx/utils/decorators.py71
-rw-r--r--silx/utils/deprecation.py117
-rw-r--r--silx/utils/proxy.py204
-rw-r--r--silx/utils/test/__init__.py22
-rw-r--r--silx/utils/test/test_deprecation.py107
-rw-r--r--silx/utils/test/test_proxy.py295
-rw-r--r--version.py16
582 files changed, 134116 insertions, 76091 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 2e98df3..b54c4fa 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,62 @@
Change Log
==========
+0.6.0: 2017/10/02
+-----------------
+
+ * OpenCl. Tomography. Implement a filtered back projection.
+ * Add a *PrintPreview* widget and a *PrintPreviewToolButton* for *PlotWidget*.
+ * Plot:
+
+ * Add a context menu on right click.
+ * Add a *ComplexImageView* widget.
+ * Merged abstract *Plot* class with *PlotWidget* class.
+ * Make colormap an object with signals (*sigChanged*)
+ * Add a colorbar widget *silx.gui.plot.ColorBar*.
+ * Make axis an object, allow axis synchronization between plots,
+ allow adding constraints on axes limits.
+ * Refactor plot actions, new sub-package *silx.gui.plot.actions*.
+ * Add signals on *PlotWidget* items notifying updates.
+ * Mask. Support loading of TIFF images.
+
+ * Plot3d:
+
+ * Rework toolbar and interaction to use only the left mouse button.
+ * Support any colormap.
+
+ * Hdf5TreeView:
+
+ * Add an API to select a single tree node item (*setSelectedH5Node*)
+ * Better support and display of types.
+ * New column for displaying the kind of links.
+ * Broken nodes are now selectable.
+
+ * StackView. Add a *setTitleCallback* method.
+ * Median filter. Add new modes (*reflect, mirror, shrink*) in addition to *nearest*.
+
+ * IO:
+
+ * Rename module *spectoh5* to *convert*. Add support for conversion of *fabio* formats.
+ * Support NPZ format.
+ * Support opening an URI (*silx.io.open(filename::path)*).
+ * *Group* methods *.keys*, *.value* and *.items* now return lists in Python 2
+ and iterators in Python 3.
+
+ * Image. Add tomography utils: *phantomgenerator* to produce Shepp-Logan phantom, function to compute center of rotation (*calc_center_corr*, *calc_center_centroid*) and rescale the intensity of an image (*rescale_intensity*).
+
+ * Commands:
+
+ * *silx view*:
+
+ * Add command line option *--use-opengl-plot*.
+ * Add command line option *--debug*, to print dataset reading errors.
+ * Support opening URI (*silx view filename::path*).
+
+ * *silx convert*. New command line application to convert supported data files to HDF5.
+
+ * Enable usage of *silx.resources* for other projects.
+ * The *silx* license is now fully MIT.
+
0.5.0: 2017/05/12
-----------------
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..acebc8d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,29 @@
+The silx toolkit is a software library and one of its goals is not to impose any license to the end user.
+
+Silx follows the permissive MIT license although it may include contributions following other licenses not interfering with the previous goal. Detailed information can be found in the copyright file.
+
+Silx uses the Qt library for its graphical user interfaces.
+A word of caution is to be provided.
+If users develop and distribute software using modules accessing Qt by means of Riverbank Computing Qt bindings PyQt4 or PyQt5, those users will be conditioned by the license of their PyQt4/5 software (GPL or commercial).
+If the end user does not own a commercial license of PyQt4 or PyQt5 and wishes to be free of any distribution condition, (s)he should be able to use PySide because it uses the LGPL license.
+
+The MIT license follows:
+
+Copyright (c) European Synchrotron Radiation Facility (ESRF)
+
+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.
diff --git a/MANIFEST.in b/MANIFEST.in
index 4334bba..0a8a964 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,13 +1,18 @@
include README.rst
include CHANGELOG.rst
include copyright
+include LICENSE
include MANIFEST.in
include run_tests.py
include version.py
include stdeb.cfg
+include build-deb.sh
+include requirements.txt
+include requirements-dev.txt
recursive-include silx *.pyx *.pxd *.pxi
recursive-include silx *.h *.c *.hpp *.cpp
recursive-include doc/source *.py *.rst *.png *.ico
recursive-include qtdesigner_plugins *.py *.rst
recursive-include silx/resources *
recursive-include examples *
+recursive-include package *
diff --git a/PKG-INFO b/PKG-INFO
index 7a6c11c..7649c9a 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: silx
-Version: 0.5.0
+Version: 0.6.0
Summary: Software library for X-Ray data analysis
Home-page: https://github.com/silx-kit/silx
Author: data analysis unit
@@ -10,20 +10,30 @@ Description:
silx toolkit
============
- The silx project aims at providing a collection of Python packages to support the development of data assessment, reduction and analysis applications at synchrotron radiation facilities.
- It aims at providing reading/writing different file formats, data reduction routines and a set of Qt widgets to browse and visualize data.
+ The silx project aims at providing a collection of Python packages to support the
+ development of data assessment, reduction and analysis applications at synchrotron
+ radiation facilities.
+ It aims at providing reading/writing different file formats, data reduction routines
+ and a set of Qt widgets to browse and visualize data.
- The current version provides :
+ The current version provides:
- * reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of `SPEC <https://certif.com/spec.html>`_ file format)
+ * reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of
+ `SPEC <https://certif.com/spec.html>`_ file format and
+ `FabIO <http://www.silx.org/doc/fabio/dev/getting_started.html#list-of-file-formats-that-fabio-can-read-and-write>`_
+ images)
* histogramming
* fitting
- * 1D and 2D visualization using multiple backends (matplotlib or OpenGL)
- * image plot widget with a set of associated tools (See `changelog file <https://github.com/silx-kit/silx/blob/master/CHANGELOG.rst>`_).
- * Unified browser for HDF5, SPEC and image file formats supporting inspection and visualization of n-dimensional datasets.
- * Unified viewer (silx view filename) for HDF5, SPEC and image file formats
- * OpenGL-based widget to display 3D scalar field with isosurface and cutting plane.
+ * 1D and 2D visualization widgets using multiple backends (matplotlib or OpenGL)
+ * an OpenGL-based widget to display 3D scalar field with isosurface and cutting plane
+ * an image plot widget with a set of associated tools
+ * a unified browser for HDF5, SPEC and image file formats supporting inspection and
+ visualization of n-dimensional datasets.
+ * a unified viewer (*silx view filename*) for HDF5, SPEC and image file formats
+ * a unified converter to HDF5 format (*silx convert filename*)
+ * median filters on images (C and OpenCL implementations)
* image alignement (sift - OpenCL implementation)
+ * filtered backprojection and forward projection for tomography
Installation
------------
@@ -31,21 +41,36 @@ Description:
To install silx, run::
pip install silx
+
+ Or with Anaconda on Linux and MacOS::
+
+ conda install silx -c conda-forge
To install silx locally, run::
pip install silx --user
- On Linux, to install silx with pip, you must install numpy first. Unofficial packages for different distributions are available :
+ Unofficial packages for different distributions are available :
- Unofficial Debian8 packages are available at http://www.silx.org/pub/debian/
- CentOS 7 rpm packages are provided by Max IV at the following url: http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/
- Fedora 23 rpm packages are provided by Max IV at http://pubrepo.maxiv.lu.se/rpm/fc23/x86_64/
- Arch Linux (AUR) packages are also available: https://aur.archlinux.org/packages/python-silx
- On Windows, pre-compiled binaries (aka Python wheels) are available for Python 2.7, 3.5 and 3.6.
+ Beside this, we provide a certain number of wheels (pre-compiled binary packages) to be installed
+ onto a pre-existing Python installation:
+
+ - On Windows, binary wheels are available for Python 2.7, 3.5 and 3.6.
+ - On MacOS, binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+ - On Linux, manylinux1 binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+
+ Those builds are made from "up-date" systems at the time of the release, i.e. they use
+ the latest stable version of numpy (and cython).
+ Hence your system should use a fairly recent version of numpy to be compatible with silx.
+ This can be achieved simply by::
+
+ pip install numpy --upgrade
- On Mac OS X, pre-compiled binaries (aka Python wheels) are available for Python 2.7.
The latest development version can be obtained from the git repository::
@@ -65,19 +90,28 @@ Description:
* `matplotlib <http://matplotlib.org/>`_ for the silx.gui.plot package
* `PyOpenGL <http://pyopengl.sourceforge.net/>`_ for the silx.gui.plot3d package
- Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on the following extra package:
+ Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on:
+
* `h5py <http://www.h5py.org/>`_
- * `ipython <https://ipython.org/>`_ and `qtconsole <https://pypi.python.org/pypi/qtconsole>`_ is required by silx.gui.console.py
+ Parallel algorithms depend on:
+
+ * `PyOpenCL <https://documen.tician.de/pyopencl/>`_
+
+ The console widgets depend on:
+
+ * `ipython <https://ipython.org/>`_
+ * `qtconsole <https://pypi.python.org/pypi/qtconsole>`_
+
Supported platforms: Linux, Windows, Mac OS X.
Documentation
-------------
- Documentation of releases is available at https://pythonhosted.org/silx/
+ Documentation of latest release is available at http://www.silx.org/doc/silx/latest/
- Latest documentation (nightly build) is available at http://www.silx.org/doc/silx/
+ Documentation of previous releases and nightly build is available at http://www.silx.org/doc/silx/
To build the documentation from the source (requires `Sphinx <http://www.sphinx-doc.org>`_), run::
@@ -101,21 +135,28 @@ Description:
Examples
--------
- Some examples are available in the source code repository. For example::
-
- python examples/{exampleName.py}
+ Some examples of sample code using silx are provided with the
+ `silx documentation <http://www.silx.org/doc/silx/dev/sample_code/index.html>`_.
License
-------
- The source code of silx is licensed under the MIT and LGPL licenses.
- See the `copyright file <https://github.com/silx-kit/silx/blob/master/copyright>`_ for details.
+ The source code of silx is licensed under the MIT license.
+ See the `LICENSE <https://github.com/silx-kit/silx/blob/master/LICENSE>`_ and `copyright <https://github.com/silx-kit/silx/blob/master/copyright>`_ files for details.
+
+ Citation
+ --------
+
+ silx releases can be cited by their DOI on Zenodo: |DOI:10.5281/zenodo.1000472|
.. |Travis Status| image:: https://travis-ci.org/silx-kit/silx.svg?branch=master
:target: https://travis-ci.org/silx-kit/silx
.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/qgox9ei0wxwfagrb/branch/master?svg=true
:target: https://ci.appveyor.com/project/ESRF/silx
+ .. |DOI:10.5281/zenodo.1000472| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1000472.svg
+ :target: https://doi.org/10.5281/zenodo.1000472
+
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
@@ -126,7 +167,6 @@ Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
-Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
@@ -135,6 +175,7 @@ Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff --git a/README.rst b/README.rst
index 38ce368..5983c46 100644
--- a/README.rst
+++ b/README.rst
@@ -2,20 +2,30 @@
silx toolkit
============
-The silx project aims at providing a collection of Python packages to support the development of data assessment, reduction and analysis applications at synchrotron radiation facilities.
-It aims at providing reading/writing different file formats, data reduction routines and a set of Qt widgets to browse and visualize data.
-
-The current version provides :
-
-* reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of `SPEC <https://certif.com/spec.html>`_ file format)
+The silx project aims at providing a collection of Python packages to support the
+development of data assessment, reduction and analysis applications at synchrotron
+radiation facilities.
+It aims at providing reading/writing different file formats, data reduction routines
+and a set of Qt widgets to browse and visualize data.
+
+The current version provides:
+
+* reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of
+ `SPEC <https://certif.com/spec.html>`_ file format and
+ `FabIO <http://www.silx.org/doc/fabio/dev/getting_started.html#list-of-file-formats-that-fabio-can-read-and-write>`_
+ images)
* histogramming
* fitting
-* 1D and 2D visualization using multiple backends (matplotlib or OpenGL)
-* image plot widget with a set of associated tools (See `changelog file <https://github.com/silx-kit/silx/blob/master/CHANGELOG.rst>`_).
-* Unified browser for HDF5, SPEC and image file formats supporting inspection and visualization of n-dimensional datasets.
-* Unified viewer (silx view filename) for HDF5, SPEC and image file formats
-* OpenGL-based widget to display 3D scalar field with isosurface and cutting plane.
+* 1D and 2D visualization widgets using multiple backends (matplotlib or OpenGL)
+* an OpenGL-based widget to display 3D scalar field with isosurface and cutting plane
+* an image plot widget with a set of associated tools
+* a unified browser for HDF5, SPEC and image file formats supporting inspection and
+ visualization of n-dimensional datasets.
+* a unified viewer (*silx view filename*) for HDF5, SPEC and image file formats
+* a unified converter to HDF5 format (*silx convert filename*)
+* median filters on images (C and OpenCL implementations)
* image alignement (sift - OpenCL implementation)
+* filtered backprojection and forward projection for tomography
Installation
------------
@@ -23,21 +33,36 @@ Installation
To install silx, run::
pip install silx
+
+Or with Anaconda on Linux and MacOS::
+
+ conda install silx -c conda-forge
To install silx locally, run::
pip install silx --user
-On Linux, to install silx with pip, you must install numpy first. Unofficial packages for different distributions are available :
+Unofficial packages for different distributions are available :
- Unofficial Debian8 packages are available at http://www.silx.org/pub/debian/
- CentOS 7 rpm packages are provided by Max IV at the following url: http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/
- Fedora 23 rpm packages are provided by Max IV at http://pubrepo.maxiv.lu.se/rpm/fc23/x86_64/
- Arch Linux (AUR) packages are also available: https://aur.archlinux.org/packages/python-silx
-On Windows, pre-compiled binaries (aka Python wheels) are available for Python 2.7, 3.5 and 3.6.
+Beside this, we provide a certain number of wheels (pre-compiled binary packages) to be installed
+onto a pre-existing Python installation:
+
+- On Windows, binary wheels are available for Python 2.7, 3.5 and 3.6.
+- On MacOS, binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+- On Linux, manylinux1 binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+
+Those builds are made from "up-date" systems at the time of the release, i.e. they use
+the latest stable version of numpy (and cython).
+Hence your system should use a fairly recent version of numpy to be compatible with silx.
+This can be achieved simply by::
+
+ pip install numpy --upgrade
-On Mac OS X, pre-compiled binaries (aka Python wheels) are available for Python 2.7.
The latest development version can be obtained from the git repository::
@@ -57,19 +82,28 @@ The GUI widgets of the silx package depend on the following extra packages:
* `matplotlib <http://matplotlib.org/>`_ for the silx.gui.plot package
* `PyOpenGL <http://pyopengl.sourceforge.net/>`_ for the silx.gui.plot3d package
-Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on the following extra package:
+Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on:
+
* `h5py <http://www.h5py.org/>`_
-* `ipython <https://ipython.org/>`_ and `qtconsole <https://pypi.python.org/pypi/qtconsole>`_ is required by silx.gui.console.py
+Parallel algorithms depend on:
+
+* `PyOpenCL <https://documen.tician.de/pyopencl/>`_
+
+The console widgets depend on:
+
+* `ipython <https://ipython.org/>`_
+* `qtconsole <https://pypi.python.org/pypi/qtconsole>`_
+
Supported platforms: Linux, Windows, Mac OS X.
Documentation
-------------
-Documentation of releases is available at https://pythonhosted.org/silx/
+Documentation of latest release is available at http://www.silx.org/doc/silx/latest/
-Latest documentation (nightly build) is available at http://www.silx.org/doc/silx/
+Documentation of previous releases and nightly build is available at http://www.silx.org/doc/silx/
To build the documentation from the source (requires `Sphinx <http://www.sphinx-doc.org>`_), run::
@@ -93,18 +127,25 @@ To run the tests, from the source directory, run::
Examples
--------
-Some examples are available in the source code repository. For example::
-
- python examples/{exampleName.py}
+Some examples of sample code using silx are provided with the
+`silx documentation <http://www.silx.org/doc/silx/dev/sample_code/index.html>`_.
License
-------
-The source code of silx is licensed under the MIT and LGPL licenses.
-See the `copyright file <https://github.com/silx-kit/silx/blob/master/copyright>`_ for details.
+The source code of silx is licensed under the MIT license.
+See the `LICENSE <https://github.com/silx-kit/silx/blob/master/LICENSE>`_ and `copyright <https://github.com/silx-kit/silx/blob/master/copyright>`_ files for details.
+
+Citation
+--------
+
+silx releases can be cited by their DOI on Zenodo: |DOI:10.5281/zenodo.1000472|
.. |Travis Status| image:: https://travis-ci.org/silx-kit/silx.svg?branch=master
:target: https://travis-ci.org/silx-kit/silx
.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/qgox9ei0wxwfagrb/branch/master?svg=true
:target: https://ci.appveyor.com/project/ESRF/silx
+.. |DOI:10.5281/zenodo.1000472| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1000472.svg
+ :target: https://doi.org/10.5281/zenodo.1000472
+
diff --git a/build-deb.sh b/build-deb.sh
new file mode 100755
index 0000000..064674c
--- /dev/null
+++ b/build-deb.sh
@@ -0,0 +1,239 @@
+#!/bin/sh
+#
+# Project: Silx
+# https://github.com/silx-kit/silx
+#
+# Copyright (C) 2015-2017 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
+
+# Script that builds a debian package from this library
+
+project=silx
+source_project=silx
+version=$(python -c"import version; print(version.version)")
+strictversion=$(python -c"import version; print(version.strictversion)")
+debianversion=$(python -c"import version; print(version.debianversion)")
+
+deb_name=$(echo "$source_project" | tr '[:upper:]' '[:lower:]')
+
+# target system
+debian_version=$(grep -o '[0-9]*' /etc/issue)
+target_system=debian${debian_version}
+
+project_directory="`dirname \"$0\"`"
+project_directory="`( cd \"$project_directory\" && pwd )`" # absolutized
+dist_directory=${project_directory}/dist/${target_system}
+build_directory=${project_directory}/build/${target_system}
+
+if [ -d /usr/lib/ccache ];
+then
+ export PATH=/usr/lib/ccache:$PATH
+fi
+
+usage="usage: $(basename "$0") [options]
+
+Build the Debian ${debian_version} package of the ${project} library.
+
+If the build succeed the directory dist/debian${debian_version} will
+contains the packages.
+
+optional arguments:
+ --help show this help text
+ --install install the packages generated at the end of
+ the process using 'sudo dpkg'
+ --debian7 Simulate a debian7 system (fail-safe)
+ --debian8 Simulate a debian 8 Jessie system
+ --debian9 Simulate a debian 9 Stretch system
+"
+
+install=0
+use_python3=0 #used only for stdeb
+
+while :
+do
+ case "$1" in
+ -h | --help)
+ echo "$usage"
+ exit 0
+ ;;
+ --install)
+ install=1
+ shift
+ ;;
+ --python3)
+ use_python3=1
+ shift
+ ;;
+ --debian7)
+ debian_version=7
+ shift
+ ;;
+ --debian8)
+ debian_version=8
+ shift
+ ;;
+ --debian9)
+ debian_version=9
+ shift
+ ;;
+ -*)
+ echo "Error: Unknown option: $1" >&2
+ echo "$usage"
+ exit 1
+ ;;
+ *) # No more options
+ break
+ ;;
+ esac
+done
+
+clean_up()
+{
+ echo "Clean working dir:"
+ # clean up previous build
+ rm -rf ${build_directory}
+ # create the build context
+ mkdir -p ${build_directory}
+}
+
+build_deb_8_plus () {
+ echo "Build for debian 8 or newer using actual packaging"
+ tarname=${project}_${debianversion}.orig.tar.gz
+ clean_up
+ python setup.py debian_src
+ cp -f dist/${tarname} ${build_directory}
+ if [ -f dist/${project}-testimages.tar.gz ]
+ then
+ cp -f dist/${project}-testimages.tar.gz ${build_directory}
+ fi
+
+ cd ${build_directory}
+ tar -xzf ${tarname}
+
+ directory=${project}-${strictversion}
+ newname=${deb_name}_${debianversion}.orig.tar.gz
+
+ #echo tarname $tarname newname $newname
+ if [ $tarname != $newname ]
+ then
+ if [ -h $newname ]
+ then
+ rm ${newname}
+ fi
+ ln -s ${tarname} ${newname}
+ fi
+
+ if [ -f ${project}-testimages.tar.gz ]
+ then
+ if [ ! -h ${deb_name}_${debianversion}.orig-testimages.tar.gz ]
+ then
+ ln -s ${project}-testimages.tar.gz ${deb_name}_${debianversion}.orig-testimages.tar.gz
+ fi
+ fi
+
+ cd ${directory}
+ cp -r ${project_directory}/package/${target_system} debian
+ cp ${project_directory}/copyright debian
+
+ #handle test images
+ if [ -f ../${deb_name}_${debianversion}.orig-testimages.tar.gz ]
+ then
+ if [ ! -d testimages ]
+ then
+ mkdir testimages
+ fi
+ cd testimages
+ tar -xzf ../${deb_name}_${debianversion}.orig-testimages.tar.gz
+ cd ..
+ else
+ # Disable to skip tests during build
+ echo No test data
+ #export PYBUILD_DISABLE_python2=test
+ #export PYBUILD_DISABLE_python3=test
+ #export DEB_BUILD_OPTIONS=nocheck
+ fi
+
+ dch -v ${debianversion}-1 "upstream development build of ${project} ${version}"
+ dch --bpo "${project} snapshot ${version} built for ${target_system}"
+ dpkg-buildpackage -r
+ rc=$?
+
+ if [ $rc -eq 0 ]; then
+ # move packages to dist directory
+ echo Build succeeded...
+ rm -rf ${dist_directory}
+ mkdir -p ${dist_directory}
+ mv ${build_directory}/*.deb ${dist_directory}
+ mv ${build_directory}/*.x* ${dist_directory}
+ mv ${build_directory}/*.dsc ${dist_directory}
+ mv ${build_directory}/*.changes ${dist_directory}
+ cd ../../..
+ else
+ echo Build failed, please investigate ...
+ exit "$rc"
+ fi
+}
+
+build_deb_7_minus () {
+ echo "Build for debian 7 or older using stdeb"
+ tarname=${project}-${strictversion}.tar.gz
+ clean_up
+
+ python setup.py sdist
+ cp -f dist/${tarname} ${build_directory}
+ cd ${build_directory}
+ tar -xzf ${tarname}
+ cd ${project}-${strictversion}
+
+ if [ $use_python3 = 1 ]
+ then
+ echo Using Python 2+3
+ python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=True --no-python3-scripts=True build --no-cython bdist_deb
+ rc=$?
+ else
+ echo Using Python 2
+ # bdist_deb feed /usr/bin using setup.py entry-points
+ python setup.py --command-packages=stdeb.command build --no-cython bdist_deb
+ rc=$?
+ fi
+
+ # move packages to dist directory
+ rm -rf ${dist_directory}
+ mkdir -p ${dist_directory}
+ mv -f deb_dist/*.deb ${dist_directory}
+
+ # back to the root
+ cd ../../..
+}
+
+if [ $debian_version -ge 8 ]
+then
+ build_deb_8_plus
+else
+ build_deb_7_minus
+fi
+
+if [ $install -eq 1 ]; then
+ sudo -v su -c "dpkg -i ${dist_directory}/*.deb"
+fi
+
+exit "$rc"
diff --git a/copyright b/copyright
index a9b99ae..4229c58 100644
--- a/copyright
+++ b/copyright
@@ -7,15 +7,11 @@ Copyright: 2004-2017 European Synchrotron Radiation Facility
Data analysis unit (silx@esrf.fr)
License: MIT
-Files: silx/io/specfile/src/* silx/io/specfile/include/Lists.h silx/io/specfile/include/locale_management.h silx/io/specfile/include/SpecFile.h silx/io/specfile/include/SpecFileP.h
-Copyright: 2004-2016 European Synchrotron Radiation Facility
-License: LGPL-2.1+
-
Files: silx/math/histogramnd/include/msvc/stdint.h
Copyright: 2006-2008 Alexander Chemeris
License: BSD-3
-Files: silx/gui/plot/MPLColormap.py
+Files: silx/resources/gui/colormaps/inferno.npy silx/resources/gui/colormaps/magma.npy silx/resources/gui/colormaps/plasma.npy silx/resources/gui/colormaps/viridis.npy
Copyright: Nathaniel J. Smith, Stefan van der Walt, Eric Firing
License: CC0
@@ -68,45 +64,10 @@ License: BSD-3
(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: 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: public-domain
You can use this free for any purpose. It's in the public domain. It
has no warranty
-License: LGPL-2.1+
- 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 2.1 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
- .
- On Debian systems, the complete text of the GNU Lesser General Public
- License can be found in "/usr/share/common-licenses/LGPL-2.1".
-
License: CC0
Statement of Purpose
.
diff --git a/doc/source/Tutorials/fitconfig.rst b/doc/source/Tutorials/fitconfig.rst
index 1b5e8ae..225ef8f 100644
--- a/doc/source/Tutorials/fitconfig.rst
+++ b/doc/source/Tutorials/fitconfig.rst
@@ -122,7 +122,7 @@ used by our fit function to scale the *y* values.
self.scalingFactorEdit.setToolTip(
"Enter the scaling factor"
)
- self.scalingFactorEdit.setValidator(qt.QDoubleValidator())
+ self.scalingFactorEdit.setValidator(qt.QDoubleValidator(self))
self.ok = qt.QPushButton("ok", self)
self.ok.clicked.connect(self.accept)
diff --git a/doc/source/Tutorials/img/silx_view_edf.png b/doc/source/Tutorials/img/silx_view_edf.png
new file mode 100644
index 0000000..424c165
--- /dev/null
+++ b/doc/source/Tutorials/img/silx_view_edf.png
Binary files differ
diff --git a/doc/source/Tutorials/io.rst b/doc/source/Tutorials/io.rst
new file mode 100644
index 0000000..139ad2d
--- /dev/null
+++ b/doc/source/Tutorials/io.rst
@@ -0,0 +1,289 @@
+
+Getting started with silx.io
+============================
+
+This tutorial explains how to read data files using the :meth:`silx.io.open` function.
+
+The target audience are developers without knowledge of the *h5py* library.
+
+If you are already familiar with *h5py*, you just need to know that
+the :meth:`silx.io.open` function returns objects that mimic *h5py* file objects,
+and that the main supported file formats are:
+
+ - HDF5
+ - all formats supported by the *FabIO* library
+ - SPEC data files
+
+Knowledge about the python *dictionary* type and the numpy *ndarray* type
+are prerequisites for this tutorial.
+
+
+Background
+----------
+
+In the past, it was necessary to learn how to use multiple libraries to read multiple
+data formats. The library *FabIO* was designed to read images in many formats, but not to read
+more heterogeneous formats, such as *HDF5* or *SPEC*.
+
+To read *SPEC* data files in Python, a common solution was to use the *PyMca* module
+:mod:`PyMca5.PyMcaIO.specfilewrapper`.
+Regarding HDF5 files, the de-facto standard for reading them in Python is to
+use the *h5py* library.
+
+*silx* tries to address this situation by providing a unified way to read all
+data formats supported at the ESRF. Today, HDF5 is the preffered format to store
+data for many scientific institutions, including most synchrotrons.
+So it was decided to provide tools for reading data that mimic the *h5py* library's API.
+
+
+Definitions
+-----------
+
+HDF5
+++++
+
+The *HDF5* format is a *hierarchical data format*, designed to store and
+organize large amounts of data.
+
+A HDF5 file contains a number of *datasets*, which are multidimensional arrays
+of a homogeneous type.
+
+These datasets are stored in container structures
+called *groups*. Groups can also be stored in other groups, allowing to
+define a hierarchical tree structure.
+
+Both datasets and groups may have *attributes* attached to them. Attributes are
+used to document the object. They are similar to datasets in several ways
+(data container of homogeneous type), but they are typically much smaller.
+
+It is a common analogy to compare a HDF5 file to a filesystem.
+Groups are analogous to directories, while datasets are analogous to files,
+and attributes are analogous to file metadata (creation date, last modification...).
+
+.. image:: img/silx_view_edf.png
+ :width: 400px
+
+
+h5py
+++++
+
+The *h5py* library is a Pythonic interface to the `HDF5`_ binary data format.
+
+It exposes an HDF5 group as a python object that resembles a python
+dictionary, and an HDF5 dataset or attribute as an object that resembles a
+numpy array.
+
+API description
+---------------
+
+All main objects, File, Group and Dataset, share the following attributes:
+
+ - :attr:`attrs`: Attributes, as a dictionary of metadata for the group or dataset.
+ - :attr:`basename`: String giving the basename of this group or dataset.
+ - :attr:`name`: String giving the full path to this group or dataset, relative
+ to the root group (file).
+ - :attr:`file`: File object at the root of the tree structure containing this
+ group or dataset.
+ - :attr:`parent`: Group object containing this group or dataset.
+
+File object
++++++++++++
+
+The API of the file objects returned by the :meth:`silx.io.open`
+function tries to be as close as possible to the API of the :class:`h5py.File`
+objects used to read HDF5 data.
+
+A h5py file is a group with just a few extra attributes and methods.
+
+The objects defined in `silx.io` implement a subset of these attributes and methods:
+
+ - :attr:`filename`: Name of the file on disk.
+ - :attr:`mode`: String indicating if the file is open in read mode ("r")
+ or write mode ("w"). :meth:`silx.io.open` always returns objects in read mode.
+ - :meth:`close`: Close this file. All open objects will become invalid.
+
+The :attr:`parent` of a file is `None`, and its :attr:`name` is an empty string.
+
+Group object
+++++++++++++
+
+Group objects behave like python dictionaries.
+
+You can iterate over a group's :meth:`keys`, which are the names of the objects
+encapsulated by the group (datasets and sub-groups). The :meth:`values` method
+returns an iterator over the encapsulated objects. The :meth:`items` method returns
+an iterator over `(name, value)` pairs.
+
+Groups provide a :meth:`get` method that retrieves an item, or information about an item.
+Like standard python dictionaries, a `default` parameter can be used to specify
+a value to be returned if the given name is not a member of the group.
+
+Two methods are provided to visit recursively all members of a group, :meth:`visit`
+and :meth:`visititems`. The former takes as argument a *callable* with the signature
+``callable(name) -> None or return value``. The latter takes as argument a *callable*
+with the signature ``callable(name, object) -> None or return value`` (``object`` being a
+a group or dataset instance.)
+
+Example
+-------
+
+Accessing data
+++++++++++++++
+
+In this first example, we open a Spec data file and we print some of its information.
+
+.. code-block:: python
+
+ >>> import silx.io
+ >>> sf = silx.io.open("data/CuZnO_2.spec")
+ <silx.io.spech5.SpecH5 at 0x7f00d0760f90>
+ >>> print(sf.keys())
+ ['1.1', '2.1', '3.1', '4.1', '5.1', '6.1', '7.1', ...]
+ >>> print(sf["1.1"])
+ <silx.io.spech5.ScanGroup object at 0x7f00d0715b90>
+
+
+We just opened a file, keeping a reference to the file object as ``sf``.
+We then printed all items contained in this root group. We can see that all
+these items are groups. Lets looks at what is inside these groups, and find
+datasets:
+
+
+.. code-block:: python
+
+ >>> grp = sf["2.1"]
+ ... for name in grp:
+ ... item = grp[name]
+ ... print("Found item " + name)
+ ... if silx.io.is_dataset(item):
+ ... print("'%s' is a dataset.\n" % name)
+ ... elif silx.io.is_group(item):
+ ... print("'%s' is a group.\n" % name)
+ ...
+ Found item title
+ title is a dataset.
+
+ Found item start_time
+ start_time is a dataset.
+
+ Found item instrument
+ instrument is a group.
+
+ Found item measurement
+ measurement is a group.
+
+ Found item sample
+ sample is a group.
+
+We could have replaced the first three lines with this single line,
+by iterating over the iterator returned by the group method :meth:`items`:
+
+.. code-block:: python
+
+ >>> for name, item in sf["2.1"].items():
+ ...
+
+In addition to :meth:`silx.io.is_group` and :meth:`silx.io.is_dataset`,
+you can also use :meth:`silx.io.is_file` and :meth:`silx.io.is_softlink`.
+
+
+Let's look at a dataset:
+
+.. code-block:: python
+
+ >>> print(sf["2.1/title"])
+ <HDF5-like dataset "title": shape (), type "|S29">
+
+As you can see, printing a dataset does not print the data itself, it only print a
+representation of the dataset object. The information printed tells us that the
+object is similar to a numpy array, with a *shape* and a *type*.
+
+In this case, we are dealing with a scalar dataset, so we can use the same syntax as
+in numpy to access the scalar value, ``result = dset[()]``:
+
+.. code-block:: python
+
+ >>> print(sf["2.1/title"][()])
+ 2 ascan phi 0.61 1.61 20 1
+
+Similarly, you need to use numpy slicing to access values in numeric array:
+
+.. code-block:: python
+
+ >>> print (sf["2.1/measurement/Phi"])
+ <HDF5-like dataset "Phi": shape (21,), type "<f4">
+ >>> print (sf["2.1/measurement/Phi"][0:10])
+ [ 0.61000001 0.66000003 0.70999998 0.75999999 0.81 0.86000001
+ 0.91000003 0.95999998 1.00999999 1.05999994]
+ >>> entire_phi_array = sf["2.1/measurement/Phi"][:]
+
+Here we could read the entire array by slicing it with ``[:]``, because we know
+it is a 1D array. For a 2D array, the slicing argument would have been ``[:, :]``.
+
+For a dataset of unknown dimensionality (including scalar datasets), the
+``Ellipsis`` object (represented by ``...``) can be used to slice the object.
+
+.. code-block:: python
+
+ >>> print(sf["2.1/title"][...])
+ 2 ascan phi 0.61 1.61 20 1
+ >>> print (sf["2.1/measurement/Phi"][...])
+ [ 0.61000001 0.66000003 0.70999998 0.75999999 0.81 0.86000001
+ 0.91000003 0.95999998 1.00999999 1.05999994 1.11000001 1.15999997
+ 1.21000004 1.25999999 1.30999994 1.36000001 1.40999997 1.46000004
+ 1.50999999 1.55999994 1.61000001]
+
+To read more about the usage of ``Ellipsis`` to slice arrays, see
+`Indexing numpy arrays <http://scipy-cookbook.readthedocs.io/items/Indexing.html?highlight=indexing#Multidimensional-slices>`_
+in the scipy documentation.
+
+Note that slicing a scalar dataset with ``[()]`` is not strictly equivalent to
+slicing with ``[...]``. The former gives you the actual scalar value in
+the dataset, while the latter always gives you an array object, which happens to
+be 0D in the case of a scalar.
+
+ >>> sf["2.1/instrument/positioners/Delta"][()]
+ 0.0
+ >>> sf["2.1/instrument/positioners/Delta"][...]
+ array(0.0, dtype=float32)
+
+Closing the file
+++++++++++++++++
+
+You should always make sure to close the files that you opened. The simple way of
+closing a file is to call its :meth:`close` method.
+
+.. code-block:: python
+
+ import silx.io
+ sf = silx.io.open("data/CuZnO_2.spec")
+
+ # read the information you need...
+ maxPhi = sf["2.1/measurement/Phi"][...].max()
+
+ sf.close()
+
+The drawback of this method is that, if an error is raised while processing
+the file, the program might never reach the ``sf.close()`` line.
+Leaving files open can cause various issues for the rest of your program,
+such as consuming memory, not being able to reopen the file when you need it...
+
+The best way to ensure the file is always properly closed is to use the file
+inside its context manager:
+
+.. code-block:: python
+
+ import silx.io
+
+ with silx.io.open("data/CuZnO_2.spec") as sf:
+ # read the information you need...
+ maxPhi = sf["2.1/measurement/Phi"][...].max()
+
+
+Additional resources
+--------------------
+
+- `h5py documentation <http://docs.h5py.org/en/latest/>`_
+- `Formats supported by FabIO <http://www.silx.org/doc/fabio/dev/getting_started.html#list-of-file-formats-that-fabio-can-read-and-write>`_
+- `Spec file h5py-like structure <http://www.silx.org/doc/silx/dev/modules/io/spech5.html#api-description>`_
+- `HDF5 format documentation <https://support.hdfgroup.org/HDF5/>`_
diff --git a/doc/source/Tutorials/specfile_to_hdf5.rst b/doc/source/Tutorials/specfile_to_hdf5.rst
index 31f8383..32d942a 100644
--- a/doc/source/Tutorials/specfile_to_hdf5.rst
+++ b/doc/source/Tutorials/specfile_to_hdf5.rst
@@ -126,8 +126,7 @@ Example of scan and data block, without MCA::
29.366004 45256 0.000343 734 419 248 229 236 343 178082 664 0.00372862 0.00765939 0.0041217 0.00235285 0.00185308 0.00139262 0.00128592 0.00132523 0.00192608 1364 330
29.36998 45258 0.00036 847 448 254 229 248 360 178342 668 0.00374561 0.00857342 0.0047493 0.00251203 0.00194009 0.00142423 0.00128405 0.00139059 0.00201859 1529 346
-Synthetic example of file with 3 scans. The last scan includes data of 3 multichannel analysers, sharing the
-same MCA header.
+Synthetic example of file with 3 scans. The last scan includes MCA data.
::
@@ -198,8 +197,8 @@ The structure exposed is as follows::
start_time = "…"
instrument/
specfile/
- file_header = ["…", "…", …]
- scan_header = ["…", "…", …]
+ file_header = "…"
+ scan_header = "…"
positioners/
motor_name = value
@@ -222,6 +221,11 @@ The structure exposed is as follows::
data -> /1.1/instrument/mca_0/data
info -> /1.1/instrument/mca_0/
+ sample/
+ ub_matrix = …
+ unit_cell = …
+ unit_cell_abc = …
+ unit_cell_alphabetagamma = …
2.1/
@@ -292,12 +296,15 @@ Files and groups can be treated as iterators, which allows looping through them.
Converting SPEC data to HDF5
++++++++++++++++++++++++++++
-The *silx* module :mod:`silx.io.spectoh5` can be used to convert a SPEC file into a
+Using the convert module
+************************
+
+The *silx* module :mod:`silx.io.convert` can be used to convert a SPEC file into a
HDF5 file with the same structure as the one exposed by the :mod:`spech5` module.
.. code-block:: python
- from silx.io.spectoh5 import convert
+ from silx.io.convert import convert
convert("/home/pierre/myspecfile.dat", "myfile.h5")
@@ -305,10 +312,10 @@ HDF5 file with the same structure as the one exposed by the :mod:`spech5` module
You can then read the file with any HDF5 reader.
-In addition to the function :func:`silx.io.spectoh5.convert`, which is simplified
-on purpose, you can use the more flexible :func:`silx.io.spectoh5.write_spec_to_h5`.
+The function :func:`silx.io.convert.convert` is a simplified version of a
+more flexible function :func:`silx.io.convert.write_to_h5`.
-This way, you can choose to write scans into a specific HDF5 group in the output directory.
+The latter allows you to write scans into a specific HDF5 group in the output directory.
You can also decide whether you want to overwrite an existing file, or append data to it.
You can specify whether existing data with the same name as input data should be overwritten
or ignored.
@@ -316,8 +323,34 @@ or ignored.
This allows you to repeatedly transfer new content of a SPEC file to an existing HDF5 file, in between
two scans.
-The following script is an example of a command line interface to :func:`write_spec_to_h5`.
+The following script is an example of a command line interface to :func:`write_to_h5`.
+
+.. literalinclude:: ../../../examples/writetoh5.py
+ :lines: 44-
+
+Using the convert application
+*****************************
+
+.. versionadded:: 0.6
+
+*silx* also provides a ``silx convert`` command line application, which allows you to
+perform standard conversions without having to write your own program.
+
+Type ``silx convert --help`` in a terminal to see all available options.
+
+The simplest command to convert a single SPEC file to an HDF5 file would be::
+
+ silx convert myspecfile.dat
+
+As no output name is supplied, the input file name is reused but the extension is
+modified from *.dat* to *.h5*.
+
+The following example allows you to append the content of a SPEC file to an
+existing HDF5 file::
+
+ silx convert myspecfile.dat -m a -o myhdf5file.h5
-.. literalinclude:: ../../../examples/spectoh5.py
- :lines: 42-
+You could write the file into a specific group of the HDF5 file by providing
+the complete URI in the format ``file_path::group_path``. For instance::
+ silx convert myspecfile.dat -m a -o archive.h5::/2017-09-20/SPEC
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 30abf54..e724d3c 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -1,18 +1,40 @@
# -*- coding: utf-8 -*-
+# /*##########################################################################
+# Copyright (C) 2015-2017 European Synchrotron Radiation Facility
#
-# silx documentation build configuration file, created by
-# sphinx-quickstart on Fri Nov 27 14:20:46 2015.
+# 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:
#
-# This file is execfile()d with the current directory set to its containing dir.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
+# 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.
#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
+# ############################################################################*/
+"""silx documentation build configuration file, created by
+sphinx-quickstart on Fri Nov 27 14:20:46 2015.
+
+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 os.path
import glob
import subprocess
@@ -20,11 +42,18 @@ import subprocess
# 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('.'))
-dirname = os.path.dirname
-root_dir = dirname(dirname(dirname(os.path.abspath(__file__))))
-import silx
-source_dir = dirname(dirname(silx.__file__))
-os.environ["PYTHONPATH"] = source_dir + os.pathsep + os.environ.get("PYTHONPATH", "")
+project = u'silx'
+try:
+ import silx
+ project_dir = os.path.abspath(os.path.join(__file__, "..", "..", ".."))
+ build_dir = os.path.abspath(silx.__file__)
+ if not build_dir.startswith(project_dir):
+ raise RuntimeError("%s looks to come from the system. Fix your PYTHONPATH and restart sphinx." % project)
+except ImportError:
+ raise RuntimeError("%s is not on the path. Fix your PYTHONPATH and restart sphinx." % project)
+
+# Add local sphinx extension directory
+sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ext'))
# -- General configuration -----------------------------------------------------
@@ -38,7 +67,8 @@ extensions = [
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.viewcode',
- 'sphinx.ext.doctest'
+ 'sphinx.ext.doctest',
+ 'sphinxext-archive'
]
autodoc_member_order = 'bysource'
@@ -56,7 +86,6 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
-project = u'silx'
from silx._version import strictversion, version, __date__ as _date
year = _date.split("/")[-1]
copyright = u'2015-%s, Data analysis unit, European Synchrotron Radiation Facility, Grenoble' % year
@@ -138,7 +167,7 @@ html_favicon = "img/silx.ico"
# 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']
+# html_static_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
diff --git a/doc/source/description/img/sift_frame_ROI.png b/doc/source/description/img/sift_frame_ROI.png
new file mode 100644
index 0000000..f722b35
--- /dev/null
+++ b/doc/source/description/img/sift_frame_ROI.png
Binary files differ
diff --git a/doc/source/description/img/sift_match2.png b/doc/source/description/img/sift_match2.png
new file mode 100644
index 0000000..a3beb3c
--- /dev/null
+++ b/doc/source/description/img/sift_match2.png
Binary files differ
diff --git a/doc/source/description/sift.rst b/doc/source/description/sift.rst
index bd89dd0..d4a9fad 100644
--- a/doc/source/description/sift.rst
+++ b/doc/source/description/sift.rst
@@ -246,7 +246,7 @@ Matching is also explained in this tutorial, once the keypoints are
:alt: Example of image matching for pattern recognition
-.. figure:: img/sift_match2.jpg
+.. figure:: img/sift_match2.png
:align: center
:alt: Another example of image matching for pattern recognition
@@ -382,7 +382,7 @@ For instance, if a sample is centered on the image, the user can select the
center of the image before processing.
-.. figure:: img/sift_frame_ROI.jpg
+.. figure:: img/sift_frame_ROI.png
:align: center
:alt: Sample with region of interest
diff --git a/doc/source/ext/sphinxext-archive.py b/doc/source/ext/sphinxext-archive.py
new file mode 100644
index 0000000..dc1c2c8
--- /dev/null
+++ b/doc/source/ext/sphinxext-archive.py
@@ -0,0 +1,184 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""Sphinx extension creating a link to an archive.
+
+This Sphinx extension adds the possibility to create a zip archive and
+include it in the generated HTML documentation.
+
+This extension provides an *archive* directive.
+
+Usage:
+
+.. archive:: <relative_path/to/directory/to/compress>
+ :filename: <name_of_the_archive_file, default: last_folder_of_directory.zip>
+ :filter: <Space-separated list of included file patterns, default *.*>
+ :basedir: <Name of the base directory in the archive, default: filename>
+
+Examples:
+
+To create a example.zip archive of the ../../example/ folder:
+
+.. archive:: ../../examples/
+
+To get more control on the name of the archive and its content:
+
+.. archive:: ../../examples/
+ :filename: myproject_examples.zip
+ :filter: *.py *.png
+ :basedir: myproject_examples
+
+WARNING: The content of this directory is not checked for outdated documents.
+"""
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "01/09/2017"
+
+
+import fnmatch
+import logging
+import os
+import os.path
+import posixpath
+import shutil
+import tempfile
+
+from docutils.parsers.rst import directives, Directive
+import docutils.nodes
+
+
+_logger = logging.getLogger(__name__)
+
+
+# docutils directive
+
+class ArchiveDirective(Directive):
+ """Add a link to download an archive
+
+ This directive add an :class:`archive` node to the document tree.
+ """
+
+ has_content = False
+ required_arguments = 1
+ optional_arguments = 0
+ final_argument_whitespace = False
+ option_spec = {
+ 'filename': directives.unchanged,
+ 'filter': directives.unchanged,
+ 'basedir': directives.unchanged,
+ }
+
+ def run(self):
+ node = archive('')
+
+ # Get rst source file containing this directive
+ source_file = self.state_machine.get_source_and_line()[0]
+ if source_file is None:
+ raise RuntimeError('Cannot get rst source file path')
+
+ # Build input path from rst source file and directive argument
+ input_path = self.arguments[0]
+ if not input_path.startswith('/'): # Argument is a relative path
+ input_path = os.path.abspath(
+ os.path.join(os.path.dirname(source_file), input_path))
+ node['input_path'] = input_path
+
+ default_basedir = os.path.basename(input_path)
+ node['basedir'] = self.options.get('basedir', default_basedir)
+ node['filename'] = self.options.get('filename',
+ '.'.join((default_basedir, 'zip')))
+
+ node['filter'] = self.options.get('filter', '*.*')
+
+ return [node]
+
+
+# archive doctuils node
+
+class archive(docutils.nodes.General, docutils.nodes.Element, docutils.nodes.Inline):
+ """archive node created by :class:`ArchiveDirective`"""
+ pass
+
+
+def visit_archive_html(self, node):
+ """Node visitor to translate :class:`archive` nodes to HTML.
+
+ :param self: Sphinx HTML Writter
+ :param node: The :class:`archive` node to translate to HTML
+ :raise: SkipNode as depart is not implemented
+ """
+ filename = node['filename']
+ input_path = node['input_path']
+
+ # Create a temporary folder to create archive content
+ tmp_dir = tempfile.mkdtemp()
+
+ # Copy selected content to temporary folder
+ base_dir = os.path.join(tmp_dir, node['basedir'])
+
+ def ignore(src, names):
+ patterns = node['filter'].split()
+ ignored_names = []
+ for name in names:
+ for pattern in patterns:
+ if fnmatch.fnmatch(name, pattern):
+ break
+ else:
+ ignored_names.append(name)
+ return ignored_names
+
+ shutil.copytree(input_path, base_dir, ignore=ignore)
+
+ # Compress temporary folder to zip
+ output_filename = os.path.join(
+ self.builder.outdir, '_downloads', filename)
+ root, ext = os.path.splitext(output_filename)
+ assert ext == '.zip'
+ shutil.make_archive(root, 'zip', tmp_dir, node['basedir'])
+
+ # Clean-up temporary folder
+ shutil.rmtree(tmp_dir)
+
+ # Generate HTML
+ relative_path = posixpath.join(self.builder.dlpath, filename)
+ self.body.append('<a href="%s">%s</a>' % (relative_path, filename))
+ raise docutils.nodes.SkipNode
+
+
+def visit_skip(self, node):
+ """No-op node visitor"""
+ raise docutils.nodes.SkipNode
+
+
+# Extension setup
+
+def setup(app):
+ """Sphinx extension registration"""
+ app.add_node(archive,
+ html=(visit_archive_html, None),
+ latex=(visit_skip, None))
+
+ app.add_directive('archive', ArchiveDirective)
+
+ return {'version': '0.1'}
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 656f774..86a1395 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -1,10 +1,16 @@
silx |version|
==============
-The silx project aims at providing a collection of Python packages to support the development of data assessment, reduction and analysis applications at synchrotron radiation facilities.
-It aims at providing reading/writing different file formats, data reduction routines and a set of Qt widgets to browse and visualize data.
+The silx project aims at providing a collection of Python packages to support the
+development of data assessment, reduction and analysis applications at synchrotron
+radiation facilities.
+It aims at providing reading/writing different file formats, data reduction routines
+and a set of Qt widgets to browse and visualize data.
+Silx can be cited by its DOIs referenced on `Zenodo <https://doi.org/10.5281/zenodo.1000472>`_.
-The current version provides reading `SPEC <https://certif.com/spec.html>`_ file format, histogramming, fitting, curves and image plot widget with a set of associated tools.
+The current version provides reading `SPEC <https://certif.com/spec.html>`_ file
+format, histogramming, fitting, curves and image plot widget with a set of
+associated tools.
.. toctree::
:hidden:
@@ -33,6 +39,9 @@ The current version provides reading `SPEC <https://certif.com/spec.html>`_ file
:doc:`modules/index`
Documentation of the packages included in *silx*
+:doc:`modules/gui/gallery`
+ Widgets gallery and screenshots
+
:doc:`changelog`
List of changes between releases
diff --git a/doc/source/license.rst b/doc/source/license.rst
index 6b38b8e..760be91 100644
--- a/doc/source/license.rst
+++ b/doc/source/license.rst
@@ -1,7 +1,9 @@
License
=======
-The source code of *silx* is mostly licensed under the `MIT <https://opensource.org/licenses/MIT>`_ and `LGPL 2.1 <https://opensource.org/licenses/LGPL-2.1>`_ licenses.
+The source code of *silx* is licensed under the `MIT <https://opensource.org/licenses/MIT>`_ license:
+
+.. include:: ../../LICENSE
The following list provides the copyright and license of the different source files of the project:
diff --git a/doc/source/modules/gui/data/img/ArrayTableWidget.png b/doc/source/modules/gui/data/img/ArrayTableWidget.png
new file mode 100644
index 0000000..7c81d02
--- /dev/null
+++ b/doc/source/modules/gui/data/img/ArrayTableWidget.png
Binary files differ
diff --git a/doc/source/modules/gui/fit/backgroundwidget.rst b/doc/source/modules/gui/fit/backgroundwidget.rst
index eea2052..a34c639 100644
--- a/doc/source/modules/gui/fit/backgroundwidget.rst
+++ b/doc/source/modules/gui/fit/backgroundwidget.rst
@@ -7,13 +7,6 @@
.. automodule:: silx.gui.fit.BackgroundWidget
-.. |imgBGWidget| image:: ./img/bgwidget.png
- :height: 300px
- :align: middle
-
-|imgBGWidget|
-
-
API
---
diff --git a/doc/source/modules/gui/fit/img/BackgroundDialog.png b/doc/source/modules/gui/fit/img/BackgroundDialog.png
new file mode 100644
index 0000000..c6b8c03
--- /dev/null
+++ b/doc/source/modules/gui/fit/img/BackgroundDialog.png
Binary files differ
diff --git a/doc/source/modules/gui/fit/img/FitWidget.png b/doc/source/modules/gui/fit/img/FitWidget.png
new file mode 100644
index 0000000..73a80b4
--- /dev/null
+++ b/doc/source/modules/gui/fit/img/FitWidget.png
Binary files differ
diff --git a/doc/source/modules/gui/fit/img/bgwidget.png b/doc/source/modules/gui/fit/img/bgwidget.png
deleted file mode 100644
index 724eadb..0000000
--- a/doc/source/modules/gui/fit/img/bgwidget.png
+++ /dev/null
Binary files differ
diff --git a/doc/source/modules/gui/fit/index.rst b/doc/source/modules/gui/fit/index.rst
index 67c22a1..d9581ed 100644
--- a/doc/source/modules/gui/fit/index.rst
+++ b/doc/source/modules/gui/fit/index.rst
@@ -9,11 +9,11 @@
Snapshot of the widgets:
-.. |imgFitWidget| image:: ../../../Tutorials/img/fitwidget4.png
+.. |imgFitWidget| image:: ./img/FitWidget.png
:height: 150px
:align: middle
-.. |imgBGWidget| image:: ./img/bgwidget.png
+.. |imgBGWidget| image:: ./img/BackgroundDialog.png
:height: 150px
:align: middle
diff --git a/doc/source/modules/gui/gallery.rst b/doc/source/modules/gui/gallery.rst
new file mode 100644
index 0000000..4ae83d6
--- /dev/null
+++ b/doc/source/modules/gui/gallery.rst
@@ -0,0 +1,273 @@
+
+Widgets gallery
+===============
+
+
+:mod:`silx.gui.console` Widgets
++++++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.console
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: img/IPythonWidget.png
+ :height: 150px
+ :align: center
+ - :class:`IPythonWidget` is an interactive console widget running a
+ :class`QtInProcessKernelManager`. This allows to push variables to the
+ interactive console, and interact with your application (e.g. adding
+ curves to a plot)
+ * - .. image:: img/IPythonDockWidget.png
+ :height: 150px
+ :align: center
+ - :class:`IPythonDockWidget` is an :class:`IPythonWidget` embedded in
+ a :class:`QDockWidget`.
+
+
+:mod:`silx.gui.data` Widgets
+++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.data
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: data/img/ArrayTableWidget.png
+ :height: 150px
+ :align: center
+ - :class:`ArrayTableWidget` is a table widget with browsers designed to
+ display the content of multi-dimensional data arrays.
+ * - .. image:: data/img/DataViewer.png
+ :height: 150px
+ :align: center
+ - :class:`DataViewer` is a widget designed to display data using the most
+ adapted view.
+ * - .. image:: data/img/DataViewerFrame.png
+ :height: 150px
+ :align: center
+ - :class:`DataViewerFrame` is a :class:`DataViewer` with a view selector
+ that lets you view the data using any compatible view.
+ * - .. image:: data/img/NumpyAxesSelector.png
+ :height: 50px
+ :align: center
+ - :class:`NumpyAxesSelector` is a widget designed to select a subarray in a
+ n-dimensional array, by fixing the index on some of the dimensions.
+
+
+:mod:`silx.gui.fit` Widgets
++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.fit
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: fit/img/FitWidget.png
+ :height: 150px
+ :align: center
+ - :class:`FitWidget` is a widget designed to configure and run a fitting process,
+ with constraints on parameters.
+ * - .. image:: fit/img/BackgroundDialog.png
+ :height: 150px
+ :align: center
+ - :class:`BackgroundWidget.BackgroundDialog` is a widget designed to adjust
+ the parameters and preview the results of a *snip* or *strip* background
+ filter.
+
+
+:mod:`silx.gui.hdf5` Widgets
+++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.hdf5
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: hdf5/img/Hdf5TreeView.png
+ :height: 150px
+ :align: center
+ - :class:`Hdf5TreeView` is a tree view desiged to browse an HDF5
+ file structure.
+
+.. _plot-gallery:
+
+:mod:`silx.gui.plot` Widgets
+++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.plot
+
+Plotting widgets:
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: plot/img/PlotWidget.png
+ :height: 150px
+ :align: center
+ - :class:`PlotWidget` is the base Qt widget providing a plot area.
+ Other plot widgets are based on this one and provides the same API.
+ * - .. image:: plot/img/PlotWindow.png
+ :height: 150px
+ :align: center
+ - :class:`PlotWindow` adds a toolbar to :class:`PlotWidget`.
+ The content of this toolbar can be configured from the
+ :class:`PlotWindow` constructor or by hiding its content afterward.
+ * - .. image:: plot/img/Plot1D.png
+ :height: 150px
+ :align: center
+ - :class:`.Plot1D` is a :class:`PlotWindow` configured with tools useful
+ for curves.
+ * - .. image:: plot/img/Plot2D.png
+ :height: 150px
+ :align: center
+ - :class:`.Plot2D` is a :class:`PlotWindow` configured with tools useful
+ for images.
+ * - .. image:: plot/img/ImageView.png
+ :height: 150px
+ :align: center
+ - :class:`ImageView` adds side histograms to a :class:`.Plot2D` widget.
+ * - .. image:: plot/img/StackView.png
+ :height: 150px
+ :align: center
+ - :class:`StackView` is a widget designed to display an image from a
+ stack of images in a :class:`PlotWindow` widget, with a frame browser
+ to navigate in the stack. The profile tool can do a 2D profile on the
+ stack of images.
+ * - .. image:: plot/img/ComplexImageView.png
+ :height: 150px
+ :align: center
+ - :class:`ComplexImageView` is a widget dedicated to visualize a single
+ 2D dataset of complex data.
+ It allows to switch between viewing amplitude, phase, real, imaginary,
+ colored phase with amplitude or log10(amplitude) as brightness.
+
+
+Additional widgets:
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: plot/img/PositionInfo.png
+ :width: 300px
+ :align: center
+ - :class:`.PlotTools.PositionInfo` is a widget displaying mouse position and
+ information of a :class:`PlotWidget` associated to the mouse position.
+ * - .. image:: plot/img/LimitsToolBar.png
+ :width: 300px
+ :align: center
+ - :class:`.PlotTools.LimitsToolBar` is a QToolBar displaying and
+ controlling the limits of a :class:`PlotWidget`.
+ * - .. image:: plot/img/logColorbar.png
+ :height: 150px
+ :align: center
+ - :class:`.ColorBar.ColorBarWidget` display colormap gradient and can be linked with a plot
+ to display the colormap
+
+.. _plot3d-gallery:
+
+:mod:`silx.gui.plot3d` Widgets
+++++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.plot3d
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: plot3d/img/ScalarFieldView.png
+ :height: 150px
+ :align: center
+ - :class:`ScalarFieldView` is a :class:`Plot3DWindow` dedicated to display 3D scalar field.
+ It can display iso-surfaces and an interactive cutting plane.
+ Sample code: :doc:`plot3d/viewer3dvolume_example`.
+ * - .. image:: plot3d/img/Plot3DWindow.png
+ :height: 150px
+ :align: center
+ - :class:`Plot3DWindow` is a :class:`QMainWindow` with a :class:`Plot3DWidget` as central widget
+ and toolbars.
+ * - .. image:: plot3d/img/Plot3DWidget.png
+ :height: 150px
+ :align: center
+ - :class:`Plot3DWidget` is the base Qt widget providing an OpenGL 3D scene.
+ Other widgets are using this widget as the OpenGL scene canvas.
+ * - .. image:: plot3d/img/SFViewParamTree.png
+ :height: 150px
+ :align: center
+ - :class:`SFViewParamTree` is a :class:`QTreeView` widget that can be attached to a :class:`ScalarFieldView`.
+ It displays current parameters of the :class:`ScalarFieldView` and allows to modify it.
+ Sample code: :doc:`plot3d/viewer3dvolume_example`.
+
+
+:mod:`silx.gui.widgets` Widgets
++++++++++++++++++++++++++++++++
+
+.. currentmodule:: silx.gui.widgets
+
+.. list-table::
+ :widths: 1 4
+ :header-rows: 1
+
+ * - Widget
+ - Description
+ * - .. image:: widgets/img/FrameBrowser.png
+ :width: 110px
+ :align: center
+ - :class:`FrameBrowser.FrameBrowser` is a browser widget designed to
+ browse through a sequence of integers (e.g. the indices of an array)
+ * - .. image:: widgets/img/HorizontalSliderWithBrowser.png
+ :width: 150px
+ :align: center
+ - :class:`FrameBrowser.HorizontalSliderWithBrowser` is a :class:`FrameBrowser`
+ with an additional slider.
+ * - .. image:: widgets/img/PeriodicCombo.png
+ :width: 150px
+ :align: center
+ - :class:`PeriodicTable.PeriodicCombo` is a :class:`QComboBox` widget designed to
+ select a single atomic element.
+ * - .. image:: widgets/img/PeriodicList.png
+ :height: 150px
+ :align: center
+ - :class:`PeriodicTable.PeriodicList` is a :class:`QTreeWidget` designed to select one
+ or more atomic elements.
+ * - .. image:: widgets/img/PeriodicTable.png
+ :height: 150px
+ :align: center
+ - :class:`PeriodicTable.PeriodicTable` is a periodic table widget designed to select one
+ or more atomic elements.
+ * - .. image:: widgets/img/TableWidget.png
+ :height: 150px
+ :align: center
+ - :class:`TableWidget.TableWidget` and :class:`TableWidget.TableView` inherit respectively
+ :class:`QTableWidget` and :class:`QTableView`, and add a context menu with *cut/copy/paste*
+ actions.
+ * - .. image:: widgets/img/WaitingPushButton.png
+ :width: 60px
+ :align: center
+ - :class:`WaitingPushButton` is a :class:`QPushButton` that can be graphically disabled,
+ for example to wait for a callback function to finish computing.
+ * - .. image:: widgets/img/ThreadPoolPushButton.png
+ :width: 100px
+ :align: center
+ - :class:`ThreadPoolPushButton` is a :class:`WaitingPushButton` that executes a
+ callback in a thread.
diff --git a/doc/source/modules/gui/icons.rst b/doc/source/modules/gui/icons.rst
index 61ea71d..c3fefd8 100644
--- a/doc/source/modules/gui/icons.rst
+++ b/doc/source/modules/gui/icons.rst
@@ -25,16 +25,22 @@ Available icons
- 3d-plane-normal-y
* - |3d-plane-normal-z|
- 3d-plane-normal-z
+ * - |3d-plane-pan|
+ - 3d-plane-pan
* - |3d-plane|
- 3d-plane
* - |arrow-keys|
- arrow-keys
+ * - |axis|
+ - axis
* - |camera|
- camera
* - |clipboard|
- clipboard
* - |close|
- close
+ * - |colorbar|
+ - colorbar
* - |colormap|
- colormap
* - |crop|
@@ -97,10 +103,14 @@ Available icons
- item-3dim
* - |item-ndim|
- item-ndim
+ * - |item-none|
+ - item-none
* - |item-object|
- item-object
* - |last|
- last
+ * - |math-amplitude|
+ - math-amplitude
* - |math-average|
- math-average
* - |math-derive|
@@ -109,6 +119,8 @@ Available icons
- math-energy
* - |math-fit|
- math-fit
+ * - |math-imaginary|
+ - math-imaginary
* - |math-normalize|
- math-normalize
* - |math-peak-reset|
@@ -117,6 +129,14 @@ Available icons
- math-peak-search
* - |math-peak|
- math-peak
+ * - |math-phase-color-log|
+ - math-phase-color-log
+ * - |math-phase-color|
+ - math-phase-color
+ * - |math-phase|
+ - math-phase
+ * - |math-real|
+ - math-real
* - |math-sigma|
- math-sigma
* - |math-smooth|
@@ -127,10 +147,14 @@ Available icons
- math-swap-sign
* - |math-ymin-to-zero|
- math-ymin-to-zero
+ * - |median-filter|
+ - median-filter
* - |next|
- next
* - |normal|
- normal
+ * - |pan|
+ - pan
* - |pixel-intensities|
- pixel-intensities
* - |plot-grid|
@@ -167,12 +191,16 @@ Available icons
- plot-yup
* - |previous|
- previous
+ * - |profile-clear|
+ - profile-clear
* - |profile1D|
- profile1D
* - |profile2D|
- profile2D
* - |remove|
- remove
+ * - |rotate-3d|
+ - rotate-3d
* - |rudder|
- rudder
* - |selected|
@@ -205,8 +233,6 @@ Available icons
- sliders-on
* - |spec|
- spec
- * - |test-png|
- - test-png
* - |view-1d|
- view-1d
* - |view-2d-stack|
@@ -217,6 +243,10 @@ Available icons
- view-3d
* - |view-fullscreen|
- view-fullscreen
+ * - |view-hdf5|
+ - view-hdf5
+ * - |view-nexus|
+ - view-nexus
* - |view-nofullscreen|
- view-nofullscreen
* - |view-raw|
@@ -227,6 +257,8 @@ Available icons
- view-text
* - |window-new|
- window-new
+ * - |zoom-back|
+ - zoom-back
* - |zoom-in|
- zoom-in
* - |zoom-original|
@@ -239,11 +271,14 @@ Available icons
.. |3d-plane-normal-x| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-x.png
.. |3d-plane-normal-y| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-y.png
.. |3d-plane-normal-z| image:: ../../../../silx/resources/gui/icons/3d-plane-normal-z.png
+.. |3d-plane-pan| image:: ../../../../silx/resources/gui/icons/3d-plane-pan.png
.. |3d-plane| image:: ../../../../silx/resources/gui/icons/3d-plane.png
.. |arrow-keys| image:: ../../../../silx/resources/gui/icons/arrow-keys.png
+.. |axis| image:: ../../../../silx/resources/gui/icons/axis.png
.. |camera| image:: ../../../../silx/resources/gui/icons/camera.png
.. |clipboard| image:: ../../../../silx/resources/gui/icons/clipboard.png
.. |close| image:: ../../../../silx/resources/gui/icons/close.png
+.. |colorbar| image:: ../../../../silx/resources/gui/icons/colorbar.png
.. |colormap| image:: ../../../../silx/resources/gui/icons/colormap.png
.. |crop| image:: ../../../../silx/resources/gui/icons/crop.png
.. |crosshair| image:: ../../../../silx/resources/gui/icons/crosshair.png
@@ -275,23 +310,32 @@ Available icons
.. |item-2dim| image:: ../../../../silx/resources/gui/icons/item-2dim.png
.. |item-3dim| image:: ../../../../silx/resources/gui/icons/item-3dim.png
.. |item-ndim| image:: ../../../../silx/resources/gui/icons/item-ndim.png
+.. |item-none| image:: ../../../../silx/resources/gui/icons/item-none.png
.. |item-object| image:: ../../../../silx/resources/gui/icons/item-object.png
.. |last| image:: ../../../../silx/resources/gui/icons/last.png
+.. |math-amplitude| image:: ../../../../silx/resources/gui/icons/math-amplitude.png
.. |math-average| image:: ../../../../silx/resources/gui/icons/math-average.png
.. |math-derive| image:: ../../../../silx/resources/gui/icons/math-derive.png
.. |math-energy| image:: ../../../../silx/resources/gui/icons/math-energy.png
.. |math-fit| image:: ../../../../silx/resources/gui/icons/math-fit.png
+.. |math-imaginary| image:: ../../../../silx/resources/gui/icons/math-imaginary.png
.. |math-normalize| image:: ../../../../silx/resources/gui/icons/math-normalize.png
.. |math-peak-reset| image:: ../../../../silx/resources/gui/icons/math-peak-reset.png
.. |math-peak-search| image:: ../../../../silx/resources/gui/icons/math-peak-search.png
.. |math-peak| image:: ../../../../silx/resources/gui/icons/math-peak.png
+.. |math-phase-color-log| image:: ../../../../silx/resources/gui/icons/math-phase-color-log.png
+.. |math-phase-color| image:: ../../../../silx/resources/gui/icons/math-phase-color.png
+.. |math-phase| image:: ../../../../silx/resources/gui/icons/math-phase.png
+.. |math-real| image:: ../../../../silx/resources/gui/icons/math-real.png
.. |math-sigma| image:: ../../../../silx/resources/gui/icons/math-sigma.png
.. |math-smooth| image:: ../../../../silx/resources/gui/icons/math-smooth.png
.. |math-substract| image:: ../../../../silx/resources/gui/icons/math-substract.png
.. |math-swap-sign| image:: ../../../../silx/resources/gui/icons/math-swap-sign.png
.. |math-ymin-to-zero| image:: ../../../../silx/resources/gui/icons/math-ymin-to-zero.png
+.. |median-filter| image:: ../../../../silx/resources/gui/icons/median-filter.png
.. |next| image:: ../../../../silx/resources/gui/icons/next.png
.. |normal| image:: ../../../../silx/resources/gui/icons/normal.png
+.. |pan| image:: ../../../../silx/resources/gui/icons/pan.png
.. |pixel-intensities| image:: ../../../../silx/resources/gui/icons/pixel-intensities.png
.. |plot-grid| image:: ../../../../silx/resources/gui/icons/plot-grid.png
.. |plot-roi-above| image:: ../../../../silx/resources/gui/icons/plot-roi-above.png
@@ -310,9 +354,11 @@ Available icons
.. |plot-ylog| image:: ../../../../silx/resources/gui/icons/plot-ylog.png
.. |plot-yup| image:: ../../../../silx/resources/gui/icons/plot-yup.png
.. |previous| image:: ../../../../silx/resources/gui/icons/previous.png
+.. |profile-clear| image:: ../../../../silx/resources/gui/icons/profile-clear.png
.. |profile1D| image:: ../../../../silx/resources/gui/icons/profile1D.png
.. |profile2D| image:: ../../../../silx/resources/gui/icons/profile2D.png
.. |remove| image:: ../../../../silx/resources/gui/icons/remove.png
+.. |rotate-3d| image:: ../../../../silx/resources/gui/icons/rotate-3d.png
.. |rudder| image:: ../../../../silx/resources/gui/icons/rudder.png
.. |selected| image:: ../../../../silx/resources/gui/icons/selected.png
.. |shape-circle-solid| image:: ../../../../silx/resources/gui/icons/shape-circle-solid.png
@@ -329,17 +375,19 @@ Available icons
.. |sliders-off| image:: ../../../../silx/resources/gui/icons/sliders-off.png
.. |sliders-on| image:: ../../../../silx/resources/gui/icons/sliders-on.png
.. |spec| image:: ../../../../silx/resources/gui/icons/spec.png
-.. |test-png| image:: ../../../../silx/resources/gui/icons/test-png.png
.. |view-1d| image:: ../../../../silx/resources/gui/icons/view-1d.png
.. |view-2d-stack| image:: ../../../../silx/resources/gui/icons/view-2d-stack.png
.. |view-2d| image:: ../../../../silx/resources/gui/icons/view-2d.png
.. |view-3d| image:: ../../../../silx/resources/gui/icons/view-3d.png
.. |view-fullscreen| image:: ../../../../silx/resources/gui/icons/view-fullscreen.png
+.. |view-hdf5| image:: ../../../../silx/resources/gui/icons/view-hdf5.png
+.. |view-nexus| image:: ../../../../silx/resources/gui/icons/view-nexus.png
.. |view-nofullscreen| image:: ../../../../silx/resources/gui/icons/view-nofullscreen.png
.. |view-raw| image:: ../../../../silx/resources/gui/icons/view-raw.png
.. |view-refresh| image:: ../../../../silx/resources/gui/icons/view-refresh.png
.. |view-text| image:: ../../../../silx/resources/gui/icons/view-text.png
.. |window-new| image:: ../../../../silx/resources/gui/icons/window-new.png
+.. |zoom-back| image:: ../../../../silx/resources/gui/icons/zoom-back.png
.. |zoom-in| image:: ../../../../silx/resources/gui/icons/zoom-in.png
.. |zoom-original| image:: ../../../../silx/resources/gui/icons/zoom-original.png
.. |zoom-out| image:: ../../../../silx/resources/gui/icons/zoom-out.png
diff --git a/doc/source/modules/gui/img/IPythonDockWidget.png b/doc/source/modules/gui/img/IPythonDockWidget.png
new file mode 100644
index 0000000..111a926
--- /dev/null
+++ b/doc/source/modules/gui/img/IPythonDockWidget.png
Binary files differ
diff --git a/doc/source/modules/gui/img/IPythonWidget.png b/doc/source/modules/gui/img/IPythonWidget.png
new file mode 100644
index 0000000..18b44e0
--- /dev/null
+++ b/doc/source/modules/gui/img/IPythonWidget.png
Binary files differ
diff --git a/doc/source/modules/gui/index.rst b/doc/source/modules/gui/index.rst
index eecd124..0b7f433 100644
--- a/doc/source/modules/gui/index.rst
+++ b/doc/source/modules/gui/index.rst
@@ -19,3 +19,11 @@ The ``silx.gui`` package provides a set of PyQt widgets.
plot3d/index.rst
qt.rst
widgets/index.rst
+
+
+.. toctree::
+ :hidden:
+
+ gallery.rst
+
+See the :doc:`gallery` page for an overview of all available widgets.
diff --git a/doc/source/modules/gui/plot/actions/control.rst b/doc/source/modules/gui/plot/actions/control.rst
new file mode 100644
index 0000000..b35986d
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/control.rst
@@ -0,0 +1,5 @@
+:mod:`silx.gui.plot.actions.control`
+````````````````````````````````````
+
+.. automodule:: silx.gui.plot.actions.control
+ :members:
diff --git a/doc/source/modules/gui/plot/plotactions_examples.rst b/doc/source/modules/gui/plot/actions/examples.rst
index f14a42a..125e9c5 100644
--- a/doc/source/modules/gui/plot/plotactions_examples.rst
+++ b/doc/source/modules/gui/plot/actions/examples.rst
@@ -17,7 +17,7 @@ Simple example: Shift a curve
The following script is a simplistic example to show the basic required steps:
- - create a new class inheriting from :class:`silx.gui.plot.PlotActions.PlotAction`
+ - create a new class inheriting from :class:`silx.gui.plot.actions.PlotAction`
- define basic parameters such as the icon, the tooltip...
- write a method that will be triggered by the action
- initialize the new plot action by passing a reference to a plot window
@@ -27,7 +27,7 @@ The method implemented in this action interacts with the plot in a basic way. It
then it creates a new data array based on the curve data, and finally it replaces the original curve
with a new one using the modified data array.
-.. literalinclude:: ../../../../../examples/shiftPlotAction.py
+.. literalinclude:: ../../../../../../examples/shiftPlotAction.py
:lines: 36-
.. |imgShiftAction0| image:: img/shiftAction0.png
@@ -66,7 +66,7 @@ the amplitude spectrum. However, the inverse FFT requires the complete FFT data
We are therefore required to store the complex array of FFT data as curve metadata,
in order to be able to reverse the process when the action is unchecked.
-.. literalinclude:: ../../../../../examples/fftPlotAction.py
+.. literalinclude:: ../../../../../../examples/fftPlotAction.py
:lines: 44-
.. |imgFftAction0| image:: img/fftAction0.png
diff --git a/doc/source/modules/gui/plot/actions/fit.rst b/doc/source/modules/gui/plot/actions/fit.rst
new file mode 100644
index 0000000..8b06908
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/fit.rst
@@ -0,0 +1,5 @@
+:mod:`silx.gui.plot.actions.fit`
+````````````````````````````````
+
+.. automodule:: silx.gui.plot.actions.fit
+ :members:
diff --git a/doc/source/modules/gui/plot/actions/histogram.rst b/doc/source/modules/gui/plot/actions/histogram.rst
new file mode 100644
index 0000000..6a31236
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/histogram.rst
@@ -0,0 +1,5 @@
+:mod:`silx.gui.plot.actions.histogram`
+``````````````````````````````````````
+
+.. automodule:: silx.gui.plot.actions.histogram
+ :members:
diff --git a/doc/source/modules/gui/plot/img/fftAction0.png b/doc/source/modules/gui/plot/actions/img/fftAction0.png
index 5bd8061..5bd8061 100644
--- a/doc/source/modules/gui/plot/img/fftAction0.png
+++ b/doc/source/modules/gui/plot/actions/img/fftAction0.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/img/fftAction1.png b/doc/source/modules/gui/plot/actions/img/fftAction1.png
index e4b20d7..e4b20d7 100644
--- a/doc/source/modules/gui/plot/img/fftAction1.png
+++ b/doc/source/modules/gui/plot/actions/img/fftAction1.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/img/shiftAction0.png b/doc/source/modules/gui/plot/actions/img/shiftAction0.png
index 2d5837a..2d5837a 100644
--- a/doc/source/modules/gui/plot/img/shiftAction0.png
+++ b/doc/source/modules/gui/plot/actions/img/shiftAction0.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/img/shiftAction3.png b/doc/source/modules/gui/plot/actions/img/shiftAction3.png
index a2187b8..a2187b8 100644
--- a/doc/source/modules/gui/plot/img/shiftAction3.png
+++ b/doc/source/modules/gui/plot/actions/img/shiftAction3.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/actions/index.rst b/doc/source/modules/gui/plot/actions/index.rst
new file mode 100644
index 0000000..f95b1f8
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/index.rst
@@ -0,0 +1,30 @@
+.. currentmodule:: silx.gui.plot
+
+:mod:`actions`: Actions for PlotWidget
+===========================================
+
+.. currentmodule:: silx.gui.plot.actions
+
+The :class:`PlotAction` is a base class used to define plot actions.
+
+Plot actions serve to add menu items or toolbar items that are associated with a method
+that can interact with the associated :class:`.PlotWidget`.
+
+For an introduction to creating custom plot actions, see :doc:`examples`.
+
+actions API
+-----------
+
+Actions are divided into the following sub-modules:
+
+
+.. toctree::
+ :maxdepth: 1
+
+ control.rst
+ medfilt.rst
+ fit.rst
+ histogram.rst
+ io.rst
+
+.. autoclass:: silx.gui.plot.actions.PlotAction
diff --git a/doc/source/modules/gui/plot/actions/io.rst b/doc/source/modules/gui/plot/actions/io.rst
new file mode 100644
index 0000000..98f1808
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/io.rst
@@ -0,0 +1,6 @@
+:mod:`silx.gui.plot.actions.io`
+```````````````````````````````
+
+.. automodule:: silx.gui.plot.actions.io
+ :members:
+
diff --git a/doc/source/modules/gui/plot/actions/medfilt.rst b/doc/source/modules/gui/plot/actions/medfilt.rst
new file mode 100644
index 0000000..25f5af1
--- /dev/null
+++ b/doc/source/modules/gui/plot/actions/medfilt.rst
@@ -0,0 +1,5 @@
+:mod:`silx.gui.plot.actions.medfilt`
+````````````````````````````````````
+
+.. automodule:: silx.gui.plot.actions.medfilt
+ :members:
diff --git a/doc/source/modules/gui/plot/colormap.rst b/doc/source/modules/gui/plot/colormap.rst
new file mode 100644
index 0000000..a492605
--- /dev/null
+++ b/doc/source/modules/gui/plot/colormap.rst
@@ -0,0 +1,16 @@
+
+.. currentmodule:: silx.gui.plot.Colormap
+
+:mod:`Colormap`: Colormap API
+=============================
+
+.. automodule:: silx.gui.plot.Colormap
+
+.. currentmodule:: silx.gui.plot.Colormap
+
+:class:`Colormap` class
+-----------------------
+
+.. autoclass:: Colormap
+ :show-inheritance:
+ :members:
diff --git a/doc/source/modules/gui/plot/compleximageview.rst b/doc/source/modules/gui/plot/compleximageview.rst
new file mode 100644
index 0000000..d9009eb
--- /dev/null
+++ b/doc/source/modules/gui/plot/compleximageview.rst
@@ -0,0 +1,19 @@
+
+.. currentmodule:: silx.gui.plot
+
+:mod:`ComplexImageView`: Plot a 2D array of complex
+===================================================
+
+.. automodule:: silx.gui.plot.ComplexImageView
+
+.. currentmodule:: silx.gui.plot.ComplexImageView
+
+.. image:: img/ComplexImageView.png
+ :height: 400px
+ :align: center
+
+:class:`ComplexImageView` class
+-------------------------------
+
+.. autoclass:: ComplexImageView
+ :members:
diff --git a/doc/source/modules/gui/plot/dev.rst b/doc/source/modules/gui/plot/dev.rst
index 707d215..b793b01 100644
--- a/doc/source/modules/gui/plot/dev.rst
+++ b/doc/source/modules/gui/plot/dev.rst
@@ -10,7 +10,7 @@ This package is structured as follows.
:class:`PlotWidget` is a Qt widget (actually a :class:`QMainWindow`) displaying a 1D, 2D plot area.
It provides different interaction modes.
:class:`PlotWindow` is a Qt widget (actually a :class:`QMainWindow`) which adds a set of toolbar buttons and associated functionalities to :class:`PlotWidget`.
-The toolbar QActions are implemented in :mod:`.PlotActions`.
+The toolbar QActions are implemented in :mod:`.actions`.
:mod:`.Plot`, :mod:`.PlotEvents` and :mod:`.PlotInteraction` implement the plotting API regardless of the rendering backend and regardless of its integration in Qt.
The plotting API in defined in :mod:`.Plot`.
@@ -40,7 +40,6 @@ The :class:`PlotWindow` uses additional widgets:
The widgets also use the following miscellaneous modules:
- :mod:`.Colors` to convert colors from name to RGB(A)
-- :mod:`.MPLColormap` to embed recent matplotlib colormaps: 'magma', 'inferno', 'plasma' and 'viridis'.
- :mod:`._utils`: utility functions
The :mod:`backends` package provide the implementation of the rendering used by the :class:`Plot`.
@@ -89,15 +88,6 @@ The following modules are the modules used internally by the plot package.
.. automodule:: silx.gui.plot.backends.BackendMatplotlib
:members:
-:mod:`backends.ModestImage`
-+++++++++++++++++++++++++++
-
-.. currentmodule:: silx.gui.plot.backends.ModestImage
-
-.. automodule:: silx.gui.plot.backends.ModestImage
- :members:
- :undoc-members:
-
:mod:`ColormapDialog`
+++++++++++++++++++++
@@ -164,14 +154,6 @@ The following modules are the modules used internally by the plot package.
:members:
:show-inheritance:
-:mod:`MPLColormap`
-++++++++++++++++++
-
-.. currentmodule:: silx.gui.plot.MPLColormap
-
-.. automodule:: silx.gui.plot.MPLColormap
- :members:
-
:mod:`PlotEvents`
+++++++++++++++++
diff --git a/doc/source/modules/gui/plot/getting_started.rst b/doc/source/modules/gui/plot/getting_started.rst
index 9e45b70..484d3f7 100644
--- a/doc/source/modules/gui/plot/getting_started.rst
+++ b/doc/source/modules/gui/plot/getting_started.rst
@@ -157,6 +157,7 @@ a module from :mod:`silx.gui`:
.. warning::
+
:mod:`silx.gui.plot` widgets are not thread-safe.
All calls to :mod:`silx.gui.plot` widgets must be made from the main thread.
@@ -342,17 +343,15 @@ When updating an image, if ``origin`` and ``scale`` are not provided, the previo
Colormap
++++++++
-A ``colormap`` is described with a :class:`dict` as follows (See :mod:`silx.gui.plot.Plot` for full documentation of the colormap):
+A ``colormap`` is described with a :class:`.Colormap` class as follows:
.. code-block:: python
- colormap = {
- 'name': 'gray', # Name of the colormap
- 'normalization': 'linear', # Either 'linear' or 'log'
- 'autoscale': True, # True to autoscale colormap to data range, False to use [vmin, vmax]
- 'vmin': 0.0, # If not autoscale, data value to bind to min of colormap
- 'vmax': 1.0 # If not autoscale, data value to bind to max of colormap
- }
+ colormap = Colormap(name='gray', # Name of the colormap
+ normalization='linear', # Either 'linear' or 'log'
+ vmin=0.0, # If not autoscale, data value to bind to min of colormap
+ vmax=1.0 # If not autoscale, data value to bind to max of colormap
+ )
At least the following colormap names are guaranteed to be available, but any colormap name from `matplotlib <http://matplotlib.org/>`_ (see `Choosing Colormaps <http://matplotlib.org/users/colormaps.html>`_) should work:
@@ -372,19 +371,23 @@ It is possible to change the default colormap of :meth:`.PlotWidget.addImage` fo
.. code-block:: python
- colormap = {'name': 'viridis', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='viridis',
+ normalization='linear',
+ vmin=0.0,
+ vmax=1.0)
plot.setDefaultColormap(colormap)
data = numpy.arange(512 * 512.).reshape(512, -1)
plot.addImage(data) # Rendered with the default colormap set before
-It is also possible to provide a ``colormap`` to :meth:`.PlotWidget.addImage` to override this default for an image:
+It is also possible to provide a :class:`.Colormap` to :meth:`.PlotWidget.addImage` to override this default for an image:
.. code-block:: python
- colormap = {'name': 'magma', 'normalization': 'log',
- 'autoscale': False, 'vmin': 1.2, 'vmax': 1.8}
+ colormap = Colormap(name='magma',
+ normalization='log',
+ vmin=1.2,
+ vmax=1.8)
data = numpy.random.random(512 * 512).reshape(512, -1) + 1.
plot.addImage(data, colormap=colormap)
@@ -432,18 +435,19 @@ Control plot axes
-----------------
The following examples illustrate the API to control the plot axes.
+:meth:`.PlotWidget.getXAxis` and :meth:`.PlotWidget.getYAxis` give access to each plot axis (:class:`.items.Axis`) in order to control them.
Labels and title
++++++++++++++++
Use :meth:`.PlotWidget.setGraphTitle` to set the plot main title.
-Use :meth:`.PlotWidget.setGraphXLabel` and :meth:`.PlotWidget.setGraphYLabel` to set the axes text labels:
+Use :meth:`.PlotWidget.getXAxis` and :meth:`.PlotWidget.getYAxis` to get the axes and set their text label with :meth:`.items.Axis.setLabel`:
.. code-block:: python
plot.setGraphTitle('My plot')
- plot.setGraphXLabel('X')
- plot.setGraphYLabel('Y')
+ plot.getXAxis().setLabel('X')
+ plot.getYAxis().setLabel('Y')
Axes limits
@@ -455,9 +459,9 @@ The following code moves the visible plot area to the right:
.. code-block:: python
- xmin, xmax = plot.getGraphXLimits()
+ xmin, xmax = plot.getXAxis().getLimits()
offset = 0.1 * (xmax - xmin)
- plot.setGraphXLimits(xmin + offset, xmax + offset)
+ plot.getXAxis().setLimits(xmin + offset, xmax + offset)
:meth:`.PlotWidget.resetZoom` set the plot limits to the bounds of the data:
@@ -465,7 +469,7 @@ The following code moves the visible plot area to the right:
plot.resetZoom()
-See :meth:`.PlotWidget.resetZoom`, :meth:`.PlotWidget.setLimits`, :meth:`.PlotWidget.getGraphXLimits`, :meth:`.PlotWidget.setGraphXLimits`, :meth:`.PlotWidget.getGraphYLimits`, :meth:`.PlotWidget.setGraphYLimits` for details.
+See :meth:`.PlotWidget.resetZoom`, :meth:`.PlotWidget.setLimits`, :meth:`.PlotWidget.getXAxis`, :meth:`.PlotWidget.getYAxis` and :class:`.items.Axis` for details.
Axes
@@ -475,17 +479,17 @@ Different methods allow plot axes modifications:
.. code-block:: python
- plot.setYAxisInverted(True) # Makes the Y axis pointing downward
+ plot.getYAxis().setInverted(True) # Makes the Y axis pointing downward
plot.setKeepDataAspectRatio(True) # To keep aspect ratio between X and Y axes
-See :meth:`.PlotWidget.setYAxisInverted`, :meth:`.PlotWidget.setKeepDataAspectRatio` for details.
+See :meth:`.PlotWidget.getYAxis`, :meth:`.PlotWidget.setKeepDataAspectRatio` for details.
.. code-block:: python
plot.setGraphGrid(which='both') # To show a grid for both minor and major axes ticks
# Use logarithmic axes
- plot.setXAxisLogarithmic(True)
- plot.setYAxisLogarithmic(True)
+ plot.getXAxis().setScale("log")
+ plot.getYAxis().setScale("log")
-See :meth:`.PlotWidget.setGraphGrid`, :meth:`.PlotWidget.setXAxisLogarithmic`, :meth:`.PlotWidget.setYAxisLogarithmic` for details.
+See :meth:`.PlotWidget.setGraphGrid`, :meth:`.PlotWidget.getXAxis`, :meth:`.PlotWidget.getXAxis` and :class:`.items.Axis` for details.
diff --git a/doc/source/modules/gui/plot/imageview.rst b/doc/source/modules/gui/plot/imageview.rst
index c2663c7..f03868b 100644
--- a/doc/source/modules/gui/plot/imageview.rst
+++ b/doc/source/modules/gui/plot/imageview.rst
@@ -6,10 +6,12 @@
.. automodule:: silx.gui.plot.ImageView
-.. currentmodule:: silx.gui.plot.ImageView
+.. image:: img/ImageView.png
+ :height: 400
+ :align: center
:class:`ImageView` class
------------------------
.. autoclass:: ImageView
- :members: valueChanged, profile, setImage, getColormap, setColormap, getHistogram, setGraphTitle, setGraphXLabel, setGraphYLabel
+ :members: valueChanged, setImage, getColormap, setColormap, getHistogram, setGraphTitle, getXAxis, getYAxis
diff --git a/doc/source/modules/gui/plot/img/ComplexImageView.png b/doc/source/modules/gui/plot/img/ComplexImageView.png
new file mode 100644
index 0000000..3f8b502
--- /dev/null
+++ b/doc/source/modules/gui/plot/img/ComplexImageView.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png b/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png
new file mode 100644
index 0000000..4ce42b3
--- /dev/null
+++ b/doc/source/modules/gui/plot/img/printPreviewMultiPlot.png
Binary files differ
diff --git a/doc/source/modules/gui/plot/index.rst b/doc/source/modules/gui/plot/index.rst
index 143b85b..b77bbcc 100644
--- a/doc/source/modules/gui/plot/index.rst
+++ b/doc/source/modules/gui/plot/index.rst
@@ -15,94 +15,12 @@
For an introduction to the widgets of this package, see :doc:`getting_started`.
-For examples of custom plot actions, see :doc:`plotactions_examples`.
+For examples of custom plot actions, see :doc:`actions/examples`.
Widgets gallery
---------------
-The :mod:`silx.gui.plot` package provides the following plotting widgets:
-
-.. |imgPlotWidget| image:: img/PlotWidget.png
- :height: 150px
- :align: middle
-
-.. |imgPlotWindow| image:: img/PlotWindow.png
- :height: 150px
- :align: middle
-
-.. |imgPlot1D| image:: img/Plot1D.png
- :height: 150px
- :align: middle
-
-.. |imgPlot2D| image:: img/Plot2D.png
- :height: 150px
- :align: middle
-
-.. |imgImageView| image:: img/ImageView.png
- :height: 150px
- :align: middle
-
-.. |imgStackView| image:: img/StackView.png
- :height: 150px
- :align: middle
-
-.. list-table::
- :widths: 1 4
- :header-rows: 1
-
- * - Widget
- - Description
- * - |imgPlotWidget|
- - :class:`PlotWidget` is the base Qt widget providing a plot area.
- Other plot widgets are based on this one and provides the same API.
- * - |imgPlotWindow|
- - :class:`PlotWindow` adds a toolbar to :class:`PlotWidget`.
- The content of this toolbar can be configured from the
- :class:`PlotWindow` constructor or by hiding its content afterward.
- * - |imgPlot1D|
- - :class:`.Plot1D` is a :class:`PlotWindow` configured with tools useful
- for curves.
- * - |imgPlot2D|
- - :class:`.Plot2D` is a :class:`PlotWindow` configured with tools useful
- for images.
- * - |imgImageView|
- - :class:`ImageView` adds side histograms to a :class:`.Plot2D` widget.
- * - |imgStackView|
- - :class:`StackView` is a widget designed to display an image from a
- stack of images in a :class:`PlotWindow` widget, with a frame browser
- to navigate in the stack. The profile tool can do a 2D profile on the
- stack of images.
-
-It also provides (and uses) widgets that can be attached to a :class:`PlotWidget`:
-
-.. |imgPositionInfo| image:: img/PositionInfo.png
- :width: 300px
- :align: middle
-
-.. |imgLimitsToolBar| image:: img/LimitsToolBar.png
- :width: 300px
- :align: middle
-
-.. |imgColorbar| image:: img/logColorbar.png
- :height: 150px
- :align: middle
-
-
-.. list-table::
- :widths: 1 4
- :header-rows: 1
-
- * - Widget
- - Description
- * - |imgPositionInfo|
- - :class:`.PlotTools.PositionInfo` is a widget displaying mouse position and
- information of a :class:`PlotWidget` associated to the mouse position.
- * - |imgLimitsToolBar|
- - :class:`.PlotTools.LimitsToolBar` is a QToolBar displaying and
- controlling the limits of a :class:`PlotWidget`.
- * - |imgColorbar|
- - :class:`.ColorBar.ColorBarWidget` display colormap gradient and can be linked with a plot
- to display the colormap
+See :ref:`plot-gallery` gallery.
Public modules
--------------
@@ -114,12 +32,14 @@ Public modules
plotwindow.rst
imageview.rst
stackview.rst
- plot.rst
+ compleximageview.rst
+ colormap.rst
items.rst
- plotactions.rst
+ actions/index.rst
plottools.rst
profile.rst
roi.rst
+ printpreviewtoolbutton.rst
Internals
---------
diff --git a/doc/source/modules/gui/plot/items.rst b/doc/source/modules/gui/plot/items.rst
index beba3a1..3cdcf17 100644
--- a/doc/source/modules/gui/plot/items.rst
+++ b/doc/source/modules/gui/plot/items.rst
@@ -8,56 +8,103 @@
.. currentmodule:: silx.gui.plot.items
+Item
+----
+
+All plot primitives inherits from :class:`Item` as a common ground:
+
+.. autoclass:: Item
+ :show-inheritance:
+ :members:
+
Curve
-----
.. autoclass:: Curve
- :members:
- :inherited-members:
+ :members: getData, getXData, getYData, getXErrorData, getYErrorData, setData,
+ getSymbol, setSymbol, getSymbolSize, setSymbolSize,
+ getAlpha, setAlpha,
+ getColor, setColor,
+ getYAxis, setYAxis,
+ isFill, setFill,
+ getXLabel, getYLabel,
+ getLineWidth, setLineWidth, getLineStyle, setLineStyle,
+ isHighlighted, setHighlighted, getHighlightedColor, setHighlightedColor,
+ getCurrentColor
Images
------
.. autoclass:: ImageData
- :members:
- :inherited-members:
+ :members: getData, getRgbaImageData,
+ getOrigin, setOrigin,
+ getScale, setScale,
+ isDraggable,
+ getAlpha, setAlpha,
+ getColormap, setColormap,
+ getAlternativeImageData
.. autoclass:: ImageRgba
- :members:
- :inherited-members:
+ :members: getData, getRgbaImageData,
+ getOrigin, setOrigin,
+ getScale, setScale,
+ isDraggable,
+ getAlpha, setAlpha
Scatter
-------
.. autoclass:: Scatter
- :members:
- :inherited-members:
+ :members: getValueData,
+ getData, getXData, getYData, getXErrorData, getYErrorData, setData,
+ getSymbol, setSymbol, getSymbolSize, setSymbolSize,
+ getAlpha, setAlpha,
+ getColormap, setColormap
Histogram
---------
.. autoclass:: Histogram
- :members:
- :inherited-members:
+ :members: getValueData, getBinEdgesData, getData, setData,
+ getAlpha, setAlpha,
+ getColor, setColor,
+ getYAxis, setYAxis,
+ isFill, setFill,
+ getLineWidth, setLineWidth, getLineStyle, setLineStyle
Markers
-------
.. autoclass:: Marker
- :members:
- :inherited-members:
+ :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint,
+ getSymbol, setSymbol, getSymbolSize, setSymbolSize
.. autoclass:: XMarker
- :members:
- :inherited-members:
+ :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint
.. autoclass:: YMarker
+ :members: getText, setText, getXPosition, getYPosition, getPosition, setPosition, getConstraint
+
+Shapes
+------
+
+.. autoclass:: Shape
+ :members: setOverlay,
+ getColor, setColor,
+ isFill, setFill,
+ getType, getPoints, setPoints
+
+Item changed signal
+-------------------
+
+Plot items emit a :attr:`Item.sigItemChanged` signal when their values are updated.
+This signal provides a flag in the following enumeration describing the modified value:
+
+.. autoclass:: ItemChangedType
:members:
- :inherited-members:
-Item
+Axis
----
-.. autoclass:: Shape
+.. autoclass:: Axis
:members:
- :inherited-members:
diff --git a/doc/source/modules/gui/plot/plot.rst b/doc/source/modules/gui/plot/plot.rst
deleted file mode 100644
index 2b8e096..0000000
--- a/doc/source/modules/gui/plot/plot.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-
-.. currentmodule:: silx.gui.plot
-
-:mod:`Plot`: Full plot API
-==========================
-
-.. automodule:: silx.gui.plot.Plot
-
-.. currentmodule:: silx.gui.plot.Plot
-
-:class:`Plot` class
--------------------
-
-.. autoclass:: Plot
- :show-inheritance:
- :members:
diff --git a/doc/source/modules/gui/plot/plotactions.rst b/doc/source/modules/gui/plot/plotactions.rst
deleted file mode 100644
index 29a3656..0000000
--- a/doc/source/modules/gui/plot/plotactions.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-
-.. currentmodule:: silx.gui.plot
-
-:mod:`PlotActions`: Actions for PlotWidget
-===========================================
-
-.. currentmodule:: silx.gui.plot.PlotActions
-
-The :class:`PlotAction` is a base class used to define plot actions.
-
-Plot actions serve to add menu items or toolbar items that are associated with a method
-that can interact with the associated :class:`PlotWidget`.
-
-For an introduction to creating custom plot actions, see :doc:`plotactions_examples`.
-
-PlotActions API
----------------
-
-.. automodule:: silx.gui.plot.PlotActions
- :members:
diff --git a/doc/source/modules/gui/plot/plotwidget.rst b/doc/source/modules/gui/plot/plotwidget.rst
index df576fc..a8e7831 100644
--- a/doc/source/modules/gui/plot/plotwidget.rst
+++ b/doc/source/modules/gui/plot/plotwidget.rst
@@ -14,13 +14,8 @@ It is the basis of other plot widget, thus all plot widgets share the same API.
For an introduction and examples of the plot API, see :doc:`getting_started`.
-Plot API
---------
-
-.. currentmodule:: silx.gui.plot.Plot
-
-This is a choosen subset of the complete plot API, the full API is
-documented in :class:`silx.gui.plot.Plot`.
+:class:`PlotWidget`
+-------------------
.. currentmodule:: silx.gui.plot.PlotWidget
@@ -37,6 +32,20 @@ Those methods allow to add and update plotted data:
.. automethod:: PlotWidget.addScatter
.. automethod:: PlotWidget.addHistogram
+Get data
+........
+
+Those methods return objects providing access to plotted data:
+
+.. automethod:: PlotWidget.getCurve
+.. automethod:: PlotWidget.getImage
+.. automethod:: PlotWidget.getScatter
+.. automethod:: PlotWidget.getHistogram
+
+.. automethod:: PlotWidget.getAllCurves
+.. automethod:: PlotWidget.getAllImages
+
+
Plot markers
............
@@ -52,59 +61,40 @@ Remove data from the plot
.. automethod:: PlotWidget.clear
.. automethod:: PlotWidget.remove
-Title and labels
-................
+Title
+.....
-Those methods handle the text labels of the axes and the plot title:
+Those methods handle the plot title:
.. automethod:: PlotWidget.getGraphTitle
.. automethod:: PlotWidget.setGraphTitle
-.. automethod:: PlotWidget.getGraphXLabel
-.. automethod:: PlotWidget.setGraphXLabel
-.. automethod:: PlotWidget.getGraphYLabel
-.. automethod:: PlotWidget.setGraphYLabel
-
-Axes limits
-...........
-
-Those methods change the range of data values displayed on each axis.
-
-.. automethod:: PlotWidget.getGraphXLimits
-.. automethod:: PlotWidget.setGraphXLimits
-.. automethod:: PlotWidget.getGraphYLimits
-.. automethod:: PlotWidget.setGraphYLimits
-.. automethod:: PlotWidget.setLimits
Axes
....
-The following methods handle the display properties of the axes:
+Those two methods give access to :class:`.items.Axis` which handle the limits, scales and labels of axis:
-.. automethod:: PlotWidget.isXAxisLogarithmic
-.. automethod:: PlotWidget.setXAxisLogarithmic
-.. automethod:: PlotWidget.isYAxisLogarithmic
-.. automethod:: PlotWidget.setYAxisLogarithmic
+.. automethod:: PlotWidget.getXAxis
+.. automethod:: PlotWidget.getYAxis
-.. automethod:: PlotWidget.isYAxisInverted
-.. automethod:: PlotWidget.setYAxisInverted
+The following methods handle plot limits, aspect ratio, grid and axes display:
+
+.. automethod:: PlotWidget.setLimits
.. automethod:: PlotWidget.isKeepDataAspectRatio
.. automethod:: PlotWidget.setKeepDataAspectRatio
.. automethod:: PlotWidget.getGraphGrid
.. automethod:: PlotWidget.setGraphGrid
+.. automethod:: PlotWidget.setAxesDisplayed
Reset zoom
..........
.. automethod:: PlotWidget.resetZoom
-Those methods change the behavior of :meth:`PlotWidget.resetZoom`.
+The following methods allow to add margins around the data when performing a zoom reset:
.. automethod:: PlotWidget.getDataMargins
.. automethod:: PlotWidget.setDataMargins
-.. automethod:: PlotWidget.isXAxisAutoScale
-.. automethod:: PlotWidget.setXAxisAutoScale
-.. automethod:: PlotWidget.isYAxisAutoScale
-.. automethod:: PlotWidget.setYAxisAutoScale
Defaults
........
@@ -130,10 +120,35 @@ of the plot and to toggle the use of a crosshair cursor:
.. automethod:: PlotWidget.getGraphCursor
.. automethod:: PlotWidget.setGraphCursor
+.. automethod:: PlotWidget.isPanWithArrowKeys
+.. automethod:: PlotWidget.setPanWithArrowKeys
+
+Coordinates conversion
+......................
+
+.. automethod:: PlotWidget.getDataRange
+.. automethod:: PlotWidget.getPlotBoundsInPixels
+.. automethod:: PlotWidget.dataToPixel
+.. automethod:: PlotWidget.pixelToData
+
+Active Item
+...........
+
+.. automethod:: PlotWidget.isActiveCurveHandling
+.. automethod:: PlotWidget.setActiveCurveHandling
+.. automethod:: PlotWidget.getActiveCurveColor
+.. automethod:: PlotWidget.setActiveCurveColor
+.. automethod:: PlotWidget.getActiveCurve
+.. automethod:: PlotWidget.setActiveCurve
+.. automethod:: PlotWidget.getActiveImage
+.. automethod:: PlotWidget.setActiveImage
+
Misc.
.....
+.. automethod:: PlotWidget.getWidgetHandle
.. automethod:: PlotWidget.saveGraph
+.. automethod:: PlotWidget.setDefaultBackend
Signals
.......
@@ -141,11 +156,6 @@ Signals
The :class:`PlotWidget` provides the following Qt signals:
.. autoattribute:: PlotWidget.sigPlotSignal
-.. autoattribute:: PlotWidget.sigSetYAxisInverted
-.. autoattribute:: PlotWidget.sigSetXAxisLogarithmic
-.. autoattribute:: PlotWidget.sigSetYAxisLogarithmic
-.. autoattribute:: PlotWidget.sigSetXAxisAutoScale
-.. autoattribute:: PlotWidget.sigSetYAxisAutoScale
.. autoattribute:: PlotWidget.sigSetKeepDataAspectRatio
.. autoattribute:: PlotWidget.sigSetGraphGrid
.. autoattribute:: PlotWidget.sigSetGraphCursor
@@ -153,21 +163,33 @@ The :class:`PlotWidget` provides the following Qt signals:
.. autoattribute:: PlotWidget.sigContentChanged
.. autoattribute:: PlotWidget.sigActiveCurveChanged
.. autoattribute:: PlotWidget.sigActiveImageChanged
+.. autoattribute:: PlotWidget.sigActiveScatterChanged
.. autoattribute:: PlotWidget.sigInteractiveModeChanged
-.. Not documented:
- addItem, removeItem, clearItems
- isActiveCurveHandling, enableActiveCurveHandling,
- getActiveCurveColor, setActiveCurveColor,
- getActiveCurve, setActiveCurve,
- isCurveHidden, hideCurve,
- getActiveImage, setActiveImage,
- getAllCurves, getCurve, getImage, getAllImages,
- getScatter, getHistogram,
- setDefaultPlotPoints, setDefaultPlotLines,
- getWidgetHandle, notify, setCallback, graphCallback,
- dataToPixel, pixelToData, getPlotBoundsInPixels,
- setGraphCursorShape, pickMarker, moveMarker, pickImageOrCurve, moveImage,
- onMousePress, onMouseMove, onMouseRelease, onMouseWheel,
- isDrawModeEnabled, setDrawModeEnabled, getDrawMode,
- isZoomModeEnabled, setZoomModeEnabled,
+.. PlotWidget public API that is not documented:
+ Could be added:
+ - addItem
+ - pan
+ - getLimitsHistory
+ - isDefaultPlotPoints
+ - isDefaultPlotLines
+ - setGraphCursorShape
+ - getAutoReplot, setAutoReplot, replot
+ Should not be added:
+ * Should be private:
+ - notify, setCallback, graphCallback
+ * Use remove instead:
+ - removeCurve, removeImage, removeItem, removeMarker
+ - clearCurves, clearImages, clearItems, clearMarkers
+ * Use items instead:
+ - isCurveHidden, hideCurve
+ * Use items.axis instead:
+ - getGraphXLimits, setGraphXLimits
+ - getGraphYLimits, setGraphYLimits
+ - getGraphXLabel, setGraphXLabel
+ - getGraphYLabel, setGraphYLabel
+ - isXAxisLogarithmic, setXAxisLogarithmic
+ - isYAxisLogarithmic, setXAxisLogarithmic
+ - isXAxisAutoScale, setXAxisAutoScale
+ - isYAxisAutoScale, setYAxisAutoScale
+ - setYAxisInverted, isYAxisInverted
diff --git a/doc/source/modules/gui/plot/printpreviewtoolbutton.rst b/doc/source/modules/gui/plot/printpreviewtoolbutton.rst
new file mode 100644
index 0000000..42b3832
--- /dev/null
+++ b/doc/source/modules/gui/plot/printpreviewtoolbutton.rst
@@ -0,0 +1,8 @@
+
+.. currentmodule:: silx.gui.plot
+
+:mod:`PrintPreviewToolButton`: Print preview buttons
+====================================================
+
+.. automodule:: silx.gui.plot.PrintPreviewToolButton
+ :members:
diff --git a/doc/source/modules/gui/plot/stackview.rst b/doc/source/modules/gui/plot/stackview.rst
index 7f2442a..11c7828 100644
--- a/doc/source/modules/gui/plot/stackview.rst
+++ b/doc/source/modules/gui/plot/stackview.rst
@@ -13,7 +13,9 @@
.. autoclass:: StackView
:members:
- :exclude-members: remove, setInteractiveMode, addItem
+ :exclude-members: remove, setInteractiveMode, addItem, getActiveImage,
+ resetZoom, setYAxisInverted, isYAxisInverted, getSupportedColormaps,
+ isKeepDataAspectRatio, setKeepDataAspectRatio
:class:`StackViewMainWindow` class
----------------------------------
diff --git a/doc/source/modules/gui/plot3d/actions.rst b/doc/source/modules/gui/plot3d/actions.rst
index a2fde68..c9e3af2 100644
--- a/doc/source/modules/gui/plot3d/actions.rst
+++ b/doc/source/modules/gui/plot3d/actions.rst
@@ -1,10 +1,15 @@
-Actions
-=======
+:mod:`actions`
+==============
-:mod:`Plot3DActions`
---------------------
+.. currentmodule:: silx.gui.plot3d.actions
-.. currentmodule:: silx.gui.plot3d.Plot3DActions
+.. automodule:: silx.gui.plot3d.actions
+ :members:
+
+.. automodule:: silx.gui.plot3d.actions.io
+ :members:
-.. automodule:: silx.gui.plot3d.Plot3DActions
+.. automodule:: silx.gui.plot3d.actions.mode
:members:
+
+.. autoclass:: Plot3DAction
diff --git a/doc/source/modules/gui/plot3d/dev.rst b/doc/source/modules/gui/plot3d/dev.rst
index 757240e..96704f8 100644
--- a/doc/source/modules/gui/plot3d/dev.rst
+++ b/doc/source/modules/gui/plot3d/dev.rst
@@ -12,10 +12,10 @@ Widget-level API
Widgets are available as modules of the :mod:`silx.gui.plot3d` packages.
The :mod:`.Plot3DWidget` module provides the OpenGL canvas where the scene is rendered.
-The :mod:`.Plot3DWindow` module provides a :class:`QMainWindow` with a :class:`Plot3DWindow` as its central widget
-and toolbars: :class:`ViewpointToolBar` and :class:`Plot3DToolBar`.
-:class:`QAction` that can be associated with a :class:`Plot3DWidget` are defined in the :mod:`.Plot3DActions` module.
-Those actions are used by the :class:`Plot3DToolBar` toolbar.
+The :mod:`.Plot3DWindow` module provides a :class:`QMainWindow` with a :class:`Plot3DWindow` as its central widget,
+toolbars (:class:`InteractiveModeToolBar` and :class:`OutputToolBar`) and a :class:`ViewpointToolButton` in a toolbar.
+:class:`QAction` that can be associated with a :class:`Plot3DWidget` are defined in the :mod:`.actions` module.
+Those actions are used by the :class:`OutputToolBar` and the :class:`InteractiveModeToolBar` toolbars.
The :mod:`.ScalarFieldView` module defines the :class:`ScalarFieldView` widget that displays iso-surfaces of a 3D scalar data set and the associated classes.
The :mod:`.SFViewParamTree` module defines a :class:`SFViewParamTree.TreeView` widget that can be attached to a :class:`ScalarFieldView` to control the display.
diff --git a/doc/source/modules/gui/plot3d/index.rst b/doc/source/modules/gui/plot3d/index.rst
index 8941403..38b8f02 100644
--- a/doc/source/modules/gui/plot3d/index.rst
+++ b/doc/source/modules/gui/plot3d/index.rst
@@ -11,42 +11,7 @@
Widgets gallery
---------------
-.. |imgPlot3DWidget| image:: img/Plot3DWidget.png
- :height: 150px
- :align: middle
-
-.. |imgPlot3DWindow| image:: img/Plot3DWindow.png
- :height: 150px
- :align: middle
-
-.. |imgScalarFieldView| image:: img/ScalarFieldView.png
- :height: 150px
- :align: middle
-
-.. |imgSFViewParamTree| image:: img/SFViewParamTree.png
- :height: 150px
- :align: middle
-
-.. list-table::
- :widths: 1 4
- :header-rows: 1
-
- * - Widget
- - Description
- * - |imgScalarFieldView|
- - :class:`ScalarFieldView` is a :class:`Plot3DWindow` dedicated to display 3D scalar field.
- It can display iso-surfaces and an interactive cutting plane.
- Sample code: :doc:`viewer3dvolume_example`.
- * - |imgPlot3DWindow|
- - :class:`Plot3DWindow` is a :class:`QMainWindow` with a :class:`Plot3DWidget` as central widget
- and toolbars.
- * - |imgPlot3DWidget|
- - :class:`Plot3DWidget` is the base Qt widget providing an OpenGL 3D scene.
- Other widgets are using this widget as the OpenGL scene canvas.
- * - |imgSFViewParamTree|
- - :class:`SFViewParamTree` is a :class:`QTreeView` widget that can be attached to a :class:`ScalarFieldView`.
- It displays current parameters of the :class:`ScalarFieldView` and allows to modify it.
- Sample code: :doc:`viewer3dvolume_example`.
+See :ref:`plot3d-gallery` gallery.
Public modules
--------------
@@ -60,7 +25,7 @@ The following sub-modules are available:
plot3dwindow.rst
scalarfieldview.rst
sfviewparamtree.rst
- toolbars.rst
+ tools.rst
actions.rst
diff --git a/doc/source/modules/gui/plot3d/scalarfieldview.rst b/doc/source/modules/gui/plot3d/scalarfieldview.rst
index 763c18e..80127ea 100644
--- a/doc/source/modules/gui/plot3d/scalarfieldview.rst
+++ b/doc/source/modules/gui/plot3d/scalarfieldview.rst
@@ -21,13 +21,6 @@ Helper classes
Those classes are used by :class:`ScalarFieldView`.
-:class:`Colormap`
-+++++++++++++++++
-
-.. autoclass:: Colormap
- :show-inheritance:
- :members:
-
:class:`CutPlane`
+++++++++++++++++
diff --git a/doc/source/modules/gui/plot3d/toolbars.rst b/doc/source/modules/gui/plot3d/toolbars.rst
deleted file mode 100644
index df4b4ef..0000000
--- a/doc/source/modules/gui/plot3d/toolbars.rst
+++ /dev/null
@@ -1,29 +0,0 @@
-Toolbars
-========
-
-
-:mod:`ViewpointToolbar`
------------------------
-
-.. currentmodule:: silx.gui.plot3d.ViewpointToolBar
-
-.. automodule:: silx.gui.plot3d.ViewpointToolBar
-
-.. autoclass:: ViewpointActionGroup
- :show-inheritance:
- :members:
-
-.. autoclass:: ViewpointToolBar
- :show-inheritance:
- :members:
-
-:mod:`Plot3DToolbar`
---------------------
-
-.. currentmodule:: silx.gui.plot3d.Plot3DToolBar
-
-.. automodule:: silx.gui.plot3d.Plot3DToolBar
-
-.. autoclass:: Plot3DToolBar
- :show-inheritance:
- :members:
diff --git a/doc/source/modules/gui/plot3d/tools.rst b/doc/source/modules/gui/plot3d/tools.rst
new file mode 100644
index 0000000..6cd433b
--- /dev/null
+++ b/doc/source/modules/gui/plot3d/tools.rst
@@ -0,0 +1,40 @@
+:mod:`tools`
+============
+
+.. currentmodule:: silx.gui.plot3d.tools
+
+.. automodule:: silx.gui.plot3d.tools
+
+Toolbars
+--------
+
+:class:`InteractiveModeToolbar`
++++++++++++++++++++++++++++++++
+
+.. autoclass:: InteractiveModeToolBar
+ :show-inheritance:
+ :members:
+
+:class:`OutputToolBar`
+++++++++++++++++++++++
+
+.. autoclass:: OutputToolBar
+ :show-inheritance:
+ :members:
+
+:class:`ViewpointToolbar`
++++++++++++++++++++++++++
+
+.. autoclass:: ViewpointToolBar
+ :show-inheritance:
+ :members:
+
+Tool Buttons
+------------
+
+:class:`ViewpointToolButton`
+++++++++++++++++++++++++++++
+
+.. autoclass:: ViewpointToolButton
+ :show-inheritance:
+ :members:
diff --git a/doc/source/modules/gui/widgets/img/FrameBrowser.png b/doc/source/modules/gui/widgets/img/FrameBrowser.png
new file mode 100644
index 0000000..c5624f7
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/FrameBrowser.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png b/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png
new file mode 100644
index 0000000..d64b2df
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/PeriodicCombo.png b/doc/source/modules/gui/widgets/img/PeriodicCombo.png
new file mode 100644
index 0000000..e0b40c2
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/PeriodicCombo.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/PeriodicList.png b/doc/source/modules/gui/widgets/img/PeriodicList.png
new file mode 100644
index 0000000..d1e540b
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/PeriodicList.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/PeriodicTable.png b/doc/source/modules/gui/widgets/img/PeriodicTable.png
new file mode 100644
index 0000000..c06dded
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/PeriodicTable.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/TableWidget.png b/doc/source/modules/gui/widgets/img/TableWidget.png
new file mode 100644
index 0000000..a0f819f
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/TableWidget.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png b/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png
new file mode 100644
index 0000000..4710d16
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/img/WaitingPushButton.png b/doc/source/modules/gui/widgets/img/WaitingPushButton.png
new file mode 100644
index 0000000..fa1d51a
--- /dev/null
+++ b/doc/source/modules/gui/widgets/img/WaitingPushButton.png
Binary files differ
diff --git a/doc/source/modules/gui/widgets/index.rst b/doc/source/modules/gui/widgets/index.rst
index 2284f22..72f89a8 100644
--- a/doc/source/modules/gui/widgets/index.rst
+++ b/doc/source/modules/gui/widgets/index.rst
@@ -14,6 +14,7 @@ Public modules:
framebrowser.rst
periodictable.rst
+ printpreview.rst
tablewidget.rst
threadpoolpushbutton.rst
waitingpushbutton.rst
diff --git a/doc/source/modules/gui/widgets/printpreview.rst b/doc/source/modules/gui/widgets/printpreview.rst
new file mode 100644
index 0000000..d0b7999
--- /dev/null
+++ b/doc/source/modules/gui/widgets/printpreview.rst
@@ -0,0 +1,60 @@
+
+.. currentmodule:: silx.gui.widgets
+
+:mod:`PrintPreview`: Print preview dialog
+-----------------------------------------
+
+.. automodule:: silx.gui.widgets.PrintPreview
+
+Widgets
++++++++
+
+.. autoclass:: silx.gui.widgets.PrintPreview.PrintPreviewDialog
+ :members:
+ :exclude-members: printDialog, showEvent
+ :show-inheritance:
+
+
+.. autoclass:: silx.gui.widgets.PrintPreview.SingletonPrintPreviewDialog
+ :show-inheritance:
+
+Example
++++++++
+
+.. code-block:: python
+
+ import sys
+ from silx.gui import qt
+ from silx.gui.widgets import PrintPreviewDialog
+
+ a = qt.QApplication(sys.argv)
+
+ if len(sys.argv) < 2:
+ print("give an image file as parameter please.")
+ sys.exit(1)
+
+ if len(sys.argv) > 2:
+ print("only one parameter please.")
+ sys.exit(1)
+
+ filename = sys.argv[1]
+ w = PrintPreviewDialog()
+ w.resize(400, 500)
+
+ comment = ""
+ for i in range(20):
+ comment += "Line number %d: En un lugar de La Mancha de cuyo nombre ...\n"
+
+ if filename[-3:] == "svg":
+ item = qt.QSvgRenderer(filename, w.page)
+ w.addSvgItem(item, title=filename,
+ comment=comment, commentPosition="CENTER")
+ else:
+ w.addPixmap(qt.QPixmap.fromImage(qt.QImage(filename)),
+ title=filename,
+ comment=comment,
+ commentPosition="CENTER")
+ w.addImage(qt.QImage(filename), comment=comment, commentPosition="LEFT")
+
+ w.exec_()
+ a.exec_()
diff --git a/doc/source/modules/image/backprojection.rst b/doc/source/modules/image/backprojection.rst
new file mode 100644
index 0000000..c45f670
--- /dev/null
+++ b/doc/source/modules/image/backprojection.rst
@@ -0,0 +1,8 @@
+
+.. currentmodule:: silx.image
+
+:mod:`backprojection`: backprojection algorithm
+-----------------------------------------------
+
+.. automodule:: silx.image.backprojection
+ :members: Backprojection
diff --git a/doc/source/modules/image/index.rst b/doc/source/modules/image/index.rst
index abdeb64..89c5642 100644
--- a/doc/source/modules/image/index.rst
+++ b/doc/source/modules/image/index.rst
@@ -11,3 +11,4 @@
medianfilter.rst
shapes.rst
sift.rst
+ backprojection.rst
diff --git a/doc/source/modules/image/projection.rst b/doc/source/modules/image/projection.rst
new file mode 100644
index 0000000..f5f4815
--- /dev/null
+++ b/doc/source/modules/image/projection.rst
@@ -0,0 +1,15 @@
+
+.. currentmodule:: silx.image
+
+:mod:`projection`: projection algorithm
+---------------------------------------
+
+.. warning::
+
+ This module is known to be buggy in version 0.6:
+ Do NOT use it without having checked it provides
+ proper results
+
+.. automodule:: silx.image.projection
+ :members: Projection
+
diff --git a/doc/source/modules/image/reconstruction.rst b/doc/source/modules/image/reconstruction.rst
new file mode 100644
index 0000000..d288581
--- /dev/null
+++ b/doc/source/modules/image/reconstruction.rst
@@ -0,0 +1,14 @@
+
+.. currentmodule:: silx.image
+
+:mod:`reconstruction`: reconstruction algorithm
+-----------------------------------------------
+
+.. warning::
+
+ This module is known to be buggy in version 0.6:
+ Do NOT use it without having checked it provides
+ proper results
+
+.. automodule:: silx.image.reconstruction
+ :members: ReconstructionAlgorithm, SIRT, TV
diff --git a/doc/source/modules/io/convert.rst b/doc/source/modules/io/convert.rst
new file mode 100644
index 0000000..4d3abdc
--- /dev/null
+++ b/doc/source/modules/io/convert.rst
@@ -0,0 +1,8 @@
+
+.. currentmodule:: silx.io
+
+:mod:`convert`: HDF5 conversion
+-------------------------------
+
+.. automodule:: silx.io.convert
+ :members: write_to_h5, convert
diff --git a/doc/source/modules/io/index.rst b/doc/source/modules/io/index.rst
index 1538a74..815a094 100644
--- a/doc/source/modules/io/index.rst
+++ b/doc/source/modules/io/index.rst
@@ -9,13 +9,13 @@
:maxdepth: 1
configdict.rst
+ convert.rst
dictdump.rst
nxdata.rst
octaveh5.rst
specfile.rst
specfilewrapper.rst
spech5.rst
- spectoh5.rst
utils.rst
Top-level functions
@@ -23,3 +23,8 @@ Top-level functions
.. autofunction:: silx.io.open
.. autofunction:: silx.io.save1D
+
+.. autofunction:: silx.io.is_dataset
+.. autofunction:: silx.io.is_group
+.. autofunction:: silx.io.is_file
+.. autofunction:: silx.io.is_softlink
diff --git a/doc/source/modules/io/spech5.rst b/doc/source/modules/io/spech5.rst
index 143d3bb..61e0083 100644
--- a/doc/source/modules/io/spech5.rst
+++ b/doc/source/modules/io/spech5.rst
@@ -5,7 +5,41 @@
-----------------------------------------
.. automodule:: silx.io.spech5
+
+
+Classes
++++++++
+
+- :class:`SpecH5`
+- :class:`SpecH5Group`
+- :class:`SpecH5Dataset`
+
+.. autoclass:: SpecH5
+ :members:
+ :show-inheritance:
+ :undoc-members:
+ :inherited-members: name, basename, attrs, h5py_class, parent,
+ get, keys, values, items,
+ :special-members: __getitem__, __len__, __contains__, __enter__, __exit__, __iter__
+ :exclude-members: add_node
+
+.. autoclass:: SpecH5Group
+ :show-inheritance:
+
+.. autoclass:: silx.io.commonh5.Group
+ :show-inheritance:
+ :undoc-members:
+ :members: name, basename, file, attrs, h5py_class, parent,
+ get, keys, values, items, visit, visititems
+ :special-members: __getitem__, __len__, __contains__, __iter__
+ :exclude-members: add_node
+
+.. autoclass:: SpecH5Dataset
+ :show-inheritance:
+
+.. autoclass:: SpecH5NodeDataset
:members:
:show-inheritance:
:undoc-members:
- :special-members: __getitem__, __len__, __contains__
+ :inherited-members:
+ :special-members: __getitem__, __len__, __iter__, __getattr__
diff --git a/doc/source/modules/io/spectoh5.rst b/doc/source/modules/io/spectoh5.rst
deleted file mode 100644
index 05fc768..0000000
--- a/doc/source/modules/io/spectoh5.rst
+++ /dev/null
@@ -1,8 +0,0 @@
-
-.. currentmodule:: silx.io
-
-:mod:`spectoh5`: SpecFile to HDF5 conversion
----------------------------------------------
-
-.. automodule:: silx.io.spectoh5
- :members: write_spec_to_h5, convert
diff --git a/doc/source/modules/utils/decorators.rst b/doc/source/modules/utils/decorators.rst
index 1da0f44..c181220 100644
--- a/doc/source/modules/utils/decorators.rst
+++ b/doc/source/modules/utils/decorators.rst
@@ -1,7 +1,7 @@
.. currentmodule:: silx.utils
-:mod:`decorators`
+:mod:`deprecation`
------------------
-.. automodule:: silx.utils.decorators
- :members:
+.. automodule:: silx.utils.deprecation
+ :members: deprecated
diff --git a/doc/source/sample_code/img/animatedicons.png b/doc/source/sample_code/img/animatedicons.png
new file mode 100644
index 0000000..c6f02d8
--- /dev/null
+++ b/doc/source/sample_code/img/animatedicons.png
Binary files differ
diff --git a/doc/source/sample_code/img/customHdf5TreeModel.png b/doc/source/sample_code/img/customHdf5TreeModel.png
new file mode 100644
index 0000000..fff6db5
--- /dev/null
+++ b/doc/source/sample_code/img/customHdf5TreeModel.png
Binary files differ
diff --git a/doc/source/sample_code/img/fftPlotAction.png b/doc/source/sample_code/img/fftPlotAction.png
new file mode 100644
index 0000000..beb3ae3
--- /dev/null
+++ b/doc/source/sample_code/img/fftPlotAction.png
Binary files differ
diff --git a/doc/source/sample_code/img/hdf5widget.png b/doc/source/sample_code/img/hdf5widget.png
new file mode 100644
index 0000000..90ef758
--- /dev/null
+++ b/doc/source/sample_code/img/hdf5widget.png
Binary files differ
diff --git a/doc/source/sample_code/img/icons.png b/doc/source/sample_code/img/icons.png
new file mode 100644
index 0000000..927184e
--- /dev/null
+++ b/doc/source/sample_code/img/icons.png
Binary files differ
diff --git a/doc/source/sample_code/img/imageview.png b/doc/source/sample_code/img/imageview.png
new file mode 100644
index 0000000..b46cd97
--- /dev/null
+++ b/doc/source/sample_code/img/imageview.png
Binary files differ
diff --git a/doc/source/sample_code/img/periodicTable.png b/doc/source/sample_code/img/periodicTable.png
new file mode 100644
index 0000000..85aea6c
--- /dev/null
+++ b/doc/source/sample_code/img/periodicTable.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotContextMenu.png b/doc/source/sample_code/img/plotContextMenu.png
new file mode 100644
index 0000000..2ca7386
--- /dev/null
+++ b/doc/source/sample_code/img/plotContextMenu.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotItemsSelector.png b/doc/source/sample_code/img/plotItemsSelector.png
new file mode 100644
index 0000000..f040472
--- /dev/null
+++ b/doc/source/sample_code/img/plotItemsSelector.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotLimits.png b/doc/source/sample_code/img/plotLimits.png
new file mode 100644
index 0000000..4ca3d29
--- /dev/null
+++ b/doc/source/sample_code/img/plotLimits.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotUpdateFromThread.png b/doc/source/sample_code/img/plotUpdateFromThread.png
new file mode 100644
index 0000000..ac97ccd
--- /dev/null
+++ b/doc/source/sample_code/img/plotUpdateFromThread.png
Binary files differ
diff --git a/doc/source/sample_code/img/plotWidget.png b/doc/source/sample_code/img/plotWidget.png
new file mode 100644
index 0000000..7385ee5
--- /dev/null
+++ b/doc/source/sample_code/img/plotWidget.png
Binary files differ
diff --git a/doc/source/sample_code/img/printPreview.png b/doc/source/sample_code/img/printPreview.png
new file mode 100644
index 0000000..fb75025
--- /dev/null
+++ b/doc/source/sample_code/img/printPreview.png
Binary files differ
diff --git a/doc/source/sample_code/img/scatterMask.png b/doc/source/sample_code/img/scatterMask.png
new file mode 100644
index 0000000..b2028a1
--- /dev/null
+++ b/doc/source/sample_code/img/scatterMask.png
Binary files differ
diff --git a/doc/source/sample_code/img/shiftPlotAction.png b/doc/source/sample_code/img/shiftPlotAction.png
new file mode 100644
index 0000000..afa51eb
--- /dev/null
+++ b/doc/source/sample_code/img/shiftPlotAction.png
Binary files differ
diff --git a/doc/source/sample_code/img/simplewidget.png b/doc/source/sample_code/img/simplewidget.png
new file mode 100644
index 0000000..b4ed9dd
--- /dev/null
+++ b/doc/source/sample_code/img/simplewidget.png
Binary files differ
diff --git a/doc/source/sample_code/img/stackView.png b/doc/source/sample_code/img/stackView.png
new file mode 100644
index 0000000..6003f0a
--- /dev/null
+++ b/doc/source/sample_code/img/stackView.png
Binary files differ
diff --git a/doc/source/sample_code/img/syncaxis.png b/doc/source/sample_code/img/syncaxis.png
new file mode 100644
index 0000000..fd15353
--- /dev/null
+++ b/doc/source/sample_code/img/syncaxis.png
Binary files differ
diff --git a/doc/source/sample_code/img/viewer3DVolume.png b/doc/source/sample_code/img/viewer3DVolume.png
new file mode 100644
index 0000000..69abf26
--- /dev/null
+++ b/doc/source/sample_code/img/viewer3DVolume.png
Binary files differ
diff --git a/doc/source/sample_code/index.rst b/doc/source/sample_code/index.rst
new file mode 100644
index 0000000..6c826b7
--- /dev/null
+++ b/doc/source/sample_code/index.rst
@@ -0,0 +1,232 @@
+.. _sample-code:
+
+Sample Code
+===========
+
+All sample codes can be downloaded as a zip file: |sample_code_archive|.
+
+.. |sample_code_archive| archive:: ../../../examples/
+ :filename: silx_examples.zip
+ :basedir: silx_examples
+ :filter: *.py *.png
+
+:mod:`silx.gui` sample code
++++++++++++++++++++++++++++
+
+.. list-table::
+ :widths: 1 1 4
+ :header-rows: 1
+
+ * - Source
+ - Screenshot
+ - Description
+ * - :download:`animatedicons.py <../../../examples/animatedicons.py>`
+ - .. image:: img/animatedicons.png
+ :height: 150px
+ :align: center
+ - Display available project icons using Qt.
+ * - :download:`customHdf5TreeModel.py <../../../examples/customHdf5TreeModel.py>`
+ - .. image:: img/customHdf5TreeModel.png
+ :height: 150px
+ :align: center
+ - Qt Hdf5 widget examples
+ * - :download:`hdf5widget.py <../../../examples/hdf5widget.py>`
+ - .. image:: img/hdf5widget.png
+ :height: 150px
+ :align: center
+ - Qt Hdf5 widget examples
+
+ .. note:: This module has a dependency on the `h5py <http://www.h5py.org/>`_
+ library, which is not a mandatory dependency for `silx`. You might need
+ to install it if you don't already have it.
+ * - :download:`icons.py <../../../examples/icons.py>`
+ - .. image:: img/icons.png
+ :height: 150px
+ :align: center
+ - Display available project icons using Qt.
+ * - :download:`periodicTable.py <../../../examples/periodicTable.py>`
+ - .. image:: img/periodicTable.png
+ :height: 150px
+ :align: center
+ - This script is a simple example of how to use the periodic table widgets,
+ select elements and connect signals.
+ * - :download:`simplewidget.py <../../../examples/simplewidget.py>`
+ - .. image:: img/simplewidget.png
+ :height: 150px
+ :align: center
+ - This script shows a gallery of simple widgets provided by silx.
+
+ It shows the following widgets:
+
+ - :class:WaitingPushButton: A button with a progress-like waiting animated icon
+ * - :download:`viewer3DVolume.py <../../../examples/viewer3DVolume.py>`
+ - .. image:: img/viewer3DVolume.png
+ :height: 150px
+ :align: center
+ - This script illustrates the use of silx.gui.plot3d.ScalarFieldView.
+
+ It loads a 3D scalar data set from a file and displays iso-surfaces and
+ an interactive cutting plane.
+ It can also be started without providing a file.
+
+:mod:`silx.gui.plot` sample code
+++++++++++++++++++++++++++++++++
+
+.. list-table::
+ :widths: 1 1 4
+ :header-rows: 1
+
+ * - Source
+ - Screenshot
+ - Description
+ * - :download:`fftPlotAction.py <../../../examples/fftPlotAction.py>`,
+ :download:`fft.png <../../../examples/fft.png>`
+ - .. image:: img/fftPlotAction.png
+ :height: 150px
+ :align: center
+ - This script is a simple example of how to create a PlotWindow with a custom
+ PlotAction added to the toolbar.
+
+ The action computes the FFT of all curves and plots their amplitude spectrum.
+ It also performs the reverse transform.
+
+ This example illustrates:
+ - how to create a checkable action
+ - how to store user info with a curve in a PlotWindow
+ - how to modify the graph title and axes labels
+ - how to add your own icon as a PNG file
+
+ See shiftPlotAction.py for a simpler example with more basic comments.
+ * - :download:`imageview.py <../../../examples/imageview.py>`
+ - .. image:: img/imageview.png
+ :height: 150px
+ :align: center
+ - Example to show the use of `ImageView` widget. It can be used to open an EDF
+ or TIFF file from the shell command line.
+
+ To view an image file with the current installed silx library:
+ ``python examples/imageview.py <file to open>``
+ To get help:
+ ``python examples/imageview.py -h``
+
+ For developers with a git clone you can use it with the bootstrap
+ To view an image file with the current installed silx library:
+
+ ``./bootstrap.py python examples/imageview.py <file to open>``
+ * - :download:`plotContextMenu.py <../../../examples/plotContextMenu.py>`
+ - .. image:: img/plotContextMenu.png
+ :height: 150px
+ :align: center
+ - This script illustrates the addition of a context menu to a PlotWidget.
+
+ This is done by adding a custom context menu to the plot area of PlotWidget:
+ - set the context menu policy of the plot area to Qt.CustomContextMenu.
+ - connect to the plot area customContextMenuRequested signal.
+
+ The same method works with PlotWindow, Plot1D and Plot2D widgets as they
+ inherit from PlotWidget.
+
+ For more information on context menus, see Qt documentation.
+ * - :download:`plotItemsSelector.py <../../../examples/plotItemsSelector.py>`
+ - .. image:: img/plotItemsSelector.png
+ :height: 150px
+ :align: center
+ - This example illustrates how to use a :class:`ItemsSelectionDialog` widget
+ associated with a :class:`PlotWidget`.
+ * - :download:`plotLimits.py <../../../examples/plotLimits.py>`
+ - .. image:: img/plotLimits.png
+ :height: 150px
+ :align: center
+ - This script is an example to illustrate how to use axis synchronization
+ tool.
+ * - :download:`plotUpdateFromThread.py <../../../examples/plotUpdateFromThread.py>`
+ - .. image:: img/plotUpdateFromThread.png
+ :height: 150px
+ :align: center
+ - This script illustrates the update of a silx.gui.plot widget from a thread.
+
+ The problem is that plot and GUI methods should be called from the main thread.
+ To safely update the plot from another thread, one need to make the update
+ asynchronously from the main thread.
+ In this example, this is achieved through a Qt signal.
+
+ In this example we create a subclass of :class:`silx.gui.plot.Plot1D`
+ that adds a thread-safe method to add curves:
+ :meth:`ThreadSafePlot1D.addCurveThreadSafe`.
+ This thread-safe method is then called from a thread to update the plot.
+ * - :download:`plotWidget.py <../../../examples/plotWidget.py>`
+ - .. image:: img/plotWidget.png
+ :height: 150px
+ :align: center
+ - This script shows how to subclass :class:`PlotWidget` to tune its tools.
+
+ It subclasses a :class:`silx.gui.plot.PlotWidget` and adds toolbars and
+ a colorbar by using pluggable widgets:
+
+ - QAction from :mod:`silx.gui.plot.actions`
+ - QToolButton from :mod:`silx.gui.plot.PlotToolButtons`
+ - QToolBar from :mod:`silx.gui.plot.PlotTools`
+ - :class:`ColorBarWidget` from :mod:`silx.gui.plot.ColorBar`.
+ * - :download:`printPreview.py <../../../examples/printPreview.py>`
+ - .. image:: img/printPreview.png
+ :height: 150px
+ :align: center
+ - This script illustrates how to add a print preview tool button to any plot
+ widget inheriting :class:`PlotWidget`.
+
+ Three plot widgets are instantiated. One of them uses a standalone
+ :class:`PrintPreviewToolButton`, while the other two use a
+ :class:`SingletonPrintPreviewToolButton` which allows them to send their content
+ to the same print preview page.
+ * - :download:`scatterMask.py <../../../examples/scatterMask.py>`
+ - .. image:: img/scatterMask.png
+ :height: 150px
+ :align: center
+ - This example demonstrates how to use ScatterMaskToolsWidget
+ and NamedScatterAlphaSlider with a PlotWidget.
+ * - :download:`shiftPlotAction.py <../../../examples/shiftPlotAction.py>`
+ - .. image:: img/shiftPlotAction.png
+ :height: 150px
+ :align: center
+ - This script is a simple (trivial) example of how to create a PlotWindow,
+ create a custom :class:`PlotAction` and add it to the toolbar.
+
+ The action simply shifts the selected curve up by 1 unit by adding 1 to each
+ value of y.
+ * - :download:`stackView.py <../../../examples/stackView.py>`
+ - .. image:: img/stackView.png
+ :height: 150px
+ :align: center
+ - This script is a simple example to illustrate how to use the StackView
+ widget.
+ * - :download:`syncaxis.py <../../../examples/syncaxis.py>`
+ - .. image:: img/syncaxis.png
+ :height: 150px
+ :align: center
+ - This script is an example to illustrate how to use axis synchronization
+ tool.
+
+:mod:`silx.io` sample code
+++++++++++++++++++++++++++
+
+.. list-table::
+ :widths: 1 1 4
+ :header-rows: 1
+
+ * - Source
+ - Screenshot
+ - Description
+ * - :download:`writetoh5.py <../../../examples/writetoh5.py>`
+ -
+ - This script converts a supported data file (SPEC, EDF...) to a HDF5 file.
+
+ By default, it creates a new output file or fails if the output file given
+ on the command line already exist, but the user can choose to overwrite
+ an existing file, or append data to an existing HDF5 file.
+
+ In case of appending data to HDF5 files, the user can choose between ignoring
+ input data if a corresponding dataset already exists in the output file, or
+ overwriting the existing dataset.
+
+ By default, new scans are written to the root (/) of the HDF5 file, but it is
+ possible to specify a different target path.
diff --git a/doc/source/tutorials.rst b/doc/source/tutorials.rst
index 8ea536b..97698cd 100644
--- a/doc/source/tutorials.rst
+++ b/doc/source/tutorials.rst
@@ -1,5 +1,5 @@
-Tutorials
-=========
+Tutorials and sample code
+=========================
Tutorials and cookbooks:
@@ -7,11 +7,17 @@ Tutorials and cookbooks:
:maxdepth: 1
modules/gui/plot/getting_started.rst
- modules/gui/plot/plotactions_examples.rst
+ modules/gui/plot/actions/examples.rst
modules/gui/designer.rst
Tutorials/Sift/sift.rst
+ Tutorials/io.rst
Tutorials/specfile_to_hdf5.rst
modules/gui/hdf5/getting_started.rst
Tutorials/fit.rst
Tutorials/fitconfig.rst
Tutorials/array_widget.rst
+
+.. toctree::
+ :maxdepth: 2
+
+ sample_code/index.rst
diff --git a/examples/customHdf5TreeModel.py b/examples/customHdf5TreeModel.py
new file mode 100644
index 0000000..8bd444a
--- /dev/null
+++ b/examples/customHdf5TreeModel.py
@@ -0,0 +1,290 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Qt Hdf5 widget examples
+"""
+
+import logging
+import sys
+import tempfile
+import numpy
+import h5py
+
+logging.basicConfig()
+_logger = logging.getLogger("customHdf5TreeModel")
+"""Module logger"""
+
+from silx.gui import qt
+import silx.gui.hdf5
+from silx.gui.data.DataViewerFrame import DataViewerFrame
+from silx.gui.widgets.ThreadPoolPushButton import ThreadPoolPushButton
+from silx.gui.hdf5.Hdf5TreeModel import Hdf5TreeModel
+
+
+class CustomTooltips(qt.QIdentityProxyModel):
+ """Custom the tooltip of the model by composition.
+
+ It is a very stable way to custom it cause it uses the Qt API. Then it will
+ not change according to the version of Silx.
+
+ But it is not well integrated if you only want to add custom fields to the
+ default tooltips.
+ """
+
+ def data(self, index, role=qt.Qt.DisplayRole):
+ if role == qt.Qt.ToolTipRole:
+
+ # Reach information from the node
+ sourceIndex = self.mapToSource(index)
+ sourceModel = self.sourceModel()
+ originalTooltip = sourceModel.data(sourceIndex, qt.Qt.ToolTipRole)
+ originalH5pyObject = sourceModel.data(sourceIndex, Hdf5TreeModel.H5PY_OBJECT_ROLE)
+
+ # We can filter according to the column
+ if sourceIndex.column() == Hdf5TreeModel.TYPE_COLUMN:
+ return super(CustomTooltips, self).data(index, role)
+
+ # Let's create our own tooltips
+ template = u"""<html>
+ <dl>
+ <dt><b>Original</b></dt><dd>{original}</dd>
+ <dt><b>Parent name</b></dt><dd>{parent_name}</dd>
+ <dt><b>Name</b></dt><dd>{name}</dd>
+ <dt><b>Power of 2</b></dt><dd>{pow_of_2}</dd>
+ </dl>
+ </html>
+ """
+
+ try:
+ data = originalH5pyObject[()]
+ if data.size <= 10:
+ result = data ** 2
+ else:
+ result = "..."
+ except Exception:
+ result = "NA"
+
+ info = dict(
+ original=originalTooltip,
+ parent_name=originalH5pyObject.parent.name,
+ name=originalH5pyObject.name,
+ pow_of_2=str(result)
+ )
+ return template.format(**info)
+
+ return super(CustomTooltips, self).data(index, role)
+
+
+_file_cache = {}
+
+
+def get_hdf5_with_all_types():
+ global _file_cache
+ ID = "alltypes"
+ if ID in _file_cache:
+ return _file_cache[ID].name
+
+ tmp = tempfile.NamedTemporaryFile(prefix=ID + "_", suffix=".h5", delete=True)
+ tmp.file.close()
+ h5 = h5py.File(tmp.name, "w")
+
+ g = h5.create_group("arrays")
+ g.create_dataset("scalar", data=10)
+ g.create_dataset("list", data=numpy.arange(10))
+ base_image = numpy.arange(10**2).reshape(10, 10)
+ images = [base_image,
+ base_image.T,
+ base_image.size - 1 - base_image,
+ base_image.size - 1 - base_image.T]
+ dtype = images[0].dtype
+ data = numpy.empty((10 * 10, 10, 10), dtype=dtype)
+ for i in range(10 * 10):
+ data[i] = images[i % 4]
+ data.shape = 10, 10, 10, 10
+ g.create_dataset("image", data=data[0, 0])
+ g.create_dataset("cube", data=data[0])
+ g.create_dataset("hypercube", data=data)
+ g = h5.create_group("dtypes")
+ g.create_dataset("int32", data=numpy.int32(10))
+ g.create_dataset("int64", data=numpy.int64(10))
+ g.create_dataset("float32", data=numpy.float32(10))
+ g.create_dataset("float64", data=numpy.float64(10))
+ g.create_dataset("string_", data=numpy.string_("Hi!"))
+ # g.create_dataset("string0",data=numpy.string0("Hi!\x00"))
+
+ g.create_dataset("bool", data=True)
+ g.create_dataset("bool2", data=False)
+ h5.close()
+
+ _file_cache[ID] = tmp
+ return tmp.name
+
+
+class Hdf5TreeViewExample(qt.QMainWindow):
+ """
+ This window show an example of use of a Hdf5TreeView.
+
+ The tree is initialized with a list of filenames. A panel allow to play
+ with internal property configuration of the widget, and a text screen
+ allow to display events.
+ """
+
+ def __init__(self, filenames=None):
+ """
+ :param files_: List of HDF5 or Spec files (pathes or
+ :class:`silx.io.spech5.SpecH5` or :class:`h5py.File`
+ instances)
+ """
+ qt.QMainWindow.__init__(self)
+ self.setWindowTitle("Silx HDF5 widget example")
+
+ self.__asyncload = False
+ self.__treeview = silx.gui.hdf5.Hdf5TreeView(self)
+ """Silx HDF5 TreeView"""
+
+ self.__sourceModel = self.__treeview.model()
+ """Store the source model"""
+
+ self.__text = qt.QTextEdit(self)
+ """Widget displaying information"""
+
+ self.__dataViewer = DataViewerFrame(self)
+ vSpliter = qt.QSplitter(qt.Qt.Vertical)
+ vSpliter.addWidget(self.__dataViewer)
+ vSpliter.addWidget(self.__text)
+ vSpliter.setSizes([10, 0])
+
+ spliter = qt.QSplitter(self)
+ spliter.addWidget(self.__treeview)
+ spliter.addWidget(vSpliter)
+ spliter.setStretchFactor(1, 1)
+
+ main_panel = qt.QWidget(self)
+ layout = qt.QVBoxLayout()
+ layout.addWidget(spliter)
+ layout.addWidget(self.createTreeViewConfigurationPanel(self, self.__treeview))
+ layout.setStretchFactor(spliter, 1)
+ main_panel.setLayout(layout)
+
+ self.setCentralWidget(main_panel)
+
+ # append all files to the tree
+ for file_name in filenames:
+ self.__treeview.findHdf5TreeModel().appendFile(file_name)
+
+ self.__treeview.activated.connect(self.displayData)
+
+ def displayData(self):
+ """Called to update the dataviewer with the selected data.
+ """
+ selected = list(self.__treeview.selectedH5Nodes())
+ if len(selected) == 1:
+ # Update the viewer for a single selection
+ data = selected[0]
+ # data is a hdf5.H5Node object
+ # data.h5py_object is a Group/Dataset object (from h5py, spech5, fabioh5)
+ # The dataviewer can display both
+ self.__dataViewer.setData(data)
+
+ def __fileCreated(self, filename):
+ if self.__asyncload:
+ self.__treeview.findHdf5TreeModel().insertFileAsync(filename)
+ else:
+ self.__treeview.findHdf5TreeModel().insertFile(filename)
+
+ def __hdf5ComboChanged(self, index):
+ function = self.__hdf5Combo.itemData(index)
+ self.__createHdf5Button.setCallable(function)
+
+ def __edfComboChanged(self, index):
+ function = self.__edfCombo.itemData(index)
+ self.__createEdfButton.setCallable(function)
+
+ def __useCustomLabel(self):
+ customModel = CustomTooltips(self.__treeview)
+ customModel.setSourceModel(self.__sourceModel)
+ self.__treeview.setModel(customModel)
+
+ def __useOriginalModel(self):
+ self.__treeview.setModel(self.__sourceModel)
+
+ def createTreeViewConfigurationPanel(self, parent, treeview):
+ """Create a configuration panel to allow to play with widget states"""
+ panel = qt.QWidget(parent)
+ panel.setLayout(qt.QHBoxLayout())
+
+ content = qt.QGroupBox("Create HDF5", panel)
+ content.setLayout(qt.QVBoxLayout())
+ panel.layout().addWidget(content)
+
+ combo = qt.QComboBox()
+ combo.addItem("Containing all types", get_hdf5_with_all_types)
+ combo.activated.connect(self.__hdf5ComboChanged)
+ content.layout().addWidget(combo)
+
+ button = ThreadPoolPushButton(content, text="Create")
+ button.setCallable(combo.itemData(combo.currentIndex()))
+ button.succeeded.connect(self.__fileCreated)
+ content.layout().addWidget(button)
+
+ self.__hdf5Combo = combo
+ self.__createHdf5Button = button
+
+ content.layout().addStretch(1)
+
+ option = qt.QGroupBox("Custom model", panel)
+ option.setLayout(qt.QVBoxLayout())
+ panel.layout().addWidget(option)
+
+ button = qt.QPushButton("Original model")
+ button.clicked.connect(self.__useOriginalModel)
+ option.layout().addWidget(button)
+
+ button = qt.QPushButton("Custom tooltips by composition")
+ button.clicked.connect(self.__useCustomLabel)
+ option.layout().addWidget(button)
+
+ option.layout().addStretch(1)
+
+ panel.layout().addStretch(1)
+ return panel
+
+
+def main(filenames):
+ """
+ :param filenames: list of file paths
+ """
+ app = qt.QApplication([])
+ sys.excepthook = qt.exceptionHandler
+ window = Hdf5TreeViewExample(filenames)
+ window.show()
+ result = app.exec_()
+ # remove ending warnings relative to QTimer
+ app.deleteLater()
+ sys.exit(result)
+
+
+if __name__ == "__main__":
+ main(sys.argv[1:])
diff --git a/examples/fftPlotAction.py b/examples/fftPlotAction.py
index e4d4081..66ecfbd 100755
--- a/examples/fftPlotAction.py
+++ b/examples/fftPlotAction.py
@@ -40,7 +40,7 @@ See shiftPlotAction.py for a simpler example with more basic comments.
"""
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "12/01/2017"
+__date__ = "27/06/2017"
import numpy
import os
@@ -48,7 +48,7 @@ import sys
from silx.gui import qt
from silx.gui.plot import PlotWindow
-from silx.gui.plot.PlotActions import PlotAction
+from silx.gui.plot.actions import PlotAction
# Custom icon
# make sure there is a "fft.png" file saved in the same folder as this script
@@ -77,8 +77,8 @@ class FftAction(PlotAction):
def _rememberGraphLabels(self):
"""Store labels and title as attributes"""
self.original_title = self.plot.getGraphTitle()
- self.original_xlabel = self.plot.getGraphXLabel()
- self.original_ylabel = self.plot.getGraphYLabel()
+ self.original_xlabel = self.plot.getXAxis().getLabel()
+ self.original_ylabel = self.plot.getYAxis().getLabel()
def fftAllCurves(self, checked=False):
"""Get all curves from our PlotWindow, compute the amplitude spectrum
@@ -97,13 +97,13 @@ class FftAction(PlotAction):
self._rememberGraphLabels()
# change them
self.plot.setGraphTitle("Amplitude spectrum")
- self.plot.setGraphXLabel("Frequency")
- self.plot.setGraphYLabel("Amplitude")
+ self.plot.getXAxis().setLabel("Frequency")
+ self.plot.getYAxis().setLabel("Amplitude")
else:
# restore original labels
self.plot.setGraphTitle(self.original_title)
- self.plot.setGraphXLabel(self.original_xlabel)
- self.plot.setGraphYLabel(self.original_ylabel)
+ self.plot.getXAxis().setLabel(self.original_xlabel)
+ self.plot.getYAxis().setLabel(self.original_ylabel)
self.plot.clearCurves()
@@ -186,8 +186,8 @@ plotwin.addCurve(x, y2, legend="cos")
plotwin.addCurve(x, y3, legend="square wave")
plotwin.setGraphTitle("Original data")
-plotwin.setGraphYLabel("amplitude")
-plotwin.setGraphXLabel("time")
+plotwin.getYAxis().setLabel("amplitude")
+plotwin.getXAxis().setLabel("time")
plotwin.show()
app.exec_()
diff --git a/examples/icons.py b/examples/icons.py
index 0992cf4..a6f0ada 100644
--- a/examples/icons.py
+++ b/examples/icons.py
@@ -26,10 +26,10 @@
"""
Display available project icons using Qt.
"""
+import functools
+
from silx.gui import qt
import silx.gui.icons
-import pkg_resources
-import functools
class IconPreview(qt.QMainWindow):
@@ -74,9 +74,11 @@ class IconPreview(qt.QMainWindow):
self.tools = []
- icons = pkg_resources.resource_listdir("silx.resources", "gui/icons")
+ import silx.resources
+
+ icons = silx.resources.list_dir("gui/icons")
# filter out sub-directories
- icons = filter(lambda x: not pkg_resources.resource_isdir("silx.resources", "gui/icons/" + x), icons)
+ icons = filter(lambda x: not silx.resources.is_dir("gui/icons/" + x), icons)
# remove extension
icons = [i.split(".")[0] for i in icons]
# remove duplicated names
diff --git a/examples/plotContextMenu.py b/examples/plotContextMenu.py
new file mode 100644
index 0000000..3e9af1e
--- /dev/null
+++ b/examples/plotContextMenu.py
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This script illustrates the addition of a context menu to a PlotWidget.
+
+This is done by adding a custom context menu to the plot area of PlotWidget:
+- set the context menu policy of the plot area to Qt.CustomContextMenu.
+- connect to the plot area customContextMenuRequested signal.
+
+The same method works with PlotWindow, Plot1D and Plot2D widgets as they
+inherit from PlotWidget.
+
+For more information on context menus, see Qt documentation.
+"""
+
+import numpy
+
+from silx.gui import qt
+from silx.gui.plot import PlotWidget
+from silx.gui.plot.actions.control import ZoomBackAction, CrosshairAction
+from silx.gui.plot.actions.io import SaveAction, PrintAction
+
+
+class PlotWidgetWithContextMenu(PlotWidget):
+ """This class adds a custom context menu to PlotWidget's plot area."""
+
+ def __init__(self, *args, **kwargs):
+ super(PlotWidgetWithContextMenu, self).__init__(*args, **kwargs)
+ self.setWindowTitle('PlotWidget with a context menu')
+ self.setGraphTitle('Right-click on the plot to access context menu')
+
+ # Create QAction for the context menu once for all
+ self._zoomBackAction = ZoomBackAction(plot=self, parent=self)
+ self._crosshairAction = CrosshairAction(plot=self, parent=self)
+ self._saveAction = SaveAction(plot=self, parent=self)
+ self._printAction = PrintAction(plot=self, parent=self)
+
+ # Retrieve PlotWidget's plot area widget
+ plotArea = self.getWidgetHandle()
+
+ # Set plot area custom context menu
+ plotArea.setContextMenuPolicy(qt.Qt.CustomContextMenu)
+ plotArea.customContextMenuRequested.connect(self._contextMenu)
+
+ def _contextMenu(self, pos):
+ """Handle plot area customContextMenuRequested signal.
+
+ :param QPoint pos: Mouse position relative to plot area
+ """
+ # Create the context menu
+ menu = qt.QMenu(self)
+ menu.addAction(self._zoomBackAction)
+ menu.addSeparator()
+ menu.addAction(self._crosshairAction)
+ menu.addSeparator()
+ menu.addAction(self._saveAction)
+ menu.addAction(self._printAction)
+
+ # Displaying the context menu at the mouse position requires
+ # a global position.
+ # The position received as argument is relative to PlotWidget's
+ # plot area, and thus needs to be converted.
+ plotArea = self.getWidgetHandle()
+ globalPosition = plotArea.mapToGlobal(pos)
+ menu.exec_(globalPosition)
+
+
+# Start the QApplication
+app = qt.QApplication([]) # Start QApplication
+plot = PlotWidgetWithContextMenu() # Create the widget
+
+# Add content to the plot
+x = numpy.linspace(0, 2 * numpy.pi, 1000)
+plot.addCurve(x, numpy.sin(x), legend='sin')
+
+# Show the widget and start the application
+plot.show()
+app.exec_()
diff --git a/examples/colorbar.py b/examples/plotItemsSelector.py
index a4dc2d8..8f29457 100644..100755
--- a/examples/colorbar.py
+++ b/examples/plotItemsSelector.py
@@ -2,7 +2,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
+# Copyright (c) 2017 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
@@ -23,40 +23,34 @@
# THE SOFTWARE.
#
# ###########################################################################*/
+"""This example illustrates how to use a :class:`ItemsSelectionDialog` widget
+associated with a :class:`PlotWidget`.
"""
-Example to show the use of `ColorBarWidget` widget.
-It can be associated to a plot.
-In this exqmple the `ColorBarWidget` widget will display the colormap of the
-active image.
-
-To change the active image slick on the image you want to set active.
-"""
-
-__authors__ = ["H. Payno"]
+__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "03/05/2017"
-
+__date__ = "28/06/2017"
from silx.gui import qt
-import numpy
-from silx.gui.plot import Plot2D
-from silx.gui.plot.ColorBar import ColorBarWidget
-
-image = numpy.exp(numpy.random.rand(100, 100) * 10)
+from silx.gui.plot.PlotWidget import PlotWidget
+from silx.gui.plot.ItemsSelectionDialog import ItemsSelectionDialog
app = qt.QApplication([])
-plot = Plot2D()
-colorbar = ColorBarWidget(parent=None, plot=plot)
-colorbar.setLegend('my colormap')
-colorbar.show()
-plot.show()
-
-clm = plot.getDefaultColormap()
-clm['normalization'] = 'log'
-clm['name'] = 'viridis'
-plot.addImage(data=image, colormap=clm, legend='image')
-plot.setActiveImage('image')
+pw = PlotWidget()
+pw.addCurve([0, 1, 2], [3, 2, 1], "A curve")
+pw.addScatter([0, 1, 2.5], [3, 2.5, 0.9], [8, 9, 72], "A scatter")
+pw.addHistogram([0, 1, 2.5], [0, 1, 2, 3], "A histogram")
+pw.addImage([[0, 1, 2], [3, 2, 1]], "An image")
+pw.show()
+
+isd = ItemsSelectionDialog(plot=pw)
+isd.setItemsSelectionMode(qt.QTableWidget.ExtendedSelection)
+result = isd.exec_()
+if result:
+ for item in isd.getSelectedItems():
+ print(item.getLegend(), type(item))
+else:
+ print("Selection cancelled")
app.exec_()
diff --git a/examples/plotLimits.py b/examples/plotLimits.py
new file mode 100644
index 0000000..0a39bc6
--- /dev/null
+++ b/examples/plotLimits.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""This script is an example to illustrate how to use axis synchronization
+tool.
+"""
+
+from silx.gui import qt
+from silx.gui import plot
+import numpy
+import silx.test.utils
+
+
+class ConstrainedViewPlot(qt.QMainWindow):
+
+ def __init__(self):
+ qt.QMainWindow.__init__(self)
+ self.setWindowTitle("Plot with synchronized axes")
+ widget = qt.QWidget(self)
+ self.setCentralWidget(widget)
+
+ layout = qt.QGridLayout()
+ widget.setLayout(layout)
+
+ backend = "mpl"
+
+ data = numpy.arange(100 * 100)
+ data = (data % 100) / 5.0
+ data = numpy.sin(data)
+ data = silx.test.utils.add_gaussian_noise(data, mean=0.01)
+ data.shape = 100, 100
+
+ data1d = numpy.mean(data, axis=0)
+
+ self.plot2d = plot.Plot2D(parent=widget, backend=backend)
+ self.plot2d.setGraphTitle("A pixel can't be too big")
+ self.plot2d.setInteractiveMode('pan')
+ self.plot2d.addImage(data)
+ self.plot2d.getXAxis().setRangeConstraints(minRange=10)
+ self.plot2d.getYAxis().setRangeConstraints(minRange=10)
+
+ self.plot2d2 = plot.Plot2D(parent=widget, backend=backend)
+ self.plot2d2.setGraphTitle("The image can't be too small")
+ self.plot2d2.setInteractiveMode('pan')
+ self.plot2d2.addImage(data)
+ self.plot2d2.getXAxis().setRangeConstraints(maxRange=200)
+ self.plot2d2.getYAxis().setRangeConstraints(maxRange=200)
+
+ self.plot1d = plot.Plot1D(parent=widget, backend=backend)
+ self.plot1d.setGraphTitle("The curve is clamped into the view")
+ self.plot1d.addCurve(x=numpy.arange(100), y=data1d, legend="mean")
+ self.plot1d.getXAxis().setLimitsConstraints(minPos=0, maxPos=100)
+ self.plot1d.getYAxis().setLimitsConstraints(minPos=data1d.min(), maxPos=data1d.max())
+
+ self.plot1d2 = plot.Plot1D(parent=widget, backend=backend)
+ self.plot1d2.setGraphTitle("Only clamp y-axis")
+ self.plot1d2.setInteractiveMode('pan')
+ self.plot1d2.addCurve(x=numpy.arange(100), y=data1d, legend="mean")
+ self.plot1d2.getYAxis().setLimitsConstraints(minPos=data1d.min(), maxPos=data1d.max())
+
+ layout.addWidget(self.plot2d, 0, 0)
+ layout.addWidget(self.plot1d, 0, 1)
+ layout.addWidget(self.plot2d2, 1, 0)
+ layout.addWidget(self.plot1d2, 1, 1)
+
+
+if __name__ == "__main__":
+ app = qt.QApplication([])
+ window = ConstrainedViewPlot()
+ window.setVisible(True)
+ app.exec_()
diff --git a/examples/plotUpdateFromThread.py b/examples/plotUpdateFromThread.py
new file mode 100644
index 0000000..d36bc48
--- /dev/null
+++ b/examples/plotUpdateFromThread.py
@@ -0,0 +1,128 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This script illustrates the update of a silx.gui.plot widget from a thread.
+
+The problem is that plot and GUI methods should be called from the main thread.
+To safely update the plot from another thread, one need to make the update
+asynchronously from the main thread.
+In this example, this is achieved through a Qt signal.
+
+In this example we create a subclass of :class:`silx.gui.plot.Plot1D`
+that adds a thread-safe method to add curves:
+:meth:`ThreadSafePlot1D.addCurveThreadSafe`.
+This thread-safe method is then called from a thread to update the plot.
+"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "05/09/2017"
+
+
+import threading
+import time
+
+import numpy
+
+from silx.gui import qt
+from silx.gui.plot import Plot1D
+
+
+class ThreadSafePlot1D(Plot1D):
+ """Add a thread-safe :meth:`addCurveThreadSafe` method to Plot1D.
+ """
+
+ _sigAddCurve = qt.Signal(tuple, dict)
+ """Signal used to perform addCurve in the main thread.
+
+ It takes args and kwargs as arguments.
+ """
+
+ def __init__(self, parent=None):
+ super(ThreadSafePlot1D, self).__init__(parent)
+ # Connect the signal to the method actually calling addCurve
+ self._sigAddCurve.connect(self.__addCurve)
+
+ def __addCurve(self, args, kwargs):
+ """Private method calling addCurve from _sigAddCurve"""
+ self.addCurve(*args, **kwargs)
+
+ def addCurveThreadSafe(self, *args, **kwargs):
+ """Thread-safe version of :meth:`silx.gui.plot.Plot.addCurve`
+
+ This method takes the same arguments as Plot.addCurve.
+
+ WARNING: This method does not return a value as opposed to Plot.addCurve
+ """
+ self._sigAddCurve.emit(args, kwargs)
+
+
+class UpdateThread(threading.Thread):
+ """Thread updating the curve of a :class:`ThreadSafePlot1D`
+
+ :param plot1d: The ThreadSafePlot1D to update."""
+
+ def __init__(self, plot1d):
+ self.plot1d = plot1d
+ self.running = False
+ super(UpdateThread, self).__init__()
+
+ def start(self):
+ """Start the update thread"""
+ self.running = True
+ super(UpdateThread, self).start()
+
+ def run(self):
+ """Method implementing thread loop that updates the plot"""
+ while self.running:
+ time.sleep(1)
+ self.plot1d.addCurveThreadSafe(
+ numpy.arange(1000), numpy.random.random(1000), resetzoom=False)
+
+ def stop(self):
+ """Stop the update thread"""
+ self.running = False
+ self.join(2)
+
+
+def main():
+ global app
+ app = qt.QApplication([])
+
+ # Create a ThreadSafePlot1D, set its limits and display it
+ plot1d = ThreadSafePlot1D()
+ plot1d.setLimits(0., 1000., 0., 1.)
+ plot1d.show()
+
+ # Create the thread that calls ThreadSafePlot1D.addCurveThreadSafe
+ updateThread = UpdateThread(plot1d)
+ updateThread.start() # Start updating the plot
+
+ app.exec_()
+
+ updateThread.stop() # Stop updating the plot
+
+
+if __name__ == '__main__':
+ main()
diff --git a/examples/plotWidget.py b/examples/plotWidget.py
new file mode 100644
index 0000000..698fe56
--- /dev/null
+++ b/examples/plotWidget.py
@@ -0,0 +1,121 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This script shows how to subclass :class:`PlotWidget` to tune its tools.
+
+It subclasses a :class:`silx.gui.plot.PlotWidget` and adds toolbars and
+a colorbar by using pluggable widgets:
+
+- QAction from :mod:`silx.gui.plot.actions`
+- QToolButton from :mod:`silx.gui.plot.PlotToolButtons`
+- QToolBar from :mod:`silx.gui.plot.PlotTools`
+- :class:`ColorBarWidget` from :mod:`silx.gui.plot.ColorBar`.
+"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "05/09/2017"
+
+import numpy
+
+from silx.gui import qt
+import silx.gui.plot
+
+from silx.gui.plot import actions # QAction to use with PlotWidget
+from silx.gui.plot import PlotToolButtons # QToolButton to use with PlotWidget
+from silx.gui.plot.PlotTools import LimitsToolBar
+from silx.gui.plot.ColorBar import ColorBarWidget
+
+class MyPlotWidget(silx.gui.plot.PlotWidget):
+ """PlotWidget with an ad hoc toolbar and a colorbar"""
+
+ def __init__(self, parent=None):
+ super(MyPlotWidget, self).__init__(parent)
+
+ # Add a tool bar to PlotWidget
+ toolBar = qt.QToolBar("Plot Tools", self)
+ self.addToolBar(toolBar)
+
+ # Add actions from silx.gui.plot.action to the toolbar
+ resetZoomAction = actions.control.ResetZoomAction(self, self)
+ toolBar.addAction(resetZoomAction)
+
+ # Add tool buttons from silx.gui.plot.PlotToolButtons
+ aspectRatioButton = PlotToolButtons.AspectToolButton(
+ parent=self, plot=self)
+ toolBar.addWidget(aspectRatioButton)
+
+ # Add limits tool bar from silx.gui.plot.PlotTools
+ limitsToolBar = LimitsToolBar(parent=self, plot=self)
+ self.addToolBar(qt.Qt.BottomToolBarArea, limitsToolBar)
+
+ self._initColorBar()
+
+ def _initColorBar(self):
+ """Create the ColorBarWidget and add it to the PlotWidget"""
+
+ # Add a colorbar on the right side
+ colorBar = ColorBarWidget(parent=self, plot=self)
+
+ # Make ColorBarWidget background white by changing its palette
+ colorBar.setAutoFillBackground(True)
+ palette = colorBar.palette()
+ palette.setColor(qt.QPalette.Background, qt.Qt.white)
+ palette.setColor(qt.QPalette.Window, qt.Qt.white)
+ colorBar.setPalette(palette)
+
+ # Add the ColorBarWidget by changing PlotWidget's central widget
+ gridLayout = qt.QGridLayout()
+ gridLayout.setSpacing(0)
+ gridLayout.setContentsMargins(0, 0, 0, 0)
+ plot = self.getWidgetHandle() # Get the widget rendering the plot
+ gridLayout.addWidget(plot, 0, 0)
+ gridLayout.addWidget(colorBar, 0, 1)
+ gridLayout.setRowStretch(0, 1)
+ gridLayout.setColumnStretch(0, 1)
+ centralWidget = qt.QWidget()
+ centralWidget.setLayout(gridLayout)
+ self.setCentralWidget(centralWidget)
+
+
+def main():
+ global app
+ app = qt.QApplication([])
+
+ # Create the ad hoc plot widget and change its default colormap
+ plot = MyPlotWidget()
+ plot.getDefaultColormap().setName('viridis')
+ plot.show()
+
+ # Add an image to the plot
+ x = numpy.outer(
+ numpy.linspace(-10, 10, 200), numpy.linspace(-10, 5, 150))
+ image = numpy.sin(x) / x
+ plot.addImage(image)
+
+ app.exec_()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/examples/printPreview.py b/examples/printPreview.py
new file mode 100755
index 0000000..187ad84
--- /dev/null
+++ b/examples/printPreview.py
@@ -0,0 +1,82 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""This script illustrates how to add a print preview tool button to any plot
+widget inheriting :class:`PlotWidget`.
+
+Three plot widgets are instantiated. One of them uses a standalone
+:class:`PrintPreviewToolButton`, while the other two use a
+:class:`SingletonPrintPreviewToolButton` which allows them to send their content
+to the same print preview page.
+"""
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "25/07/2017"
+
+import numpy
+
+from silx.gui import qt
+from silx.gui.plot import PlotWidget
+from silx.gui.plot import PrintPreviewToolButton
+
+app = qt.QApplication([])
+
+x = numpy.arange(1000)
+
+# first widget has a standalone print preview action
+pw1 = PlotWidget()
+pw1.setWindowTitle("Widget 1 with standalone print preview")
+toolbar1 = qt.QToolBar(pw1)
+toolbutton1 = PrintPreviewToolButton.PrintPreviewToolButton(parent=toolbar1,
+ plot=pw1)
+pw1.addToolBar(toolbar1)
+toolbar1.addWidget(toolbutton1)
+pw1.show()
+pw1.addCurve(x, numpy.tan(x * 2 * numpy.pi / 1000))
+
+# next two plots share a common print preview
+pw2 = PlotWidget()
+pw2.setWindowTitle("Widget 2 with shared print preview")
+toolbar2 = qt.QToolBar(pw2)
+toolbutton2 = PrintPreviewToolButton.SingletonPrintPreviewToolButton(
+ parent=toolbar2, plot=pw2)
+pw2.addToolBar(toolbar2)
+toolbar2.addWidget(toolbutton2)
+pw2.show()
+pw2.addCurve(x, numpy.sin(x * 2 * numpy.pi / 1000))
+
+
+pw3 = PlotWidget()
+pw3.setWindowTitle("Widget 3 with shared print preview")
+toolbar3 = qt.QToolBar(pw3)
+toolbutton3 = PrintPreviewToolButton.SingletonPrintPreviewToolButton(
+ parent=toolbar3, plot=pw3)
+pw3.addToolBar(toolbar3)
+toolbar3.addWidget(toolbutton3)
+pw3.show()
+pw3.addCurve(x, numpy.cos(x * 2 * numpy.pi / 1000))
+
+
+app.exec_()
diff --git a/examples/shiftPlotAction.py b/examples/shiftPlotAction.py
index ca48300..7cac08c 100755
--- a/examples/shiftPlotAction.py
+++ b/examples/shiftPlotAction.py
@@ -37,7 +37,7 @@ __date__ = "12/01/2017"
import sys
from silx.gui import qt
from silx.gui.plot import PlotWindow
-from silx.gui.plot.PlotActions import PlotAction
+from silx.gui.plot.actions import PlotAction
class ShiftUpAction(PlotAction):
diff --git a/examples/syncaxis.py b/examples/syncaxis.py
new file mode 100644
index 0000000..1033738
--- /dev/null
+++ b/examples/syncaxis.py
@@ -0,0 +1,101 @@
+#!/usr/bin/env python
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""This script is an example to illustrate how to use axis synchronization
+tool.
+"""
+
+from silx.gui import qt
+from silx.gui import plot
+import numpy
+import silx.test.utils
+from silx.gui.plot.utils.axis import SyncAxes
+
+
+class SyncPlot(qt.QMainWindow):
+
+ def __init__(self):
+ qt.QMainWindow.__init__(self)
+ self.setWindowTitle("Plot with synchronized axes")
+ widget = qt.QWidget(self)
+ self.setCentralWidget(widget)
+
+ layout = qt.QGridLayout()
+ widget.setLayout(layout)
+
+ backend = "mpl"
+ self.plot2d = plot.Plot2D(parent=widget, backend=backend)
+ self.plot2d.setInteractiveMode('pan')
+ self.plot1d_x1 = plot.Plot1D(parent=widget, backend=backend)
+ self.plot1d_x2 = plot.PlotWidget(parent=widget, backend=backend)
+ self.plot1d_y1 = plot.Plot1D(parent=widget, backend=backend)
+ self.plot1d_y2 = plot.PlotWidget(parent=widget, backend=backend)
+
+ data = numpy.arange(100 * 100)
+ data = (data % 100) / 5.0
+ data = numpy.sin(data)
+ data = silx.test.utils.add_gaussian_noise(data, mean=0.01)
+ data.shape = 100, 100
+
+ self.plot2d.addImage(data)
+ self.plot1d_x1.addCurve(x=numpy.arange(100), y=numpy.mean(data, axis=0), legend="mean")
+ self.plot1d_x1.addCurve(x=numpy.arange(100), y=numpy.max(data, axis=0), legend="max")
+ self.plot1d_x1.addCurve(x=numpy.arange(100), y=numpy.min(data, axis=0), legend="min")
+ self.plot1d_x2.addCurve(x=numpy.arange(100), y=numpy.std(data, axis=0))
+
+ self.plot1d_y1.addCurve(y=numpy.arange(100), x=numpy.mean(data, axis=1), legend="mean")
+ self.plot1d_y1.addCurve(y=numpy.arange(100), x=numpy.max(data, axis=1), legend="max")
+ self.plot1d_y1.addCurve(y=numpy.arange(100), x=numpy.min(data, axis=1), legend="min")
+ self.plot1d_y2.addCurve(y=numpy.arange(100), x=numpy.std(data, axis=1))
+
+ self.constraint1 = SyncAxes([self.plot2d.getXAxis(), self.plot1d_x1.getXAxis(), self.plot1d_x2.getXAxis()])
+ self.constraint2 = SyncAxes([self.plot2d.getYAxis(), self.plot1d_y1.getYAxis(), self.plot1d_y2.getYAxis()])
+ self.constraint3 = SyncAxes([self.plot1d_x1.getYAxis(), self.plot1d_y1.getXAxis()])
+ self.constraint4 = SyncAxes([self.plot1d_x2.getYAxis(), self.plot1d_y2.getXAxis()])
+
+ layout.addWidget(self.plot2d, 0, 0)
+ layout.addWidget(self.createCenteredLabel(u"↓↑"), 1, 0)
+ layout.addWidget(self.plot1d_x1, 2, 0)
+ layout.addWidget(self.createCenteredLabel(u"↓↑"), 3, 0)
+ layout.addWidget(self.plot1d_x2, 4, 0)
+ layout.addWidget(self.createCenteredLabel(u"→\n←"), 0, 1)
+ layout.addWidget(self.plot1d_y1, 0, 2)
+ layout.addWidget(self.createCenteredLabel(u"→\n←"), 0, 3)
+ layout.addWidget(self.plot1d_y2, 0, 4)
+ layout.addWidget(self.createCenteredLabel(u"↗↙"), 2, 2)
+ layout.addWidget(self.createCenteredLabel(u"↗↙"), 4, 4)
+
+ def createCenteredLabel(self, text):
+ label = qt.QLabel(self)
+ label.setAlignment(qt.Qt.AlignCenter)
+ label.setText(text)
+ return label
+
+
+if __name__ == "__main__":
+ app = qt.QApplication([])
+ window = SyncPlot()
+ window.setVisible(True)
+ app.exec_()
diff --git a/examples/viewer3DVolume.py b/examples/viewer3DVolume.py
index 7a95d8a..82022f9 100644
--- a/examples/viewer3DVolume.py
+++ b/examples/viewer3DVolume.py
@@ -101,6 +101,19 @@ def load(filename):
return data
+def default_isolevel(data):
+ """Compute a default isosurface level: mean + 1 std
+
+ :param numpy.ndarray data: The data to process
+ :rtype: float
+ """
+ data = data[numpy.isfinite(data)]
+ if len(data) == 0:
+ return 0
+ else:
+ return numpy.mean(data) + numpy.std(data)
+
+
def main(argv=None):
# Parse input arguments
parser = argparse.ArgumentParser(
@@ -171,11 +184,11 @@ def main(argv=None):
else:
# Create dummy data
_logger.warning('Not data file provided, creating dummy data')
- size = 128
- z, y, x = numpy.mgrid[0:size, 0:size, 0:size]
- data = numpy.asarray(
- size**2 - ((x-size/2)**2 + (y-size/2)**2 + (z-size/2)**2),
- dtype='float32')
+ coords = numpy.linspace(-10, 10, 64)
+ z = coords.reshape(-1, 1, 1)
+ y = coords.reshape(1, -1, 1)
+ x = coords.reshape(1, 1, -1)
+ data = numpy.sin(x * y * z) / (x * y * z)
# Set ScalarFieldView data
window.setData(data)
@@ -195,9 +208,7 @@ def main(argv=None):
window.addIsosurface(args.level, '#FF0000FF')
else:
# Add an iso-surface from a function
- window.addIsosurface(
- lambda data: numpy.mean(data) + numpy.std(data),
- '#FF0000FF')
+ window.addIsosurface(default_isolevel, '#FF0000FF')
window.show()
return app.exec_()
diff --git a/examples/spectoh5.py b/examples/writetoh5.py
index f2f796b..5e89e48 100755..100644
--- a/examples/spectoh5.py
+++ b/examples/writetoh5.py
@@ -2,7 +2,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2017 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
@@ -23,7 +23,7 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This script converts SPEC data files to HDF5 files.
+"""This script converts a supported data file (SPEC, EDF,...) to a HDF5 file.
By default, it creates a new output file or fails if the output file given
on the command line already exist, but the user can choose to overwrite
@@ -39,14 +39,14 @@ possible to specify a different target path.
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "18/10/2016"
+__date__ = "12/09/2016"
import argparse
-from silx.io.spectoh5 import write_spec_to_h5
+from silx.io.convert import write_to_h5
parser = argparse.ArgumentParser(description=__doc__)
-parser.add_argument('spec_path',
- help='Path to input SPEC data file')
+parser.add_argument('input_path',
+ help='Path to input data file')
parser.add_argument('h5_path',
help='Path to output HDF5 file')
parser.add_argument('-t', '--target-path', default="/",
@@ -82,7 +82,7 @@ else:
# by default, use "write" mode and fail if file already exists
mode = "w-"
-write_spec_to_h5(args.spec_path, args.h5_path,
- h5path=args.target_path,
- mode=mode,
- overwrite_data=args.overwrite_data)
+write_to_h5(args.input_path, args.h5_path,
+ h5path=args.target_path,
+ mode=mode,
+ overwrite_data=args.overwrite_data)
diff --git a/package/debian8/changelog b/package/debian8/changelog
new file mode 100644
index 0000000..763d069
--- /dev/null
+++ b/package/debian8/changelog
@@ -0,0 +1,22 @@
+silx (0.3.0-1) unstable; urgency=low
+
+ * debian/control
+ - Add missing dependencies
+ - Add -dbg packages
+ * Upstream version 0.4.0a
+
+ -- Thomas Vincent <tvincent@edna-site.org> Mon, 23 Jan 2017 17:09:20 +0100
+
+silx (0.1.0-1) unstable; urgency=low
+
+ * debian/control
+ - Comment -dbg packages
+ * Upstream version 0.1.0
+
+ -- Thomas Vincent <thomas.vincent@esrf.fr> Thu, 14 Apr 2016 09:35:28 +0200
+
+silx (0.0.0-1) unstable; urgency=low
+
+ * Initial release (Closes: #??????)
+
+ -- Jerome Kieffer <jerome.kieffer@esrf.fr> Tue, 15 Mar 2016 11:00:20 +0100
diff --git a/package/debian8/clean b/package/debian8/clean
new file mode 100644
index 0000000..668a363
--- /dev/null
+++ b/package/debian8/clean
@@ -0,0 +1 @@
+*.egg-info/* \ No newline at end of file
diff --git a/package/debian8/compat b/package/debian8/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/package/debian8/compat
@@ -0,0 +1 @@
+9
diff --git a/package/debian8/control b/package/debian8/control
new file mode 100644
index 0000000..6ffe66f
--- /dev/null
+++ b/package/debian8/control
@@ -0,0 +1,198 @@
+Source: silx
+Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
+Uploaders: Jerome Kieffer <jerome.kieffer@esrf.fr>,
+ Picca Frédéric-Emmanuel <picca@debian.org>
+Section: science
+Priority: extra
+Build-Depends: cython,
+ cython-dbg,
+ cython3,
+ cython3-dbg,
+ libstdc++6-4.9-dbg,
+ libstdc++-4.9-dev,
+ libstdc++6,
+ debhelper (>=9.20150101+deb8u2),
+ dh-python,
+ python-all-dev,
+ python-all-dbg,
+ python-numpy,
+ python-numpy-dbg,
+ python-fabio,
+ python-fabio-dbg,
+ python-h5py,
+ python-h5py-dbg,
+ python-pyopencl,
+ python-pyopencl-dbg,
+ python-mako,
+ ipython,
+ ipython-qtconsole,
+ python-matplotlib,
+ python-matplotlib-dbg,
+ python-opengl,
+ python-pyqt5,
+ python-pyqt5-dbg,
+ python-pyqt5.qtopengl,
+ python-pyqt5.qtopengl-dbg,
+ python-scipy,
+ python-scipy-dbg,
+ python-sphinx,
+ python-sphinxcontrib.programoutput,
+ python-enum34,
+ python3-all-dev,
+ python3-all-dbg,
+ python3-numpy,
+ python3-numpy-dbg,
+ python3-fabio,
+ python3-fabio-dbg,
+ python3-h5py,
+ python3-h5py-dbg,
+ python3-pyopencl,
+ python3-pyopencl-dbg,
+ python3-mako,
+ ipython3,
+ ipython3-qtconsole,
+ python3-matplotlib,
+ python3-matplotlib-dbg,
+ python3-opengl,
+ python3-pyqt5,
+ python3-pyqt5-dbg,
+ python3-pyqt5.qtopengl,
+ python3-pyqt5.qtopengl-dbg,
+ python3-scipy,
+ python3-scipy-dbg,
+ python3-sphinx,
+ python3-sphinxcontrib.programoutput,
+Standards-Version: 3.9.6
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/silx.git
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/silx.git
+Homepage: https://github.com/silx-kit/silx
+X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.4
+
+Package: silx
+Architecture: all
+Depends: ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+ python3-pkg-resources,
+ python3-silx (>= ${source:Version})
+Description: Toolbox for X-Ray data analysis - Executables
+ .
+ This uses the Python 3 version of the package.
+
+Package: python-silx
+Architecture: any
+Section: python
+Depends: ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+ libstdc++6,
+ python-numpy,
+ python-fabio,
+ python-h5py,
+ python-pyopencl,
+ python-mako,
+ ipython,
+ ipython-qtconsole,
+ python-matplotlib,
+ python-opengl,
+ python-pyqt5,
+ python-pyqt5.qtopengl,
+ python-scipy,
+ python-six,
+ python-enum34,
+# Recommends:
+Suggests: python-rfoo
+Description: Toolbox for X-Ray data analysis - Python2 library
+ .
+ This is the Python 2 version of the package.
+
+Package: python-silx-dbg
+Architecture: any
+Section: debug
+Depends: ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+ python-silx (= ${binary:Version}),
+ libstdc++6-4.9-dbg,
+ python-dbg,
+ python-numpy-dbg,
+ python-fabio-dbg,
+ python-h5py-dbg,
+ python-pyopencl-dbg,
+ python-mako,
+ ipython,
+ ipython-qtconsole,
+ python-matplotlib-dbg,
+ python-opengl,
+ python-pyqt5-dbg,
+ python-pyqt5.qtopengl-dbg,
+ python-scipy-dbg,
+ python-six,
+ python-enum34,
+Description: Toolbox for X-Ray data analysis - python2 debug
+ .
+ This package contains the extension built for the Python 2 debug
+ interpreter.
+
+Package: python3-silx
+Architecture: any
+Section: python
+Depends: ${misc:Depends},
+ ${python3:Depends},
+ ${shlibs:Depends},
+ libstdc++6,
+ python3-numpy,
+ python3-fabio,
+ python3-h5py,
+ python3-pyopencl,
+ python3-mako,
+ ipython3,
+ ipython3-qtconsole,
+ python3-matplotlib,
+ python3-opengl,
+ python3-pyqt5,
+ python3-pyqt5.qtopengl,
+ python3-scipy,
+ python3-six,
+# Recommends:
+# Suggests: python3-rfoo
+Description: Toolbox for X-Ray data analysis - Python3
+ .
+ This is the Python 3 version of the package.
+
+Package: python3-silx-dbg
+Architecture: any
+Section: debug
+Depends: ${misc:Depends},
+ ${python3:Depends},
+ ${shlibs:Depends},
+ python3-silx (= ${binary:Version}),
+ libstdc++6-4.9-dbg,
+ python3-dbg,
+ python3-numpy-dbg,
+ python3-fabio-dbg,
+ python3-h5py-dbg,
+ python3-pyopencl-dbg,
+ python3-mako,
+ ipython3,
+ ipython3-qtconsole,
+ python3-matplotlib-dbg,
+ python3-opengl,
+ python3-pyqt5-dbg,
+ python3-pyqt5.qtopengl-dbg,
+ python3-scipy-dbg,
+ python3-six,
+Description: Toolbox for X-Ray data analysis - Python3 debug
+ .
+ This package contains the extension built for the Python 3 debug
+ interpreter.
+
+Package: python-silx-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends},
+ ${sphinxdoc:Depends}
+Description: Toolbox for X-Ray data analysis - Documentation
+ .
+ This is the common documentation package.
diff --git a/package/debian8/gbp.conf b/package/debian8/gbp.conf
new file mode 100644
index 0000000..f68d262
--- /dev/null
+++ b/package/debian8/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch = master \ No newline at end of file
diff --git a/package/debian8/python-silx-doc.doc-base b/package/debian8/python-silx-doc.doc-base
new file mode 100644
index 0000000..b290d8a
--- /dev/null
+++ b/package/debian8/python-silx-doc.doc-base
@@ -0,0 +1,9 @@
+Document: silx-manual
+Title: silx documentation manual
+Author: Jérôme Kieffer <jerome.kieffer@esrf.eu>
+Abstract: Toolbox for X-Ray data analysis
+Section: Science/Data Analysis
+
+Format: HTML
+Index: /usr/share/doc/python-silx-doc/html/index.html
+Files: /usr/share/doc/python-silx-doc/html/*
diff --git a/package/debian8/rules b/package/debian8/rules
new file mode 100755
index 0000000..98e59cd
--- /dev/null
+++ b/package/debian8/rules
@@ -0,0 +1,54 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=silx
+
+# Make does not offer a recursive wildcard function, so here's one:
+rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
+
+# How to recursively find all files with the same name in a given folder
+ALL_PYX := $(call rwildcard,silx/,*.pyx)
+#NOTA: No space before *
+
+%:
+ dh $@ --with python2,python3 --buildsystem=pybuild
+
+override_dh_clean:
+ dh_clean
+ # remove the cython generated file to force rebuild
+ rm -f $(patsubst %.pyx,%.cpp,${ALL_PYX})
+ rm -f $(patsubst %.pyx,%.c,${ALL_PYX})
+ rm -f $(patsubst %.pyx,%.html,${ALL_PYX})
+ rm -rf build/html
+ rm -rf *.egg-info
+
+override_dh_auto_build:
+ dh_auto_build
+ python setup.py build build_man build_doc
+
+override_dh_install:
+ dh_numpy
+ dh_numpy3
+
+ # move the scripts to right package
+ dh_install -p silx debian/python3-silx/usr/bin/* usr/bin
+ dh_install -p silx package/desktop/*.desktop usr/share/applications
+ dh_install -p silx package/desktop/silx.png usr/share/icons/hicolor/48x48/apps
+ dh_install -p silx package/desktop/silx.svg usr/share/icons/hicolor/scalable/apps
+ rm -rf debian/python-silx/usr/bin
+ rm -rf debian/python3-silx/usr/bin
+
+ # remove all py/pyc/egg-info files from dbg packages
+ find debian/python-silx-dbg/usr -type f \( -not -name "*.so" \) -delete
+ find debian/python3-silx-dbg/usr -type f \( -not -name "*.so" \) -delete
+
+ dh_install
+
+override_dh_auto_test:
+ dh_auto_test -- -s custom --test-args="env PYTHONPATH={build_dir} WITH_QT_TEST=False {interpreter} run_tests.py -v"
+
+override_dh_installman:
+ dh_installman -p silx build/man/*.1
+
+override_dh_installdocs:
+ dh_installdocs "build/sphinx/html" -p python-silx-doc
+ dh_installdocs
diff --git a/package/debian8/source/format b/package/debian8/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/package/debian8/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/package/debian8/source/options b/package/debian8/source/options
new file mode 100644
index 0000000..6e88e49
--- /dev/null
+++ b/package/debian8/source/options
@@ -0,0 +1 @@
+extend-diff-ignore="^[^/]+\.egg-info/" \ No newline at end of file
diff --git a/package/debian8/watch b/package/debian8/watch
new file mode 100644
index 0000000..8972716
--- /dev/null
+++ b/package/debian8/watch
@@ -0,0 +1,5 @@
+version=3
+opts=repacksuffix=+dfsg,\
+uversionmangle=s/(rc|a|b|c)/~$1/,\
+dversionmangle=s/\+dfsg// \
+http://pypi.debian.net/silx/silx-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
diff --git a/package/debian9/changelog b/package/debian9/changelog
new file mode 100644
index 0000000..763d069
--- /dev/null
+++ b/package/debian9/changelog
@@ -0,0 +1,22 @@
+silx (0.3.0-1) unstable; urgency=low
+
+ * debian/control
+ - Add missing dependencies
+ - Add -dbg packages
+ * Upstream version 0.4.0a
+
+ -- Thomas Vincent <tvincent@edna-site.org> Mon, 23 Jan 2017 17:09:20 +0100
+
+silx (0.1.0-1) unstable; urgency=low
+
+ * debian/control
+ - Comment -dbg packages
+ * Upstream version 0.1.0
+
+ -- Thomas Vincent <thomas.vincent@esrf.fr> Thu, 14 Apr 2016 09:35:28 +0200
+
+silx (0.0.0-1) unstable; urgency=low
+
+ * Initial release (Closes: #??????)
+
+ -- Jerome Kieffer <jerome.kieffer@esrf.fr> Tue, 15 Mar 2016 11:00:20 +0100
diff --git a/package/debian9/clean b/package/debian9/clean
new file mode 100644
index 0000000..668a363
--- /dev/null
+++ b/package/debian9/clean
@@ -0,0 +1 @@
+*.egg-info/* \ No newline at end of file
diff --git a/package/debian9/compat b/package/debian9/compat
new file mode 100644
index 0000000..ec63514
--- /dev/null
+++ b/package/debian9/compat
@@ -0,0 +1 @@
+9
diff --git a/package/debian9/control b/package/debian9/control
new file mode 100644
index 0000000..f5bffde
--- /dev/null
+++ b/package/debian9/control
@@ -0,0 +1,125 @@
+Source: silx
+Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
+Uploaders: Jerome Kieffer <jerome.kieffer@esrf.fr>,
+ Picca Frédéric-Emmanuel <picca@debian.org>
+Section: science
+Priority: extra
+Build-Depends: cython,
+ cython3,
+ libstdc++-4.9-dev,
+ libstdc++6,
+ debhelper (>=9.20150101+deb8u2),
+ dh-python,
+ python-all-dev,
+ python-numpy,
+ python-fabio,
+ python-h5py,
+ python-pyopencl,
+ python-mako,
+ ipython,
+ ipython-qtconsole,
+ python-matplotlib,
+ python-opengl,
+ python-pyqt5,
+ python-pyqt5.qtopengl,
+ python-scipy,
+ python-sphinx,
+ python-sphinxcontrib.programoutput,
+ python-enum34,
+ python3-all-dev,
+ python3-numpy,
+ python3-fabio,
+ python3-h5py,
+ python3-pyopencl,
+ python3-mako,
+ ipython3,
+ ipython3-qtconsole,
+ python3-matplotlib,
+ python3-opengl,
+ python3-pyqt5,
+ python3-pyqt5.qtopengl,
+ python3-scipy,
+ python3-sphinx,
+ python3-sphinxcontrib.programoutput,
+ openstack-pkg-tools
+Standards-Version: 3.9.8
+Vcs-Browser: https://anonscm.debian.org/cgit/debian-science/packages/silx.git
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/silx.git
+Homepage: https://github.com/silx-kit/silx
+X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.4
+
+Package: silx
+Architecture: all
+Depends: ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+ python3-pkg-resources,
+ python3-silx (>= ${source:Version})
+Description: Toolbox for X-Ray data analysis - Executables
+ .
+ This uses the Python 3 version of the package.
+
+Package: python-silx
+Architecture: any
+Section: python
+Depends: ${misc:Depends},
+ ${python:Depends},
+ ${shlibs:Depends},
+ libstdc++6,
+ python-numpy,
+ python-fabio,
+ python-h5py,
+ python-pyopencl,
+ python-mako,
+ ipython,
+ ipython-qtconsole,
+ python-matplotlib,
+ python-opengl,
+ python-pyqt5,
+ python-pyqt5.qtopengl,
+ python-scipy,
+ python-six,
+ python-enum34,
+# Recommends:
+Suggests: python-rfoo
+Description: Toolbox for X-Ray data analysis - Python2 library
+ .
+ This is the Python 2 version of the package.
+
+
+Package: python3-silx
+Architecture: any
+Section: python
+Depends: ${misc:Depends},
+ ${python3:Depends},
+ ${shlibs:Depends},
+ libstdc++6,
+ python3-numpy,
+ python3-fabio,
+ python3-h5py,
+ python3-pyopencl,
+ python3-mako,
+ ipython3,
+ ipython3-qtconsole,
+ python3-matplotlib,
+ python3-opengl,
+ python3-pyqt5,
+ python3-pyqt5.qtopengl,
+ python3-scipy,
+ python3-six,
+# Recommends:
+# Suggests: python3-rfoo
+Description: Toolbox for X-Ray data analysis - Python3
+ .
+ This is the Python 3 version of the package.
+
+
+Package: python-silx-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends},
+ ${sphinxdoc:Depends}
+Description: Toolbox for X-Ray data analysis - Documentation
+ .
+ This is the common documentation package.
diff --git a/package/debian9/gbp.conf b/package/debian9/gbp.conf
new file mode 100644
index 0000000..f68d262
--- /dev/null
+++ b/package/debian9/gbp.conf
@@ -0,0 +1,2 @@
+[DEFAULT]
+debian-branch = master \ No newline at end of file
diff --git a/package/debian9/python-silx-doc.doc-base b/package/debian9/python-silx-doc.doc-base
new file mode 100644
index 0000000..b290d8a
--- /dev/null
+++ b/package/debian9/python-silx-doc.doc-base
@@ -0,0 +1,9 @@
+Document: silx-manual
+Title: silx documentation manual
+Author: Jérôme Kieffer <jerome.kieffer@esrf.eu>
+Abstract: Toolbox for X-Ray data analysis
+Section: Science/Data Analysis
+
+Format: HTML
+Index: /usr/share/doc/python-silx-doc/html/index.html
+Files: /usr/share/doc/python-silx-doc/html/*
diff --git a/package/debian9/rules b/package/debian9/rules
new file mode 100755
index 0000000..9adbaf4
--- /dev/null
+++ b/package/debian9/rules
@@ -0,0 +1,50 @@
+#!/usr/bin/make -f
+
+export PYBUILD_NAME=silx
+
+# Make does not offer a recursive wildcard function, so here's one:
+rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
+
+# How to recursively find all files with the same name in a given folder
+ALL_PYX := $(call rwildcard,silx/,*.pyx)
+#NOTA: No space before *
+
+%:
+ dh $@ --with python2,python3 --buildsystem=pybuild
+
+override_dh_clean:
+ dh_clean
+ # remove the cython generated file to force rebuild
+ rm -f $(patsubst %.pyx,%.cpp,${ALL_PYX})
+ rm -f $(patsubst %.pyx,%.c,${ALL_PYX})
+ rm -f $(patsubst %.pyx,%.html,${ALL_PYX})
+ rm -rf build/html
+ rm -rf *.egg-info
+
+override_dh_auto_build:
+ dh_auto_build
+ python setup.py build build_man build_doc
+
+override_dh_install:
+ dh_numpy
+ dh_numpy3
+
+ # move the scripts to right package
+ dh_install -p silx debian/python3-silx/usr/bin/* usr/bin
+ dh_install -p silx package/desktop/*.desktop usr/share/applications
+ dh_install -p silx package/desktop/silx.png usr/share/icons/hicolor/48x48/apps
+ dh_install -p silx package/desktop/silx.svg usr/share/icons/hicolor/scalable/apps
+ rm -rf debian/python-silx/usr/bin
+ rm -rf debian/python3-silx/usr/bin
+
+ dh_install
+
+override_dh_auto_test:
+ dh_auto_test -- -s custom --test-args="env PYTHONPATH={build_dir} WITH_QT_TEST=False {interpreter} run_tests.py -v"
+
+override_dh_installman:
+ dh_installman -p silx build/man/*.1
+
+override_dh_installdocs:
+ dh_installdocs "build/sphinx/html" -p python-silx-doc
+ dh_installdocs
diff --git a/package/debian9/source/format b/package/debian9/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/package/debian9/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/package/debian9/source/options b/package/debian9/source/options
new file mode 100644
index 0000000..6e88e49
--- /dev/null
+++ b/package/debian9/source/options
@@ -0,0 +1 @@
+extend-diff-ignore="^[^/]+\.egg-info/" \ No newline at end of file
diff --git a/package/debian9/watch b/package/debian9/watch
new file mode 100644
index 0000000..8972716
--- /dev/null
+++ b/package/debian9/watch
@@ -0,0 +1,5 @@
+version=3
+opts=repacksuffix=+dfsg,\
+uversionmangle=s/(rc|a|b|c)/~$1/,\
+dversionmangle=s/\+dfsg// \
+http://pypi.debian.net/silx/silx-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
diff --git a/package/desktop/org.silx.SilxView.desktop b/package/desktop/org.silx.SilxView.desktop
new file mode 100644
index 0000000..577c0c8
--- /dev/null
+++ b/package/desktop/org.silx.SilxView.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Name=silx Data Viewer
+Comment=HDF5 EDF SPEC Data Viewer
+Exec=silx view %F
+Terminal=false
+Icon=silx
+Categories=Education;Science;DataVisualization;Qt
diff --git a/package/desktop/silx.png b/package/desktop/silx.png
new file mode 100644
index 0000000..c3b639b
--- /dev/null
+++ b/package/desktop/silx.png
Binary files differ
diff --git a/package/desktop/silx.svg b/package/desktop/silx.svg
new file mode 100644
index 0000000..6d91541
--- /dev/null
+++ b/package/desktop/silx.svg
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="265.95999"
+ height="265.95999"
+ viewBox="0 0 265.95998 265.95999"
+ id="svg2"
+ xml:space="preserve"><defs
+ id="defs74" /><metadata
+ id="metadata4"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><g
+ transform="matrix(6.1124607,0,0,6.1124607,-9.0246964,-11.55017)"
+ id="g6"><polygon
+ points="32.301,35.732 31.56,35.929 29.495,28.237 38.689,29.693 39.026,32.153 33.188,36.185 "
+ id="polygon8"
+ style="fill:#5a5b5d" /><path
+ d="M 29.222,26.766 C 29.279,26.645 26.99,26.557 26.99,26.557 l -4.19,3.048 4.559,7.404 4.322,-1.051 -2.459,-9.192 z"
+ id="path10"
+ style="fill:#808285" /><path
+ d="m 24.472,1.89 c 0,0 -4.283,2.305 -4.828,2.497 -0.546,0.189 -4.033,3.568 -3.404,3.791 0.628,0.223 3.772,1.429 3.772,1.429 L 26.414,5.893 25.73,3.523 24.472,1.89"
+ id="path12"
+ style="fill:#dcddde" /><path
+ d="m 16.067,8.177 -1.303,1.925 c 0,0 -0.701,2.221 -1.167,3.446 -0.452,1.187 -1.11,2.632 -1.11,2.632 l 3.899,3.088 c 0,0 6.086,-2.344 5.914,-2.23 -0.171,0.114 -2.287,-7.432 -2.287,-7.432 L 16.067,8.177 z"
+ id="path14"
+ style="fill:#f8f8f9" /><path
+ d="M 13.61,15.472"
+ id="path16"
+ style="fill:#939598" /><polygon
+ points="15.439,27.157 11.453,23.67 9.931,19.558 8.219,24.074 7.666,28 12.923,33.159 "
+ id="polygon18"
+ style="fill:#dcddde" /><path
+ d="m 7.666,28 c 0,0 -0.799,1.539 -0.794,2.701 0,1.164 0.396,3.087 0.396,3.087 L 8.185,36.429 15.531,34.437 13.155,33.159 7.666,28 z"
+ id="path20"
+ style="fill:#d1d3d4" /><path
+ d="m 18.127,39.503 2.523,0.67 5.38,4.701 c 0,0 -8.99,0.824 -9.364,0.41 -0.371,-0.41 0.659,-2.008 0.088,-2.408 -0.571,-0.402 1.373,-3.373 1.373,-3.373 z"
+ id="path22"
+ style="fill:#58595b" /><path
+ d="m 15.439,27.157 c 0,0 -2.625,5.788 -2.516,6.001 0.218,0.431 2.607,1.278 2.607,1.278 l 8.371,-5.678 -2.844,-11.251 -3.067,1.22 c 0,0 -3.294,5.58 -3.122,5.347 0.171,-0.234 0.571,3.083 0.571,3.083 z"
+ id="path24"
+ style="fill:#d1d3d4" /><path
+ d="m 21.058,17.507 0.35,-0.081 1.83,-0.731 c 0,0 1.176,1.715 1.119,1.887 -0.059,0.171 2.766,1.713 2.766,1.713 0,0 -0.021,6.005 -0.251,6.261 -0.228,0.258 -2.969,2.203 -2.969,2.203 L 21.058,17.507 z"
+ id="path26"
+ style="fill:#808285" /><path
+ d="m 20.299,40.275 c 0,0 6.674,-1.889 6.847,-2.002 0.171,-0.119 8.016,2.002 8.016,2.002 l -1.33,0.883 h -1.07 l -2.747,2.402 -3.984,1.314 -5.732,-4.599 z"
+ id="path28"
+ style="fill:#333334" /><polygon
+ points="27.239,37.009 32.301,35.732 38.019,37.826 35.162,40.275 27.35,38.281 "
+ id="polygon30"
+ style="fill:#515254" /><path
+ d="m 32.647,35.91 6.379,-3.757 c 0,0 0.555,2.034 0.566,2.376 0.007,0.348 -1.573,3.297 -1.573,3.297 L 32.647,35.91 z"
+ id="path32"
+ style="fill:#464547" /><polygon
+ points="29.104,26.766 26.871,26.556 26.871,21.247 30.071,21.783 32.189,28.826 29.575,28.531 "
+ id="polygon34"
+ style="fill:#9fa1a4" /><path
+ d="m 30.071,21.783 0.207,-0.131 5.299,-3.419 2.685,5.348 c 0,0 -0.294,4.035 -0.01,3.918 0.282,-0.112 0.437,2.194 0.437,2.194 l -6.5,-0.867 -2.118,-7.043 z"
+ id="path36"
+ style="fill:#464547" /><path
+ d="M 26.031,5.748"
+ id="path38"
+ style="fill:#939598" /><polygon
+ points="30.887,8.967 31.56,10.979 32.49,12.237 32.989,14.524 26.241,12.581 26.241,5.893 27.498,6.494 29.285,8.156 30.071,8.177 "
+ id="polygon40"
+ style="fill:#6d6e71" /><polygon
+ points="35.578,18.233 32.989,14.524 29.575,15.381 24.156,18.583 26.708,21.247 26.974,21.783 30.071,21.783 "
+ id="polygon42"
+ style="fill:#5a5b5d" /><path
+ d="m 26.241,5.893 c 0,0 -6.516,4 -6.229,3.714 0.025,-0.022 1.757,7.32 2.287,7.432 0.458,0.096 0.458,0.096 0.458,0.096 l 1.599,1.448 1.436,-4.059 0.449,-1.943 V 5.893 z"
+ id="path44"
+ style="fill:#939598" /><path
+ d="m 8.185,36.429 7.579,-2.156 2.364,5.23 -1.465,2.957 0.264,0.75 -0.259,2.074 -2.654,-1.322 -1.545,-1.313 -1.486,-1.943 c 0,0 -1.011,-0.891 -1.028,-1.203 -0.022,-0.31 -1.77,-3.074 -1.77,-3.074 z"
+ id="path46"
+ style="fill:#808285" /><polygon
+ points="12.487,16.18 10.696,17.753 9.931,19.558 11.453,23.67 15.439,27.157 14.869,24.074 17.991,18.727 16.386,19.268 "
+ id="polygon48"
+ style="fill:#ededee" /><polygon
+ points="26.241,12.581 25.792,14.524 24.356,18.583 29.575,15.381 32.989,14.524 "
+ id="polygon50"
+ style="fill:#464547" /><path
+ d="M 22.303,28.826"
+ id="path52"
+ style="fill:#a7a9ac" /><polygon
+ points="31.022,42.675 32.148,39.503 39.094,35.732 38.019,37.826 33.832,41.158 "
+ id="polygon54" /><polygon
+ points="20.649,40.173 18.127,39.503 15.763,34.273 22.682,29.605 27.757,37.009 27.35,38.281 27.35,38.281 "
+ id="polygon56"
+ style="fill:#515254" /><path
+ d="M 11.114,33.878"
+ id="path58"
+ style="fill:#939598" /><path
+ d="m 18.264,25.999 c 0,0.965 -0.465,1.451 -1.394,1.457 l -4.407,-0.009 c -0.978,0.012 -1.469,0.259 -1.475,0.742 0.012,0.458 0.507,0.685 1.484,0.678 h 1.421 c 2.914,0.013 4.377,1.237 4.389,3.674 0,2.371 -1.46,3.563 -4.38,3.574 H 9.549 C 8.59,36.11 8.11,35.637 8.11,34.696 8.116,33.737 8.592,33.262 9.54,33.276 l 4.362,-0.027 c 0.977,-0.006 1.466,-0.254 1.466,-0.742 0,-0.496 -0.495,-0.74 -1.484,-0.734 h -1.42 C 9.562,31.767 8.111,30.573 8.111,28.19 v -0.045 c 0,-2.389 1.451,-3.587 4.353,-3.593 h 4.353 c 0.958,0.005 1.441,0.488 1.447,1.447 z"
+ id="path60"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 20.37,24.288 c 0.923,0.006 1.394,0.497 1.411,1.471 v 8.955 c -0.011,0.986 -0.476,1.488 -1.394,1.508 -0.923,-0.025 -1.385,-0.527 -1.385,-1.508 v -8.946 c -0.006,-0.987 0.45,-1.48 1.368,-1.48 z"
+ id="path62"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><circle
+ cx="20.290001"
+ cy="20.566999"
+ r="1.689"
+ id="circle64"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 27.838,24.594 c 0.559,-0.001 0.979,0.115 1.263,0.351 0.283,0.236 1.279,1.245 2.986,3.026 1.727,-1.82 2.731,-2.847 3.014,-3.081 0.282,-0.233 0.702,-0.352 1.261,-0.353 0.545,-10e-4 0.964,0.119 1.257,0.36 0.28,0.229 0.421,0.574 0.422,1.035 v 0.063 c 0.001,0.515 -0.295,0.997 -0.887,1.445 l -2.841,2.923 2.865,2.88 c 0.587,0.477 0.882,0.938 0.883,1.379 0,0.031 -0.004,0.064 -0.011,0.1 v 0.119 c 0.001,0.43 -0.134,0.756 -0.405,0.98 -0.307,0.25 -0.732,0.369 -1.277,0.357 -0.572,0.008 -1.003,-0.117 -1.293,-0.373 -0.291,-0.258 -1.269,-1.258 -2.935,-3.004 -1.692,1.783 -2.681,2.801 -2.966,3.053 -0.285,0.252 -0.715,0.379 -1.287,0.381 h -0.042 c -0.523,0.002 -0.932,-0.117 -1.226,-0.352 -0.28,-0.223 -0.42,-0.551 -0.421,-0.98 v -0.117 c -0.007,-0.037 -0.01,-0.07 -0.01,-0.1 -10e-4,-0.443 0.291,-0.9 0.876,-1.375 L 30.042,30.408 27.062,27.5 C 26.467,27.053 26.17,26.572 26.168,26.058 v -0.063 c -10e-4,-0.46 0.138,-0.806 0.417,-1.036 0.29,-0.242 0.709,-0.364 1.253,-0.365 z"
+ id="path66"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 25.549,35.16 c 0,0.551 -0.45,1 -1,1 h -0.845 c -0.55,0 -1,-0.449 -1,-1 V 15.277 c 0,-0.55 0.45,-1 1,-1 h 0.845 c 0.55,0 1,0.45 1,1 V 35.16 z"
+ id="path68"
+ style="fill:#f7941e" /><path
+ d="m 25.549,35.16 c 0,0.551 -0.45,1 -1,1 h -0.845 c -0.55,0 -1,-0.449 -1,-1 V 15.277 c 0,-0.55 0.45,-1 1,-1 h 0.845 c 0.55,0 1,0.45 1,1 V 35.16 z"
+ id="path70"
+ style="fill:none;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /></g></svg> \ No newline at end of file
diff --git a/requirements-dev.txt b/requirements-dev.txt
new file mode 100644
index 0000000..d3c36e3
--- /dev/null
+++ b/requirements-dev.txt
@@ -0,0 +1,7 @@
+# List of silx development dependencies
+# Those ARE NOT required for installation, at runtime or to build from source (except for the doc)
+
+Cython >= 0.21.1 # To regenerate .c/.cpp files from .pyx
+Sphinx # To build the documentation in doc/
+lxml # For test coverage in run_test.py
+coverage # For test coverage in run_test.py
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..9e46ba1
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,29 @@
+# List all dependencies of silx
+# Requires pip >= 8.0
+
+--trusted-host www.silx.org
+--find-links http://www.silx.org/pub/wheelhouse/
+--only-binary numpy,h5py,scipy,PyQt4,PyQt5,PySide
+
+numpy >= 1.8
+fabio >= 0.4 # For silx.io
+h5py # For silx.io
+pyopencl # For silx.opencl
+Mako # For pyopencl reduction
+ipython # For silx.gui.console
+qtconsole # For silx.gui.console
+matplotlib >= 1.2.0 # For silx.gui.plot
+PyOpenGL # For silx.gui.plot3d
+# PyQt4, PyQt5 or PySide # For silx.gui
+# scipy # For silx.math.fit demo, silx.image.sift demo, silx.image.sift.test
+
+# Try to install a Qt binding from a wheel
+# This is no available for all configurations
+
+# Require PyQt when wheel is available
+PyQt5; python_version >= '3.5'
+PyQt4; sys_platform == 'win32' and python_version == '2.7' # From silx.org
+PyQt4; sys_platform == 'darwin' and python_version == '2.7' # From silx.org
+
+# Require scipy when wheel is available
+scipy; sys_platform != 'win32'
diff --git a/run_tests.py b/run_tests.py
index f314e6a..f01ea84 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -32,7 +32,7 @@ Test coverage dependencies: coverage, lxml.
"""
__authors__ = ["Jérôme Kieffer", "Thomas Vincent"]
-__date__ = "19/04/2017"
+__date__ = "03/08/2017"
__license__ = "MIT"
import distutils.util
@@ -44,7 +44,38 @@ import time
import unittest
-logging.basicConfig(level=logging.WARNING)
+class StreamHandlerUnittestReady(logging.StreamHandler):
+ """The unittest class TestResult redefine sys.stdout/err to capture
+ stdout/err from tests and to display them only when a test fail.
+ This class allow to use unittest stdout-capture by using the last sys.stdout
+ and not a cached one.
+ """
+
+ def emit(self, record):
+ """
+ :type record: logging.LogRecord
+ """
+ self.stream = sys.stderr
+ super(StreamHandlerUnittestReady, self).emit(record)
+
+ def flush(self):
+ pass
+
+
+def createBasicHandler():
+ """Create the handler using the basic configuration"""
+ hdlr = StreamHandlerUnittestReady()
+ fs = logging.BASIC_FORMAT
+ dfs = None
+ fmt = logging.Formatter(fs, dfs)
+ hdlr.setFormatter(fmt)
+ return hdlr
+
+
+# Use an handler compatible with unittests, else use_buffer is not working
+logging.root.addHandler(createBasicHandler())
+logging.captureWarnings(True)
+
logger = logging.getLogger("run_tests")
logger.setLevel(logging.WARNING)
@@ -100,6 +131,17 @@ PROJECT_NAME = get_project_name(PROJECT_DIR)
logger.info("Project name: %s", PROJECT_NAME)
+class TextTestResultWithSkipList(unittest.TextTestResult):
+ """Override default TextTestResult to display list of skipped tests at the
+ end
+ """
+
+ def printErrors(self):
+ unittest.TextTestResult.printErrors(self)
+ # Print skipped tests at the end
+ self.printErrorList("SKIPPED", self.skipped)
+
+
class ProfileTextTestResult(unittest.TextTestRunner.resultclass):
def __init__(self, *arg, **kwarg):
@@ -228,9 +270,10 @@ WITH_GL_TEST=False to disable tests using OpenGL
parser = ArgumentParser(description='Run the tests.',
epilog=epilog)
-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("--installed",
+ action="store_true", dest="installed", default=False,
+ help=("Test the installed version instead of" +
+ "building from the source"))
parser.add_argument("-c", "--coverage", dest="coverage",
action="store_true", default=False,
help=("Report code coverage" +
@@ -267,14 +310,17 @@ sys.argv = [sys.argv[0]]
test_verbosity = 1
+use_buffer = True
if options.verbose == 1:
logging.root.setLevel(logging.INFO)
logger.info("Set log level: INFO")
test_verbosity = 2
+ use_buffer = False
elif options.verbose > 1:
logging.root.setLevel(logging.DEBUG)
logger.info("Set log level: DEBUG")
test_verbosity = 2
+ use_buffer = False
if not options.gui:
os.environ["WITH_QT_TEST"] = "False"
@@ -304,6 +350,14 @@ if options.qt_binding:
binding = options.qt_binding.lower()
if binding == "pyqt4":
logger.info("Force using PyQt4")
+ if sys.version < "3.0.0":
+ try:
+ import sip
+
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ logger.warning("Cannot set sip API")
import PyQt4.QtCore # noqa
elif binding == "pyqt5":
logger.info("Force using PyQt5")
@@ -322,16 +376,14 @@ if (os.path.dirname(os.path.abspath(__file__)) ==
# import module
-if not options.insource:
+if options.installed: # Use installed version
try:
module = importer(PROJECT_NAME)
except:
- logger.warning(
- "%s missing, using built (i.e. not installed) version",
+ raise ImportError(
+ "%s not installed: Cannot run tests on installed version" %
PROJECT_NAME)
- options.insource = True
-
-if options.insource:
+else: # Use built source
build_dir = build_project(PROJECT_NAME, PROJECT_DIR)
sys.path.insert(0, build_dir)
@@ -346,8 +398,11 @@ PROJECT_PATH = module.__path__[0]
# Run the tests
runnerArgs = {}
runnerArgs["verbosity"] = test_verbosity
+runnerArgs["buffer"] = use_buffer
if options.memprofile:
runnerArgs["resultclass"] = ProfileTextTestResult
+else:
+ runnerArgs["resultclass"] = TextTestResultWithSkipList
runner = unittest.TextTestRunner(**runnerArgs)
logger.warning("Test %s %s from %s",
@@ -368,17 +423,14 @@ else:
test_suite.addTest(
unittest.defaultTestLoader.loadTestsFromNames(options.test_name))
+# Display the result when using CTRL-C
+unittest.installHandler()
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
diff --git a/setup.cfg b/setup.cfg
index 861a9f5..8bfd5a1 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,4 @@
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 852c48d..7593cf5 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@
# ###########################################################################*/
__authors__ = ["Jérôme Kieffer", "Thomas Vincent"]
-__date__ = "04/05/2017"
+__date__ = "02/10/2017"
__license__ = "MIT"
@@ -106,7 +106,6 @@ classifiers = ["Development Status :: 4 - Beta",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
- "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
"Natural Language :: English",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
@@ -115,6 +114,7 @@ classifiers = ["Development Status :: 4 - Beta",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
+ "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -152,7 +152,7 @@ class PyTest(Command):
def run(self):
import subprocess
- errno = subprocess.call([sys.executable, 'run_tests.py', '-i'])
+ errno = subprocess.call([sys.executable, 'run_tests.py'])
if errno != 0:
raise SystemExit(errno)
@@ -441,7 +441,6 @@ class Build(_build):
logger.warning(msg)
use_cython = "no"
-
# Remove attribute used by distutils parsing
# use 'use_cython' and 'force_cython' instead
del self.no_cython
@@ -461,7 +460,7 @@ class BuildExt(build_ext):
COMPILE_ARGS_CONVERTER = {'-fopenmp': '/openmp'}
- LINK_ARGS_CONVERTER = {'-fopenmp': ' '}
+ LINK_ARGS_CONVERTER = {'-fopenmp': ''}
description = 'Build silx extensions'
@@ -530,7 +529,63 @@ class BuildExt(build_ext):
ext.extra_link_args = [self.LINK_ARGS_CONVERTER.get(f, f)
for f in ext.extra_link_args]
+ def is_debug_interpreter(self):
+ """
+ Returns true if the script is executed with a debug interpreter.
+
+ It looks to be a non-standard code. It is not working for Windows and
+ Mac. But it have to work at least for Debian interpreters.
+
+ :rtype: bool
+ """
+ if sys.version_info >= (3, 0):
+ # It is normalized on Python 3
+ # But it is not available on Windows CPython
+ if hasattr(sys, "abiflags"):
+ return "d" in sys.abiflags
+ else:
+ # It's a Python 2 interpreter
+ # pydebug is not available on Windows/Mac OS interpreters
+ if hasattr(sys, "pydebug"):
+ return sys.pydebug
+
+ # We can't know if we uses debug interpreter
+ return False
+
+ def patch_compiler(self):
+ """
+ Patch the compiler to:
+ - always compile extensions with debug symboles (-g)
+ - only compile asserts in debug mode (-DNDEBUG)
+
+ Plus numpy.distutils/setuptools/distutils inject a lot of duplicated
+ flags. This function tries to clean up default debug options.
+ """
+ build_obj = self.distribution.get_command_obj("build")
+ if build_obj.debug:
+ debug_mode = build_obj.debug
+ else:
+ # Force debug_mode also when it uses python-dbg
+ # It is needed for Debian packaging
+ debug_mode = self.is_debug_interpreter()
+
+ if self.compiler.compiler_type == "unix":
+ args = list(self.compiler.compiler_so)
+ # clean up debug flags -g is included later in another way
+ must_be_cleaned = ["-DNDEBUG", "-g"]
+ args = filter(lambda x: x not in must_be_cleaned, args)
+ args = list(args)
+
+ # always insert symbols
+ args.append("-g")
+ # only strip asserts in release mode
+ if not debug_mode:
+ args.append('-DNDEBUG')
+ # patch options
+ self.compiler.compiler_so = list(args)
+
def build_extensions(self):
+ self.patch_compiler()
for ext in self.extensions:
self.patch_extension(ext)
build_ext.build_extensions(self)
@@ -654,15 +709,18 @@ def get_project_configuration(dry_run):
setup_requires = ["setuptools", "numpy"]
package_data = {
+ # Resources files for silx
'silx.resources': [
- # Add here all resources files
+ 'gui/logo/*.png',
+ 'gui/logo/*.svg',
'gui/icons/*.png',
'gui/icons/*.svg',
'gui/icons/*.mng',
'gui/icons/*.gif',
- 'gui/icons/animated/*.png',
+ 'gui/icons/*/*.png',
'opencl/*.cl',
- 'opencl/sift/*.cl']
+ 'opencl/sift/*.cl',
+ 'gui/colormaps/*.npy'],
}
entry_points = {
diff --git a/silx.egg-info/PKG-INFO b/silx.egg-info/PKG-INFO
index 7a6c11c..7649c9a 100644
--- a/silx.egg-info/PKG-INFO
+++ b/silx.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: silx
-Version: 0.5.0
+Version: 0.6.0
Summary: Software library for X-Ray data analysis
Home-page: https://github.com/silx-kit/silx
Author: data analysis unit
@@ -10,20 +10,30 @@ Description:
silx toolkit
============
- The silx project aims at providing a collection of Python packages to support the development of data assessment, reduction and analysis applications at synchrotron radiation facilities.
- It aims at providing reading/writing different file formats, data reduction routines and a set of Qt widgets to browse and visualize data.
+ The silx project aims at providing a collection of Python packages to support the
+ development of data assessment, reduction and analysis applications at synchrotron
+ radiation facilities.
+ It aims at providing reading/writing different file formats, data reduction routines
+ and a set of Qt widgets to browse and visualize data.
- The current version provides :
+ The current version provides:
- * reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of `SPEC <https://certif.com/spec.html>`_ file format)
+ * reading `HDF5 <https://www.hdfgroup.org/HDF5/>`_ file format (with support of
+ `SPEC <https://certif.com/spec.html>`_ file format and
+ `FabIO <http://www.silx.org/doc/fabio/dev/getting_started.html#list-of-file-formats-that-fabio-can-read-and-write>`_
+ images)
* histogramming
* fitting
- * 1D and 2D visualization using multiple backends (matplotlib or OpenGL)
- * image plot widget with a set of associated tools (See `changelog file <https://github.com/silx-kit/silx/blob/master/CHANGELOG.rst>`_).
- * Unified browser for HDF5, SPEC and image file formats supporting inspection and visualization of n-dimensional datasets.
- * Unified viewer (silx view filename) for HDF5, SPEC and image file formats
- * OpenGL-based widget to display 3D scalar field with isosurface and cutting plane.
+ * 1D and 2D visualization widgets using multiple backends (matplotlib or OpenGL)
+ * an OpenGL-based widget to display 3D scalar field with isosurface and cutting plane
+ * an image plot widget with a set of associated tools
+ * a unified browser for HDF5, SPEC and image file formats supporting inspection and
+ visualization of n-dimensional datasets.
+ * a unified viewer (*silx view filename*) for HDF5, SPEC and image file formats
+ * a unified converter to HDF5 format (*silx convert filename*)
+ * median filters on images (C and OpenCL implementations)
* image alignement (sift - OpenCL implementation)
+ * filtered backprojection and forward projection for tomography
Installation
------------
@@ -31,21 +41,36 @@ Description:
To install silx, run::
pip install silx
+
+ Or with Anaconda on Linux and MacOS::
+
+ conda install silx -c conda-forge
To install silx locally, run::
pip install silx --user
- On Linux, to install silx with pip, you must install numpy first. Unofficial packages for different distributions are available :
+ Unofficial packages for different distributions are available :
- Unofficial Debian8 packages are available at http://www.silx.org/pub/debian/
- CentOS 7 rpm packages are provided by Max IV at the following url: http://pubrepo.maxiv.lu.se/rpm/el7/x86_64/
- Fedora 23 rpm packages are provided by Max IV at http://pubrepo.maxiv.lu.se/rpm/fc23/x86_64/
- Arch Linux (AUR) packages are also available: https://aur.archlinux.org/packages/python-silx
- On Windows, pre-compiled binaries (aka Python wheels) are available for Python 2.7, 3.5 and 3.6.
+ Beside this, we provide a certain number of wheels (pre-compiled binary packages) to be installed
+ onto a pre-existing Python installation:
+
+ - On Windows, binary wheels are available for Python 2.7, 3.5 and 3.6.
+ - On MacOS, binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+ - On Linux, manylinux1 binary wheels are available for Python 2.7, 3.4, 3.5 and 3.6.
+
+ Those builds are made from "up-date" systems at the time of the release, i.e. they use
+ the latest stable version of numpy (and cython).
+ Hence your system should use a fairly recent version of numpy to be compatible with silx.
+ This can be achieved simply by::
+
+ pip install numpy --upgrade
- On Mac OS X, pre-compiled binaries (aka Python wheels) are available for Python 2.7.
The latest development version can be obtained from the git repository::
@@ -65,19 +90,28 @@ Description:
* `matplotlib <http://matplotlib.org/>`_ for the silx.gui.plot package
* `PyOpenGL <http://pyopengl.sourceforge.net/>`_ for the silx.gui.plot3d package
- Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on the following extra package:
+ Most modules and functions dealing with `HDF5 <https://www.hdfgroup.org/HDF5/>`_ input/output depend on:
+
* `h5py <http://www.h5py.org/>`_
- * `ipython <https://ipython.org/>`_ and `qtconsole <https://pypi.python.org/pypi/qtconsole>`_ is required by silx.gui.console.py
+ Parallel algorithms depend on:
+
+ * `PyOpenCL <https://documen.tician.de/pyopencl/>`_
+
+ The console widgets depend on:
+
+ * `ipython <https://ipython.org/>`_
+ * `qtconsole <https://pypi.python.org/pypi/qtconsole>`_
+
Supported platforms: Linux, Windows, Mac OS X.
Documentation
-------------
- Documentation of releases is available at https://pythonhosted.org/silx/
+ Documentation of latest release is available at http://www.silx.org/doc/silx/latest/
- Latest documentation (nightly build) is available at http://www.silx.org/doc/silx/
+ Documentation of previous releases and nightly build is available at http://www.silx.org/doc/silx/
To build the documentation from the source (requires `Sphinx <http://www.sphinx-doc.org>`_), run::
@@ -101,21 +135,28 @@ Description:
Examples
--------
- Some examples are available in the source code repository. For example::
-
- python examples/{exampleName.py}
+ Some examples of sample code using silx are provided with the
+ `silx documentation <http://www.silx.org/doc/silx/dev/sample_code/index.html>`_.
License
-------
- The source code of silx is licensed under the MIT and LGPL licenses.
- See the `copyright file <https://github.com/silx-kit/silx/blob/master/copyright>`_ for details.
+ The source code of silx is licensed under the MIT license.
+ See the `LICENSE <https://github.com/silx-kit/silx/blob/master/LICENSE>`_ and `copyright <https://github.com/silx-kit/silx/blob/master/copyright>`_ files for details.
+
+ Citation
+ --------
+
+ silx releases can be cited by their DOI on Zenodo: |DOI:10.5281/zenodo.1000472|
.. |Travis Status| image:: https://travis-ci.org/silx-kit/silx.svg?branch=master
:target: https://travis-ci.org/silx-kit/silx
.. |Appveyor Status| image:: https://ci.appveyor.com/api/projects/status/qgox9ei0wxwfagrb/branch/master?svg=true
:target: https://ci.appveyor.com/project/ESRF/silx
+ .. |DOI:10.5281/zenodo.1000472| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1000472.svg
+ :target: https://doi.org/10.5281/zenodo.1000472
+
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
@@ -126,7 +167,6 @@ Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
-Classifier: License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
@@ -135,6 +175,7 @@ Classifier: Programming Language :: Cython
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
diff --git a/silx.egg-info/SOURCES.txt b/silx.egg-info/SOURCES.txt
index 6c9b73a..9918323 100644
--- a/silx.egg-info/SOURCES.txt
+++ b/silx.egg-info/SOURCES.txt
@@ -1,7 +1,11 @@
CHANGELOG.rst
+LICENSE
MANIFEST.in
README.rst
+build-deb.sh
copyright
+requirements-dev.txt
+requirements.txt
run_tests.py
setup.py
stdeb.cfg
@@ -17,6 +21,7 @@ doc/source/virtualenv.rst
doc/source/Tutorials/array_widget.rst
doc/source/Tutorials/fit.rst
doc/source/Tutorials/fitconfig.rst
+doc/source/Tutorials/io.rst
doc/source/Tutorials/specfile_to_hdf5.rst
doc/source/Tutorials/Sift/sift.rst
doc/source/Tutorials/img/arraywidget3D_0.png
@@ -31,6 +36,7 @@ doc/source/Tutorials/img/fitwidget2.png
doc/source/Tutorials/img/fitwidget3.png
doc/source/Tutorials/img/fitwidget4.png
doc/source/Tutorials/img/fitwidget5.png
+doc/source/Tutorials/img/silx_view_edf.png
doc/source/Tutorials/img/stripbg_plot1.png
doc/source/Tutorials/img/stripbg_plot2.png
doc/source/description/index.rst
@@ -42,8 +48,11 @@ doc/source/description/img/sift_bench_gpu0.png
doc/source/description/img/sift_bench_gpu_kp.png
doc/source/description/img/sift_bench_gpu_res.png
doc/source/description/img/sift_dog1.png
+doc/source/description/img/sift_frame_ROI.png
doc/source/description/img/sift_match1.png
+doc/source/description/img/sift_match2.png
doc/source/description/img/sift_orientation.png
+doc/source/ext/sphinxext-archive.py
doc/source/img/silx.ico
doc/source/img/silx_large.png
doc/source/img/silx_small.png
@@ -51,6 +60,7 @@ doc/source/modules/index.rst
doc/source/modules/resources.rst
doc/source/modules/gui/console.rst
doc/source/modules/gui/designer.rst
+doc/source/modules/gui/gallery.rst
doc/source/modules/gui/icons.rst
doc/source/modules/gui/index.rst
doc/source/modules/gui/qt.rst
@@ -61,13 +71,15 @@ doc/source/modules/gui/data/dataviewerframe.rst
doc/source/modules/gui/data/index.rst
doc/source/modules/gui/data/numpyaxesselector.rst
doc/source/modules/gui/data/textformatter.rst
+doc/source/modules/gui/data/img/ArrayTableWidget.png
doc/source/modules/gui/data/img/DataViewer.png
doc/source/modules/gui/data/img/DataViewerFrame.png
doc/source/modules/gui/data/img/NumpyAxesSelector.png
doc/source/modules/gui/fit/backgroundwidget.rst
doc/source/modules/gui/fit/fitwidget.rst
doc/source/modules/gui/fit/index.rst
-doc/source/modules/gui/fit/img/bgwidget.png
+doc/source/modules/gui/fit/img/BackgroundDialog.png
+doc/source/modules/gui/fit/img/FitWidget.png
doc/source/modules/gui/hdf5/examples_hdf5widget.rst
doc/source/modules/gui/hdf5/getting_started.rst
doc/source/modules/gui/hdf5/h5node.rst
@@ -78,20 +90,34 @@ doc/source/modules/gui/hdf5/index.rst
doc/source/modules/gui/hdf5/nexussortfilterproxymodel.rst
doc/source/modules/gui/hdf5/img/Hdf5Example.png
doc/source/modules/gui/hdf5/img/Hdf5TreeView.png
+doc/source/modules/gui/img/IPythonDockWidget.png
+doc/source/modules/gui/img/IPythonWidget.png
+doc/source/modules/gui/plot/colormap.rst
+doc/source/modules/gui/plot/compleximageview.rst
doc/source/modules/gui/plot/dev.rst
doc/source/modules/gui/plot/getting_started.rst
doc/source/modules/gui/plot/imageview.rst
doc/source/modules/gui/plot/index.rst
doc/source/modules/gui/plot/items.rst
-doc/source/modules/gui/plot/plot.rst
-doc/source/modules/gui/plot/plotactions.rst
-doc/source/modules/gui/plot/plotactions_examples.rst
doc/source/modules/gui/plot/plottools.rst
doc/source/modules/gui/plot/plotwidget.rst
doc/source/modules/gui/plot/plotwindow.rst
+doc/source/modules/gui/plot/printpreviewtoolbutton.rst
doc/source/modules/gui/plot/profile.rst
doc/source/modules/gui/plot/roi.rst
doc/source/modules/gui/plot/stackview.rst
+doc/source/modules/gui/plot/actions/control.rst
+doc/source/modules/gui/plot/actions/examples.rst
+doc/source/modules/gui/plot/actions/fit.rst
+doc/source/modules/gui/plot/actions/histogram.rst
+doc/source/modules/gui/plot/actions/index.rst
+doc/source/modules/gui/plot/actions/io.rst
+doc/source/modules/gui/plot/actions/medfilt.rst
+doc/source/modules/gui/plot/actions/img/fftAction0.png
+doc/source/modules/gui/plot/actions/img/fftAction1.png
+doc/source/modules/gui/plot/actions/img/shiftAction0.png
+doc/source/modules/gui/plot/actions/img/shiftAction3.png
+doc/source/modules/gui/plot/img/ComplexImageView.png
doc/source/modules/gui/plot/img/ImageView.png
doc/source/modules/gui/plot/img/LimitsToolBar.png
doc/source/modules/gui/plot/img/Plot1D.png
@@ -103,16 +129,13 @@ doc/source/modules/gui/plot/img/StackView.png
doc/source/modules/gui/plot/img/StackViewMainWindow.png
doc/source/modules/gui/plot/img/colorScale.png
doc/source/modules/gui/plot/img/colorScaleBar.png
-doc/source/modules/gui/plot/img/fftAction0.png
-doc/source/modules/gui/plot/img/fftAction1.png
doc/source/modules/gui/plot/img/linearColorbar.png
doc/source/modules/gui/plot/img/logColorbar.png
doc/source/modules/gui/plot/img/netCounts.png
doc/source/modules/gui/plot/img/plot_and_backend.png
+doc/source/modules/gui/plot/img/printPreviewMultiPlot.png
doc/source/modules/gui/plot/img/rawCounts.png
doc/source/modules/gui/plot/img/roiwidget.png
-doc/source/modules/gui/plot/img/shiftAction0.png
-doc/source/modules/gui/plot/img/shiftAction3.png
doc/source/modules/gui/plot/img/tickbar.png
doc/source/modules/gui/plot3d/actions.rst
doc/source/modules/gui/plot3d/dev.rst
@@ -123,7 +146,7 @@ doc/source/modules/gui/plot3d/plot3dwindow.rst
doc/source/modules/gui/plot3d/scalarfieldview.rst
doc/source/modules/gui/plot3d/scene.rst
doc/source/modules/gui/plot3d/sfviewparamtree.rst
-doc/source/modules/gui/plot3d/toolbars.rst
+doc/source/modules/gui/plot3d/tools.rst
doc/source/modules/gui/plot3d/utils.rst
doc/source/modules/gui/plot3d/viewer3dvolume_example.rst
doc/source/modules/gui/plot3d/img/Plot3DWidget.png
@@ -133,15 +156,28 @@ doc/source/modules/gui/plot3d/img/ScalarFieldView.png
doc/source/modules/gui/widgets/framebrowser.rst
doc/source/modules/gui/widgets/index.rst
doc/source/modules/gui/widgets/periodictable.rst
+doc/source/modules/gui/widgets/printpreview.rst
doc/source/modules/gui/widgets/tablewidget.rst
doc/source/modules/gui/widgets/threadpoolpushbutton.rst
doc/source/modules/gui/widgets/waitingpushbutton.rst
+doc/source/modules/gui/widgets/img/FrameBrowser.png
+doc/source/modules/gui/widgets/img/HorizontalSliderWithBrowser.png
+doc/source/modules/gui/widgets/img/PeriodicCombo.png
+doc/source/modules/gui/widgets/img/PeriodicList.png
+doc/source/modules/gui/widgets/img/PeriodicTable.png
+doc/source/modules/gui/widgets/img/TableWidget.png
+doc/source/modules/gui/widgets/img/ThreadPoolPushButton.png
+doc/source/modules/gui/widgets/img/WaitingPushButton.png
+doc/source/modules/image/backprojection.rst
doc/source/modules/image/bilinear.rst
doc/source/modules/image/index.rst
doc/source/modules/image/medianfilter.rst
+doc/source/modules/image/projection.rst
+doc/source/modules/image/reconstruction.rst
doc/source/modules/image/shapes.rst
doc/source/modules/image/sift.rst
doc/source/modules/io/configdict.rst
+doc/source/modules/io/convert.rst
doc/source/modules/io/dictdump.rst
doc/source/modules/io/index.rst
doc/source/modules/io/nxdata.rst
@@ -149,7 +185,6 @@ doc/source/modules/io/octaveh5.rst
doc/source/modules/io/specfile.rst
doc/source/modules/io/specfilewrapper.rst
doc/source/modules/io/spech5.rst
-doc/source/modules/io/spectoh5.rst
doc/source/modules/io/utils.rst
doc/source/modules/math/combo.rst
doc/source/modules/math/histogram.rst
@@ -170,20 +205,70 @@ doc/source/modules/utils/decorators.rst
doc/source/modules/utils/html.rst
doc/source/modules/utils/index.rst
doc/source/modules/utils/weakref.rst
+doc/source/sample_code/index.rst
+doc/source/sample_code/img/animatedicons.png
+doc/source/sample_code/img/customHdf5TreeModel.png
+doc/source/sample_code/img/fftPlotAction.png
+doc/source/sample_code/img/hdf5widget.png
+doc/source/sample_code/img/icons.png
+doc/source/sample_code/img/imageview.png
+doc/source/sample_code/img/periodicTable.png
+doc/source/sample_code/img/plotContextMenu.png
+doc/source/sample_code/img/plotItemsSelector.png
+doc/source/sample_code/img/plotLimits.png
+doc/source/sample_code/img/plotUpdateFromThread.png
+doc/source/sample_code/img/plotWidget.png
+doc/source/sample_code/img/printPreview.png
+doc/source/sample_code/img/scatterMask.png
+doc/source/sample_code/img/shiftPlotAction.png
+doc/source/sample_code/img/simplewidget.png
+doc/source/sample_code/img/stackView.png
+doc/source/sample_code/img/syncaxis.png
+doc/source/sample_code/img/viewer3DVolume.png
examples/animatedicons.py
-examples/colorbar.py
+examples/customHdf5TreeModel.py
examples/fft.png
examples/fftPlotAction.py
examples/hdf5widget.py
examples/icons.py
examples/imageview.py
examples/periodicTable.py
+examples/plotContextMenu.py
+examples/plotItemsSelector.py
+examples/plotLimits.py
+examples/plotUpdateFromThread.py
+examples/plotWidget.py
+examples/printPreview.py
examples/scatterMask.py
examples/shiftPlotAction.py
examples/simplewidget.py
-examples/spectoh5.py
examples/stackView.py
+examples/syncaxis.py
examples/viewer3DVolume.py
+examples/writetoh5.py
+package/debian8/changelog
+package/debian8/clean
+package/debian8/compat
+package/debian8/control
+package/debian8/gbp.conf
+package/debian8/python-silx-doc.doc-base
+package/debian8/rules
+package/debian8/watch
+package/debian8/source/format
+package/debian8/source/options
+package/debian9/changelog
+package/debian9/clean
+package/debian9/compat
+package/debian9/control
+package/debian9/gbp.conf
+package/debian9/python-silx-doc.doc-base
+package/debian9/rules
+package/debian9/watch
+package/debian9/source/format
+package/debian9/source/options
+package/desktop/org.silx.SilxView.desktop
+package/desktop/silx.png
+package/desktop/silx.svg
qtdesigner_plugins/README.rst
qtdesigner_plugins/plot1dplugin.py
qtdesigner_plugins/plot2dplugin.py
@@ -200,9 +285,13 @@ silx.egg-info/not-zip-safe
silx.egg-info/requires.txt
silx.egg-info/top_level.txt
silx/app/__init__.py
+silx/app/convert.py
+silx/app/qtutils.py
silx/app/setup.py
+silx/app/test_.py
silx/app/view.py
silx/app/test/__init__.py
+silx/app/test/test_convert.py
silx/app/test/test_view.py
silx/gui/__init__.py
silx/gui/_utils.py
@@ -211,6 +300,7 @@ silx/gui/icons.py
silx/gui/setup.py
silx/gui/_glutils/Context.py
silx/gui/_glutils/FramebufferTexture.py
+silx/gui/_glutils/OpenGLWidget.py
silx/gui/_glutils/Program.py
silx/gui/_glutils/Texture.py
silx/gui/_glutils/VertexBuffer.py
@@ -225,6 +315,7 @@ silx/gui/data/DataViewerFrame.py
silx/gui/data/DataViewerSelector.py
silx/gui/data/DataViews.py
silx/gui/data/Hdf5TableView.py
+silx/gui/data/HexaTableView.py
silx/gui/data/NXdataWidgets.py
silx/gui/data/NumpyAxesSelector.py
silx/gui/data/RecordTableView.py
@@ -247,6 +338,7 @@ silx/gui/fit/test/__init__.py
silx/gui/fit/test/testBackgroundWidget.py
silx/gui/fit/test/testFitConfig.py
silx/gui/fit/test/testFitWidget.py
+silx/gui/hdf5/Hdf5Formatter.py
silx/gui/hdf5/Hdf5HeaderView.py
silx/gui/hdf5/Hdf5Item.py
silx/gui/hdf5/Hdf5LoadingItem.py
@@ -258,19 +350,20 @@ silx/gui/hdf5/__init__.py
silx/gui/hdf5/_utils.py
silx/gui/hdf5/setup.py
silx/gui/hdf5/test/__init__.py
-silx/gui/hdf5/test/_mock.py
silx/gui/hdf5/test/test_hdf5.py
silx/gui/plot/AlphaSlider.py
silx/gui/plot/ColorBar.py
+silx/gui/plot/Colormap.py
silx/gui/plot/ColormapDialog.py
silx/gui/plot/Colors.py
+silx/gui/plot/ComplexImageView.py
silx/gui/plot/CurvesROIWidget.py
silx/gui/plot/ImageView.py
silx/gui/plot/Interaction.py
+silx/gui/plot/ItemsSelectionDialog.py
silx/gui/plot/LegendSelector.py
-silx/gui/plot/MPLColormap.py
+silx/gui/plot/LimitsHistory.py
silx/gui/plot/MaskToolsWidget.py
-silx/gui/plot/Plot.py
silx/gui/plot/PlotActions.py
silx/gui/plot/PlotEvents.py
silx/gui/plot/PlotInteraction.py
@@ -278,6 +371,7 @@ silx/gui/plot/PlotToolButtons.py
silx/gui/plot/PlotTools.py
silx/gui/plot/PlotWidget.py
silx/gui/plot/PlotWindow.py
+silx/gui/plot/PrintPreviewToolButton.py
silx/gui/plot/Profile.py
silx/gui/plot/ProfileMainWindow.py
silx/gui/plot/ScatterMaskToolsWidget.py
@@ -291,12 +385,18 @@ silx/gui/plot/_utils/setup.py
silx/gui/plot/_utils/ticklayout.py
silx/gui/plot/_utils/test/__init__.py
silx/gui/plot/_utils/test/test_ticklayout.py
+silx/gui/plot/actions/PlotAction.py
+silx/gui/plot/actions/__init__.py
+silx/gui/plot/actions/control.py
+silx/gui/plot/actions/fit.py
+silx/gui/plot/actions/histogram.py
+silx/gui/plot/actions/io.py
+silx/gui/plot/actions/medfilt.py
+silx/gui/plot/actions/mode.py
silx/gui/plot/backends/BackendBase.py
silx/gui/plot/backends/BackendMatplotlib.py
silx/gui/plot/backends/BackendOpenGL.py
-silx/gui/plot/backends/ModestImage.py
silx/gui/plot/backends/__init__.py
-silx/gui/plot/backends/_matplotlib.py
silx/gui/plot/backends/glutils/GLPlotCurve.py
silx/gui/plot/backends/glutils/GLPlotFrame.py
silx/gui/plot/backends/glutils/GLPlotImage.py
@@ -306,6 +406,7 @@ silx/gui/plot/backends/glutils/GLTexture.py
silx/gui/plot/backends/glutils/PlotImageFile.py
silx/gui/plot/backends/glutils/__init__.py
silx/gui/plot/items/__init__.py
+silx/gui/plot/items/axis.py
silx/gui/plot/items/core.py
silx/gui/plot/items/curve.py
silx/gui/plot/items/histogram.py
@@ -313,32 +414,44 @@ silx/gui/plot/items/image.py
silx/gui/plot/items/marker.py
silx/gui/plot/items/scatter.py
silx/gui/plot/items/shape.py
+silx/gui/plot/matplotlib/Colormap.py
+silx/gui/plot/matplotlib/ModestImage.py
+silx/gui/plot/matplotlib/__init__.py
silx/gui/plot/test/__init__.py
silx/gui/plot/test/testAlphaSlider.py
silx/gui/plot/test/testColorBar.py
+silx/gui/plot/test/testColormap.py
silx/gui/plot/test/testColormapDialog.py
silx/gui/plot/test/testColors.py
+silx/gui/plot/test/testComplexImageView.py
silx/gui/plot/test/testCurvesROIWidget.py
silx/gui/plot/test/testInteraction.py
+silx/gui/plot/test/testItem.py
silx/gui/plot/test/testLegendSelector.py
+silx/gui/plot/test/testLimitConstraints.py
silx/gui/plot/test/testMaskToolsWidget.py
-silx/gui/plot/test/testPlot.py
silx/gui/plot/test/testPlotInteraction.py
silx/gui/plot/test/testPlotTools.py
silx/gui/plot/test/testPlotWidget.py
+silx/gui/plot/test/testPlotWidgetNoBackend.py
silx/gui/plot/test/testPlotWindow.py
silx/gui/plot/test/testProfile.py
silx/gui/plot/test/testScatterMaskToolsWidget.py
silx/gui/plot/test/testStackView.py
-silx/gui/plot3d/Plot3DActions.py
-silx/gui/plot3d/Plot3DToolBar.py
+silx/gui/plot/test/testUtilsAxis.py
+silx/gui/plot/test/utils.py
+silx/gui/plot/utils/__init__.py
+silx/gui/plot/utils/axis.py
silx/gui/plot3d/Plot3DWidget.py
silx/gui/plot3d/Plot3DWindow.py
silx/gui/plot3d/SFViewParamTree.py
silx/gui/plot3d/ScalarFieldView.py
-silx/gui/plot3d/ViewpointToolBar.py
silx/gui/plot3d/__init__.py
silx/gui/plot3d/setup.py
+silx/gui/plot3d/actions/Plot3DAction.py
+silx/gui/plot3d/actions/__init__.py
+silx/gui/plot3d/actions/io.py
+silx/gui/plot3d/actions/mode.py
silx/gui/plot3d/scene/__init__.py
silx/gui/plot3d/scene/axes.py
silx/gui/plot3d/scene/camera.py
@@ -358,6 +471,11 @@ silx/gui/plot3d/scene/test/__init__.py
silx/gui/plot3d/scene/test/test_transform.py
silx/gui/plot3d/scene/test/test_utils.py
silx/gui/plot3d/test/__init__.py
+silx/gui/plot3d/test/testGL.py
+silx/gui/plot3d/test/testScalarFieldView.py
+silx/gui/plot3d/tools/ViewpointTools.py
+silx/gui/plot3d/tools/__init__.py
+silx/gui/plot3d/tools/toolbars.py
silx/gui/plot3d/utils/__init__.py
silx/gui/plot3d/utils/mng.py
silx/gui/qt/__init__.py
@@ -372,10 +490,13 @@ silx/gui/test/test_icons.py
silx/gui/test/test_qt.py
silx/gui/test/test_utils.py
silx/gui/test/utils.py
+silx/gui/widgets/FloatEdit.py
silx/gui/widgets/FrameBrowser.py
silx/gui/widgets/HierarchicalTableView.py
silx/gui/widgets/MedianFilterDialog.py
silx/gui/widgets/PeriodicTable.py
+silx/gui/widgets/PrintGeometryDialog.py
+silx/gui/widgets/PrintPreview.py
silx/gui/widgets/TableWidget.py
silx/gui/widgets/ThreadPoolPushButton.py
silx/gui/widgets/WaitingPushButton.py
@@ -384,34 +505,44 @@ silx/gui/widgets/setup.py
silx/gui/widgets/test/__init__.py
silx/gui/widgets/test/test_hierarchicaltableview.py
silx/gui/widgets/test/test_periodictable.py
+silx/gui/widgets/test/test_printpreview.py
silx/gui/widgets/test/test_tablewidget.py
silx/gui/widgets/test/test_threadpoolpushbutton.py
silx/image/__init__.py
+silx/image/backprojection.py
silx/image/bilinear.c
silx/image/bilinear.pyx
silx/image/medianfilter.py
+silx/image/phantomgenerator.py
+silx/image/projection.py
+silx/image/reconstruction.py
silx/image/setup.py
silx/image/shapes.c
silx/image/shapes.pyx
silx/image/sift.py
+silx/image/tomography.py
silx/image/test/__init__.py
silx/image/test/test_bilinear.py
silx/image/test/test_medianfilter.py
silx/image/test/test_shapes.py
+silx/image/test/test_tomography.py
silx/io/__init__.py
+silx/io/commonh5.py
silx/io/configdict.py
+silx/io/convert.py
silx/io/dictdump.py
silx/io/fabioh5.py
silx/io/nxdata.py
silx/io/octaveh5.py
+silx/io/rawh5.py
silx/io/setup.py
+silx/io/specfile.c
+silx/io/specfile.pyx
+silx/io/specfile_wrapper.pxd
silx/io/specfilewrapper.py
silx/io/spech5.py
silx/io/spectoh5.py
silx/io/utils.py
-silx/io/specfile/specfile.c
-silx/io/specfile/specfile.pyx
-silx/io/specfile/specfile_wrapper.pxd
silx/io/specfile/include/Lists.h
silx/io/specfile/include/SpecFile.h
silx/io/specfile/include/SpecFileCython.h
@@ -428,10 +559,12 @@ silx/io/specfile/src/sfmca.c
silx/io/specfile/src/sftools.c
silx/io/specfile/src/sfwrite.c
silx/io/test/__init__.py
+silx/io/test/test_commonh5.py
silx/io/test/test_dictdump.py
silx/io/test/test_fabioh5.py
silx/io/test/test_nxdata.py
silx/io/test/test_octaveh5.py
+silx/io/test/test_rawh5.py
silx/io/test/test_specfile.py
silx/io/test/test_specfilewrapper.py
silx/io/test/test_spech5.py
@@ -439,35 +572,42 @@ silx/io/test/test_spectoh5.py
silx/io/test/test_utils.py
silx/math/__init__.py
silx/math/calibration.py
+silx/math/chistogramnd.c
+silx/math/chistogramnd.pyx
+silx/math/chistogramnd_lut.c
+silx/math/chistogramnd_lut.pyx
+silx/math/combo.c
+silx/math/combo.pyx
silx/math/histogram.py
+silx/math/histogramnd_c.pxd
+silx/math/marchingcubes.cpp
+silx/math/marchingcubes.pyx
+silx/math/mc.pxd
silx/math/setup.py
-silx/math/combo/combo.c
-silx/math/combo/combo.pyx
-silx/math/combo/isnan.h
silx/math/fit/__init__.py
silx/math/fit/bgtheories.py
+silx/math/fit/filters.c
+silx/math/fit/filters.pyx
+silx/math/fit/filters_wrapper.pxd
silx/math/fit/fitmanager.py
silx/math/fit/fittheories.py
silx/math/fit/fittheory.py
+silx/math/fit/functions.c
+silx/math/fit/functions.pyx
+silx/math/fit/functions_wrapper.pxd
silx/math/fit/leastsq.py
+silx/math/fit/peaks.c
+silx/math/fit/peaks.pyx
+silx/math/fit/peaks_wrapper.pxd
silx/math/fit/setup.py
-silx/math/fit/filters/filters.c
-silx/math/fit/filters/filters.pyx
-silx/math/fit/filters/filters_wrapper.pxd
silx/math/fit/filters/include/filters.h
silx/math/fit/filters/src/smoothnd.c
silx/math/fit/filters/src/snip1d.c
silx/math/fit/filters/src/snip2d.c
silx/math/fit/filters/src/snip3d.c
silx/math/fit/filters/src/strip.c
-silx/math/fit/functions/functions.c
-silx/math/fit/functions/functions.pyx
-silx/math/fit/functions/functions_wrapper.pxd
silx/math/fit/functions/include/functions.h
silx/math/fit/functions/src/funs.c
-silx/math/fit/peaks/peaks.c
-silx/math/fit/peaks/peaks.pyx
-silx/math/fit/peaks/peaks_wrapper.pxd
silx/math/fit/peaks/include/peaks.h
silx/math/fit/peaks/src/peaks.c
silx/math/fit/test/__init__.py
@@ -477,20 +617,13 @@ silx/math/fit/test/test_fit.py
silx/math/fit/test/test_fitmanager.py
silx/math/fit/test/test_functions.py
silx/math/fit/test/test_peaks.py
-silx/math/histogramnd/chistogramnd.c
-silx/math/histogramnd/chistogramnd.pyx
-silx/math/histogramnd/chistogramnd_lut.c
-silx/math/histogramnd/chistogramnd_lut.pyx
-silx/math/histogramnd/histogramnd_c.pxd
silx/math/histogramnd/include/histogramnd_c.h
silx/math/histogramnd/include/templates.h
silx/math/histogramnd/include/msvc/stdint.h
silx/math/histogramnd/src/histogramnd_c.c
silx/math/histogramnd/src/histogramnd_template.c
-silx/math/marchingcubes/marchingcubes.cpp
-silx/math/marchingcubes/marchingcubes.pyx
+silx/math/include/isnan.h
silx/math/marchingcubes/mc.hpp
-silx/math/marchingcubes/mc.pxd
silx/math/marchingcubes/mc_lut.cpp
silx/math/medianfilter/__init__.py
silx/math/medianfilter/median_filter.pxd
@@ -511,9 +644,13 @@ silx/math/test/test_histogramnd_nominal.py
silx/math/test/test_histogramnd_vs_np.py
silx/math/test/test_marchingcubes.py
silx/opencl/__init__.py
+silx/opencl/backprojection.py
silx/opencl/common.py
+silx/opencl/linalg.py
silx/opencl/medfilt.py
silx/opencl/processing.py
+silx/opencl/projection.py
+silx/opencl/reconstruction.py
silx/opencl/setup.py
silx/opencl/utils.py
silx/opencl/sift/__init__.py
@@ -537,27 +674,40 @@ silx/opencl/sift/test/test_matching.py
silx/opencl/sift/test/test_preproc.py
silx/opencl/sift/test/test_reductions.py
silx/opencl/sift/test/test_transform.py
-silx/opencl/sift/test/utilstest.py
silx/opencl/test/__init__.py
silx/opencl/test/test_addition.py
+silx/opencl/test/test_array_utils.py
+silx/opencl/test/test_backprojection.py
+silx/opencl/test/test_linalg.py
silx/opencl/test/test_medfilt.py
+silx/opencl/test/test_projection.py
silx/resources/__init__.py
+silx/resources/gui/colormaps/inferno.npy
+silx/resources/gui/colormaps/magma.npy
+silx/resources/gui/colormaps/plasma.npy
+silx/resources/gui/colormaps/viridis.npy
silx/resources/gui/icons/3d-plane-normal-x.png
silx/resources/gui/icons/3d-plane-normal-x.svg
silx/resources/gui/icons/3d-plane-normal-y.png
silx/resources/gui/icons/3d-plane-normal-y.svg
silx/resources/gui/icons/3d-plane-normal-z.png
silx/resources/gui/icons/3d-plane-normal-z.svg
+silx/resources/gui/icons/3d-plane-pan.png
+silx/resources/gui/icons/3d-plane-pan.svg
silx/resources/gui/icons/3d-plane.png
silx/resources/gui/icons/3d-plane.svg
silx/resources/gui/icons/arrow-keys.png
silx/resources/gui/icons/arrow-keys.svg
+silx/resources/gui/icons/axis.png
+silx/resources/gui/icons/axis.svg
silx/resources/gui/icons/camera.png
silx/resources/gui/icons/camera.svg
silx/resources/gui/icons/clipboard.png
silx/resources/gui/icons/clipboard.svg
silx/resources/gui/icons/close.png
silx/resources/gui/icons/close.svg
+silx/resources/gui/icons/colorbar.png
+silx/resources/gui/icons/colorbar.svg
silx/resources/gui/icons/colormap.png
silx/resources/gui/icons/colormap.svg
silx/resources/gui/icons/crop.png
@@ -620,10 +770,14 @@ silx/resources/gui/icons/item-3dim.png
silx/resources/gui/icons/item-3dim.svg
silx/resources/gui/icons/item-ndim.png
silx/resources/gui/icons/item-ndim.svg
+silx/resources/gui/icons/item-none.png
+silx/resources/gui/icons/item-none.svg
silx/resources/gui/icons/item-object.png
silx/resources/gui/icons/item-object.svg
silx/resources/gui/icons/last.png
silx/resources/gui/icons/last.svg
+silx/resources/gui/icons/math-amplitude.png
+silx/resources/gui/icons/math-amplitude.svg
silx/resources/gui/icons/math-average.png
silx/resources/gui/icons/math-average.svg
silx/resources/gui/icons/math-derive.png
@@ -632,6 +786,8 @@ silx/resources/gui/icons/math-energy.png
silx/resources/gui/icons/math-energy.svg
silx/resources/gui/icons/math-fit.png
silx/resources/gui/icons/math-fit.svg
+silx/resources/gui/icons/math-imaginary.png
+silx/resources/gui/icons/math-imaginary.svg
silx/resources/gui/icons/math-normalize.png
silx/resources/gui/icons/math-normalize.svg
silx/resources/gui/icons/math-peak-reset.png
@@ -640,6 +796,14 @@ silx/resources/gui/icons/math-peak-search.png
silx/resources/gui/icons/math-peak-search.svg
silx/resources/gui/icons/math-peak.png
silx/resources/gui/icons/math-peak.svg
+silx/resources/gui/icons/math-phase-color-log.png
+silx/resources/gui/icons/math-phase-color-log.svg
+silx/resources/gui/icons/math-phase-color.png
+silx/resources/gui/icons/math-phase-color.svg
+silx/resources/gui/icons/math-phase.png
+silx/resources/gui/icons/math-phase.svg
+silx/resources/gui/icons/math-real.png
+silx/resources/gui/icons/math-real.svg
silx/resources/gui/icons/math-sigma.png
silx/resources/gui/icons/math-sigma.svg
silx/resources/gui/icons/math-smooth.png
@@ -656,6 +820,8 @@ silx/resources/gui/icons/next.png
silx/resources/gui/icons/next.svg
silx/resources/gui/icons/normal.png
silx/resources/gui/icons/normal.svg
+silx/resources/gui/icons/pan.png
+silx/resources/gui/icons/pan.svg
silx/resources/gui/icons/pixel-intensities.png
silx/resources/gui/icons/pixel-intensities.svg
silx/resources/gui/icons/plot-grid.png
@@ -701,6 +867,8 @@ silx/resources/gui/icons/profile2D.png
silx/resources/gui/icons/profile2D.svg
silx/resources/gui/icons/remove.png
silx/resources/gui/icons/remove.svg
+silx/resources/gui/icons/rotate-3d.png
+silx/resources/gui/icons/rotate-3d.svg
silx/resources/gui/icons/rudder.png
silx/resources/gui/icons/rudder.svg
silx/resources/gui/icons/selected.png
@@ -733,8 +901,6 @@ silx/resources/gui/icons/sliders-on.png
silx/resources/gui/icons/sliders-on.svg
silx/resources/gui/icons/spec.png
silx/resources/gui/icons/spec.svg
-silx/resources/gui/icons/test-png.png
-silx/resources/gui/icons/test-svg.svg
silx/resources/gui/icons/view-1d.png
silx/resources/gui/icons/view-1d.svg
silx/resources/gui/icons/view-2d-stack.png
@@ -759,6 +925,8 @@ silx/resources/gui/icons/view-text.png
silx/resources/gui/icons/view-text.svg
silx/resources/gui/icons/window-new.png
silx/resources/gui/icons/window-new.svg
+silx/resources/gui/icons/zoom-back.png
+silx/resources/gui/icons/zoom-back.svg
silx/resources/gui/icons/zoom-in.png
silx/resources/gui/icons/zoom-in.svg
silx/resources/gui/icons/zoom-original.png
@@ -767,41 +935,48 @@ silx/resources/gui/icons/zoom-out.png
silx/resources/gui/icons/zoom-out.svg
silx/resources/gui/icons/zoom.png
silx/resources/gui/icons/zoom.svg
-silx/resources/gui/icons/animated/process-working-00.png
-silx/resources/gui/icons/animated/process-working-01.png
-silx/resources/gui/icons/animated/process-working-02.png
-silx/resources/gui/icons/animated/process-working-03.png
-silx/resources/gui/icons/animated/process-working-04.png
-silx/resources/gui/icons/animated/process-working-05.png
-silx/resources/gui/icons/animated/process-working-06.png
-silx/resources/gui/icons/animated/process-working-07.png
-silx/resources/gui/icons/animated/process-working-08.png
-silx/resources/gui/icons/animated/process-working-09.png
-silx/resources/gui/icons/animated/process-working-10.png
-silx/resources/gui/icons/animated/process-working-11.png
-silx/resources/gui/icons/animated/process-working-12.png
-silx/resources/gui/icons/animated/process-working-13.png
-silx/resources/gui/icons/animated/process-working-14.png
-silx/resources/gui/icons/animated/process-working-15.png
-silx/resources/gui/icons/animated/process-working-16.png
-silx/resources/gui/icons/animated/process-working-17.png
-silx/resources/gui/icons/animated/process-working-18.png
-silx/resources/gui/icons/animated/process-working-19.png
-silx/resources/gui/icons/animated/process-working-20.png
-silx/resources/gui/icons/animated/process-working-21.png
-silx/resources/gui/icons/animated/process-working-22.png
-silx/resources/gui/icons/animated/process-working-23.png
-silx/resources/gui/icons/animated/process-working-24.png
-silx/resources/gui/icons/animated/process-working-25.png
-silx/resources/gui/icons/animated/process-working-26.png
-silx/resources/gui/icons/animated/process-working-27.png
-silx/resources/gui/icons/animated/process-working-28.png
-silx/resources/gui/icons/animated/process-working-29.png
-silx/resources/gui/icons/animated/process-working-30.png
+silx/resources/gui/icons/process-working/00.png
+silx/resources/gui/icons/process-working/01.png
+silx/resources/gui/icons/process-working/02.png
+silx/resources/gui/icons/process-working/03.png
+silx/resources/gui/icons/process-working/04.png
+silx/resources/gui/icons/process-working/05.png
+silx/resources/gui/icons/process-working/06.png
+silx/resources/gui/icons/process-working/07.png
+silx/resources/gui/icons/process-working/08.png
+silx/resources/gui/icons/process-working/09.png
+silx/resources/gui/icons/process-working/10.png
+silx/resources/gui/icons/process-working/11.png
+silx/resources/gui/icons/process-working/12.png
+silx/resources/gui/icons/process-working/13.png
+silx/resources/gui/icons/process-working/14.png
+silx/resources/gui/icons/process-working/15.png
+silx/resources/gui/icons/process-working/16.png
+silx/resources/gui/icons/process-working/17.png
+silx/resources/gui/icons/process-working/18.png
+silx/resources/gui/icons/process-working/19.png
+silx/resources/gui/icons/process-working/20.png
+silx/resources/gui/icons/process-working/21.png
+silx/resources/gui/icons/process-working/22.png
+silx/resources/gui/icons/process-working/23.png
+silx/resources/gui/icons/process-working/24.png
+silx/resources/gui/icons/process-working/25.png
+silx/resources/gui/icons/process-working/26.png
+silx/resources/gui/icons/process-working/27.png
+silx/resources/gui/icons/process-working/28.png
+silx/resources/gui/icons/process-working/29.png
+silx/resources/gui/icons/process-working/30.png
+silx/resources/gui/logo/silx.png
+silx/resources/gui/logo/silx.svg
silx/resources/opencl/addition.cl
+silx/resources/opencl/array_utils.cl
+silx/resources/opencl/backproj.cl
+silx/resources/opencl/backproj_helper.cl
silx/resources/opencl/bitonic.cl
+silx/resources/opencl/linalg.cl
silx/resources/opencl/medfilt.cl
silx/resources/opencl/preprocess.cl
+silx/resources/opencl/proj.cl
silx/resources/opencl/sift/addition.cl
silx/resources/opencl/sift/algebra.cl
silx/resources/opencl/sift/convolution.cl
@@ -829,20 +1004,25 @@ silx/test/utils.py
silx/third_party/EdfFile.py
silx/third_party/TiffIO.py
silx/third_party/__init__.py
+silx/third_party/enum.py
silx/third_party/setup.py
silx/third_party/six.py
silx/third_party/_local/__init__.py
+silx/third_party/_local/enum.py
silx/third_party/_local/six.py
silx/utils/__init__.py
silx/utils/array_like.py
-silx/utils/decorators.py
+silx/utils/deprecation.py
silx/utils/html.py
silx/utils/launcher.py
+silx/utils/proxy.py
silx/utils/setup.py
silx/utils/weakref.py
silx/utils/test/__init__.py
silx/utils/test/test_array_like.py
+silx/utils/test/test_deprecation.py
silx/utils/test/test_html.py
silx/utils/test/test_launcher.py
silx/utils/test/test_launcher_command.py
+silx/utils/test/test_proxy.py
silx/utils/test/test_weakref.py \ No newline at end of file
diff --git a/silx/__init__.py b/silx/__init__.py
index cfb306b..8dab7e1 100644
--- a/silx/__init__.py
+++ b/silx/__init__.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2015-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2015-2017 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
@@ -32,7 +32,10 @@ __date__ = "23/05/2016"
import os as _os
import logging as _logging
-_logging.basicConfig() # Make sure logging is initialised
+
+# Attach a do nothing logging handler for silx
+_logging.getLogger(__name__).addHandler(_logging.NullHandler())
+
project = _os.path.basename(_os.path.dirname(_os.path.abspath(__file__)))
diff --git a/silx/__main__.py b/silx/__main__.py
index 4c05ef3..8323b03 100644
--- a/silx/__main__.py
+++ b/silx/__main__.py
@@ -2,7 +2,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2017 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
@@ -30,9 +30,9 @@ Your environment should provide a command `silx`. You can reach help with
`silx --help`, and check the version with `silx --version`.
"""
-__authors__ = ["V. Valls"]
+__authors__ = ["V. Valls", "P. Knobel"]
__license__ = "MIT"
-__date__ = "18/04/2017"
+__date__ = "29/06/2017"
import logging
@@ -46,8 +46,8 @@ import silx._version
def main():
"""Main function of the launcher
- This function is referenced in the setup.py file.
- Thisfor it is executed by a launcher script generated by setuptools.
+ This function is referenced in the setup.py file, to create a
+ launcher script generated by setuptools.
:rtype: int
:returns: The execution status
@@ -56,6 +56,12 @@ def main():
launcher.add_command("view",
module_name="silx.app.view",
description="Browse a data file with a GUI")
+ launcher.add_command("convert",
+ module_name="silx.app.convert",
+ description="Convert and concatenate files into a HDF5 file")
+ launcher.add_command("test",
+ module_name="silx.app.test_",
+ description="Launch silx unittest")
status = launcher.execute(sys.argv)
return status
diff --git a/silx/app/convert.py b/silx/app/convert.py
new file mode 100644
index 0000000..a092ec1
--- /dev/null
+++ b/silx/app/convert.py
@@ -0,0 +1,283 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+"""Convert silx supported data files into HDF5 files"""
+
+import ast
+import sys
+import os
+import argparse
+from glob import glob
+import logging
+import numpy
+import silx
+
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "12/09/2017"
+
+
+_logger = logging.getLogger(__name__)
+"""Module logger"""
+
+
+def main(argv):
+ """
+ Main function to launch the converter as an application
+
+ :param argv: Command line arguments
+ :returns: exit status
+ """
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument(
+ 'input_files',
+ nargs="+",
+ help='Input files (EDF, SPEC)')
+ parser.add_argument(
+ '-o', '--output-uri',
+ nargs="?",
+ help='Output file (HDF5). If omitted, it will be the '
+ 'concatenated input file names, with a ".h5" suffix added.'
+ ' An URI can be provided to write the data into a specific '
+ 'group in the output file: /path/to/file::/path/to/group')
+ parser.add_argument(
+ '-m', '--mode',
+ default="w-",
+ help='Write mode: "r+" (read/write, file must exist), '
+ '"w" (write, existing file is lost), '
+ '"w-" (write, fail if file exists) or '
+ '"a" (read/write if exists, create otherwise)')
+ parser.add_argument(
+ '--no-root-group',
+ action="store_true",
+ help='This option disables the default behavior of creating a '
+ 'root group (entry) for each file to be converted. When '
+ 'merging multiple input files, this can cause conflicts '
+ 'when datasets have the same name (see --overwrite-data).')
+ parser.add_argument(
+ '--overwrite-data',
+ action="store_true",
+ help='If the output path exists and an input dataset has the same'
+ ' name as an existing output dataset, overwrite the output '
+ 'dataset (in modes "r+" or "a").')
+ parser.add_argument(
+ '--min-size',
+ type=int,
+ default=500,
+ help='Minimum number of elements required to be in a dataset to '
+ 'apply compression or chunking (default 500).')
+ parser.add_argument(
+ '--chunks',
+ nargs="?",
+ const="auto",
+ help='Chunk shape. Provide an argument that evaluates as a python '
+ 'tuple (e.g. "(1024, 768)"). If this option is provided without '
+ 'specifying an argument, the h5py library will guess a chunk for '
+ 'you. Note that if you specify an explicit chunking shape, it '
+ 'will be applied identically to all datasets with a large enough '
+ 'size (see --min-size). ')
+ parser.add_argument(
+ '--compression',
+ nargs="?",
+ const="gzip",
+ help='Compression filter. By default, the datasets in the output '
+ 'file are not compressed. If this option is specified without '
+ 'argument, the GZIP compression is used. Additional compression '
+ 'filters may be available, depending on your HDF5 installation.')
+
+ def check_gzip_compression_opts(value):
+ ivalue = int(value)
+ if ivalue < 0 or ivalue > 9:
+ raise argparse.ArgumentTypeError(
+ "--compression-opts must be an int from 0 to 9")
+ return ivalue
+
+ parser.add_argument(
+ '--compression-opts',
+ type=check_gzip_compression_opts,
+ help='Compression options. For "gzip", this may be an integer from '
+ '0 to 9, with a default of 4. This is only supported for GZIP.')
+ parser.add_argument(
+ '--shuffle',
+ action="store_true",
+ help='Enables the byte shuffle filter, may improve the compression '
+ 'ratio for block oriented compressors like GZIP or LZF.')
+ parser.add_argument(
+ '--fletcher32',
+ action="store_true",
+ help='Adds a checksum to each chunk to detect data corruption.')
+ parser.add_argument(
+ '--debug',
+ action="store_true",
+ default=False,
+ help='Set logging system in debug mode')
+
+ options = parser.parse_args(argv[1:])
+
+ # some shells (windows) don't interpret wildcard characters (*, ?, [])
+ old_input_list = list(options.input_files)
+ options.input_files = []
+ for fname in old_input_list:
+ globbed_files = glob(fname)
+ if not globbed_files:
+ # no files found, keep the name as it is, to raise an error later
+ options.input_files += [fname]
+ else:
+ options.input_files += globbed_files
+ old_input_list = None
+
+ if options.debug:
+ logging.root.setLevel(logging.DEBUG)
+
+ # Import most of the things here to be sure to use the right logging level
+ try:
+ # it should be loaded before h5py
+ import hdf5plugin # noqa
+ except ImportError:
+ _logger.debug("Backtrace", exc_info=True)
+ hdf5plugin = None
+
+ try:
+ import h5py
+ from silx.io.convert import write_to_h5
+ except ImportError:
+ _logger.debug("Backtrace", exc_info=True)
+ h5py = None
+ write_to_h5 = None
+
+ if h5py is None:
+ message = "Module 'h5py' is not installed but is mandatory."\
+ + " You can install it using \"pip install h5py\"."
+ _logger.error(message)
+ return -1
+
+ if hdf5plugin is None:
+ message = "Module 'hdf5plugin' is not installed. It supports additional hdf5"\
+ + " compressions. You can install it using \"pip install hdf5plugin\"."
+ _logger.debug(message)
+
+ # Test that the output path is writeable
+ if options.output_uri is None:
+ input_basenames = [os.path.basename(name) for name in options.input_files]
+ output_name = ''.join(input_basenames) + ".h5"
+ _logger.info("No output file specified, using %s", output_name)
+ hdf5_path = "/"
+ else:
+ if "::" in options.output_uri:
+ output_name, hdf5_path = options.output_uri.split("::")
+ else:
+ output_name, hdf5_path = options.output_uri, "/"
+
+ if os.path.isfile(output_name):
+ if options.mode == "w-":
+ _logger.error("Output file %s exists and mode is 'w-'"
+ " (write, file must not exist). Aborting.",
+ output_name)
+ return -1
+ elif not os.access(output_name, os.W_OK):
+ _logger.error("Output file %s exists and is not writeable.",
+ output_name)
+ return -1
+ elif options.mode == "w":
+ _logger.info("Output file %s exists and mode is 'w'. "
+ "Overwriting existing file.", output_name)
+ elif options.mode in ["a", "r+"]:
+ _logger.info("Appending data to existing file %s.",
+ output_name)
+ else:
+ if options.mode == "r+":
+ _logger.error("Output file %s does not exist and mode is 'r+'"
+ " (append, file must exist). Aborting.",
+ output_name)
+ return -1
+ else:
+ _logger.info("Creating new output file %s.",
+ output_name)
+
+ # Test that all input files exist and are readable
+ bad_input = False
+ for fname in options.input_files:
+ if not os.access(fname, os.R_OK):
+ _logger.error("Cannot read input file %s.",
+ fname)
+ bad_input = True
+ if bad_input:
+ _logger.error("Aborting.")
+ return -1
+
+ # create_dataset special args
+ create_dataset_args = {}
+ if options.chunks is not None:
+ if options.chunks.lower() in ["auto", "true"]:
+ create_dataset_args["chunks"] = True
+ else:
+ try:
+ chunks = ast.literal_eval(options.chunks)
+ except (ValueError, SyntaxError):
+ _logger.error("Invalid --chunks argument %s", options.chunks)
+ return -1
+ if not isinstance(chunks, (tuple, list)):
+ _logger.error("--chunks argument str does not evaluate to a tuple")
+ return -1
+ else:
+ nitems = numpy.prod(chunks)
+ nbytes = nitems * 8
+ if nbytes > 10**6:
+ _logger.warning("Requested chunk size might be larger than"
+ " the default 1MB chunk cache, for float64"
+ " data. This can dramatically affect I/O "
+ "performances.")
+ create_dataset_args["chunks"] = chunks
+
+ if options.compression is not None:
+ create_dataset_args["compression"] = options.compression
+
+ if options.compression_opts is not None:
+ create_dataset_args["compression_opts"] = options.compression_opts
+
+ if options.shuffle:
+ create_dataset_args["shuffle"] = True
+
+ if options.fletcher32:
+ create_dataset_args["fletcher32"] = True
+
+ with h5py.File(output_name, mode=options.mode) as h5f:
+ for input_name in options.input_files:
+ hdf5_path_for_file = hdf5_path
+ if not options.no_root_group:
+ hdf5_path_for_file = hdf5_path.rstrip("/") + "/" + os.path.basename(input_name)
+ write_to_h5(input_name, h5f,
+ h5path=hdf5_path_for_file,
+ overwrite_data=options.overwrite_data,
+ create_dataset_args=create_dataset_args,
+ min_size=options.min_size)
+
+ # append the convert command to the creator attribute, for NeXus files
+ creator = h5f[hdf5_path_for_file].attrs.get("creator", b"").decode()
+ convert_command = " ".join(argv)
+ if convert_command not in creator:
+ h5f[hdf5_path_for_file].attrs["creator"] = \
+ numpy.string_(creator + "; convert command: %s" % " ".join(argv))
+
+ return 0
diff --git a/silx/app/qtutils.py b/silx/app/qtutils.py
new file mode 100644
index 0000000..4c29c84
--- /dev/null
+++ b/silx/app/qtutils.py
@@ -0,0 +1,243 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016-2017 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.
+#
+# ############################################################################*/
+"""Qt utils for Silx applications"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "22/09/2017"
+
+import sys
+
+try:
+ # it should be loaded before h5py
+ import hdf5plugin # noqa
+except ImportError:
+ hdf5plugin = None
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
+try:
+ import fabio
+except ImportError:
+ fabio = None
+
+from silx.gui import qt
+from silx.gui import icons
+
+_LICENSE_TEMPLATE = """<p align="center">
+<b>Copyright (C) {year} European Synchrotron Radiation Facility</b>
+</p>
+
+<p align="justify">
+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:
+</p>
+
+<p align="justify">
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+</p>
+
+<p align="justify">
+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.
+</p>
+"""
+
+
+class About(qt.QDialog):
+ """
+ Util dialog to display an common about box for all the silx GUIs.
+ """
+
+ def __init__(self, parent=None):
+ """
+ :param files_: List of HDF5 or Spec files (pathes or
+ :class:`silx.io.spech5.SpecH5` or :class:`h5py.File`
+ instances)
+ """
+ super(About, self).__init__(parent)
+ self.__createLayout()
+ self.setSizePolicy(qt.QSizePolicy.Fixed, qt.QSizePolicy.Fixed)
+ self.setModal(True)
+ self.setApplicationName(None)
+
+ def __createLayout(self):
+ layout = qt.QVBoxLayout(self)
+ layout.setContentsMargins(24, 15, 24, 20)
+ layout.setSpacing(8)
+
+ self.__label = qt.QLabel(self)
+ self.__label.setWordWrap(True)
+ flags = self.__label.textInteractionFlags()
+ flags = flags | qt.Qt.TextSelectableByKeyboard
+ flags = flags | qt.Qt.TextSelectableByMouse
+ self.__label.setTextInteractionFlags(flags)
+ self.__label.setOpenExternalLinks(True)
+ self.__label.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Preferred)
+
+ licenseButton = qt.QPushButton(self)
+ licenseButton.setText("License...")
+ licenseButton.clicked.connect(self.__displayLicense)
+ licenseButton.setAutoDefault(False)
+
+ self.__options = qt.QDialogButtonBox()
+ self.__options.addButton(licenseButton, qt.QDialogButtonBox.ActionRole)
+ okButton = self.__options.addButton(qt.QDialogButtonBox.Ok)
+ okButton.setDefault(True)
+ okButton.clicked.connect(self.accept)
+
+ layout.addWidget(self.__label)
+ layout.addWidget(self.__options)
+ layout.setStretch(0, 100)
+ layout.setStretch(1, 0)
+
+ def getHtmlLicense(self):
+ """Returns the text license in HTML format.
+
+ :rtype: str
+ """
+ from silx._version import __date__ as date
+ year = date.split("/")[2]
+ info = dict(
+ year=year
+ )
+ textLicense = _LICENSE_TEMPLATE.format(**info)
+ return textLicense
+
+ def __displayLicense(self):
+ """Displays the license used by silx."""
+ text = self.getHtmlLicense()
+ licenseDialog = qt.QMessageBox(self)
+ licenseDialog.setWindowTitle("License")
+ licenseDialog.setText(text)
+ licenseDialog.exec_()
+
+ def setApplicationName(self, name):
+ self.__applicationName = name
+ if name is None:
+ self.setWindowTitle("About")
+ else:
+ self.setWindowTitle("About %s" % name)
+ self.__updateText()
+
+ @staticmethod
+ def __formatOptionalLibraries(name, isAvailable):
+ """Utils to format availability of features"""
+ if isAvailable:
+ template = '<b>%s</b> is <font color="green">installed</font>'
+ else:
+ template = '<b>%s</b> is <font color="red">not installed</font>'
+ return template % name
+
+ def __updateText(self):
+ """Update the content of the dialog according to the settings."""
+ import silx._version
+
+ message = """<table>
+ <tr><td width="50%" align="center" valign="middle">
+ <img src="{silx_image_path}" width="100" />
+ </td><td width="50%" align="center" valign="middle">
+ <b>{application_name}</b>
+ <br />
+ <br />{silx_version}
+ <br />
+ <br /><a href="{project_url}">Upstream project on GitHub</a>
+ </td></tr>
+ </table>
+ <dl>
+ <dt><b>Silx version</b></dt><dd>{silx_version}</dd>
+ <dt><b>Qt version</b></dt><dd>{qt_version}</dd>
+ <dt><b>Qt binding</b></dt><dd>{qt_binding}</dd>
+ <dt><b>Python version</b></dt><dd>{python_version}</dd>
+ <dt><b>Optional libraries</b></dt><dd>{optional_lib}</dd>
+ </dl>
+ <p>
+ Copyright (C) <a href="{esrf_url}">European Synchrotron Radiation Facility</a>
+ </p>
+ """
+ optional_lib = []
+ optional_lib.append(self.__formatOptionalLibraries("FabIO", fabio is not None))
+ optional_lib.append(self.__formatOptionalLibraries("H5py", h5py is not None))
+ optional_lib.append(self.__formatOptionalLibraries("hdf5plugin", hdf5plugin is not None))
+
+ # Access to the logo in SVG or PNG
+ logo = icons.getQFile("../logo/silx")
+
+ info = dict(
+ application_name=self.__applicationName,
+ esrf_url="http://www.esrf.eu",
+ project_url="https://github.com/silx-kit/silx",
+ silx_version=silx._version.version,
+ qt_binding=qt.BINDING,
+ qt_version=qt.qVersion(),
+ python_version=sys.version.replace("\n", "<br />"),
+ optional_lib="<br />".join(optional_lib),
+ silx_image_path=logo.fileName()
+ )
+
+ self.__label.setText(message.format(**info))
+ self.__updateSize()
+
+ def __updateSize(self):
+ """Force the size to a QMessageBox like size."""
+ screenSize = qt.QApplication.desktop().availableGeometry(qt.QCursor.pos()).size()
+ hardLimit = min(screenSize.width() - 480, 1000)
+ if screenSize.width() <= 1024:
+ hardLimit = screenSize.width()
+ softLimit = min(screenSize.width() / 2, 420)
+
+ layoutMinimumSize = self.layout().totalMinimumSize()
+ width = layoutMinimumSize.width()
+ if width > softLimit:
+ width = softLimit
+ if width > hardLimit:
+ width = hardLimit
+
+ height = layoutMinimumSize.height()
+ self.setFixedSize(width, height)
+
+ @staticmethod
+ def about(parent, applicationName):
+ """Displays a silx about box with title and text text.
+
+ :param qt.QWidget parent: The parent widget
+ :param str title: The title of the dialog
+ :param str applicationName: The content of the dialog
+ """
+ dialog = About(parent)
+ dialog.setApplicationName(applicationName)
+ dialog.exec_()
diff --git a/silx/app/test/__init__.py b/silx/app/test/__init__.py
index 54241dc..0c22386 100644
--- a/silx/app/test/__init__.py
+++ b/silx/app/test/__init__.py
@@ -26,16 +26,14 @@ __authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "30/03/2017"
-
-import logging
-import os
-import sys
import unittest
-
-_logger = logging.getLogger(__name__)
+from . import test_view
+from . import test_convert
def suite():
test_suite = unittest.TestSuite()
+ test_suite.addTest(test_view.suite())
+ test_suite.addTest(test_convert.suite())
return test_suite
diff --git a/silx/app/test/test_convert.py b/silx/app/test/test_convert.py
new file mode 100644
index 0000000..3215460
--- /dev/null
+++ b/silx/app/test/test_convert.py
@@ -0,0 +1,182 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Module testing silx.app.convert"""
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "12/09/2017"
+
+
+import os
+import sys
+import tempfile
+import unittest
+import io
+import gc
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
+import silx
+from .. import convert
+from silx.test import utils
+
+
+
+# content of a spec file
+sftext = """#F /tmp/sf.dat
+#E 1455180875
+#D Thu Feb 11 09:54:35 2016
+#C imaging User = opid17
+#O0 Pslit HGap MRTSlit UP MRTSlit DOWN
+#O1 Sslit1 VOff Sslit1 HOff Sslit1 VGap
+#o0 pshg mrtu mrtd
+#o2 ss1vo ss1ho ss1vg
+
+#J0 Seconds IA ion.mono Current
+#J1 xbpmc2 idgap1 Inorm
+
+#S 1 ascan ss1vo -4.55687 -0.556875 40 0.2
+#D Thu Feb 11 09:55:20 2016
+#T 0.2 (Seconds)
+#P0 180.005 -0.66875 0.87125
+#P1 14.74255 16.197579 12.238283
+#N 4
+#L MRTSlit UP second column 3rd_col
+-1.23 5.89 8
+8.478100E+01 5 1.56
+3.14 2.73 -3.14
+1.2 2.3 3.4
+
+#S 1 aaaaaa
+#D Thu Feb 11 10:00:32 2016
+#@MCADEV 1
+#@MCA %16C
+#@CHANN 3 0 2 1
+#@CALIB 1 2 3
+#N 3
+#L uno duo
+1 2
+@A 0 1 2
+@A 10 9 8
+3 4
+@A 3.1 4 5
+@A 7 6 5
+5 6
+@A 6 7.7 8
+@A 4 3 2
+"""
+
+
+class TestConvertCommand(unittest.TestCase):
+ """Test command line parsing"""
+
+ def testHelp(self):
+ # option -h must cause a `raise SystemExit` or a `return 0`
+ try:
+ result = convert.main(["convert", "--help"])
+ except SystemExit as e:
+ result = e.args[0]
+ self.assertEqual(result, 0)
+
+ @unittest.skipUnless(h5py is None,
+ "h5py is installed, this test is specific to h5py missing")
+ @utils.test_logging(convert._logger.name, error=1)
+ def testH5pyNotInstalled(self):
+ result = convert.main(["convert", "foo.spec", "bar.edf"])
+ # we explicitly return -1 if h5py is not imported
+ self.assertNotEqual(result, 0)
+
+ @unittest.skipIf(h5py is None, "h5py is required to test convert")
+ def testWrongOption(self):
+ # presence of a wrong option must cause a SystemExit or a return
+ # with a non-zero status
+ try:
+ result = convert.main(["convert", "--foo"])
+ except SystemExit as e:
+ result = e.args[0]
+ self.assertNotEqual(result, 0)
+
+ @unittest.skipIf(h5py is None, "h5py is required to test convert")
+ @utils.test_logging(convert._logger.name, error=3)
+ # one error log per missing file + one "Aborted" error log
+ def testWrongFiles(self):
+ result = convert.main(["convert", "foo.spec", "bar.edf"])
+ self.assertNotEqual(result, 0)
+
+ @unittest.skipIf(h5py is None, "h5py is required to test convert")
+ def testFile(self):
+ # create a writable temp directory
+ tempdir = tempfile.mkdtemp()
+
+ # write a temporary SPEC file
+ specname = os.path.join(tempdir, "input.dat")
+ with io.open(specname, "wb") as fd:
+ if sys.version < '3.0':
+ fd.write(sftext)
+ else:
+ fd.write(bytes(sftext, 'ascii'))
+
+ # convert it
+ h5name = os.path.join(tempdir, "output.h5")
+ command_list = ["convert", "-m", "w",
+ "--no-root-group", specname, "-o", h5name]
+ result = convert.main(command_list)
+
+ self.assertEqual(result, 0)
+ self.assertTrue(os.path.isfile(h5name))
+
+ with h5py.File(h5name, "r") as h5f:
+ title12 = h5f["/1.2/title"][()]
+ if sys.version > '3.0':
+ title12 = title12.decode()
+ self.assertEqual(title12,
+ "1 aaaaaa")
+
+ creator = h5f.attrs.get("creator")
+ self.assertIsNotNone(creator, "No creator attribute in NXroot group")
+ creator = creator.decode() # make sure we can compare creator with native string
+ self.assertTrue(creator.startswith("silx %s" % silx.version))
+ command = " ".join(command_list)
+ self.assertTrue(creator.endswith(command))
+
+ # delete input file
+ gc.collect() # necessary to free spec file on Windows
+ os.unlink(specname)
+ os.unlink(h5name)
+ os.rmdir(tempdir)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loader = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loader(TestConvertCommand))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/app/test/test_view.py b/silx/app/test/test_view.py
index 774bc01..e55e4f3 100644
--- a/silx/app/test/test_view.py
+++ b/silx/app/test/test_view.py
@@ -26,13 +26,29 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "12/04/2017"
+__date__ = "29/09/2017"
import unittest
-from silx.gui.test.utils import TestCaseQt
-from .. import view
import sys
+import os
+
+
+# TODO: factor this code with silx.gui.test
+with_qt = False
+if sys.platform.startswith('linux') and not os.environ.get('DISPLAY', ''):
+ reason = 'test disabled (DISPLAY env. variable not set)'
+ view = None
+ TestCaseQt = unittest.TestCase
+elif os.environ.get('WITH_QT_TEST', 'True') == 'False':
+ reason = "test disabled (env. variable WITH_QT_TEST=False)"
+ view = None
+ TestCaseQt = unittest.TestCase
+else:
+ from silx.gui.test.utils import TestCaseQt
+ from .. import view
+ with_qt = True
+ reason = ""
class QApplicationMock(object):
@@ -64,6 +80,7 @@ class ViewerMock(object):
pass
+@unittest.skipUnless(with_qt, "Qt binding required for TestLauncher")
class TestLauncher(unittest.TestCase):
"""Test command line parsing"""
@@ -83,9 +100,9 @@ class TestLauncher(unittest.TestCase):
super(TestLauncher, cls).tearDownClass()
def testHelp(self):
+ # option -h must cause a raise SystemExit or a return 0
try:
result = view.main(["view", "--help"])
- self.assertNotEqual(result, 0)
except SystemExit as e:
result = e.args[0]
self.assertEqual(result, 0)
@@ -93,7 +110,6 @@ class TestLauncher(unittest.TestCase):
def testWrongOption(self):
try:
result = view.main(["view", "--foo"])
- self.assertNotEqual(result, 0)
except SystemExit as e:
result = e.args[0]
self.assertNotEqual(result, 0)
@@ -101,10 +117,9 @@ class TestLauncher(unittest.TestCase):
def testWrongFile(self):
try:
result = view.main(["view", "__file.not.found__"])
- self.assertNotEqual(result, 0)
except SystemExit as e:
result = e.args[0]
- self.assertNotEqual(result, 0)
+ self.assertEqual(result, 0)
def testFile(self):
# sys.executable is an existing readable file
@@ -118,8 +133,10 @@ class TestLauncher(unittest.TestCase):
class TestViewer(TestCaseQt):
"""Test for Viewer class"""
+ @unittest.skipUnless(with_qt, reason)
def testConstruct(self):
- widget = view.Viewer()
+ if view is not None:
+ widget = view.Viewer()
self.qWaitForWindowExposed(widget)
diff --git a/silx/app/test_.py b/silx/app/test_.py
new file mode 100644
index 0000000..7f95085
--- /dev/null
+++ b/silx/app/test_.py
@@ -0,0 +1,175 @@
+# 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.
+#
+# ############################################################################*/
+"""Launch unittests of the library"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "04/08/2017"
+
+import sys
+import os
+import argparse
+import logging
+import unittest
+
+
+class StreamHandlerUnittestReady(logging.StreamHandler):
+ """The unittest class TestResult redefine sys.stdout/err to capture
+ stdout/err from tests and to display them only when a test fail.
+
+ This class allow to use unittest stdout-capture by using the last sys.stdout
+ and not a cached one.
+ """
+
+ def emit(self, record):
+ """
+ :type record: logging.LogRecord
+ """
+ self.stream = sys.stderr
+ super(StreamHandlerUnittestReady, self).emit(record)
+
+ def flush(self):
+ pass
+
+
+def createBasicHandler():
+ """Create the handler using the basic configuration"""
+ hdlr = StreamHandlerUnittestReady()
+ fs = logging.BASIC_FORMAT
+ dfs = None
+ fmt = logging.Formatter(fs, dfs)
+ hdlr.setFormatter(fmt)
+ return hdlr
+
+
+# Use an handler compatible with unittests, else use_buffer is not working
+for h in logging.root.handlers:
+ logging.root.removeHandler(h)
+logging.root.addHandler(createBasicHandler())
+logging.captureWarnings(True)
+
+_logger = logging.getLogger(__name__)
+"""Module logger"""
+
+
+class TextTestResultWithSkipList(unittest.TextTestResult):
+ """Override default TextTestResult to display list of skipped tests at the
+ end
+ """
+
+ def printErrors(self):
+ unittest.TextTestResult.printErrors(self)
+ # Print skipped tests at the end
+ self.printErrorList("SKIPPED", self.skipped)
+
+
+def main(argv):
+ """
+ Main function to launch the unittests as an application
+
+ :param argv: Command line arguments
+ :returns: exit status
+ """
+ parser = argparse.ArgumentParser(description=__doc__)
+ 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("-x", "--no-gui", dest="gui", default=True,
+ action="store_false",
+ help="Disable the test of the graphical use interface")
+ parser.add_argument("-g", "--no-opengl", dest="opengl", default=True,
+ action="store_false",
+ help="Disable tests using OpenGL")
+ parser.add_argument("-o", "--no-opencl", dest="opencl", default=True,
+ action="store_false",
+ help="Disable the test of the OpenCL part")
+ parser.add_argument("-l", "--low-mem", dest="low_mem", default=False,
+ action="store_true",
+ help="Disable test with large memory consumption (>100Mbyte")
+ parser.add_argument("--qt-binding", dest="qt_binding", default=None,
+ help="Force using a Qt binding, from 'PyQt4', 'PyQt5', or 'PySide'")
+
+ options = parser.parse_args(argv[1:])
+
+ test_verbosity = 1
+ use_buffer = True
+ if options.verbose == 1:
+ logging.root.setLevel(logging.INFO)
+ _logger.info("Set log level: INFO")
+ test_verbosity = 2
+ use_buffer = False
+ elif options.verbose > 1:
+ logging.root.setLevel(logging.DEBUG)
+ _logger.info("Set log level: DEBUG")
+ test_verbosity = 2
+ use_buffer = False
+
+ if not options.gui:
+ os.environ["WITH_QT_TEST"] = "False"
+
+ if not options.opencl:
+ os.environ["SILX_OPENCL"] = "False"
+
+ if not options.opengl:
+ os.environ["WITH_GL_TEST"] = "False"
+
+ if options.low_mem:
+ os.environ["SILX_TEST_LOW_MEM"] = "True"
+
+ if options.qt_binding:
+ binding = options.qt_binding.lower()
+ if binding == "pyqt4":
+ _logger.info("Force using PyQt4")
+ import PyQt4.QtCore # noqa
+ elif binding == "pyqt5":
+ _logger.info("Force using PyQt5")
+ import PyQt5.QtCore # noqa
+ elif binding == "pyside":
+ _logger.info("Force using PySide")
+ import PySide.QtCore # noqa
+ else:
+ raise ValueError("Qt binding '%s' is unknown" % options.qt_binding)
+
+ # Run the tests
+ runnerArgs = {}
+ runnerArgs["verbosity"] = test_verbosity
+ runnerArgs["buffer"] = use_buffer
+ runner = unittest.TextTestRunner(**runnerArgs)
+ runner.resultclass = TextTestResultWithSkipList
+
+ # Display the result when using CTRL-C
+ unittest.installHandler()
+
+ import silx.test
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(silx.test.suite())
+ result = runner.run(test_suite)
+
+ if result.wasSuccessful():
+ exit_status = 0
+ else:
+ exit_status = 1
+ return exit_status
diff --git a/silx/app/view.py b/silx/app/view.py
index 8fdabde..e8507f4 100644
--- a/silx/app/view.py
+++ b/silx/app/view.py
@@ -1,6 +1,6 @@
# coding: utf-8
# /*##########################################################################
-# Copyright (C) 2016 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2017 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
@@ -25,7 +25,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "12/04/2017"
+__date__ = "02/10/2017"
import sys
import os
@@ -33,30 +33,10 @@ import argparse
import logging
import collections
-
-logging.basicConfig()
_logger = logging.getLogger(__name__)
"""Module logger"""
-try:
- # it should be loaded before h5py
- import hdf5plugin # noqa
-except ImportError:
- hdf5plugin = None
-
-try:
- import h5py
- import silx.gui.hdf5
-except ImportError:
- h5py = None
-
-try:
- import fabio
-except ImportError:
- fabio = None
-
from silx.gui import qt
-from silx.gui.data.DataViewerFrame import DataViewerFrame
class Viewer(qt.QMainWindow):
@@ -71,6 +51,10 @@ class Viewer(qt.QMainWindow):
:class:`silx.io.spech5.SpecH5` or :class:`h5py.File`
instances)
"""
+ # Import it here to be sure to use the right logging level
+ import silx.gui.hdf5
+ from silx.gui.data.DataViewerFrame import DataViewerFrame
+
qt.QMainWindow.__init__(self)
self.setWindowTitle("Silx viewer")
@@ -97,14 +81,15 @@ class Viewer(qt.QMainWindow):
self.setCentralWidget(main_panel)
- self.__treeview.selectionModel().selectionChanged.connect(self.displayData)
+ model = self.__treeview.selectionModel()
+ model.selectionChanged.connect(self.displayData)
+ self.__treeview.addContextMenuCallback(self.closeAndSyncCustomContextMenu)
- self.__treeview.addContextMenuCallback(self.customContextMenu)
- # lambda function will never be called cause we store it as weakref
- self.__treeview.addContextMenuCallback(lambda event: None)
- # you have to store it first
- self.__store_lambda = lambda event: self.closeAndSyncCustomContextMenu(event)
- self.__treeview.addContextMenuCallback(self.__store_lambda)
+ treeModel = self.__treeview.findHdf5TreeModel()
+ columns = list(treeModel.COLUMN_IDS)
+ columns.remove(treeModel.DESCRIPTION_COLUMN)
+ columns.remove(treeModel.NODE_COLUMN)
+ self.__treeview.header().setSections(columns)
self.createActions()
self.createMenus()
@@ -159,15 +144,17 @@ class Viewer(qt.QMainWindow):
extensions = collections.OrderedDict()
# expect h5py
- extensions["HDF5 files"] = "*.h5"
+ extensions["HDF5 files"] = "*.h5 *.hdf"
+ extensions["NeXus files"] = "*.nx *.nxs *.h5 *.hdf"
# no dependancy
- extensions["Spec files"] = "*.dat *.spec *.mca"
+ extensions["NeXus layout from spec files"] = "*.dat *.spec *.mca"
+ extensions["Numpy binary files"] = "*.npz *.npy"
# expect fabio
- extensions["EDF files"] = "*.edf"
- extensions["TIFF image files"] = "*.tif *.tiff"
- extensions["NumPy binary files"] = "*.npy"
- extensions["CBF files"] = "*.cbf"
- extensions["MarCCD image files"] = "*.mccd"
+ extensions["NeXus layout from raster images"] = "*.edf *.tif *.tiff *.cbf *.mccd"
+ extensions["NeXus layout from EDF files"] = "*.edf"
+ extensions["NeXus layout from TIFF image files"] = "*.tif *.tiff"
+ extensions["NeXus layout from CBF files"] = "*.cbf"
+ extensions["NeXus layout from MarCCD image files"] = "*.mccd"
filters = []
filters.append("All supported files (%s)" % " ".join(extensions.values()))
@@ -180,48 +167,8 @@ class Viewer(qt.QMainWindow):
return dialog
def about(self):
- import silx._version
- message = """<p align="center"><b>Silx viewer</b>
- <br />
- <br />{silx_version}
- <br />
- <br /><a href="{project_url}">Upstream project on GitHub</a>
- </p>
- <p align="left">
- <dl>
- <dt><b>Silx version</b></dt><dd>{silx_version}</dd>
- <dt><b>Qt version</b></dt><dd>{qt_version}</dd>
- <dt><b>Qt binding</b></dt><dd>{qt_binding}</dd>
- <dt><b>Python version</b></dt><dd>{python_version}</dd>
- <dt><b>Optional libraries</b></dt><dd>{optional_lib}</dd>
- </dl>
- </p>
- <p>
- Copyright (C) <a href="{esrf_url}">European Synchrotron Radiation Facility</a>
- </p>
- """
- def format_optional_lib(name, isAvailable):
- if isAvailable:
- template = '<b>%s</b> is <font color="green">installed</font>'
- else:
- template = '<b>%s</b> is <font color="red">not installed</font>'
- return template % name
-
- optional_lib = []
- optional_lib.append(format_optional_lib("FabIO", fabio is not None))
- optional_lib.append(format_optional_lib("H5py", h5py is not None))
- optional_lib.append(format_optional_lib("hdf5plugin", hdf5plugin is not None))
-
- info = dict(
- esrf_url="http://www.esrf.eu",
- project_url="https://github.com/silx-kit/silx",
- silx_version=silx._version.version,
- qt_binding=qt.BINDING,
- qt_version=qt.qVersion(),
- python_version=sys.version.replace("\n", "<br />"),
- optional_lib="<br />".join(optional_lib)
- )
- qt.QMessageBox.about(self, "About Menu", message.format(**info))
+ from . import qtutils
+ qtutils.About.about(self, "Silx viewer")
def appendFile(self, filename):
self.__treeview.findHdf5TreeModel().appendFile(filename)
@@ -229,7 +176,7 @@ class Viewer(qt.QMainWindow):
def displayData(self):
"""Called to update the dataviewer with the selected data.
"""
- selected = list(self.__treeview.selectedH5Nodes())
+ selected = list(self.__treeview.selectedH5Nodes(ignoreBrokenLinks=False))
if len(selected) == 1:
# Update the viewer for a single selection
data = selected[0]
@@ -238,40 +185,20 @@ class Viewer(qt.QMainWindow):
def useAsyncLoad(self, useAsync):
self.__asyncload = useAsync
- def customContextMenu(self, event):
- """Called to populate the context menu
-
- :param silx.gui.hdf5.Hdf5ContextMenuEvent event: Event
- containing expected information to populate the context menu
- """
- selectedObjects = event.source().selectedH5Nodes()
- menu = event.menu()
-
- hasDataset = False
- for obj in selectedObjects:
- if obj.ntype is h5py.Dataset:
- hasDataset = True
- break
-
- if len(menu.children()):
- menu.addSeparator()
-
- if hasDataset:
- action = qt.QAction("Do something on the datasets", event.source())
- menu.addAction(action)
-
def closeAndSyncCustomContextMenu(self, event):
"""Called to populate the context menu
:param silx.gui.hdf5.Hdf5ContextMenuEvent event: Event
containing expected information to populate the context menu
"""
- selectedObjects = event.source().selectedH5Nodes()
+ selectedObjects = event.source().selectedH5Nodes(ignoreBrokenLinks=False)
menu = event.menu()
if len(menu.children()):
menu.addSeparator()
+ # Import it here to be sure to use the right logging level
+ import h5py
for obj in selectedObjects:
if obj.ntype is h5py.File:
action = qt.QAction("Remove %s" % obj.local_filename, event.source())
@@ -292,12 +219,43 @@ def main(argv):
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
'files',
- type=argparse.FileType('rb'),
nargs=argparse.ZERO_OR_MORE,
help='Data file to show (h5 file, edf files, spec files)')
+ parser.add_argument(
+ '--debug',
+ dest="debug",
+ action="store_true",
+ default=False,
+ help='Set logging system in debug mode')
+ parser.add_argument(
+ '--use-opengl-plot',
+ dest="use_opengl_plot",
+ action="store_true",
+ default=False,
+ help='Use OpenGL for plots (instead of matplotlib)')
options = parser.parse_args(argv[1:])
+ if options.debug:
+ logging.root.setLevel(logging.DEBUG)
+
+ #
+ # Import most of the things here to be sure to use the right logging level
+ #
+
+ try:
+ # it should be loaded before h5py
+ import hdf5plugin # noqa
+ except ImportError:
+ _logger.debug("Backtrace", exc_info=True)
+ hdf5plugin = None
+
+ try:
+ import h5py
+ except ImportError:
+ _logger.debug("Backtrace", exc_info=True)
+ h5py = None
+
if h5py is None:
message = "Module 'h5py' is not installed but is mandatory."\
+ " You can install it using \"pip install h5py\"."
@@ -309,15 +267,27 @@ def main(argv):
+ " compressions. You can install it using \"pip install hdf5plugin\"."
_logger.warning(message)
+ #
+ # Run the application
+ #
+
+ if options.use_opengl_plot:
+ from silx.gui.plot import PlotWidget
+ PlotWidget.setDefaultBackend("opengl")
+
app = qt.QApplication([])
+ qt.QLocale.setDefault(qt.QLocale.c())
+
sys.excepthook = qt.exceptionHandler
window = Viewer()
window.resize(qt.QSize(640, 480))
- for f in options.files:
- filename = f.name
- f.close()
- window.appendFile(filename)
+ for filename in options.files:
+ try:
+ window.appendFile(filename)
+ except IOError as e:
+ _logger.error(e.args[0])
+ _logger.debug("Backtrace", exc_info=True)
window.show()
result = app.exec_()
diff --git a/silx/gui/_glutils/FramebufferTexture.py b/silx/gui/_glutils/FramebufferTexture.py
index b01eb41..cc05080 100644
--- a/silx/gui/_glutils/FramebufferTexture.py
+++ b/silx/gui/_glutils/FramebufferTexture.py
@@ -66,49 +66,48 @@ class FramebufferTexture(object):
self._previousFramebuffer = 0 # Used by with statement
self._name = gl.glGenFramebuffers(1)
- gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self._name)
-
- # Attachments
- gl.glFramebufferTexture2D(gl.GL_FRAMEBUFFER,
- gl.GL_COLOR_ATTACHMENT0,
- gl.GL_TEXTURE_2D,
- self._texture.name,
- 0)
-
- height, width = self._texture.shape
-
- if stencilFormat is not None:
- self._stencilId = gl.glGenRenderbuffers(1)
- gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, self._stencilId)
- gl.glRenderbufferStorage(gl.GL_RENDERBUFFER,
- stencilFormat,
- width, height)
- gl.glFramebufferRenderbuffer(gl.GL_FRAMEBUFFER,
- gl.GL_STENCIL_ATTACHMENT,
- gl.GL_RENDERBUFFER,
- self._stencilId)
- else:
- self._stencilId = None
- if depthFormat is not None:
- if self._stencilId and depthFormat in self._PACKED_FORMAT:
- self._depthId = self._stencilId
- else:
- self._depthId = gl.glGenRenderbuffers(1)
- gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, self._depthId)
+ with self: # Bind FBO
+ # Attachments
+ gl.glFramebufferTexture2D(gl.GL_FRAMEBUFFER,
+ gl.GL_COLOR_ATTACHMENT0,
+ gl.GL_TEXTURE_2D,
+ self._texture.name,
+ 0)
+
+ height, width = self._texture.shape
+
+ if stencilFormat is not None:
+ self._stencilId = gl.glGenRenderbuffers(1)
+ gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, self._stencilId)
gl.glRenderbufferStorage(gl.GL_RENDERBUFFER,
- depthFormat,
+ stencilFormat,
width, height)
- gl.glFramebufferRenderbuffer(gl.GL_FRAMEBUFFER,
- gl.GL_DEPTH_ATTACHMENT,
- gl.GL_RENDERBUFFER,
- self._depthId)
- else:
- self._depthId = None
+ gl.glFramebufferRenderbuffer(gl.GL_FRAMEBUFFER,
+ gl.GL_STENCIL_ATTACHMENT,
+ gl.GL_RENDERBUFFER,
+ self._stencilId)
+ else:
+ self._stencilId = None
+
+ if depthFormat is not None:
+ if self._stencilId and depthFormat in self._PACKED_FORMAT:
+ self._depthId = self._stencilId
+ else:
+ self._depthId = gl.glGenRenderbuffers(1)
+ gl.glBindRenderbuffer(gl.GL_RENDERBUFFER, self._depthId)
+ gl.glRenderbufferStorage(gl.GL_RENDERBUFFER,
+ depthFormat,
+ width, height)
+ gl.glFramebufferRenderbuffer(gl.GL_FRAMEBUFFER,
+ gl.GL_DEPTH_ATTACHMENT,
+ gl.GL_RENDERBUFFER,
+ self._depthId)
+ else:
+ self._depthId = None
- assert gl.glCheckFramebufferStatus(gl.GL_FRAMEBUFFER) == \
- gl.GL_FRAMEBUFFER_COMPLETE
- gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0)
+ assert (gl.glCheckFramebufferStatus(gl.GL_FRAMEBUFFER) ==
+ gl.GL_FRAMEBUFFER_COMPLETE)
@property
def shape(self):
@@ -143,6 +142,7 @@ class FramebufferTexture(object):
def __exit__(self, exctype, excvalue, traceback):
gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self._previousFramebuffer)
+ self._previousFramebuffer = None
def discard(self):
"""Delete associated OpenGL resources including texture"""
diff --git a/silx/gui/_glutils/OpenGLWidget.py b/silx/gui/_glutils/OpenGLWidget.py
new file mode 100644
index 0000000..6cbf8f0
--- /dev/null
+++ b/silx/gui/_glutils/OpenGLWidget.py
@@ -0,0 +1,409 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This package provides a compatibility layer for OpenGL widget.
+
+It provides a compatibility layer for Qt OpenGL widget used in silx
+across Qt<=5.3 QtOpenGL.QGLWidget and QOpenGLWidget.
+"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "26/07/2017"
+
+
+import logging
+import sys
+
+from .. import qt
+from .._glutils import gl
+
+
+_logger = logging.getLogger(__name__)
+
+
+# Probe OpenGL availability and widget
+ERROR = '' # Error message from probing Qt OpenGL support
+_BaseOpenGLWidget = None # Qt OpenGL widget to use
+
+if hasattr(qt, 'QOpenGLWidget'): # PyQt>=5.4
+ _logger.info('Using QOpenGLWidget')
+ _BaseOpenGLWidget = qt.QOpenGLWidget
+
+elif not qt.HAS_OPENGL: # QtOpenGL not installed
+ ERROR = '%s.QtOpenGL not available' % qt.BINDING
+
+elif qt.QApplication.instance() and not qt.QGLFormat.hasOpenGL():
+ # qt.QGLFormat.hasOpenGL MUST be called with a QApplication created
+ # so this is only checked if the QApplication is already created
+ ERROR = 'Qt reports OpenGL not available'
+
+else:
+ _logger.info('Using QGLWidget')
+ _BaseOpenGLWidget = qt.QGLWidget
+
+
+# Internal class wrapping Qt OpenGL widget
+if _BaseOpenGLWidget is None:
+ _logger.error('OpenGL-based widget disabled: %s', ERROR)
+ _OpenGLWidget = None
+
+else:
+ class _OpenGLWidget(_BaseOpenGLWidget):
+ """Wrapper over QOpenGLWidget and QGLWidget"""
+
+ sigOpenGLContextError = qt.Signal(str)
+ """Signal emitted when an OpenGL context error is detected at runtime.
+
+ It provides the error reason as a str.
+ """
+
+ def __init__(self, parent,
+ alphaBufferSize=0,
+ depthBufferSize=24,
+ stencilBufferSize=8,
+ version=(2, 0),
+ f=qt.Qt.WindowFlags()):
+ # True if using QGLWidget, False if using QOpenGLWidget
+ self.__legacy = not hasattr(qt, 'QOpenGLWidget')
+
+ self.__devicePixelRatio = 1.0
+ self.__requestedOpenGLVersion = int(version[0]), int(version[1])
+ self.__isValid = False
+
+ if self.__legacy: # QGLWidget
+ format_ = qt.QGLFormat()
+ format_.setAlphaBufferSize(alphaBufferSize)
+ format_.setAlpha(alphaBufferSize != 0)
+ format_.setDepthBufferSize(depthBufferSize)
+ format_.setDepth(depthBufferSize != 0)
+ format_.setStencilBufferSize(stencilBufferSize)
+ format_.setStencil(stencilBufferSize != 0)
+ format_.setVersion(*self.__requestedOpenGLVersion)
+ format_.setDoubleBuffer(True)
+
+ super(_OpenGLWidget, self).__init__(format_, parent, None, f)
+
+ else: # QOpenGLWidget
+ super(_OpenGLWidget, self).__init__(parent, f)
+
+ format_ = qt.QSurfaceFormat()
+ format_.setAlphaBufferSize(alphaBufferSize)
+ format_.setDepthBufferSize(depthBufferSize)
+ format_.setStencilBufferSize(stencilBufferSize)
+ format_.setVersion(*self.__requestedOpenGLVersion)
+ format_.setSwapBehavior(qt.QSurfaceFormat.DoubleBuffer)
+ self.setFormat(format_)
+
+
+ def getDevicePixelRatio(self):
+ """Returns the ratio device-independent / device pixel size
+
+ It should be either 1.0 or 2.0.
+
+ :return: Scale factor between screen and Qt units
+ :rtype: float
+ """
+ return self.__devicePixelRatio
+
+ def getRequestedOpenGLVersion(self):
+ """Returns the requested OpenGL version.
+
+ :return: (major, minor)
+ :rtype: 2-tuple of int"""
+ return self.__requestedOpenGLVersion
+
+ def getOpenGLVersion(self):
+ """Returns the available OpenGL version.
+
+ :return: (major, minor)
+ :rtype: 2-tuple of int"""
+ if self.__legacy: # QGLWidget
+ supportedVersion = 0, 0
+
+ # Go through all OpenGL version flags checking support
+ flags = self.format().openGLVersionFlags()
+ for version in ((1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
+ (2, 0), (2, 1),
+ (3, 0), (3, 1), (3, 2), (3, 3),
+ (4, 0)):
+ versionFlag = getattr(qt.QGLFormat,
+ 'OpenGL_Version_%d_%d' % version)
+ if not versionFlag & flags:
+ break
+ supportedVersion = version
+ return supportedVersion
+
+ else: # QOpenGLWidget
+ return self.format().version()
+
+ # QOpenGLWidget methods
+
+ def isValid(self):
+ """Returns True if OpenGL is available.
+
+ This adds extra checks to Qt isValid method.
+
+ :rtype: bool
+ """
+ return self.__isValid and super(_OpenGLWidget, self).isValid()
+
+ def defaultFramebufferObject(self):
+ """Returns the framebuffer object handle.
+
+ See :meth:`QOpenGLWidget.defaultFramebufferObject`
+ """
+ if self.__legacy: # QGLWidget
+ return 0
+ else: # QOpenGLWidget
+ return super(_OpenGLWidget, self).defaultFramebufferObject()
+
+ # *GL overridden methods
+
+ def initializeGL(self):
+ parent = self.parent()
+ if parent is None:
+ _logger.error('_OpenGLWidget has no parent')
+ return
+
+ # Check OpenGL version
+ if self.getOpenGLVersion() >= self.getRequestedOpenGLVersion():
+ version = gl.glGetString(gl.GL_VERSION)
+ if version:
+ self.__isValid = True
+ else:
+ errMsg = 'OpenGL not available'
+ if sys.platform.startswith('linux'):
+ errMsg += ': If connected remotely, ' \
+ 'GLX forwarding might be disabled.'
+ _logger.error(errMsg)
+ self.sigOpenGLContextError.emit(errMsg)
+ self.__isValid = False
+
+ else:
+ errMsg = 'OpenGL %d.%d not available' % \
+ self.getRequestedOpenGLVersion()
+ _logger.error('OpenGL widget disabled: %s', errMsg)
+ self.sigOpenGLContextError.emit(errMsg)
+ self.__isValid = False
+
+ if self.isValid():
+ parent.initializeGL()
+
+ def paintGL(self):
+ parent = self.parent()
+ if parent is None:
+ _logger.error('_OpenGLWidget has no parent')
+ return
+
+ if qt.BINDING == 'PyQt5':
+ devicePixelRatio = self.window().windowHandle().devicePixelRatio()
+
+ if devicePixelRatio != self.getDevicePixelRatio():
+ # Update devicePixelRatio and call resizeOpenGL
+ # as resizeGL is not always called.
+ self.__devicePixelRatio = devicePixelRatio
+ self.makeCurrent()
+ parent.resizeGL(self.width(), self.height())
+
+ if self.isValid():
+ parent.paintGL()
+
+ def resizeGL(self, width, height):
+ parent = self.parent()
+ if parent is None:
+ _logger.error('_OpenGLWidget has no parent')
+ return
+
+ if self.isValid():
+ # Call parent resizeGL with device-independent pixel unit
+ # This works over both QGLWidget and QOpenGLWidget
+ parent.resizeGL(self.width(), self.height())
+
+
+class OpenGLWidget(qt.QWidget):
+ """OpenGL widget wrapper over QGLWidget and QOpenGLWidget
+
+ This wrapper API implements a subset of QOpenGLWidget API.
+ The constructor takes a different set of arguments.
+ Methods returning object like :meth:`context` returns either
+ QGL* or QOpenGL* objects.
+
+ :param parent: Parent widget see :class:`QWidget`
+ :param int alphaBufferSize:
+ Size in bits of the alpha channel (default: 0).
+ Set to 0 to disable alpha channel.
+ :param int depthBufferSize:
+ Size in bits of the depth buffer (default: 24).
+ Set to 0 to disable depth buffer.
+ :param int stencilBufferSize:
+ Size in bits of the stencil buffer (default: 8).
+ Set to 0 to disable stencil buffer
+ :param version: Requested OpenGL version (default: (2, 0)).
+ :type version: 2-tuple of int
+ :param f: see :class:`QWidget`
+ """
+
+ def __init__(self, parent=None,
+ alphaBufferSize=0,
+ depthBufferSize=24,
+ stencilBufferSize=8,
+ version=(2, 0),
+ f=qt.Qt.WindowFlags()):
+ super(OpenGLWidget, self).__init__(parent, f)
+
+ layout = qt.QHBoxLayout(self)
+ layout.setContentsMargins(0, 0, 0, 0)
+ self.setLayout(layout)
+
+ if _OpenGLWidget is None:
+ self.__openGLWidget = None
+ label = self._createErrorQLabel(ERROR)
+ self.layout().addWidget(label)
+
+ else:
+ self.__openGLWidget = _OpenGLWidget(
+ parent=self,
+ alphaBufferSize=alphaBufferSize,
+ depthBufferSize=depthBufferSize,
+ stencilBufferSize=stencilBufferSize,
+ version=version,
+ f=f)
+ # Async connection need, otherwise issue when hiding OpenGL
+ # widget while doing the rendering..
+ self.__openGLWidget.sigOpenGLContextError.connect(
+ self._handleOpenGLInitError, qt.Qt.QueuedConnection)
+ self.layout().addWidget(self.__openGLWidget)
+
+ @staticmethod
+ def _createErrorQLabel(error):
+ """Create QLabel displaying error message in place of OpenGL widget
+
+ :param str error: The error message to display"""
+ label = qt.QLabel()
+ label.setText('OpenGL-based widget disabled:\n%s' % error)
+ label.setAlignment(qt.Qt.AlignCenter)
+ label.setWordWrap(True)
+ return label
+
+ def _handleOpenGLInitError(self, error):
+ """Handle runtime errors in OpenGL widget"""
+ if self.__openGLWidget is not None:
+ self.__openGLWidget.setVisible(False)
+ self.__openGLWidget.setParent(None)
+ self.__openGLWidget = None
+
+ label = self._createErrorQLabel(error)
+ self.layout().addWidget(label)
+
+ # Additional API
+
+ def getDevicePixelRatio(self):
+ """Returns the ratio device-independent / device pixel size
+
+ It should be either 1.0 or 2.0.
+
+ :return: Scale factor between screen and Qt units
+ :rtype: float
+ """
+ if self.__openGLWidget is None:
+ return 1.
+ else:
+ return self.__openGLWidget.getDevicePixelRatio()
+
+ def getOpenGLVersion(self):
+ """Returns the available OpenGL version.
+
+ :return: (major, minor)
+ :rtype: 2-tuple of int"""
+ if self.__openGLWidget is None:
+ return 0, 0
+ else:
+ return self.__openGLWidget.getOpenGLVersion()
+
+ # QOpenGLWidget API
+
+ def isValid(self):
+ """Returns True if OpenGL with the requested version is available.
+
+ :rtype: bool
+ """
+ if self.__openGLWidget is None:
+ return False
+ else:
+ return self.__openGLWidget.isValid()
+
+ def context(self):
+ """Return Qt OpenGL context object or None.
+
+ See :meth:`QOpenGLWidget.context` and :meth:`QGLWidget.context`
+ """
+ if self.__openGLWidget is None:
+ return None
+ else:
+ return self.__openGLWidget.context()
+
+ def defaultFramebufferObject(self):
+ """Returns the framebuffer object handle.
+
+ See :meth:`QOpenGLWidget.defaultFramebufferObject`
+ """
+ if self.__openGLWidget is None:
+ return 0
+ else:
+ return self.__openGLWidget.defaultFramebufferObject()
+
+ def makeCurrent(self):
+ """Make the underlying OpenGL widget's context current.
+
+ See :meth:`QOpenGLWidget.makeCurrent`
+ """
+ if self.__openGLWidget is not None:
+ self.__openGLWidget.makeCurrent()
+
+ def update(self):
+ """Async update of the OpenGL widget.
+
+ See :meth:`QOpenGLWidget.update`
+ """
+ if self.__openGLWidget is not None:
+ self.__openGLWidget.update()
+
+ # QOpenGLWidget API to override
+
+ def initializeGL(self):
+ """Override to implement OpenGL initialization."""
+ pass
+
+ def paintGL(self):
+ """Override to implement OpenGL rendering."""
+ pass
+
+ def resizeGL(self, width, height):
+ """Override to implement resize of OpenGL framebuffer.
+
+ :param int width: Width in device-independent pixels
+ :param int height: Height in device-independent pixels
+ """
+ pass
diff --git a/silx/gui/_glutils/VertexBuffer.py b/silx/gui/_glutils/VertexBuffer.py
index 689b543..b74b748 100644
--- a/silx/gui/_glutils/VertexBuffer.py
+++ b/silx/gui/_glutils/VertexBuffer.py
@@ -180,7 +180,7 @@ class VertexBufferAttrib(object):
dimension=1,
offset=0,
stride=0,
- normalisation=False):
+ normalization=False):
self.vbo = vbo
assert type_ in self._GL_TYPES
self.type_ = type_
@@ -189,7 +189,7 @@ class VertexBufferAttrib(object):
self.dimension = dimension
self.offset = offset
self.stride = stride
- self.normalisation = bool(normalisation)
+ self.normalization = bool(normalization)
@property
def itemsize(self):
@@ -200,12 +200,12 @@ class VertexBufferAttrib(object):
def setVertexAttrib(self, attribute):
"""Call glVertexAttribPointer with objects information"""
- normalisation = gl.GL_TRUE if self.normalisation else gl.GL_FALSE
+ normalization = gl.GL_TRUE if self.normalization else gl.GL_FALSE
with self.vbo:
gl.glVertexAttribPointer(attribute,
self.dimension,
self.type_,
- normalisation,
+ normalization,
self.stride,
c_void_p(self.offset))
@@ -216,7 +216,7 @@ class VertexBufferAttrib(object):
self.dimension,
self.offset,
self.stride,
- self.normalisation)
+ self.normalization)
def vertexBuffer(arrays, prefix=None, suffix=None, usage=None):
diff --git a/silx/gui/_glutils/__init__.py b/silx/gui/_glutils/__init__.py
index e86a58f..15e48e1 100644
--- a/silx/gui/_glutils/__init__.py
+++ b/silx/gui/_glutils/__init__.py
@@ -33,6 +33,7 @@ __date__ = "25/07/2016"
# OpenGL convenient functions
+from .OpenGLWidget import OpenGLWidget # noqa
from .Context import getGLContext, setGLContextGetter # noqa
from .FramebufferTexture import FramebufferTexture # noqa
from .Program import Program # noqa
diff --git a/silx/gui/_glutils/font.py b/silx/gui/_glutils/font.py
index 566ae49..2be2c04 100644
--- a/silx/gui/_glutils/font.py
+++ b/silx/gui/_glutils/font.py
@@ -98,27 +98,39 @@ def rasterText(text, font,
_logger.info("Trying to raster empty text, replaced by white space")
text = ' ' # Replace empty text by white space to produce an image
+ if (devicePixelRatio != 1.0 and
+ not hasattr(qt.QImage, 'setDevicePixelRatio')): # Qt 4
+ _logger.error('devicePixelRatio not supported')
+ devicePixelRatio = 1.0
+
if not isinstance(font, qt.QFont):
font = qt.QFont(font, size, weight, italic)
+ # get text size
+ image = qt.QImage(1, 1, qt.QImage.Format_RGB888)
+ painter = qt.QPainter()
+ painter.begin(image)
+ painter.setPen(qt.Qt.white)
+ painter.setFont(font)
+ bounds = painter.boundingRect(
+ qt.QRect(0, 0, 4096, 4096), qt.Qt.TextExpandTabs, text)
+ painter.end()
+
metrics = qt.QFontMetrics(font)
- size = metrics.size(qt.Qt.TextExpandTabs, text)
- bounds = metrics.boundingRect(
- qt.QRect(0, 0, size.width(), size.height()),
- qt.Qt.TextExpandTabs,
- text)
- if (devicePixelRatio != 1.0 and
- not hasattr(qt.QImage, 'setDevicePixelRatio')): # Qt 4
- _logger.error('devicePixelRatio not supported')
- devicePixelRatio = 1.0
+ # This does not provide the correct text bbox on macOS
+ # size = metrics.size(qt.Qt.TextExpandTabs, text)
+ # bounds = metrics.boundingRect(
+ # qt.QRect(0, 0, size.width(), size.height()),
+ # qt.Qt.TextExpandTabs,
+ # text)
# Add extra border and handle devicePixelRatio
width = bounds.width() * devicePixelRatio + 2
# align line size to 32 bits to ease conversion to numpy array
width = 4 * ((width + 3) // 4)
image = qt.QImage(width,
- bounds.height() * devicePixelRatio,
+ bounds.height() * devicePixelRatio + 2,
qt.QImage.Format_RGB888)
if (devicePixelRatio != 1.0 and
hasattr(image, 'setDevicePixelRatio')): # Qt 5
diff --git a/silx/gui/console.py b/silx/gui/console.py
index 13760b4..7812e2d 100644
--- a/silx/gui/console.py
+++ b/silx/gui/console.py
@@ -136,6 +136,8 @@ if qtconsole is None:
class IPythonWidget(RichIPythonWidget):
"""Live IPython console widget.
+ .. image:: img/IPythonWidget.png
+
:param custom_banner: Custom welcome message to be printed at the top of
the console.
"""
@@ -175,6 +177,8 @@ class IPythonDockWidget(qt.QDockWidget):
"""Dock Widget including a :class:`IPythonWidget` inside
a vertical layout.
+ .. image:: img/IPythonDockWidget.png
+
:param available_vars: Dictionary of variables to be pushed to the
console's interactive namespace: ``{"variable_name": object, …}``
:param custom_banner: Custom welcome message to be printed at the top of
diff --git a/silx/gui/data/ArrayTableModel.py b/silx/gui/data/ArrayTableModel.py
index 87a2fc1..ad4d33a 100644
--- a/silx/gui/data/ArrayTableModel.py
+++ b/silx/gui/data/ArrayTableModel.py
@@ -34,7 +34,7 @@ from silx.gui.data.TextFormatter import TextFormatter
__authors__ = ["V.A. Sole"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "27/09/2017"
_logger = logging.getLogger(__name__)
@@ -191,7 +191,7 @@ class ArrayTableModel(qt.QAbstractTableModel):
selection = self._getIndexTuple(index.row(),
index.column())
if role == qt.Qt.DisplayRole:
- return self._formatter.toString(self._array[selection])
+ return self._formatter.toString(self._array[selection], self._array.dtype)
if role == qt.Qt.BackgroundRole and self._bgcolors is not None:
r, g, b = self._bgcolors[selection][0:3]
@@ -296,6 +296,9 @@ class ArrayTableModel(qt.QAbstractTableModel):
elif copy:
# copy requested (default)
self._array = numpy.array(data, copy=True)
+ if hasattr(data, "dtype"):
+ # Avoid to lose the monkey-patched h5py dtype
+ self._array.dtype = data.dtype
elif not _is_array(data):
raise TypeError("data is not a proper array. Try setting" +
" copy=True to convert it into a numpy array" +
diff --git a/silx/gui/data/ArrayTableWidget.py b/silx/gui/data/ArrayTableWidget.py
index ba3fa11..cb8e915 100644
--- a/silx/gui/data/ArrayTableWidget.py
+++ b/silx/gui/data/ArrayTableWidget.py
@@ -230,6 +230,8 @@ class ArrayTableWidget(qt.QWidget):
To select the perspective, use :meth:`setPerspective` or
use :meth:`setFrameAxes`.
To select the frame, use :meth:`setFrameIndex`.
+
+ .. image:: img/ArrayTableWidget.png
"""
def __init__(self, parent=None):
"""
diff --git a/silx/gui/data/DataViewer.py b/silx/gui/data/DataViewer.py
index 3a3ac64..750c654 100644
--- a/silx/gui/data/DataViewer.py
+++ b/silx/gui/data/DataViewer.py
@@ -22,8 +22,8 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This module defines a widget designed to display data using to most adapted
-view from available ones from silx.
+"""This module defines a widget designed to display data using the most adapted
+view from the ones provided by silx.
"""
from __future__ import division
@@ -35,7 +35,7 @@ from silx.gui.data.NumpyAxesSelector import NumpyAxesSelector
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "03/10/2017"
_logger = logging.getLogger(__name__)
@@ -144,7 +144,7 @@ class DataViewer(qt.QFrame):
DataViews._Hdf5View,
DataViews._NXdataView,
DataViews._Plot1dView,
- DataViews._Plot2dView,
+ DataViews._ImageView,
DataViews._Plot3dView,
DataViews._RawView,
DataViews._StackView,
@@ -201,7 +201,7 @@ class DataViewer(qt.QFrame):
self.__numpySelection.clear()
info = DataViews.DataInfo(self.__data)
axisNames = self.__currentView.axesNames(self.__data, info)
- if info.isArray and self.__data is not None and len(axisNames) > 0:
+ if info.isArray and info.size != 0 and self.__data is not None and axisNames is not None:
self.__useAxisSelection = True
self.__numpySelection.setAxisNames(axisNames)
self.__numpySelection.setCustomAxis(self.__currentView.customAxisNames())
diff --git a/silx/gui/data/DataViewerFrame.py b/silx/gui/data/DataViewerFrame.py
index b48fa7b..e050d4a 100644
--- a/silx/gui/data/DataViewerFrame.py
+++ b/silx/gui/data/DataViewerFrame.py
@@ -27,7 +27,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "10/04/2017"
+__date__ = "21/09/2017"
from silx.gui import qt
from .DataViewer import DataViewer
@@ -79,6 +79,14 @@ class DataViewerFrame(qt.QWidget):
"""Avoid to create views while the instance is not created."""
super(_DataViewer, self)._initializeViews()
+ def _createDefaultViews(self, parent):
+ """Expose the original `createDefaultViews` function"""
+ return super(_DataViewer, self).createDefaultViews()
+
+ def createDefaultViews(self, parent=None):
+ """Allow the DataViewerFrame to override this function"""
+ return self.parent().createDefaultViews(parent)
+
self.__dataViewer = _DataViewer(self)
# initialize views when `self.__dataViewer` is set
self.__dataViewer.initializeViews()
@@ -127,7 +135,7 @@ class DataViewerFrame(qt.QWidget):
:param QWidget parent: QWidget parent of the views
:rtype: list[silx.gui.data.DataViews.DataView]
"""
- return self.__dataViewer.createDefaultViews(parent)
+ return self.__dataViewer._createDefaultViews(parent)
def addView(self, view):
"""Allow to add a view to the dataview.
diff --git a/silx/gui/data/DataViews.py b/silx/gui/data/DataViews.py
index d8d605a..1ad997b 100644
--- a/silx/gui/data/DataViews.py
+++ b/silx/gui/data/DataViews.py
@@ -25,6 +25,7 @@
"""This module defines a views used by :class:`silx.gui.data.DataViewer`.
"""
+from collections import OrderedDict
import logging
import numbers
import numpy
@@ -34,11 +35,11 @@ from silx.gui import qt, icons
from silx.gui.data.TextFormatter import TextFormatter
from silx.io import nxdata
from silx.gui.hdf5 import H5Node
-from silx.io.nxdata import NXdata
+from silx.io.nxdata import NXdata, get_attr_as_string
__authors__ = ["V. Valls", "P. Knobel"]
__license__ = "MIT"
-__date__ = "07/04/2017"
+__date__ = "03/10/2017"
_logger = logging.getLogger(__name__)
@@ -52,6 +53,7 @@ RAW_MODE = 40
RAW_ARRAY_MODE = 41
RAW_RECORD_MODE = 42
RAW_SCALAR_MODE = 43
+RAW_HEXA_MODE = 44
STACK_MODE = 50
HDF5_MODE = 60
@@ -62,6 +64,8 @@ def _normalizeData(data):
If the data embed a numpy data or a dataset it is returned.
Else returns the input data."""
if isinstance(data, H5Node):
+ if data.is_broken:
+ return None
return data.h5py_object
return data
@@ -89,11 +93,14 @@ class DataInfo(object):
self.isArray = False
self.interpretation = None
self.isNumeric = False
+ self.isVoid = False
self.isComplex = False
+ self.isBoolean = False
self.isRecord = False
self.isNXdata = False
self.shape = tuple()
self.dim = 0
+ self.size = 0
if data is None:
return
@@ -110,23 +117,32 @@ class DataInfo(object):
self.isArray = False
if silx.io.is_dataset(data):
- self.interpretation = data.attrs.get("interpretation", None)
+ if "interpretation" in data.attrs:
+ self.interpretation = get_attr_as_string(data, "interpretation")
+ else:
+ self.interpretation = None
elif self.isNXdata:
self.interpretation = nxd.interpretation
else:
self.interpretation = None
if hasattr(data, "dtype"):
+ if numpy.issubdtype(data.dtype, numpy.void):
+ # That's a real opaque type, else it is a structured type
+ self.isVoid = data.dtype.fields is None
self.isNumeric = numpy.issubdtype(data.dtype, numpy.number)
self.isRecord = data.dtype.fields is not None
self.isComplex = numpy.issubdtype(data.dtype, numpy.complex)
+ self.isBoolean = numpy.issubdtype(data.dtype, numpy.bool_)
elif self.isNXdata:
self.isNumeric = numpy.issubdtype(nxd.signal.dtype,
numpy.number)
self.isComplex = numpy.issubdtype(nxd.signal.dtype, numpy.complex)
+ self.isBoolean = numpy.issubdtype(nxd.signal.dtype, numpy.bool_)
else:
self.isNumeric = isinstance(data, numbers.Number)
self.isComplex = isinstance(data, numbers.Complex)
+ self.isBoolean = isinstance(data, bool)
self.isRecord = False
if hasattr(data, "shape"):
@@ -135,7 +151,13 @@ class DataInfo(object):
self.shape = nxd.signal.shape
else:
self.shape = tuple()
- self.dim = len(self.shape)
+ if self.shape is not None:
+ self.dim = len(self.shape)
+
+ if hasattr(data, "size"):
+ self.size = int(data.size)
+ else:
+ self.size = 1
def normalizeData(self, data):
"""Returns a normalized data if the embed a numpy or a dataset.
@@ -237,12 +259,12 @@ class DataView(object):
def axesNames(self, data, info):
"""Returns names of the expected axes of the view, according to the
- input data.
+ input data. A none value will disable the default axes selectior.
:param data: Data to display
:type data: numpy.ndarray or h5py.Dataset
:param DataInfo info: Pre-computed information on the data
- :rtype: list[str]
+ :rtype: list[str] or None
"""
return []
@@ -276,7 +298,7 @@ class CompositeDataView(DataView):
:param qt.QWidget parent: Parent of the hold widget
"""
super(CompositeDataView, self).__init__(parent, modeId, icon, label)
- self.__views = {}
+ self.__views = OrderedDict()
self.__currentView = None
def addView(self, dataView):
@@ -285,10 +307,9 @@ class CompositeDataView(DataView):
def getBestView(self, data, info):
"""Returns the best view according to priorities."""
- info = DataInfo(data)
views = [(v.getDataPriority(data, info), v) for v in self.__views.keys()]
views = filter(lambda t: t[0] > DataView.UNSUPPORTED, views)
- views = sorted(views, reverse=True)
+ views = sorted(views, key=lambda t: t[0], reverse=True)
if len(views) == 0:
return None
@@ -361,7 +382,7 @@ class _EmptyView(DataView):
DataView.__init__(self, parent, modeId=EMPTY_MODE)
def axesNames(self, data, info):
- return []
+ return None
def createWidget(self, parent):
return qt.QLabel(parent)
@@ -406,6 +427,8 @@ class _Plot1dView(DataView):
return ["y"]
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
if data is None or not info.isArray or not info.isNumeric:
return DataView.UNSUPPORTED
if info.dim < 1:
@@ -434,9 +457,10 @@ class _Plot2dView(DataView):
def createWidget(self, parent):
from silx.gui import plot
widget = plot.Plot2D(parent=parent)
+ widget.getIntensityHistogramAction().setVisible(True)
widget.setKeepDataAspectRatio(True)
- widget.setGraphXLabel('X')
- widget.setGraphYLabel('Y')
+ widget.getXAxis().setLabel('X')
+ widget.getYAxis().setLabel('Y')
return widget
def clear(self):
@@ -459,7 +483,11 @@ class _Plot2dView(DataView):
return ["y", "x"]
def getDataPriority(self, data, info):
- if data is None or not info.isArray or not info.isNumeric:
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
+ if (data is None or
+ not info.isArray or
+ not (info.isNumeric or info.isBoolean)):
return DataView.UNSUPPORTED
if info.dim < 2:
return DataView.UNSUPPORTED
@@ -494,8 +522,15 @@ class _Plot3dView(DataView):
plot = ScalarFieldView.ScalarFieldView(parent)
plot.setAxesLabels(*reversed(self.axesNames(None, None)))
- plot.addIsosurface(
- lambda data: numpy.mean(data) + numpy.std(data), '#FF0000FF')
+
+ def computeIsolevel(data):
+ data = data[numpy.isfinite(data)]
+ if len(data) == 0:
+ return 0
+ else:
+ return numpy.mean(data) + numpy.std(data)
+
+ plot.addIsosurface(computeIsolevel, '#FF0000FF')
# Create a parameter tree for the scalar field view
options = SFViewParamTree.TreeView(plot)
@@ -527,6 +562,8 @@ class _Plot3dView(DataView):
return ["z", "y", "x"]
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
if data is None or not info.isArray or not info.isNumeric:
return DataView.UNSUPPORTED
if info.dim < 3:
@@ -539,6 +576,54 @@ class _Plot3dView(DataView):
return 10
+class _ComplexImageView(DataView):
+ """View displaying data using a ComplexImageView"""
+
+ def __init__(self, parent):
+ super(_ComplexImageView, self).__init__(
+ parent=parent,
+ modeId=PLOT2D_MODE,
+ label="Complex Image",
+ icon=icons.getQIcon("view-2d"))
+
+ def createWidget(self, parent):
+ from silx.gui.plot.ComplexImageView import ComplexImageView
+ widget = ComplexImageView(parent=parent)
+ widget.getPlot().getIntensityHistogramAction().setVisible(True)
+ widget.getPlot().setKeepDataAspectRatio(True)
+ widget.getXAxis().setLabel('X')
+ widget.getYAxis().setLabel('Y')
+ return widget
+
+ def clear(self):
+ self.getWidget().setData(None)
+
+ def normalizeData(self, data):
+ data = DataView.normalizeData(self, data)
+ return data
+
+ def setData(self, data):
+ data = self.normalizeData(data)
+ self.getWidget().setData(data)
+
+ def axesNames(self, data, info):
+ return ["y", "x"]
+
+ def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
+ if data is None or not info.isArray or not info.isComplex:
+ return DataView.UNSUPPORTED
+ if info.dim < 2:
+ return DataView.UNSUPPORTED
+ if info.interpretation == "image":
+ return 1000
+ if info.dim == 2:
+ return 200
+ else:
+ return 190
+
+
class _ArrayView(DataView):
"""View displaying data using a 2d table"""
@@ -562,6 +647,8 @@ class _ArrayView(DataView):
return ["col", "row"]
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
if data is None or not info.isArray or info.isRecord:
return DataView.UNSUPPORTED
if info.dim < 2:
@@ -618,6 +705,8 @@ class _StackView(DataView):
return ["depth", "y", "x"]
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
if data is None or not info.isArray or not info.isNumeric:
return DataView.UNSUPPORTED
if info.dim < 3:
@@ -644,17 +733,21 @@ class _ScalarView(DataView):
self.getWidget().setText("")
def setData(self, data):
- data = self.normalizeData(data)
- if silx.io.is_dataset(data):
- data = data[()]
- text = self.__formatter.toString(data)
+ d = self.normalizeData(data)
+ if silx.io.is_dataset(d):
+ d = d[()]
+ text = self.__formatter.toString(d, data.dtype)
self.getWidget().setText(text)
def axesNames(self, data, info):
return []
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
data = self.normalizeData(data)
+ if info.shape is None:
+ return DataView.UNSUPPORTED
if data is None:
return DataView.UNSUPPORTED
if silx.io.is_group(data):
@@ -681,13 +774,16 @@ class _RecordView(DataView):
data = self.normalizeData(data)
widget = self.getWidget()
widget.setArrayData(data)
- widget.resizeRowsToContents()
- widget.resizeColumnsToContents()
+ if len(data) < 100:
+ widget.resizeRowsToContents()
+ widget.resizeColumnsToContents()
def axesNames(self, data, info):
return ["data"]
def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
if info.isRecord:
return 40
if data is None or not info.isArray:
@@ -703,6 +799,36 @@ class _RecordView(DataView):
return DataView.UNSUPPORTED
+class _HexaView(DataView):
+ """View displaying data using text"""
+
+ def __init__(self, parent):
+ DataView.__init__(self, parent, modeId=RAW_HEXA_MODE)
+
+ def createWidget(self, parent):
+ from .HexaTableView import HexaTableView
+ widget = HexaTableView(parent)
+ return widget
+
+ def clear(self):
+ self.getWidget().setArrayData(None)
+
+ def setData(self, data):
+ data = self.normalizeData(data)
+ widget = self.getWidget()
+ widget.setArrayData(data)
+
+ def axesNames(self, data, info):
+ return []
+
+ def getDataPriority(self, data, info):
+ if info.size <= 0:
+ return DataView.UNSUPPORTED
+ if info.isVoid:
+ return 2000
+ return DataView.UNSUPPORTED
+
+
class _Hdf5View(DataView):
"""View displaying data using text"""
@@ -727,7 +853,7 @@ class _Hdf5View(DataView):
widget.setData(data)
def axesNames(self, data, info):
- return []
+ return None
def getDataPriority(self, data, info):
widget = self.getWidget()
@@ -750,11 +876,28 @@ class _RawView(CompositeDataView):
modeId=RAW_MODE,
label="Raw",
icon=icons.getQIcon("view-raw"))
+ self.addView(_HexaView(parent))
self.addView(_ScalarView(parent))
self.addView(_ArrayView(parent))
self.addView(_RecordView(parent))
+class _ImageView(CompositeDataView):
+ """View displaying data as 2D image
+
+ It choose between Plot2D and ComplexImageView widgets
+ """
+
+ def __init__(self, parent):
+ super(_ImageView, self).__init__(
+ parent=parent,
+ modeId=PLOT2D_MODE,
+ label="Image",
+ icon=icons.getQIcon("view-2d"))
+ self.addView(_ComplexImageView(parent))
+ self.addView(_Plot2dView(parent))
+
+
class _NXdataScalarView(DataView):
"""DataView using a table view for displaying NXdata scalars:
0-D signal or n-D signal with *@interpretation=scalar*"""
@@ -806,7 +949,7 @@ class _NXdataCurveView(DataView):
def axesNames(self, data, info):
# disabled (used by default axis selector widget in Hdf5Viewer)
- return []
+ return None
def clear(self):
self.getWidget().clear()
@@ -814,10 +957,10 @@ class _NXdataCurveView(DataView):
def setData(self, data):
data = self.normalizeData(data)
nxd = NXdata(data)
- signal_name = data.attrs["signal"]
+ signal_name = get_attr_as_string(data, "signal")
group_name = data.name
- if nxd.axes_names[-1] is not None:
- x_errors = nxd.get_axis_errors(nxd.axes_names[-1])
+ if nxd.axes_dataset_names[-1] is not None:
+ x_errors = nxd.get_axis_errors(nxd.axes_dataset_names[-1])
else:
x_errors = None
@@ -853,7 +996,7 @@ class _NXdataXYVScatterView(DataView):
def axesNames(self, data, info):
# disabled (used by default axis selector widget in Hdf5Viewer)
- return []
+ return None
def clear(self):
self.getWidget().clear()
@@ -861,7 +1004,7 @@ class _NXdataXYVScatterView(DataView):
def setData(self, data):
data = self.normalizeData(data)
nxd = NXdata(data)
- signal_name = data.attrs["signal"]
+ signal_name = get_attr_as_string(data, "signal")
# signal_errors = nx.errors # not supported
group_name = data.name
x_axis, y_axis = nxd.axes[-2:]
@@ -902,7 +1045,8 @@ class _NXdataImageView(DataView):
return widget
def axesNames(self, data, info):
- return []
+ # disabled (used by default axis selector widget in Hdf5Viewer)
+ return None
def clear(self):
self.getWidget().clear()
@@ -910,7 +1054,7 @@ class _NXdataImageView(DataView):
def setData(self, data):
data = self.normalizeData(data)
nxd = NXdata(data)
- signal_name = data.attrs["signal"]
+ signal_name = get_attr_as_string(data, "signal")
group_name = data.name
y_axis, x_axis = nxd.axes[-2:]
y_label, x_label = nxd.axes_names[-2:]
@@ -942,7 +1086,8 @@ class _NXdataStackView(DataView):
return widget
def axesNames(self, data, info):
- return []
+ # disabled (used by default axis selector widget in Hdf5Viewer)
+ return None
def clear(self):
self.getWidget().clear()
@@ -950,7 +1095,7 @@ class _NXdataStackView(DataView):
def setData(self, data):
data = self.normalizeData(data)
nxd = NXdata(data)
- signal_name = data.attrs["signal"]
+ signal_name = get_attr_as_string(data, "signal")
group_name = data.name
z_axis, y_axis, x_axis = nxd.axes[-3:]
z_label, y_label, x_label = nxd.axes_names[-3:]
diff --git a/silx/gui/data/Hdf5TableView.py b/silx/gui/data/Hdf5TableView.py
index 5d79907..ba737e3 100644
--- a/silx/gui/data/Hdf5TableView.py
+++ b/silx/gui/data/Hdf5TableView.py
@@ -30,7 +30,7 @@ from __future__ import division
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "07/04/2017"
+__date__ = "29/09/2017"
import functools
import os.path
@@ -40,6 +40,13 @@ import silx.io
from .TextFormatter import TextFormatter
import silx.gui.hdf5
from silx.gui.widgets import HierarchicalTableView
+from ..hdf5.Hdf5Formatter import Hdf5Formatter
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
_logger = logging.getLogger(__name__)
@@ -177,6 +184,7 @@ class Hdf5TableModel(HierarchicalTableView.HierarchicalTableModel):
self.__obj = None
self.__data = _TableData(columnCount=4)
self.__formatter = None
+ self.__hdf5Formatter = Hdf5Formatter(self)
formatter = TextFormatter(self)
self.setFormatter(formatter)
self.setObject(data)
@@ -207,7 +215,7 @@ class Hdf5TableModel(HierarchicalTableView.HierarchicalTableModel):
value = cell.value()
if callable(value):
value = value(self.__obj)
- return str(value)
+ return value
return None
def flags(self, index):
@@ -248,6 +256,22 @@ class Hdf5TableModel(HierarchicalTableView.HierarchicalTableModel):
else:
self.reset()
+ def __formatHdf5Type(self, dataset):
+ """Format the HDF5 type"""
+ return self.__hdf5Formatter.humanReadableHdf5Type(dataset)
+
+ def __formatDType(self, dataset):
+ """Format the numpy dtype"""
+ return self.__hdf5Formatter.humanReadableType(dataset, full=True)
+
+ def __formatShape(self, dataset):
+ """Format the shape"""
+ if dataset.shape is None or len(dataset.shape) <= 1:
+ return self.__hdf5Formatter.humanReadableShape(dataset)
+ size = dataset.size
+ shape = self.__hdf5Formatter.humanReadableShape(dataset)
+ return u"%s = %s" % (shape, size)
+
def __initProperties(self):
"""Initialize the list of available properties according to the defined
h5py-like object."""
@@ -270,26 +294,48 @@ class Hdf5TableModel(HierarchicalTableView.HierarchicalTableModel):
else:
objectType = obj.__class__.__name__
self.__data.addHeaderRow(headerLabel="HDF5 %s" % objectType)
- self.__data.addHeaderRow(headerLabel="Path info")
- self.__data.addHeaderValueRow("basename", lambda x: os.path.basename(x.name))
- self.__data.addHeaderValueRow("name", lambda x: x.name)
- if silx.io.is_file(obj):
- self.__data.addHeaderValueRow("filename", lambda x: x.filename)
+ SEPARATOR = "::"
+ self.__data.addHeaderRow(headerLabel="Path info")
if isinstance(obj, silx.gui.hdf5.H5Node):
# helpful informations if the object come from an HDF5 tree
- self.__data.addHeaderValueRow("local_basename", lambda x: x.local_basename)
- self.__data.addHeaderValueRow("local_name", lambda x: x.local_name)
- self.__data.addHeaderValueRow("local_filename", lambda x: x.local_file.filename)
+ self.__data.addHeaderValueRow("Basename", lambda x: x.local_basename)
+ self.__data.addHeaderValueRow("Name", lambda x: x.local_name)
+ local = lambda x: x.local_filename + SEPARATOR + x.local_name
+ self.__data.addHeaderValueRow("Local", local)
+ physical = lambda x: x.physical_filename + SEPARATOR + x.physical_name
+ self.__data.addHeaderValueRow("Physical", physical)
+ else:
+ # it's a real H5py object
+ self.__data.addHeaderValueRow("Basename", lambda x: os.path.basename(x.name))
+ self.__data.addHeaderValueRow("Name", lambda x: x.name)
+ self.__data.addHeaderValueRow("File", lambda x: x.file.filename)
+
+ if hasattr(obj, "path"):
+ # That's a link
+ if hasattr(obj, "filename"):
+ link = lambda x: x.filename + SEPARATOR + x.path
+ else:
+ link = lambda x: x.path
+ self.__data.addHeaderValueRow("Link", link)
+ else:
+ if silx.io.is_file(obj):
+ physical = lambda x: x.filename + SEPARATOR + x.name
+ else:
+ physical = lambda x: x.file.filename + SEPARATOR + x.name
+ self.__data.addHeaderValueRow("Physical", physical)
if hasattr(obj, "dtype"):
+
self.__data.addHeaderRow(headerLabel="Data info")
- self.__data.addHeaderValueRow("dtype", lambda x: x.dtype)
+
+ if h5py is not None and hasattr(obj, "id"):
+ # display the HDF5 type
+ self.__data.addHeaderValueRow("HDF5 type", self.__formatHdf5Type)
+ self.__data.addHeaderValueRow("dtype", self.__formatDType)
if hasattr(obj, "shape"):
- self.__data.addHeaderValueRow("shape", lambda x: x.shape)
- if hasattr(obj, "size"):
- self.__data.addHeaderValueRow("size", lambda x: x.size)
+ self.__data.addHeaderValueRow("shape", self.__formatShape)
if hasattr(obj, "chunks") and obj.chunks is not None:
self.__data.addHeaderValueRow("chunks", lambda x: x.chunks)
@@ -354,6 +400,8 @@ class Hdf5TableModel(HierarchicalTableView.HierarchicalTableModel):
if formatter is self.__formatter:
return
+ self.__hdf5Formatter.setTextFormatter(formatter)
+
if qt.qVersion() > "4.6":
self.beginResetModel()
diff --git a/silx/gui/data/HexaTableView.py b/silx/gui/data/HexaTableView.py
new file mode 100644
index 0000000..1b2a7e9
--- /dev/null
+++ b/silx/gui/data/HexaTableView.py
@@ -0,0 +1,278 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""
+This module defines model and widget to display raw data using an
+hexadecimal viewer.
+"""
+from __future__ import division
+
+import numpy
+import collections
+from silx.gui import qt
+import silx.io.utils
+from silx.third_party import six
+from silx.gui.widgets.TableWidget import CopySelectedCellsAction
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "27/09/2017"
+
+
+class _VoidConnector(object):
+ """Byte connector to a numpy.void data.
+
+ It uses a cache of 32 x 1KB and a direct read access API from HDF5.
+ """
+
+ def __init__(self, data):
+ self.__cache = collections.OrderedDict()
+ self.__len = data.itemsize
+ self.__data = data
+
+ def __getBuffer(self, bufferId):
+ if bufferId not in self.__cache:
+ pos = bufferId << 10
+ data = self.__data.tobytes()[pos:pos + 1024]
+ self.__cache[bufferId] = data
+ if len(self.__cache) > 32:
+ self.__cache.popitem()
+ else:
+ data = self.__cache[bufferId]
+ return data
+
+ def __getitem__(self, pos):
+ """Returns the value of the byte at the given position.
+
+ :param uint pos: Position of the byte
+ :rtype: int
+ """
+ bufferId = pos >> 10
+ bufferPos = pos & 0b1111111111
+ data = self.__getBuffer(bufferId)
+ value = data[bufferPos]
+ if six.PY2:
+ return ord(value)
+ else:
+ return value
+
+ def __len__(self):
+ """
+ Returns the number of available bytes.
+
+ :rtype: uint
+ """
+ return self.__len
+
+
+class HexaTableModel(qt.QAbstractTableModel):
+ """This data model provides access to a numpy void data.
+
+ Bytes are displayed one by one as a hexadecimal viewer.
+
+ The 16th first columns display bytes as hexadecimal, the last column
+ displays the same data as ASCII.
+
+ :param qt.QObject parent: Parent object
+ :param data: A numpy array or a h5py dataset
+ """
+ def __init__(self, parent=None, data=None):
+ qt.QAbstractTableModel.__init__(self, parent)
+
+ self.__data = None
+ self.__connector = None
+ self.setArrayData(data)
+
+ if hasattr(qt.QFontDatabase, "systemFont"):
+ self.__font = qt.QFontDatabase.systemFont(qt.QFontDatabase.FixedFont)
+ else:
+ self.__font = qt.QFont("Monospace")
+ self.__font.setStyleHint(qt.QFont.TypeWriter)
+ self.__palette = qt.QPalette()
+
+ def rowCount(self, parent_idx=None):
+ """Returns number of rows to be displayed in table"""
+ if self.__connector is None:
+ return 0
+ return ((len(self.__connector) - 1) >> 4) + 1
+
+ def columnCount(self, parent_idx=None):
+ """Returns number of columns to be displayed in table"""
+ return 0x10 + 1
+
+ def data(self, index, role=qt.Qt.DisplayRole):
+ """QAbstractTableModel method to access data values
+ in the format ready to be displayed"""
+ if not index.isValid():
+ return None
+
+ if self.__connector is None:
+ return None
+
+ row = index.row()
+ column = index.column()
+
+ if role == qt.Qt.DisplayRole:
+ if column == 0x10:
+ start = (row << 4)
+ text = ""
+ for i in range(0x10):
+ pos = start + i
+ if pos >= len(self.__connector):
+ break
+ value = self.__connector[pos]
+ if value > 0x20 and value < 0x7F:
+ text += chr(value)
+ else:
+ text += "."
+ return text
+ else:
+ pos = (row << 4) + column
+ if pos < len(self.__connector):
+ value = self.__connector[pos]
+ return "%02X" % value
+ else:
+ return ""
+ elif role == qt.Qt.FontRole:
+ return self.__font
+
+ elif role == qt.Qt.BackgroundColorRole:
+ pos = (row << 4) + column
+ if column != 0x10 and pos >= len(self.__connector):
+ return self.__palette.color(qt.QPalette.Disabled, qt.QPalette.Background)
+ else:
+ return None
+
+ return None
+
+ def headerData(self, section, orientation, role=qt.Qt.DisplayRole):
+ """Returns the 0-based row or column index, for display in the
+ horizontal and vertical headers"""
+ if section == -1:
+ # PyQt4 send -1 when there is columns but no rows
+ return None
+
+ if role == qt.Qt.DisplayRole:
+ if orientation == qt.Qt.Vertical:
+ return "%02X" % (section << 4)
+ if orientation == qt.Qt.Horizontal:
+ if section == 0x10:
+ return "ASCII"
+ else:
+ return "%02X" % section
+ elif role == qt.Qt.FontRole:
+ return self.__font
+ elif role == qt.Qt.TextAlignmentRole:
+ if orientation == qt.Qt.Vertical:
+ return qt.Qt.AlignRight
+ if orientation == qt.Qt.Horizontal:
+ if section == 0x10:
+ return qt.Qt.AlignLeft
+ else:
+ return qt.Qt.AlignCenter
+ return None
+
+ def flags(self, index):
+ """QAbstractTableModel method to inform the view whether data
+ is editable or not.
+ """
+ row = index.row()
+ column = index.column()
+ pos = (row << 4) + column
+ if column != 0x10 and pos >= len(self.__connector):
+ return qt.Qt.NoItemFlags
+ return qt.QAbstractTableModel.flags(self, index)
+
+ def setArrayData(self, data):
+ """Set the data array.
+
+ :param data: A numpy object or a dataset.
+ """
+ if qt.qVersion() > "4.6":
+ self.beginResetModel()
+
+ self.__connector = None
+ self.__data = data
+ if self.__data is not None:
+ if silx.io.utils.is_dataset(self.__data):
+ data = data[()]
+ elif isinstance(self.__data, numpy.ndarray):
+ data = data[()]
+ self.__connector = _VoidConnector(data)
+
+ if qt.qVersion() > "4.6":
+ self.endResetModel()
+ else:
+ self.reset()
+
+ def arrayData(self):
+ """Returns the internal data.
+
+ :rtype: numpy.ndarray of h5py.Dataset
+ """
+ return self.__data
+
+
+class HexaTableView(qt.QTableView):
+ """TableView using HexaTableModel as default model.
+
+ It customs the column size to provide a better layout.
+ """
+ def __init__(self, parent=None):
+ """
+ Constructor
+
+ :param qt.QWidget parent: parent QWidget
+ """
+ qt.QTableView.__init__(self, parent)
+
+ model = HexaTableModel(self)
+ self.setModel(model)
+ self._copyAction = CopySelectedCellsAction(self)
+ self.addAction(self._copyAction)
+
+ def copy(self):
+ self._copyAction.trigger()
+
+ def setArrayData(self, data):
+ """Set the data array.
+
+ :param data: A numpy object or a dataset.
+ """
+ self.model().setArrayData(data)
+ self.__fixHeader()
+
+ def __fixHeader(self):
+ """Update the view according to the state of the auto-resize"""
+ header = self.horizontalHeader()
+ if qt.qVersion() < "5.0":
+ setResizeMode = header.setResizeMode
+ else:
+ setResizeMode = header.setSectionResizeMode
+
+ header.setDefaultSectionSize(30)
+ header.setStretchLastSection(True)
+ for i in range(0x10):
+ setResizeMode(i, qt.QHeaderView.Fixed)
+ setResizeMode(0x10, qt.QHeaderView.Stretch)
diff --git a/silx/gui/data/NXdataWidgets.py b/silx/gui/data/NXdataWidgets.py
index 343c7f9..b820380 100644
--- a/silx/gui/data/NXdataWidgets.py
+++ b/silx/gui/data/NXdataWidgets.py
@@ -26,7 +26,7 @@
"""
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "20/03/2017"
+__date__ = "27/06/2017"
import numpy
@@ -135,8 +135,8 @@ class ArrayCurvePlot(qt.QWidget):
self.selectorDock.show()
self._plot.setGraphTitle(title or "")
- self._plot.setGraphXLabel(self.__axis_name or "X")
- self._plot.setGraphYLabel(self.__signal_name or "Y")
+ self._plot.getXAxis().setLabel(self.__axis_name or "X")
+ self._plot.getYAxis().setLabel(self.__signal_name or "Y")
self._updateCurve()
if not self.__selector_is_connected:
@@ -188,8 +188,8 @@ class ArrayCurvePlot(qt.QWidget):
xerror=self.__axis_errors,
yerror=y_errors)
self._plot.resetZoom()
- self._plot.setGraphXLabel(self.__axis_name)
- self._plot.setGraphYLabel(self.__signal_name)
+ self._plot.getXAxis().setLabel(self.__axis_name)
+ self._plot.getYAxis().setLabel(self.__signal_name)
def clear(self):
self._plot.clear()
@@ -289,8 +289,8 @@ class ArrayImagePlot(qt.QWidget):
self.selectorDock.show()
self._plot.setGraphTitle(title or "")
- self._plot.setGraphXLabel(self.__x_axis_name or "X")
- self._plot.setGraphYLabel(self.__y_axis_name or "Y")
+ self._plot.getXAxis().setLabel(self.__x_axis_name or "X")
+ self._plot.getYAxis().setLabel(self.__y_axis_name or "Y")
self._updateImage()
@@ -352,8 +352,8 @@ class ArrayImagePlot(qt.QWidget):
numpy.ravel(scattery),
numpy.ravel(img),
legend=legend)
- self._plot.setGraphXLabel(self.__x_axis_name)
- self._plot.setGraphYLabel(self.__y_axis_name)
+ self._plot.getXAxis().setLabel(self.__x_axis_name)
+ self._plot.getYAxis().setLabel(self.__y_axis_name)
self._plot.resetZoom()
def clear(self):
@@ -450,8 +450,8 @@ class ArrayStackPlot(qt.QWidget):
self._stack_view.setGraphTitle(title or "")
# by default, the z axis is the image position (dimension not plotted)
- self._stack_view.setGraphXLabel(self.__x_axis_name or "X")
- self._stack_view.setGraphYLabel(self.__y_axis_name or "Y")
+ self._stack_view.getPlot().getXAxis().setLabel(self.__x_axis_name or "X")
+ self._stack_view.getPlot().getYAxis().setLabel(self.__y_axis_name or "Y")
self._updateStack()
diff --git a/silx/gui/data/RecordTableView.py b/silx/gui/data/RecordTableView.py
index ce6a178..54881b7 100644
--- a/silx/gui/data/RecordTableView.py
+++ b/silx/gui/data/RecordTableView.py
@@ -37,7 +37,7 @@ from silx.gui.widgets.TableWidget import CopySelectedCellsAction
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "27/01/2017"
+__date__ = "02/10/2017"
class _MultiLineItem(qt.QItemDelegate):
@@ -206,9 +206,9 @@ class RecordTableModel(qt.QAbstractTableModel):
data = data[key[1]]
if role == qt.Qt.DisplayRole:
- return self.__formatter.toString(data)
+ return self.__formatter.toString(data, dtype=self.__data.dtype)
elif role == qt.Qt.EditRole:
- return self.__editFormatter.toString(data)
+ return self.__editFormatter.toString(data, dtype=self.__data.dtype)
return None
def headerData(self, section, orientation, role=qt.Qt.DisplayRole):
@@ -270,11 +270,11 @@ class RecordTableModel(qt.QAbstractTableModel):
else:
self.__is_array = False
-
self.__fields = []
if data is not None:
if data.dtype.fields is not None:
- for name, (dtype, _index) in data.dtype.fields.items():
+ fields = sorted(data.dtype.fields.items(), key=lambda e: e[1][1])
+ for name, (dtype, _index) in fields:
if dtype.shape != tuple():
keys = itertools.product(*[range(x) for x in dtype.shape])
for key in keys:
diff --git a/silx/gui/data/TextFormatter.py b/silx/gui/data/TextFormatter.py
index f074de5..37e1f48 100644
--- a/silx/gui/data/TextFormatter.py
+++ b/silx/gui/data/TextFormatter.py
@@ -27,14 +27,18 @@ data module to format data as text in the same way."""
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "27/09/2017"
import numpy
import numbers
-import binascii
from silx.third_party import six
from silx.gui import qt
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
class TextFormatter(qt.QObject):
"""Formatter to convert data to string.
@@ -73,11 +77,13 @@ class TextFormatter(qt.QObject):
self.__floatFormat = formatter.floatFormat()
self.__useQuoteForText = formatter.useQuoteForText()
self.__imaginaryUnit = formatter.imaginaryUnit()
+ self.__enumFormat = formatter.enumFormat()
else:
self.__integerFormat = "%d"
self.__floatFormat = "%g"
self.__useQuoteForText = True
self.__imaginaryUnit = u"j"
+ self.__enumFormat = u"%(name)s(%(value)d)"
def integerFormat(self):
"""Returns the format string controlling how the integer data
@@ -162,40 +168,151 @@ class TextFormatter(qt.QObject):
self.__imaginaryUnit = imaginaryUnit
self.formatChanged.emit()
- def toString(self, data):
+ def setEnumFormat(self, value):
+ """Set format string controlling how the enum data are
+ formated by this object.
+
+ :param str value: Format string (e.g. "%(name)s(%(value)d)").
+ This is the C-style format string used by python when formatting
+ strings with the modulus operator.
+ """
+ if self.__enumFormat == value:
+ return
+ self.__enumFormat = value
+ self.formatChanged.emit()
+
+ def enumFormat(self):
+ """Returns the format string controlling how the enum data
+ are formated by this object.
+
+ This is the C-style format string used by python when formatting
+ strings with the modulus operator.
+
+ :rtype: str
+ """
+ return self.__enumFormat
+
+ def __formatText(self, text):
+ if self.__useQuoteForText:
+ text = "\"%s\"" % text.replace("\\", "\\\\").replace("\"", "\\\"")
+ return text
+
+ def __formatBinary(self, data):
+ if isinstance(data, numpy.void):
+ if six.PY2:
+ data = [ord(d) for d in data.item()]
+ else:
+ data = data.item().astype(numpy.uint8)
+ else:
+ data = [ord(d) for d in data]
+ data = ["\\x%02X" % d for d in data]
+ if self.__useQuoteForText:
+ return "b\"%s\"" % "".join(data)
+ else:
+ return "".join(data)
+
+ def __formatSafeAscii(self, data):
+ if six.PY2:
+ data = [ord(d) for d in data]
+ data = [chr(d) if (d > 0x20 and d < 0x7F) else "\\x%02X" % d for d in data]
+ if self.__useQuoteForText:
+ data = [c if c != '"' else "\\" + c for c in data]
+ return "b\"%s\"" % "".join(data)
+ else:
+ return "".join(data)
+
+ def __formatH5pyObject(self, data, dtype):
+ # That's an HDF5 object
+ ref = h5py.check_dtype(ref=dtype)
+ if ref is not None:
+ if bool(data):
+ return "REF"
+ else:
+ return "NULL_REF"
+ vlen = h5py.check_dtype(vlen=dtype)
+ if vlen is not None:
+ if vlen == six.text_type:
+ # HDF5 UTF8
+ return self.__formatText(data)
+ elif vlen == six.binary_type:
+ # HDF5 ASCII
+ try:
+ text = "%s" % data.decode("ascii")
+ return self.__formatText(text)
+ except UnicodeDecodeError:
+ return self.__formatSafeAscii(data)
+ return None
+
+ def toString(self, data, dtype=None):
"""Format a data into a string using formatter options
:param object data: Data to render
+ :param dtype: enforce a dtype (mostly used to remember the h5py dtype,
+ special h5py dtypes are not propagated from array to items)
:rtype: str
"""
if isinstance(data, tuple):
text = [self.toString(d) for d in data]
return "(" + " ".join(text) + ")"
- elif isinstance(data, (list, numpy.ndarray)):
+ elif isinstance(data, list):
text = [self.toString(d) for d in data]
return "[" + " ".join(text) + "]"
+ elif isinstance(data, (numpy.ndarray)):
+ if dtype is None:
+ dtype = data.dtype
+ if data.shape == ():
+ # it is a scaler
+ return self.toString(data[()], dtype)
+ else:
+ text = [self.toString(d, dtype) for d in data]
+ return "[" + " ".join(text) + "]"
elif isinstance(data, numpy.void):
- dtype = data.dtype
+ if dtype is None:
+ dtype = data.dtype
if data.dtype.fields is not None:
- text = [self.toString(data[f]) for f in dtype.fields]
+ text = [self.toString(data[f], dtype) for f in dtype.fields]
return "(" + " ".join(text) + ")"
- return "0x" + binascii.hexlify(data).decode("ascii")
- elif isinstance(data, (numpy.string_, numpy.object_, bytes)):
- # This have to be done before checking python string inheritance
+ return self.__formatBinary(data)
+ elif isinstance(data, (numpy.unicode_, six.text_type)):
+ return self.__formatText(data)
+ elif isinstance(data, (numpy.string_, six.binary_type)):
+ if dtype is not None:
+ # Maybe a sub item from HDF5
+ if dtype.kind == 'S':
+ try:
+ text = "%s" % data.decode("ascii")
+ return self.__formatText(text)
+ except UnicodeDecodeError:
+ return self.__formatSafeAscii(data)
+ elif dtype.kind == 'O':
+ if h5py is not None:
+ text = self.__formatH5pyObject(data, dtype)
+ if text is not None:
+ return text
try:
+ # Try ascii/utf-8
text = "%s" % data.decode("utf-8")
- if self.__useQuoteForText:
- text = "\"%s\"" % text.replace("\"", "\\\"")
- return text
+ return self.__formatText(text)
except UnicodeDecodeError:
pass
- return "0x" + binascii.hexlify(data).decode("ascii")
+ return self.__formatBinary(data)
elif isinstance(data, six.string_types):
text = "%s" % data
- if self.__useQuoteForText:
- text = "\"%s\"" % text.replace("\"", "\\\"")
- return text
- elif isinstance(data, (numpy.integer, numbers.Integral)):
+ return self.__formatText(text)
+ elif isinstance(data, (numpy.integer)):
+ if dtype is None:
+ dtype = data.dtype
+ if h5py is not None:
+ enumType = h5py.check_dtype(enum=dtype)
+ if enumType is not None:
+ for key, value in enumType.items():
+ if value == data:
+ result = {}
+ result["name"] = key
+ result["value"] = data
+ return self.__enumFormat % result
+ return self.__integerFormat % data
+ elif isinstance(data, (numbers.Integral)):
return self.__integerFormat % data
elif isinstance(data, (numbers.Real, numpy.floating)):
# It have to be done before complex checking
@@ -219,4 +336,21 @@ class TextFormatter(qt.QObject):
template = self.__floatFormat
params = (data.real)
return template % params
+ elif h5py is not None and isinstance(data, h5py.h5r.Reference):
+ dtype = h5py.special_dtype(ref=h5py.Reference)
+ text = self.__formatH5pyObject(data, dtype)
+ return text
+ elif h5py is not None and isinstance(data, h5py.h5r.RegionReference):
+ dtype = h5py.special_dtype(ref=h5py.RegionReference)
+ text = self.__formatH5pyObject(data, dtype)
+ return text
+ elif isinstance(data, numpy.object_) or dtype is not None:
+ if dtype is None:
+ dtype = data.dtype
+ if h5py is not None:
+ text = self.__formatH5pyObject(data, dtype)
+ if text is not None:
+ return text
+ # That's a numpy object
+ return str(data)
return str(data)
diff --git a/silx/gui/data/test/test_dataviewer.py b/silx/gui/data/test/test_dataviewer.py
index 5a0de0b..dd3114a 100644
--- a/silx/gui/data/test/test_dataviewer.py
+++ b/silx/gui/data/test/test_dataviewer.py
@@ -24,7 +24,7 @@
# ###########################################################################*/
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "10/04/2017"
+__date__ = "22/08/2017"
import os
import tempfile
@@ -42,8 +42,6 @@ from silx.gui.data.DataViewerFrame import DataViewerFrame
from silx.gui.test.utils import SignalListener
from silx.gui.test.utils import TestCaseQt
-from silx.gui.hdf5.test import _mock
-
try:
import h5py
except ImportError:
@@ -111,6 +109,24 @@ class AbstractDataViewerTests(TestCaseQt):
self.assertEqual(DataViewer.RAW_MODE, widget.displayMode())
self.assertIn(DataViewer.PLOT2D_MODE, availableModes)
+ def test_plot_2d_bool(self):
+ data = numpy.zeros((10, 10), dtype=numpy.bool)
+ data[::2, ::2] = True
+ widget = self.create_widget()
+ widget.setData(data)
+ availableModes = set([v.modeId() for v in widget.currentAvailableViews()])
+ self.assertEqual(DataViewer.RAW_MODE, widget.displayMode())
+ self.assertIn(DataViewer.PLOT2D_MODE, availableModes)
+
+ def test_plot_2d_complex_data(self):
+ data = numpy.arange(3 ** 2, dtype=numpy.complex)
+ data.shape = [3] * 2
+ widget = self.create_widget()
+ widget.setData(data)
+ availableModes = set([v.modeId() for v in widget.currentAvailableViews()])
+ self.assertEqual(DataViewer.RAW_MODE, widget.displayMode())
+ self.assertIn(DataViewer.PLOT2D_MODE, availableModes)
+
def test_plot_3d_data(self):
data = numpy.arange(3 ** 3)
data.shape = [3] * 3
@@ -212,6 +228,7 @@ class AbstractDataViewerTests(TestCaseQt):
self.assertTrue(view not in widget.availableViews())
self.assertTrue(view not in widget.currentAvailableViews())
+
class TestDataViewer(AbstractDataViewerTests):
def create_widget(self):
return DataViewer()
@@ -225,11 +242,10 @@ class TestDataViewerFrame(AbstractDataViewerTests):
class TestDataView(TestCaseQt):
def createComplexData(self):
- line = [1, 2j, 3+3j, 4]
+ line = [1, 2j, 3 + 3j, 4]
image = [line, line, line, line]
cube = [image, image, image, image]
- data = numpy.array(cube,
- dtype=numpy.complex)
+ data = numpy.array(cube, dtype=numpy.complex)
return data
def createDataViewWithData(self, dataViewClass, data):
diff --git a/silx/gui/data/test/test_textformatter.py b/silx/gui/data/test/test_textformatter.py
index f21e033..2a7a66b 100644
--- a/silx/gui/data/test/test_textformatter.py
+++ b/silx/gui/data/test/test_textformatter.py
@@ -24,13 +24,22 @@
# ###########################################################################*/
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "27/09/2017"
import unittest
+import shutil
+import tempfile
+import numpy
from silx.gui.test.utils import TestCaseQt
from silx.gui.test.utils import SignalListener
from ..TextFormatter import TextFormatter
+from silx.third_party import six
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
class TestTextFormatter(TestCaseQt):
@@ -83,10 +92,108 @@ class TestTextFormatter(TestCaseQt):
self.assertEquals(result, '"toto"')
+class TestTextFormatterWithH5py(TestCaseQt):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestTextFormatterWithH5py, cls).setUpClass()
+ if h5py is None:
+ raise unittest.SkipTest("h5py is not available")
+
+ cls.tmpDirectory = tempfile.mkdtemp()
+ cls.h5File = h5py.File("%s/formatter.h5" % cls.tmpDirectory, mode="w")
+ cls.formatter = TextFormatter()
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestTextFormatterWithH5py, cls).tearDownClass()
+ cls.h5File.close()
+ cls.h5File = None
+ shutil.rmtree(cls.tmpDirectory)
+
+ def create_dataset(self, data, dtype=None):
+ testName = "%s" % self.id()
+ dataset = self.h5File.create_dataset(testName, data=data, dtype=dtype)
+ return dataset
+
+ def testAscii(self):
+ d = self.create_dataset(data=b"abc")
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '"abc"')
+
+ def testUnicode(self):
+ d = self.create_dataset(data=u"i\u2661cookies")
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(len(result), 11)
+ self.assertEquals(result, u'"i\u2661cookies"')
+
+ def testBadAscii(self):
+ d = self.create_dataset(data=b"\xF0\x9F\x92\x94")
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, 'b"\\xF0\\x9F\\x92\\x94"')
+
+ def testVoid(self):
+ d = self.create_dataset(data=numpy.void(b"abc\xF0"))
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, 'b"\\x61\\x62\\x63\\xF0"')
+
+ def testEnum(self):
+ dtype = h5py.special_dtype(enum=('i', {"RED": 0, "GREEN": 1, "BLUE": 42}))
+ d = numpy.array(42, dtype=dtype)
+ d = self.create_dataset(data=d)
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, 'BLUE(42)')
+
+ def testRef(self):
+ dtype = h5py.special_dtype(ref=h5py.Reference)
+ d = numpy.array(self.h5File.ref, dtype=dtype)
+ d = self.create_dataset(data=d)
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, 'REF')
+
+ def testArrayAscii(self):
+ d = self.create_dataset(data=[b"abc"])
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '["abc"]')
+
+ def testArrayUnicode(self):
+ dtype = h5py.special_dtype(vlen=six.text_type)
+ d = numpy.array([u"i\u2661cookies"], dtype=dtype)
+ d = self.create_dataset(data=d)
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(len(result), 13)
+ self.assertEquals(result, u'["i\u2661cookies"]')
+
+ def testArrayBadAscii(self):
+ d = self.create_dataset(data=[b"\xF0\x9F\x92\x94"])
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '[b"\\xF0\\x9F\\x92\\x94"]')
+
+ def testArrayVoid(self):
+ d = self.create_dataset(data=numpy.void([b"abc\xF0"]))
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '[b"\\x61\\x62\\x63\\xF0"]')
+
+ def testArrayEnum(self):
+ dtype = h5py.special_dtype(enum=('i', {"RED": 0, "GREEN": 1, "BLUE": 42}))
+ d = numpy.array([42, 1, 100], dtype=dtype)
+ d = self.create_dataset(data=d)
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '[BLUE(42) GREEN(1) 100]')
+
+ def testArrayRef(self):
+ dtype = h5py.special_dtype(ref=h5py.Reference)
+ d = numpy.array([self.h5File.ref, None], dtype=dtype)
+ d = self.create_dataset(data=d)
+ result = self.formatter.toString(d[()], dtype=d.dtype)
+ self.assertEquals(result, '[REF NULL_REF]')
+
+
def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestTextFormatter))
+ test_suite.addTest(loadTests(TestTextFormatter))
+ test_suite.addTest(loadTests(TestTextFormatterWithH5py))
return test_suite
diff --git a/silx/gui/fit/BackgroundWidget.py b/silx/gui/fit/BackgroundWidget.py
index 577a8c7..2171e87 100644
--- a/silx/gui/fit/BackgroundWidget.py
+++ b/silx/gui/fit/BackgroundWidget.py
@@ -26,7 +26,11 @@
# #########################################################################*/
"""This module provides a background configuration widget
:class:`BackgroundWidget` and a corresponding dialog window
-:class:`BackgroundDialog`."""
+:class:`BackgroundDialog`.
+
+.. image:: img/BackgroundDialog.png
+ :height: 300px
+"""
import sys
import numpy
from silx.gui import qt
@@ -35,7 +39,7 @@ from silx.math.fit import filters
__authors__ = ["V.A. Sole", "P. Knobel"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "28/06/2017"
class HorizontalSpacer(qt.QWidget):
@@ -262,7 +266,7 @@ class BackgroundParamWidget(qt.QWidget):
class BackgroundWidget(qt.QWidget):
- """Background configuration widget, with a :class:`PlotWindow`.
+ """Background configuration widget, with a plot to preview the results.
Strip and snip filters parameters can be adjusted using input widgets,
and the computed backgrounds are plotted next to the original data to
@@ -400,7 +404,7 @@ class BackgroundWidget(qt.QWidget):
legend='SNIP Background',
resetzoom=False)
if self._xmin is not None and self._xmax is not None:
- self.graphWidget.setGraphXLimits(xmin=self._xmin, xmax=self._xmax)
+ self.graphWidget.getXAxis().setLimits(self._xmin, self._xmax)
class BackgroundDialog(qt.QDialog):
@@ -467,11 +471,11 @@ class BackgroundDialog(qt.QDialog):
return self.parametersWidget.getParameters()
def setParameters(self, ddict):
- """See :meth:`BackgroundWidget.setParameters`"""
+ """See :meth:`BackgroundWidget.setPrintGeometry`"""
return self.parametersWidget.setParameters(ddict)
def setDefault(self, ddict):
- """Alias for :meth:`setParameters`"""
+ """Alias for :meth:`setPrintGeometry`"""
return self.setParameters(ddict)
diff --git a/silx/gui/fit/FitConfig.py b/silx/gui/fit/FitConfig.py
index 70b6fbe..04e411b 100644
--- a/silx/gui/fit/FitConfig.py
+++ b/silx/gui/fit/FitConfig.py
@@ -307,7 +307,7 @@ class SearchPage(qt.QWidget):
self.yScalingEntry.setToolTip(
"Data values will be multiplied by this value prior to peak" +
" search")
- self.yScalingEntry.setValidator(qt.QDoubleValidator())
+ self.yScalingEntry.setValidator(qt.QDoubleValidator(self))
layout3.addWidget(self.yScalingEntry)
# ----------------------------------------------------
@@ -324,7 +324,7 @@ class SearchPage(qt.QWidget):
"Peak search sensitivity threshold, expressed as a multiple " +
"of the standard deviation of the noise.\nMinimum value is 1 " +
"(to be detected, peak must be higher than the estimated noise)")
- sensivalidator = qt.QDoubleValidator()
+ sensivalidator = qt.QDoubleValidator(self)
sensivalidator.setBottom(1.0)
self.sensitivityEntry.setValidator(sensivalidator)
layout4.addWidget(self.sensitivityEntry)
@@ -418,7 +418,7 @@ class BackgroundPage(qt.QGroupBox):
"Factor used by the strip algorithm to decide whether a sample" +
"value should be stripped.\nThe value must be higher than the " +
"average of the 2 samples at +- w times this factor.\n")
- self.thresholdFactorEntry.setValidator(qt.QDoubleValidator())
+ self.thresholdFactorEntry.setValidator(qt.QDoubleValidator(self))
layout.addWidget(self.thresholdFactorEntry, 2, 1)
self.smoothStripGB = qt.QGroupBox("Apply smoothing prior to strip", self)
diff --git a/silx/gui/fit/FitWidget.py b/silx/gui/fit/FitWidget.py
index a5c3cfd..7012b63 100644
--- a/silx/gui/fit/FitWidget.py
+++ b/silx/gui/fit/FitWidget.py
@@ -87,6 +87,8 @@ class FitWidget(qt.QWidget):
run the estimation, set constraints on parameters and run the actual fit.
The results are displayed in a table.
+
+ .. image:: img/FitWidget.png
"""
sigFitWidgetSignal = qt.Signal(object)
"""This signal is emitted by the estimation and fit methods.
diff --git a/silx/gui/hdf5/Hdf5Formatter.py b/silx/gui/hdf5/Hdf5Formatter.py
new file mode 100644
index 0000000..3a4c1c1
--- /dev/null
+++ b/silx/gui/hdf5/Hdf5Formatter.py
@@ -0,0 +1,229 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This package provides a class sharred by widgets to format HDF5 data as
+text."""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "27/09/2017"
+
+import numpy
+from silx.third_party import six
+from silx.gui import qt
+from silx.gui.data.TextFormatter import TextFormatter
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
+
+class Hdf5Formatter(qt.QObject):
+ """Formatter to convert HDF5 data to string.
+ """
+
+ formatChanged = qt.Signal()
+ """Emitted when properties of the formatter change."""
+
+ def __init__(self, parent=None, textFormatter=None):
+ """
+ Constructor
+
+ :param qt.QObject parent: Owner of the object
+ :param TextFormatter formatter: Text formatter
+ """
+ qt.QObject.__init__(self, parent)
+ if textFormatter is not None:
+ self.__formatter = textFormatter
+ else:
+ self.__formatter = TextFormatter(self)
+ self.__formatter.formatChanged.connect(self.__formatChanged)
+
+ def textFormatter(self):
+ """Returns the used text formatter
+
+ :rtype: TextFormatter
+ """
+ return self.__formatter
+
+ def setTextFormatter(self, textFormatter):
+ """Set the text formatter to be used
+
+ :param TextFormatter textFormatter: The text formatter to use
+ """
+ if textFormatter is None:
+ raise ValueError("Formatter expected but None found")
+ if self.__formatter is textFormatter:
+ return
+ self.__formatter.formatChanged.disconnect(self.__formatChanged)
+ self.__formatter = textFormatter
+ self.__formatter.formatChanged.connect(self.__formatChanged)
+ self.__formatChanged()
+
+ def __formatChanged(self):
+ self.formatChanged.emit()
+
+ def humanReadableShape(self, dataset):
+ if dataset.shape is None:
+ return "none"
+ if dataset.shape == tuple():
+ return "scalar"
+ shape = [str(i) for i in dataset.shape]
+ text = u" \u00D7 ".join(shape)
+ return text
+
+ def humanReadableValue(self, dataset):
+ if dataset.shape is None:
+ return "No data"
+
+ dtype = dataset.dtype
+ if dataset.dtype.type == numpy.void:
+ if dtype.fields is None:
+ return "Raw data"
+
+ if dataset.shape == tuple():
+ numpy_object = dataset[()]
+ text = self.__formatter.toString(numpy_object, dtype=dataset.dtype)
+ else:
+ if dataset.size < 5 and dataset.compression is None:
+ numpy_object = dataset[0:5]
+ text = self.__formatter.toString(numpy_object, dtype=dataset.dtype)
+ else:
+ dimension = len(dataset.shape)
+ if dataset.compression is not None:
+ text = "Compressed %dD data" % dimension
+ else:
+ text = "%dD data" % dimension
+ return text
+
+ def humanReadableType(self, dataset, full=False):
+ dtype = dataset.dtype
+ return self.humanReadableDType(dtype, full)
+
+ def humanReadableDType(self, dtype, full=False):
+ if dtype == six.binary_type or numpy.issubdtype(dtype, numpy.string_):
+ text = "string"
+ if full:
+ text = "ASCII " + text
+ return text
+ elif dtype == six.text_type or numpy.issubdtype(dtype, numpy.unicode_):
+ text = "string"
+ if full:
+ text = "UTF-8 " + text
+ return text
+ elif dtype.type == numpy.object_:
+ ref = h5py.check_dtype(ref=dtype)
+ if ref is not None:
+ return "reference"
+ vlen = h5py.check_dtype(vlen=dtype)
+ if vlen is not None:
+ text = self.humanReadableDType(vlen, full=full)
+ if full:
+ text = "variable-length " + text
+ return text
+ return "object"
+ elif dtype.type == numpy.bool_:
+ return "bool"
+ elif dtype.type == numpy.void:
+ if dtype.fields is None:
+ return "opaque"
+ else:
+ if not full:
+ return "compound"
+ else:
+ compound = [d[0] for d in dtype.fields.values()]
+ compound = [self.humanReadableDType(d) for d in compound]
+ return "compound(%s)" % ", ".join(compound)
+ elif numpy.issubdtype(dtype, numpy.integer):
+ if h5py is not None:
+ enumType = h5py.check_dtype(enum=dtype)
+ if enumType is not None:
+ return "enum"
+
+ text = str(dtype.newbyteorder('N'))
+ if full:
+ if dtype.byteorder == "<":
+ text = "Little-endian " + text
+ elif dtype.byteorder == ">":
+ text = "Big-endian " + text
+ elif dtype.byteorder == "=":
+ text = "Native " + text
+
+ dtype = dtype.newbyteorder('N')
+ return text
+
+ def humanReadableHdf5Type(self, dataset):
+ """Format the internal HDF5 type as a string"""
+ t = dataset.id.get_type()
+ class_ = t.get_class()
+ if class_ == h5py.h5t.NO_CLASS:
+ return "NO_CLASS"
+ elif class_ == h5py.h5t.INTEGER:
+ return "INTEGER"
+ elif class_ == h5py.h5t.FLOAT:
+ return "FLOAT"
+ elif class_ == h5py.h5t.TIME:
+ return "TIME"
+ elif class_ == h5py.h5t.STRING:
+ charset = t.get_cset()
+ strpad = t.get_strpad()
+ text = ""
+
+ if strpad == h5py.h5t.STR_NULLTERM:
+ text += "NULLTERM"
+ elif strpad == h5py.h5t.STR_NULLPAD:
+ text += "NULLPAD"
+ elif strpad == h5py.h5t.STR_SPACEPAD:
+ text += "SPACEPAD"
+ else:
+ text += "UNKNOWN_STRPAD"
+
+ if t.is_variable_str():
+ text += " VARIABLE"
+
+ if charset == h5py.h5t.CSET_ASCII:
+ text += " ASCII"
+ elif charset == h5py.h5t.CSET_UTF8:
+ text += " UTF8"
+ else:
+ text += " UNKNOWN_CSET"
+
+ return text + " STRING"
+ elif class_ == h5py.h5t.BITFIELD:
+ return "BITFIELD"
+ elif class_ == h5py.h5t.OPAQUE:
+ return "OPAQUE"
+ elif class_ == h5py.h5t.COMPOUND:
+ return "COMPOUND"
+ elif class_ == h5py.h5t.REFERENCE:
+ return "REFERENCE"
+ elif class_ == h5py.h5t.ENUM:
+ return "ENUM"
+ elif class_ == h5py.h5t.VLEN:
+ return "VLEN"
+ elif class_ == h5py.h5t.ARRAY:
+ return "ARRAY"
+ else:
+ return "UNKNOWN_CLASS"
diff --git a/silx/gui/hdf5/Hdf5HeaderView.py b/silx/gui/hdf5/Hdf5HeaderView.py
index 5912230..7baa6e0 100644
--- a/silx/gui/hdf5/Hdf5HeaderView.py
+++ b/silx/gui/hdf5/Hdf5HeaderView.py
@@ -25,10 +25,11 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "08/11/2016"
+__date__ = "16/06/2017"
from .. import qt
+from .Hdf5TreeModel import Hdf5TreeModel
QTVERSION = qt.qVersion()
@@ -83,19 +84,21 @@ class Hdf5HeaderView(qt.QHeaderView):
setResizeMode = self.setSectionResizeMode
if self.__auto_resize:
- setResizeMode(0, qt.QHeaderView.ResizeToContents)
- setResizeMode(1, qt.QHeaderView.ResizeToContents)
- setResizeMode(2, qt.QHeaderView.ResizeToContents)
- setResizeMode(3, qt.QHeaderView.Interactive)
- setResizeMode(4, qt.QHeaderView.Interactive)
- setResizeMode(5, qt.QHeaderView.ResizeToContents)
+ setResizeMode(Hdf5TreeModel.NAME_COLUMN, qt.QHeaderView.ResizeToContents)
+ setResizeMode(Hdf5TreeModel.TYPE_COLUMN, qt.QHeaderView.ResizeToContents)
+ setResizeMode(Hdf5TreeModel.SHAPE_COLUMN, qt.QHeaderView.ResizeToContents)
+ setResizeMode(Hdf5TreeModel.VALUE_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.DESCRIPTION_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.NODE_COLUMN, qt.QHeaderView.ResizeToContents)
+ setResizeMode(Hdf5TreeModel.LINK_COLUMN, qt.QHeaderView.ResizeToContents)
else:
- setResizeMode(0, qt.QHeaderView.Interactive)
- setResizeMode(1, qt.QHeaderView.Interactive)
- setResizeMode(2, qt.QHeaderView.Interactive)
- setResizeMode(3, qt.QHeaderView.Interactive)
- setResizeMode(4, qt.QHeaderView.Interactive)
- setResizeMode(5, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.NAME_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.TYPE_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.SHAPE_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.VALUE_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.DESCRIPTION_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.NODE_COLUMN, qt.QHeaderView.Interactive)
+ setResizeMode(Hdf5TreeModel.LINK_COLUMN, qt.QHeaderView.Interactive)
def setAutoResizeColumns(self, autoResize):
"""Enable/disable auto-resize. When auto-resized, the header take care
diff --git a/silx/gui/hdf5/Hdf5Item.py b/silx/gui/hdf5/Hdf5Item.py
index 40793a4..f131f61 100644
--- a/silx/gui/hdf5/Hdf5Item.py
+++ b/silx/gui/hdf5/Hdf5Item.py
@@ -25,10 +25,9 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "20/01/2017"
+__date__ = "26/09/2017"
-import numpy
import logging
import collections
from .. import qt
@@ -37,6 +36,7 @@ from . import _utils
from .Hdf5Node import Hdf5Node
import silx.io.utils
from silx.gui.data.TextFormatter import TextFormatter
+from ..hdf5.Hdf5Formatter import Hdf5Formatter
_logger = logging.getLogger(__name__)
@@ -47,6 +47,8 @@ except ImportError as e:
raise e
_formatter = TextFormatter()
+_hdf5Formatter = Hdf5Formatter(textFormatter=_formatter)
+# FIXME: The formatter should be an attribute of the Hdf5Model
class Hdf5Item(Hdf5Node):
@@ -55,7 +57,7 @@ class Hdf5Item(Hdf5Node):
tree structure.
"""
- def __init__(self, text, obj, parent, key=None, h5pyClass=None, isBroken=False, populateAll=False):
+ def __init__(self, text, obj, parent, key=None, h5pyClass=None, linkClass=None, populateAll=False):
"""
:param str text: text displayed
:param object obj: Pointer to h5py data. See the `obj` attribute.
@@ -63,9 +65,10 @@ class Hdf5Item(Hdf5Node):
self.__obj = obj
self.__key = key
self.__h5pyClass = h5pyClass
- self.__isBroken = isBroken
+ self.__isBroken = obj is None and h5pyClass is None
self.__error = None
self.__text = text
+ self.__linkClass = linkClass
Hdf5Node.__init__(self, parent, populateAll=populateAll)
@property
@@ -88,16 +91,26 @@ class Hdf5Item(Hdf5Node):
:rtype: h5py.File or h5py.Dataset or h5py.Group
"""
- if self.__h5pyClass is None:
+ if self.__h5pyClass is None and self.obj is not None:
self.__h5pyClass = silx.io.utils.get_h5py_class(self.obj)
return self.__h5pyClass
+ @property
+ def linkClass(self):
+ """Returns the link class object of this node
+
+ :type: h5py.SoftLink or h5py.HardLink or h5py.ExternalLink or None
+ """
+ return self.__linkClass
+
def isGroupObj(self):
"""Returns true if the stored HDF5 object is a group (contains sub
groups or datasets).
:rtype: bool
"""
+ if self.h5pyClass is None:
+ return False
return issubclass(self.h5pyClass, h5py.Group)
def isBrokenObj(self):
@@ -111,6 +124,14 @@ class Hdf5Item(Hdf5Node):
"""
return self.__isBroken
+ def _getFormatter(self):
+ """
+ Returns an Hdf5Formatter
+
+ :rtype: Hdf5Formatter
+ """
+ return _hdf5Formatter
+
def _expectedChildCount(self):
if self.isGroupObj():
return len(self.obj)
@@ -158,6 +179,22 @@ class Hdf5Item(Hdf5Node):
self.__isBroken = True
else:
self.__obj = obj
+ if not self.isGroupObj():
+ try:
+ # pre-fetch of the data
+ if obj.shape is None:
+ pass
+ elif obj.shape == tuple():
+ obj[()]
+ else:
+ if obj.compression is None and obj.size > 0:
+ key = tuple([0] * len(obj.shape))
+ obj[key]
+ except Exception as e:
+ _logger.debug(e, exc_info=True)
+ message = "%s broken. %s" % (self.__obj.name, e.args[0])
+ self.__error = message
+ self.__isBroken = True
self.__key = None
@@ -166,15 +203,15 @@ class Hdf5Item(Hdf5Node):
for name in self.obj:
try:
class_ = self.obj.get(name, getclass=True)
- has_error = False
+ link = self.obj.get(name, getclass=True, getlink=True)
except Exception as e:
- _logger.error("Internal h5py error", exc_info=True)
+ _logger.warn("Internal h5py error", exc_info=True)
+ class_ = None
try:
- class_ = self.obj.get(name, getclass=True, getlink=True)
+ link = self.obj.get(name, getclass=True, getlink=True)
except Exception as e:
- class_ = h5py.HardLink
- has_error = True
- item = Hdf5Item(text=name, obj=None, parent=self, key=name, h5pyClass=class_, isBroken=has_error)
+ link = h5py.HardLink
+ item = Hdf5Item(text=name, obj=None, parent=self, key=name, h5pyClass=class_, linkClass=link)
self.appendChild(item)
def hasChildren(self):
@@ -191,6 +228,8 @@ class Hdf5Item(Hdf5Node):
:rtype: qt.QIcon
"""
+ # Pre-fetch the object, in case it is broken
+ obj = self.obj
style = qt.QApplication.style()
if self.__isBroken:
icon = style.standardIcon(qt.QStyle.SP_MessageBoxCritical)
@@ -205,99 +244,53 @@ class Hdf5Item(Hdf5Node):
elif issubclass(class_, h5py.ExternalLink):
return style.standardIcon(qt.QStyle.SP_FileLinkIcon)
elif issubclass(class_, h5py.Dataset):
- if len(self.obj.shape) < 4:
- name = "item-%ddim" % len(self.obj.shape)
+ if obj.shape is None:
+ name = "item-none"
+ elif len(obj.shape) < 4:
+ name = "item-%ddim" % len(obj.shape)
else:
name = "item-ndim"
- if str(self.obj.dtype) == "object":
- name = "item-object"
icon = icons.getQIcon(name)
return icon
return None
- def _humanReadableShape(self, dataset):
- if dataset.shape == tuple():
- return "scalar"
- shape = [str(i) for i in dataset.shape]
- text = u" \u00D7 ".join(shape)
- return text
-
- def _humanReadableValue(self, dataset):
- if dataset.shape == tuple():
- numpy_object = dataset[()]
- text = _formatter.toString(numpy_object)
- else:
- if dataset.size < 5 and dataset.compression is None:
- numpy_object = dataset[0:5]
- text = _formatter.toString(numpy_object)
- else:
- dimension = len(dataset.shape)
- if dataset.compression is not None:
- text = "Compressed %dD data" % dimension
- else:
- text = "%dD data" % dimension
- return text
-
- def _humanReadableDType(self, dtype, full=False):
- if dtype.type == numpy.string_:
- text = "string"
- elif dtype.type == numpy.unicode_:
- text = "string"
- elif dtype.type == numpy.object_:
- text = "object"
- elif dtype.type == numpy.bool_:
- text = "bool"
- elif dtype.type == numpy.void:
- if dtype.fields is None:
- text = "raw"
- else:
- if not full:
- text = "compound"
- else:
- compound = [d[0] for d in dtype.fields.values()]
- compound = [self._humanReadableDType(d) for d in compound]
- text = "compound(%s)" % ", ".join(compound)
- else:
- text = str(dtype)
- return text
-
- def _humanReadableType(self, dataset, full=False):
- return self._humanReadableDType(dataset.dtype, full)
-
- def _setTooltipAttributes(self, attributeDict):
+ def _createTooltipAttributes(self):
"""
Add key/value attributes that will be displayed in the item tooltip
:param Dict[str,str] attributeDict: Key/value attributes
"""
+ attributeDict = collections.OrderedDict()
+
if issubclass(self.h5pyClass, h5py.Dataset):
- attributeDict["Title"] = "HDF5 Dataset"
+ attributeDict["#Title"] = "HDF5 Dataset"
attributeDict["Name"] = self.basename
attributeDict["Path"] = self.obj.name
- attributeDict["Shape"] = self._humanReadableShape(self.obj)
- attributeDict["Value"] = self._humanReadableValue(self.obj)
- attributeDict["Data type"] = self._humanReadableType(self.obj, full=True)
+ attributeDict["Shape"] = self._getFormatter().humanReadableShape(self.obj)
+ attributeDict["Value"] = self._getFormatter().humanReadableValue(self.obj)
+ attributeDict["Data type"] = self._getFormatter().humanReadableType(self.obj, full=True)
elif issubclass(self.h5pyClass, h5py.Group):
- attributeDict["Title"] = "HDF5 Group"
+ attributeDict["#Title"] = "HDF5 Group"
attributeDict["Name"] = self.basename
attributeDict["Path"] = self.obj.name
elif issubclass(self.h5pyClass, h5py.File):
- attributeDict["Title"] = "HDF5 File"
+ attributeDict["#Title"] = "HDF5 File"
attributeDict["Name"] = self.basename
attributeDict["Path"] = "/"
elif isinstance(self.obj, h5py.ExternalLink):
- attributeDict["Title"] = "HDF5 External Link"
+ attributeDict["#Title"] = "HDF5 External Link"
attributeDict["Name"] = self.basename
attributeDict["Path"] = self.obj.name
attributeDict["Linked path"] = self.obj.path
attributeDict["Linked file"] = self.obj.filename
elif isinstance(self.obj, h5py.SoftLink):
- attributeDict["Title"] = "HDF5 Soft Link"
+ attributeDict["#Title"] = "HDF5 Soft Link"
attributeDict["Name"] = self.basename
attributeDict["Path"] = self.obj.name
attributeDict["Linked path"] = self.obj.path
else:
pass
+ return attributeDict
def _getDefaultTooltip(self):
"""Returns the default tooltip
@@ -308,10 +301,8 @@ class Hdf5Item(Hdf5Node):
self.obj # lazy loading of the object
return self.__error
- attrs = collections.OrderedDict()
- self._setTooltipAttributes(attrs)
-
- title = attrs.pop("Title", None)
+ attrs = self._createTooltipAttributes()
+ title = attrs.pop("#Title", None)
if len(attrs) > 0:
tooltip = _utils.htmlFromDict(attrs, title=title)
else:
@@ -342,7 +333,7 @@ class Hdf5Item(Hdf5Node):
return ""
class_ = self.h5pyClass
if issubclass(class_, h5py.Dataset):
- text = self._humanReadableType(self.obj)
+ text = self._getFormatter().humanReadableType(self.obj)
else:
text = ""
return text
@@ -361,7 +352,7 @@ class Hdf5Item(Hdf5Node):
class_ = self.h5pyClass
if not issubclass(class_, h5py.Dataset):
return ""
- return self._humanReadableShape(self.obj)
+ return self._getFormatter().humanReadableShape(self.obj)
return None
def dataValue(self, role):
@@ -375,7 +366,7 @@ class Hdf5Item(Hdf5Node):
return ""
if not issubclass(self.h5pyClass, h5py.Dataset):
return ""
- return self._humanReadableValue(self.obj)
+ return self._getFormatter().humanReadableValue(self.obj)
return None
def dataDescription(self, role):
@@ -412,10 +403,41 @@ class Hdf5Item(Hdf5Node):
if role == qt.Qt.TextAlignmentRole:
return qt.Qt.AlignTop | qt.Qt.AlignLeft
if role == qt.Qt.DisplayRole:
+ if self.isBrokenObj():
+ return ""
class_ = self.h5pyClass
text = class_.__name__.split(".")[-1]
return text
if role == qt.Qt.ToolTipRole:
class_ = self.h5pyClass
+ if class_ is None:
+ return ""
return "Class name: %s" % self.__class__
return None
+
+ def dataLink(self, role):
+ """Data for the link column
+
+ Overwrite it to implement the content of the 'link' column.
+
+ :rtype: qt.QVariant
+ """
+ if role == qt.Qt.DecorationRole:
+ return None
+ if role == qt.Qt.TextAlignmentRole:
+ return qt.Qt.AlignTop | qt.Qt.AlignLeft
+ if role == qt.Qt.DisplayRole:
+ link = self.linkClass
+ if link is None:
+ return ""
+ elif link is h5py.ExternalLink:
+ return "External"
+ elif link is h5py.SoftLink:
+ return "Soft"
+ elif link is h5py.HardLink:
+ return ""
+ else:
+ return link.__name__
+ if role == qt.Qt.ToolTipRole:
+ return None
+ return None
diff --git a/silx/gui/hdf5/Hdf5Node.py b/silx/gui/hdf5/Hdf5Node.py
index 31bb097..0fcb407 100644
--- a/silx/gui/hdf5/Hdf5Node.py
+++ b/silx/gui/hdf5/Hdf5Node.py
@@ -25,7 +25,9 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "23/09/2016"
+__date__ = "16/06/2017"
+
+import weakref
class Hdf5Node(object):
@@ -43,7 +45,9 @@ class Hdf5Node(object):
everything is lazy loaded.
"""
self.__child = None
- self.__parent = parent
+ self.__parent = None
+ if parent is not None:
+ self.__parent = weakref.ref(parent)
if populateAll:
self.__child = []
self._populateChild(populateAll=True)
@@ -54,7 +58,12 @@ class Hdf5Node(object):
:rtype: Hdf5Node
"""
- return self.__parent
+ if self.__parent is None:
+ return None
+ parent = self.__parent()
+ if parent is None:
+ self.__parent = parent
+ return parent
def setParent(self, parent):
"""Redefine the parent of the node.
@@ -63,7 +72,10 @@ class Hdf5Node(object):
:param Hdf5Node parent: The new parent
"""
- self.__parent = parent
+ if parent is None:
+ self.__parent = None
+ else:
+ self.__parent = weakref.ref(parent)
def appendChild(self, child):
"""Append a child to the node.
@@ -208,3 +220,12 @@ class Hdf5Node(object):
:rtype: qt.QVariant
"""
return None
+
+ def dataLink(self, role):
+ """Data for the link column
+
+ Overwrite it to implement the content of the 'link' column.
+
+ :rtype: qt.QVariant
+ """
+ return None
diff --git a/silx/gui/hdf5/Hdf5TreeModel.py b/silx/gui/hdf5/Hdf5TreeModel.py
index fb5de06..41fa91c 100644
--- a/silx/gui/hdf5/Hdf5TreeModel.py
+++ b/silx/gui/hdf5/Hdf5TreeModel.py
@@ -25,7 +25,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "19/12/2016"
+__date__ = "22/09/2017"
import os
@@ -71,6 +71,25 @@ else:
return x
+def _createRootLabel(h5obj):
+ """
+ Create label for the very first npde of the tree.
+
+ :param h5obj: The h5py object to display in the GUI
+ :type h5obj: h5py-like object
+ :rtpye: str
+ """
+ if silx_io.is_file(h5obj):
+ label = os.path.basename(h5obj.filename)
+ else:
+ filename = os.path.basename(h5obj.file.filename)
+ path = h5obj.name
+ if path.startswith("/"):
+ path = path[1:]
+ label = "%s::%s" % (filename, path)
+ return label
+
+
class LoadingItemRunnable(qt.QRunnable):
"""Runner to process item loading from a file"""
@@ -107,12 +126,7 @@ class LoadingItemRunnable(qt.QRunnable):
:param h5py.File h5obj: The h5py object to display in the GUI
:rtpye: Hdf5Node
"""
- if silx_io.is_file(h5obj):
- text = os.path.basename(h5obj.filename)
- else:
- filename = os.path.basename(h5obj.file.filename)
- path = h5obj.name
- text = "%s::%s" % (filename, path)
+ text = _createRootLabel(h5obj)
item = Hdf5Item(text=text, obj=h5obj, parent=oldItem.parent, populateAll=True)
return item
@@ -121,6 +135,7 @@ class LoadingItemRunnable(qt.QRunnable):
"""Process the file loading. The worker is used as holder
of the data and the signal. The result is sent as a signal.
"""
+ h5file = None
try:
h5file = silx_io.open(self.filename)
newItem = self.__loadItemTree(self.oldItem, h5file)
@@ -129,6 +144,8 @@ class LoadingItemRunnable(qt.QRunnable):
# Should be logged
error = e
newItem = None
+ if h5file is not None:
+ h5file.close()
# Take care of None value in case of PySide
newItem = _wrapNone(newItem)
@@ -174,6 +191,9 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
NODE_COLUMN = 5
"""Column id containing HDF5 node type"""
+ LINK_COLUMN = 6
+ """Column id containing HDF5 link type"""
+
COLUMN_IDS = [
NAME_COLUMN,
TYPE_COLUMN,
@@ -181,20 +201,21 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
VALUE_COLUMN,
DESCRIPTION_COLUMN,
NODE_COLUMN,
+ LINK_COLUMN,
]
"""List of logical columns available"""
def __init__(self, parent=None):
super(Hdf5TreeModel, self).__init__(parent)
- self.treeView = parent
- self.header_labels = [None] * 6
+ self.header_labels = [None] * len(self.COLUMN_IDS)
self.header_labels[self.NAME_COLUMN] = 'Name'
self.header_labels[self.TYPE_COLUMN] = 'Type'
self.header_labels[self.SHAPE_COLUMN] = 'Shape'
self.header_labels[self.VALUE_COLUMN] = 'Value'
self.header_labels[self.DESCRIPTION_COLUMN] = 'Description'
self.header_labels[self.NODE_COLUMN] = 'Node'
+ self.header_labels[self.LINK_COLUMN] = 'Link'
# Create items
self.__root = Hdf5Node()
@@ -205,14 +226,36 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
self.__animatedIcon.iconChanged.connect(self.__updateLoadingItems)
self.__runnerSet = set([])
- # store used icons to avoid to avoid the cache to release it
+ # store used icons to avoid the cache to release it
self.__icons = []
+ self.__icons.append(icons.getQIcon("item-none"))
self.__icons.append(icons.getQIcon("item-0dim"))
self.__icons.append(icons.getQIcon("item-1dim"))
self.__icons.append(icons.getQIcon("item-2dim"))
self.__icons.append(icons.getQIcon("item-3dim"))
self.__icons.append(icons.getQIcon("item-ndim"))
- self.__icons.append(icons.getQIcon("item-object"))
+
+ self.__openedFiles = []
+ """Store the list of files opened by the model itself."""
+ # FIXME: It should managed one by one by Hdf5Item itself
+
+ def __del__(self):
+ self._closeOpened()
+ s = super(Hdf5TreeModel, self)
+ if hasattr(s, "__del__"):
+ # else it fail on Python 3
+ s.__del__()
+
+ def _closeOpened(self):
+ """Close files which was opened by this model.
+
+ This function may be removed in the future.
+
+ File are opened by the model when it was inserted using
+ `insertFileAsync`, `insertFile`, `appendFile`."""
+ for h5file in self.__openedFiles:
+ h5file.close()
+ self.__openedFiles = []
def __updateLoadingItems(self, icon):
for i in range(self.__root.childCount()):
@@ -240,6 +283,7 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
self.__root.removeChildAtIndex(row)
self.endRemoveRows()
if newItem is not None:
+ self.__openedFiles.append(newItem.obj)
self.beginInsertRows(rootIndex, row, row)
self.__root.insertChild(row, newItem)
self.endInsertRows()
@@ -423,11 +467,13 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
return node.dataDescription(role)
elif index.column() == self.NODE_COLUMN:
return node.dataNode(role)
+ elif index.column() == self.LINK_COLUMN:
+ return node.dataLink(role)
else:
return None
def columnCount(self, parent=qt.QModelIndex()):
- return len(self.header_labels)
+ return len(self.COLUMN_IDS)
def hasChildren(self, parent=qt.QModelIndex()):
node = self.nodeFromIndex(parent)
@@ -536,12 +582,7 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
or any other class of h5py file structure.
"""
if text is None:
- if silx_io.is_file(h5pyObject):
- text = os.path.basename(h5pyObject.filename)
- else:
- filename = os.path.basename(h5pyObject.file.filename)
- path = h5pyObject.name
- text = "%s::%s" % (filename, path)
+ text = _createRootLabel(h5pyObject)
if row == -1:
row = self.__root.childCount()
self.insertNode(row, Hdf5Item(text=text, obj=h5pyObject, parent=self.__root))
@@ -572,6 +613,7 @@ class Hdf5TreeModel(qt.QAbstractItemModel):
"""
try:
h5file = silx_io.open(filename)
+ self.__openedFiles.append(h5file)
self.insertH5pyObject(h5file, row=row)
except IOError:
_logger.debug("File '%s' can't be read.", filename, exc_info=True)
diff --git a/silx/gui/hdf5/Hdf5TreeView.py b/silx/gui/hdf5/Hdf5TreeView.py
index 09f6fcf..0a4198e 100644
--- a/silx/gui/hdf5/Hdf5TreeView.py
+++ b/silx/gui/hdf5/Hdf5TreeView.py
@@ -25,7 +25,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "27/09/2016"
+__date__ = "20/09/2017"
import logging
@@ -43,6 +43,8 @@ _logger = logging.getLogger(__name__)
class Hdf5TreeView(qt.QTreeView):
"""TreeView which allow to browse HDF5 file structure.
+ .. image:: img/Hdf5TreeView.png
+
It provides columns width auto-resizing and additional
signals.
@@ -192,6 +194,87 @@ class Hdf5TreeView(qt.QTreeView):
continue
yield _utils.H5Node(item)
+ def setSelectedH5Node(self, h5Object):
+ """
+ Select the specified node of the tree using an h5py node.
+
+ - If the item is found, parent items are expended, and then the item
+ is selected.
+ - If the item is not found, the selection do not change.
+ - A none argument allow to deselect everything
+
+ :param h5py.Npde h5Object: The node to select
+ """
+ if h5Object is None:
+ self.setCurrentIndex(qt.QModelIndex())
+ return
+
+ filename = h5Object.file.filename
+
+ # Seach for the right roots
+ rootIndices = []
+ model = self.model()
+ for index in range(model.rowCount(qt.QModelIndex())):
+ index = model.index(index, 0, qt.QModelIndex())
+ obj = model.data(index, Hdf5TreeModel.H5PY_OBJECT_ROLE)
+ if obj.file.filename == filename:
+ # We can have many roots with different subtree of the same
+ # root
+ rootIndices.append(index)
+
+ if len(rootIndices) == 0:
+ # No root found
+ return
+
+ path = h5Object.name + "/"
+ path = path.replace("//", "/")
+
+ # Search for the right node
+ found = False
+ foundIndices = []
+ for _ in range(1000 * len(rootIndices)):
+ # Avoid too much iterations, in case of recurssive links
+ if len(foundIndices) == 0:
+ if len(rootIndices) == 0:
+ # Nothing found
+ break
+ # Start fron a new root
+ foundIndices.append(rootIndices.pop(0))
+
+ obj = model.data(index, Hdf5TreeModel.H5PY_OBJECT_ROLE)
+ p = obj.name + "/"
+ p = p.replace("//", "/")
+ if path == p:
+ found = True
+ break
+
+ parentIndex = foundIndices[-1]
+ for index in range(model.rowCount(parentIndex)):
+ index = model.index(index, 0, parentIndex)
+ obj = model.data(index, Hdf5TreeModel.H5PY_OBJECT_ROLE)
+
+ p = obj.name + "/"
+ p = p.replace("//", "/")
+ if path == p:
+ foundIndices.append(index)
+ found = True
+ break
+ elif path.startswith(p):
+ foundIndices.append(index)
+ break
+ else:
+ # Nothing found, start again with another root
+ foundIndices = []
+
+ if found:
+ break
+
+ if found:
+ # Update the GUI
+ for index in foundIndices[:-1]:
+ self.expand(index)
+ self.setCurrentIndex(foundIndices[-1])
+
def mousePressEvent(self, event):
"""Override mousePressEvent to provide a consistante compatible API
between Qt4 and Qt5
diff --git a/silx/gui/hdf5/NexusSortFilterProxyModel.py b/silx/gui/hdf5/NexusSortFilterProxyModel.py
index 9a4268c..49a22d3 100644
--- a/silx/gui/hdf5/NexusSortFilterProxyModel.py
+++ b/silx/gui/hdf5/NexusSortFilterProxyModel.py
@@ -25,7 +25,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "12/04/2017"
+__date__ = "16/06/2017"
import logging
@@ -86,7 +86,8 @@ class NexusSortFilterProxyModel(qt.QSortFilterProxyModel):
def __isNXentry(self, node):
"""Returns true if the node is an NXentry"""
- if not issubclass(node.h5pyClass, h5py.Group):
+ class_ = node.h5pyClass
+ if class_ is None or not issubclass(node.h5pyClass, h5py.Group):
return False
nxClass = node.obj.attrs.get("NX_class", None)
return nxClass == "NXentry"
diff --git a/silx/gui/hdf5/_utils.py b/silx/gui/hdf5/_utils.py
index af9c79f..048aa20 100644
--- a/silx/gui/hdf5/_utils.py
+++ b/silx/gui/hdf5/_utils.py
@@ -28,11 +28,10 @@ package `silx.gui.hdf5` package.
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "29/09/2017"
import logging
-import numpy
from .. import qt
import silx.io.utils
from silx.utils.html import escape
@@ -138,10 +137,61 @@ class H5Node(object):
:param Hdf5Item h5py_item: An Hdf5Item
"""
self.__h5py_object = h5py_item.obj
+ self.__h5py_target = None
self.__h5py_item = h5py_item
def __getattr__(self, name):
- return object.__getattribute__(self.__h5py_object, name)
+ if hasattr(self.__h5py_object, name):
+ attr = getattr(self.__h5py_object, name)
+ return attr
+ raise AttributeError("H5Node has no attribute %s" % name)
+
+ def __get_target(self, obj):
+ """
+ Return the actual physical target of the provided object.
+
+ Objects can contains links in the middle of the path, this function
+ check each groups and remove this prefix in case of the link by the
+ link of the path.
+
+ :param obj: A valid h5py object (File, group or dataset)
+ :type obj: h5py.Dataset or h5py.Group or h5py.File
+ :rtype: h5py.Dataset or h5py.Group or h5py.File
+ """
+ elements = obj.name.split("/")
+ if obj.name == "/":
+ return obj
+ elif obj.name.startswith("/"):
+ elements.pop(0)
+ path = ""
+ while len(elements) > 0:
+ e = elements.pop(0)
+ path = path + "/" + e
+ link = obj.parent.get(path, getlink=True)
+
+ if isinstance(link, h5py.ExternalLink):
+ subpath = "/".join(elements)
+ external_obj = obj.parent.get(self.basename + "/" + subpath)
+ return self.__get_target(external_obj)
+ elif silx.io.utils.is_softlink(link):
+ # Restart from this stat
+ path = ""
+ root_elements = link.path.split("/")
+ if link.path == "/":
+ root_elements = []
+ elif link.path.startswith("/"):
+ root_elements.pop(0)
+ for name in reversed(root_elements):
+ elements.insert(0, name)
+
+ return obj.file[path]
+
+ @property
+ def h5py_target(self):
+ if self.__h5py_target is not None:
+ return self.__h5py_target
+ self.__h5py_target = self.__get_target(self.__h5py_object)
+ return self.__h5py_target
@property
def h5py_object(self):
@@ -170,8 +220,18 @@ class H5Node(object):
return self.__h5py_object.name.split("/")[-1]
@property
+ def is_broken(self):
+ """Returns true if the node is a broken link.
+
+ :rtype: bool
+ """
+ if self.__h5py_item is None:
+ raise RuntimeError("h5py_item is not defined")
+ return self.__h5py_item.isBrokenObj()
+
+ @property
def local_name(self):
- """Returns the local path of this h5py node.
+ """Returns the path from the master file root to this node.
For links, this path is not equal to the h5py one.
@@ -183,34 +243,46 @@ class H5Node(object):
result = []
item = self.__h5py_item
while item is not None:
- if issubclass(item.h5pyClass, h5py.File):
+ # stop before the root item (item without parent)
+ if item.parent.parent is None:
+ name = item.obj.name
+ if name != "/":
+ result.append(item.obj.name)
break
- result.append(item.basename)
+ else:
+ result.append(item.basename)
item = item.parent
if item is None:
raise RuntimeError("The item does not have parent holding h5py.File")
if result == []:
return "/"
- result.append("")
+ if not result[-1].startswith("/"):
+ result.append("")
result.reverse()
- return "/".join(result)
+ name = "/".join(result)
+ return name
- def __file_item(self):
- """Returns the parent item holding the :class:`h5py.File` object
+ def __get_local_file(self):
+ """Returns the file of the root of this tree
:rtype: h5py.File
- :raises RuntimeException: If no file are found
"""
item = self.__h5py_item
- while item is not None:
- if issubclass(item.h5pyClass, h5py.File):
- return item
+ while item.parent.parent is not None:
+ class_ = item.h5pyClass
+ if class_ is not None and issubclass(class_, h5py.File):
+ break
item = item.parent
- raise RuntimeError("The item does not have parent holding h5py.File")
+
+ class_ = item.h5pyClass
+ if class_ is not None and issubclass(class_, h5py.File):
+ return item.obj
+ else:
+ return item.obj.file
@property
def local_file(self):
- """Returns the local :class:`h5py.File` object.
+ """Returns the master file in which is this node.
For path containing external links, this file is not equal to the h5py
one.
@@ -218,12 +290,11 @@ class H5Node(object):
:rtype: h5py.File
:raises RuntimeException: If no file are found
"""
- item = self.__file_item()
- return item.obj
+ return self.__get_local_file()
@property
def local_filename(self):
- """Returns the local filename of the h5py node.
+ """Returns the filename from the master file of this node.
For path containing external links, this path is not equal to the
filename provided by h5py.
@@ -235,13 +306,84 @@ class H5Node(object):
@property
def local_basename(self):
- """Returns the local filename of the h5py node.
+ """Returns the basename from the master file root to this node.
For path containing links, this basename can be different than the
basename provided by h5py.
:rtype: str
"""
- if issubclass(self.__h5py_item.h5pyClass, h5py.File):
+ class_ = self.__h5py_item.h5pyClass
+ if class_ is not None and issubclass(class_, h5py.File):
return ""
return self.__h5py_item.basename
+
+ @property
+ def physical_file(self):
+ """Returns the physical file in which is this node.
+
+ .. versionadded:: 0.6
+
+ :rtype: h5py.File
+ :raises RuntimeError: If no file are found
+ """
+ if isinstance(self.__h5py_object, h5py.ExternalLink):
+ # It means the link is broken
+ raise RuntimeError("No file node found")
+ if isinstance(self.__h5py_object, h5py.SoftLink):
+ # It means the link is broken
+ return self.local_file
+
+ physical_obj = self.h5py_target
+ return physical_obj.file
+
+ @property
+ def physical_name(self):
+ """Returns the path from the location this h5py node is physically
+ stored.
+
+ For broken links, this filename can be different from the
+ filename provided by h5py.
+
+ :rtype: str
+ """
+ if isinstance(self.__h5py_object, h5py.ExternalLink):
+ # It means the link is broken
+ return self.__h5py_object.path
+ if isinstance(self.__h5py_object, h5py.SoftLink):
+ # It means the link is broken
+ return self.__h5py_object.path
+
+ physical_obj = self.h5py_target
+ return physical_obj.name
+
+ @property
+ def physical_filename(self):
+ """Returns the filename from the location this h5py node is physically
+ stored.
+
+ For broken links, this filename can be different from the
+ filename provided by h5py.
+
+ :rtype: str
+ """
+ if isinstance(self.__h5py_object, h5py.ExternalLink):
+ # It means the link is broken
+ return self.__h5py_object.filename
+ if isinstance(self.__h5py_object, h5py.SoftLink):
+ # It means the link is broken
+ return self.local_file.filename
+
+ return self.physical_file.filename
+
+ @property
+ def physical_basename(self):
+ """Returns the basename from the location this h5py node is physically
+ stored.
+
+ For broken links, this basename can be different from the
+ basename provided by h5py.
+
+ :rtype: str
+ """
+ return self.physical_name.split("/")[-1]
diff --git a/silx/gui/hdf5/test/_mock.py b/silx/gui/hdf5/test/_mock.py
deleted file mode 100644
index eada590..0000000
--- a/silx/gui/hdf5/test/_mock.py
+++ /dev/null
@@ -1,130 +0,0 @@
-# coding: utf-8
-# /*##########################################################################
-#
-# Copyright (c) 2016-2017 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.
-#
-# ###########################################################################*/
-"""Mock for silx.gui.hdf5 module"""
-
-__authors__ = ["V. Valls"]
-__license__ = "MIT"
-__date__ = "12/04/2017"
-
-
-import numpy
-try:
- import h5py
-except ImportError:
- h5py = None
-
-
-class Node(object):
-
- def __init__(self, basename, parent, h5py_class):
- self.basename = basename
- self.h5py_class = h5py_class
- self.attrs = {}
- self.parent = parent
- if parent is not None:
- self.parent._add(self)
-
- @property
- def name(self):
- if self.parent is None:
- return self.basename
- if self.parent.name == "":
- return self.basename
- return self.parent.name + "/" + self.basename
-
- @property
- def file(self):
- if self.parent is None:
- return self
- return self.parent.file
-
-
-class Group(Node):
- """Mock an h5py Group"""
-
- def __init__(self, name, parent, h5py_class=h5py.Group):
- super(Group, self).__init__(name, parent, h5py_class)
- self.__items = {}
-
- def _add(self, node):
- self.__items[node.basename] = node
-
- def __getitem__(self, key):
- return self.__items[key]
-
- def __iter__(self):
- for k in self.__items:
- yield k
-
- def __len__(self):
- return len(self.__items)
-
- def get(self, name, getclass=False, getlink=False):
- result = self.__items[name]
- if getclass:
- return result.h5py_class
- return result
-
- def create_dataset(self, name, data):
- return Dataset(name, self, data)
-
- def create_group(self, name):
- return Group(name, self)
-
- def create_NXentry(self, name):
- group = Group(name, self)
- group.attrs["NX_class"] = "NXentry"
- return group
-
-
-class File(Group):
- """Mock an h5py File"""
-
- def __init__(self, filename):
- super(File, self).__init__("", None, h5py.File)
- self.filename = filename
-
-
-class Dataset(Node):
- """Mock an h5py Dataset"""
-
- def __init__(self, name, parent, value):
- super(Dataset, self).__init__(name, parent, h5py.Dataset)
- self.__value = value
- self.shape = self.__value.shape
- self.dtype = self.__value.dtype
- self.size = self.__value.size
- self.compression = None
- self.compression_opts = None
-
- def __getitem__(self, key):
- if not isinstance(self.__value, numpy.ndarray):
- if key == tuple():
- return self.__value
- elif key == Ellipsis:
- return numpy.array(self.__value)
- else:
- raise ValueError("Bad key")
- return self.__value[key]
diff --git a/silx/gui/hdf5/test/test_hdf5.py b/silx/gui/hdf5/test/test_hdf5.py
index 3bf4897..8e375f2 100644
--- a/silx/gui/hdf5/test/test_hdf5.py
+++ b/silx/gui/hdf5/test/test_hdf5.py
@@ -26,7 +26,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "12/04/2017"
+__date__ = "22/09/2017"
import time
@@ -34,11 +34,12 @@ import os
import unittest
import tempfile
import numpy
+import shutil
from contextlib import contextmanager
from silx.gui import qt
from silx.gui.test.utils import TestCaseQt
from silx.gui import hdf5
-from . import _mock
+from silx.io import commonh5
try:
import h5py
@@ -54,6 +55,13 @@ class _Holder(object):
_called += 1
+def create_NXentry(group, name):
+ attrs = {"NX_class": "NXentry"}
+ node = commonh5.Group(name, parent=group, attrs=attrs)
+ group.add_node(node)
+ return node
+
+
class TestHdf5TreeModel(TestCaseQt):
def setUp(self):
@@ -124,14 +132,14 @@ class TestHdf5TreeModel(TestCaseQt):
h5File.close()
def testInsertObject(self):
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
model = hdf5.Hdf5TreeModel()
self.assertEquals(model.rowCount(qt.QModelIndex()), 0)
model.insertH5pyObject(h5)
self.assertEquals(model.rowCount(qt.QModelIndex()), 1)
def testRemoveObject(self):
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
model = hdf5.Hdf5TreeModel()
self.assertEquals(model.rowCount(qt.QModelIndex()), 0)
model.insertH5pyObject(h5)
@@ -223,7 +231,7 @@ class TestHdf5TreeModel(TestCaseQt):
return model.data(index, qt.Qt.DisplayRole)
def testFileData(self):
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
model = hdf5.Hdf5TreeModel()
model.insertH5pyObject(h5)
displayed = self.getRowDataAsDict(model, row=0)
@@ -236,7 +244,7 @@ class TestHdf5TreeModel(TestCaseQt):
self.assertEquals(displayed[hdf5.Hdf5TreeModel.NODE_COLUMN, qt.Qt.DisplayRole], "File")
def testGroupData(self):
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
d = h5.create_group("foo")
d.attrs["desc"] = "fooo"
@@ -252,9 +260,9 @@ class TestHdf5TreeModel(TestCaseQt):
self.assertEquals(displayed[hdf5.Hdf5TreeModel.NODE_COLUMN, qt.Qt.DisplayRole], "Group")
def testDatasetData(self):
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
value = numpy.array([1, 2, 3])
- d = h5.create_dataset("foo", value)
+ d = h5.create_dataset("foo", data=value)
model = hdf5.Hdf5TreeModel()
model.insertH5pyObject(d)
@@ -269,8 +277,8 @@ class TestHdf5TreeModel(TestCaseQt):
def testDropLastAsFirst(self):
model = hdf5.Hdf5TreeModel()
- h5_1 = _mock.File("/foo/bar/1.mock")
- h5_2 = _mock.File("/foo/bar/2.mock")
+ h5_1 = commonh5.File("/foo/bar/1.mock", "w")
+ h5_2 = commonh5.File("/foo/bar/2.mock", "w")
model.insertH5pyObject(h5_1)
model.insertH5pyObject(h5_2)
self.assertEquals(self.getItemName(model, 0), "1.mock")
@@ -283,8 +291,8 @@ class TestHdf5TreeModel(TestCaseQt):
def testDropFirstAsLast(self):
model = hdf5.Hdf5TreeModel()
- h5_1 = _mock.File("/foo/bar/1.mock")
- h5_2 = _mock.File("/foo/bar/2.mock")
+ h5_1 = commonh5.File("/foo/bar/1.mock", "w")
+ h5_2 = commonh5.File("/foo/bar/2.mock", "w")
model.insertH5pyObject(h5_1)
model.insertH5pyObject(h5_2)
self.assertEquals(self.getItemName(model, 0), "1.mock")
@@ -297,7 +305,7 @@ class TestHdf5TreeModel(TestCaseQt):
def testRootParent(self):
model = hdf5.Hdf5TreeModel()
- h5_1 = _mock.File("/foo/bar/1.mock")
+ h5_1 = commonh5.File("/foo/bar/1.mock", "w")
model.insertH5pyObject(h5_1)
index = model.index(0, 0, qt.QModelIndex())
index = model.parent(index)
@@ -318,10 +326,10 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testNXentryStartTime(self):
"""Test NXentry with start_time"""
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
- h5.create_NXentry("a").create_dataset("start_time", numpy.string_("2015"))
- h5.create_NXentry("b").create_dataset("start_time", numpy.string_("2013"))
- h5.create_NXentry("c").create_dataset("start_time", numpy.string_("2014"))
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
+ create_NXentry(h5, "a").create_dataset("start_time", data=numpy.string_("2015"))
+ create_NXentry(h5, "b").create_dataset("start_time", data=numpy.string_("2013"))
+ create_NXentry(h5, "c").create_dataset("start_time", data=numpy.string_("2014"))
model.insertH5pyObject(h5)
proxy = hdf5.NexusSortFilterProxyModel()
@@ -333,10 +341,10 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testNXentryStartTimeInArray(self):
"""Test NXentry with start_time"""
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
- h5.create_NXentry("a").create_dataset("start_time", numpy.array([numpy.string_("2015")]))
- h5.create_NXentry("b").create_dataset("start_time", numpy.array([numpy.string_("2013")]))
- h5.create_NXentry("c").create_dataset("start_time", numpy.array([numpy.string_("2014")]))
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
+ create_NXentry(h5, "a").create_dataset("start_time", data=numpy.array([numpy.string_("2015")]))
+ create_NXentry(h5, "b").create_dataset("start_time", data=numpy.array([numpy.string_("2013")]))
+ create_NXentry(h5, "c").create_dataset("start_time", data=numpy.array([numpy.string_("2014")]))
model.insertH5pyObject(h5)
proxy = hdf5.NexusSortFilterProxyModel()
@@ -348,10 +356,10 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testNXentryEndTimeInArray(self):
"""Test NXentry with end_time"""
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
- h5.create_NXentry("a").create_dataset("end_time", numpy.array([numpy.string_("2015")]))
- h5.create_NXentry("b").create_dataset("end_time", numpy.array([numpy.string_("2013")]))
- h5.create_NXentry("c").create_dataset("end_time", numpy.array([numpy.string_("2014")]))
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
+ create_NXentry(h5, "a").create_dataset("end_time", data=numpy.array([numpy.string_("2015")]))
+ create_NXentry(h5, "b").create_dataset("end_time", data=numpy.array([numpy.string_("2013")]))
+ create_NXentry(h5, "c").create_dataset("end_time", data=numpy.array([numpy.string_("2014")]))
model.insertH5pyObject(h5)
proxy = hdf5.NexusSortFilterProxyModel()
@@ -363,10 +371,10 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testNXentryName(self):
"""Test NXentry without start_time or end_time"""
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
- h5.create_NXentry("a")
- h5.create_NXentry("c")
- h5.create_NXentry("b")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
+ create_NXentry(h5, "a")
+ create_NXentry(h5, "c")
+ create_NXentry(h5, "b")
model.insertH5pyObject(h5)
proxy = hdf5.NexusSortFilterProxyModel()
@@ -378,10 +386,10 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testStartTime(self):
"""If it is not NXentry, start_time is not used"""
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
- h5.create_group("a").create_dataset("start_time", numpy.string_("2015"))
- h5.create_group("b").create_dataset("start_time", numpy.string_("2013"))
- h5.create_group("c").create_dataset("start_time", numpy.string_("2014"))
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
+ h5.create_group("a").create_dataset("start_time", data=numpy.string_("2015"))
+ h5.create_group("b").create_dataset("start_time", data=numpy.string_("2013"))
+ h5.create_group("c").create_dataset("start_time", data=numpy.string_("2014"))
model.insertH5pyObject(h5)
proxy = hdf5.NexusSortFilterProxyModel()
@@ -392,7 +400,7 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testName(self):
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
h5.create_group("a")
h5.create_group("c")
h5.create_group("b")
@@ -406,7 +414,7 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testNumber(self):
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
h5.create_group("a1")
h5.create_group("a20")
h5.create_group("a3")
@@ -420,7 +428,7 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testMultiNumber(self):
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
h5.create_group("a1-1")
h5.create_group("a20-1")
h5.create_group("a3-1")
@@ -436,7 +444,7 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
def testUnconsistantTypes(self):
model = hdf5.Hdf5TreeModel()
- h5 = _mock.File("/foo/bar/1.mock")
+ h5 = commonh5.File("/foo/bar/1.mock", "w")
h5.create_group("aaa100")
h5.create_group("100aaa")
model.insertH5pyObject(h5)
@@ -448,11 +456,235 @@ class TestNexusSortFilterProxyModel(TestCaseQt):
self.assertListEqual(names, ["100aaa", "aaa100"])
-class TestHdf5(TestCaseQt):
+class TestH5Node(TestCaseQt):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestH5Node, cls).setUpClass()
+ if h5py is None:
+ raise unittest.SkipTest("h5py is not available")
+
+ cls.tmpDirectory = tempfile.mkdtemp()
+ cls.h5Filename = cls.createResource(cls.tmpDirectory)
+ cls.h5File = h5py.File(cls.h5Filename, mode="r")
+ cls.model = cls.createModel(cls.h5File)
+
+ @classmethod
+ def createResource(cls, directory):
+ filename = os.path.join(directory, "base.h5")
+ externalFilename = os.path.join(directory, "base__external.h5")
+
+ externalh5 = h5py.File(externalFilename, mode="w")
+ externalh5["target/dataset"] = 50
+ externalh5["target/link"] = h5py.SoftLink("/target/dataset")
+ externalh5.close()
+
+ h5 = h5py.File(filename, mode="w")
+ h5["group/dataset"] = 50
+ h5["link/soft_link"] = h5py.SoftLink("/group/dataset")
+ h5["link/soft_link_to_group"] = h5py.SoftLink("/group")
+ h5["link/soft_link_to_link"] = h5py.SoftLink("/link/soft_link")
+ h5["link/soft_link_to_file"] = h5py.SoftLink("/")
+ h5["link/external_link"] = h5py.ExternalLink(externalFilename, "/target/dataset")
+ h5["link/external_link_to_link"] = h5py.ExternalLink(externalFilename, "/target/link")
+ h5["broken_link/external_broken_file"] = h5py.ExternalLink(externalFilename + "_not_exists", "/target/link")
+ h5["broken_link/external_broken_link"] = h5py.ExternalLink(externalFilename, "/target/not_exists")
+ h5["broken_link/soft_broken_link"] = h5py.SoftLink("/group/not_exists")
+ h5["broken_link/soft_link_to_broken_link"] = h5py.SoftLink("/group/not_exists")
+ h5.close()
+
+ return filename
+
+ @classmethod
+ def createModel(cls, h5pyFile):
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(h5pyFile)
+ return model
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.model = None
+ cls.h5File.close()
+ shutil.rmtree(cls.tmpDirectory)
+ super(TestH5Node, cls).tearDownClass()
+
+ def getIndexFromPath(self, model, path):
+ """
+ :param qt.QAbstractItemModel: model
+ """
+ index = qt.QModelIndex()
+ for name in path:
+ for row in range(model.rowCount(index)):
+ i = model.index(row, 0, index)
+ label = model.data(i)
+ if label == name:
+ index = i
+ break
+ else:
+ raise RuntimeError("Path not found")
+ return index
+
+ def getH5NodeFromPath(self, model, path):
+ index = self.getIndexFromPath(model, path)
+ item = model.data(index, hdf5.Hdf5TreeModel.H5PY_ITEM_ROLE)
+ h5node = hdf5.H5Node(item)
+ return h5node
+
+ def testFile(self):
+ path = ["base.h5"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "")
+ self.assertEqual(h5node.physical_name, "/")
+ self.assertEqual(h5node.local_basename, "")
+ self.assertEqual(h5node.local_name, "/")
+
+ def testGroup(self):
+ path = ["base.h5", "group"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "group")
+ self.assertEqual(h5node.physical_name, "/group")
+ self.assertEqual(h5node.local_basename, "group")
+ self.assertEqual(h5node.local_name, "/group")
+
+ def testDataset(self):
+ path = ["base.h5", "group", "dataset"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/group/dataset")
+ self.assertEqual(h5node.local_basename, "dataset")
+ self.assertEqual(h5node.local_name, "/group/dataset")
+
+ def testSoftLink(self):
+ path = ["base.h5", "link", "soft_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/group/dataset")
+ self.assertEqual(h5node.local_basename, "soft_link")
+ self.assertEqual(h5node.local_name, "/link/soft_link")
+
+ def testSoftLinkToLink(self):
+ path = ["base.h5", "link", "soft_link_to_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/group/dataset")
+ self.assertEqual(h5node.local_basename, "soft_link_to_link")
+ self.assertEqual(h5node.local_name, "/link/soft_link_to_link")
+
+ def testExternalLink(self):
+ path = ["base.h5", "link", "external_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertNotEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.local_filename)
+ self.assertIn("base__external.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/target/dataset")
+ self.assertEqual(h5node.local_basename, "external_link")
+ self.assertEqual(h5node.local_name, "/link/external_link")
+
+ def testExternalLinkToLink(self):
+ path = ["base.h5", "link", "external_link_to_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertNotEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.local_filename)
+ self.assertIn("base__external.h5", h5node.physical_filename)
+
+ self.assertNotEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/target/dataset")
+ self.assertEqual(h5node.local_basename, "external_link_to_link")
+ self.assertEqual(h5node.local_name, "/link/external_link_to_link")
+
+ def testExternalBrokenFile(self):
+ path = ["base.h5", "broken_link", "external_broken_file"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertNotEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.local_filename)
+ self.assertIn("not_exists", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "link")
+ self.assertEqual(h5node.physical_name, "/target/link")
+ self.assertEqual(h5node.local_basename, "external_broken_file")
+ self.assertEqual(h5node.local_name, "/broken_link/external_broken_file")
+
+ def testExternalBrokenLink(self):
+ path = ["base.h5", "broken_link", "external_broken_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertNotEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.local_filename)
+ self.assertIn("__external", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "not_exists")
+ self.assertEqual(h5node.physical_name, "/target/not_exists")
+ self.assertEqual(h5node.local_basename, "external_broken_link")
+ self.assertEqual(h5node.local_name, "/broken_link/external_broken_link")
+
+ def testSoftBrokenLink(self):
+ path = ["base.h5", "broken_link", "soft_broken_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "not_exists")
+ self.assertEqual(h5node.physical_name, "/group/not_exists")
+ self.assertEqual(h5node.local_basename, "soft_broken_link")
+ self.assertEqual(h5node.local_name, "/broken_link/soft_broken_link")
+
+ def testSoftLinkToBrokenLink(self):
+ path = ["base.h5", "broken_link", "soft_link_to_broken_link"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "not_exists")
+ self.assertEqual(h5node.physical_name, "/group/not_exists")
+ self.assertEqual(h5node.local_basename, "soft_link_to_broken_link")
+ self.assertEqual(h5node.local_name, "/broken_link/soft_link_to_broken_link")
+
+ def testDatasetFromSoftLinkToGroup(self):
+ path = ["base.h5", "link", "soft_link_to_group", "dataset"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/group/dataset")
+ self.assertEqual(h5node.local_basename, "dataset")
+ self.assertEqual(h5node.local_name, "/link/soft_link_to_group/dataset")
+
+ def testDatasetFromSoftLinkToFile(self):
+ path = ["base.h5", "link", "soft_link_to_file", "link", "soft_link_to_group", "dataset"]
+ h5node = self.getH5NodeFromPath(self.model, path)
+
+ self.assertEqual(h5node.physical_filename, h5node.local_filename)
+ self.assertIn("base.h5", h5node.physical_filename)
+ self.assertEqual(h5node.physical_basename, "dataset")
+ self.assertEqual(h5node.physical_name, "/group/dataset")
+ self.assertEqual(h5node.local_basename, "dataset")
+ self.assertEqual(h5node.local_name, "/link/soft_link_to_file/link/soft_link_to_group/dataset")
+
+
+class TestHdf5TreeView(TestCaseQt):
"""Test to check that icons module."""
def setUp(self):
- super(TestHdf5, self).setUp()
+ super(TestHdf5TreeView, self).setUp()
if h5py is None:
self.skipTest("h5py is not available")
@@ -464,15 +696,147 @@ class TestHdf5(TestCaseQt):
view = hdf5.Hdf5TreeView()
view._createContextMenu(qt.QPoint(0, 0))
+ def testSelection_Simple(self):
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ item = tree.create_group("a/b/c/d")
+ item.create_group("e").create_group("f")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(tree)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(item)
+
+ selected = list(view.selectedH5Nodes())[0]
+ self.assertIs(item, selected.h5py_object)
+
+ def testSelection_NotFound(self):
+ tree2 = commonh5.File("/foo/bar/2.mock", "w")
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ item = tree.create_group("a/b/c/d")
+ item.create_group("e").create_group("f")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(tree)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(tree2)
+
+ selection = list(view.selectedH5Nodes())
+ self.assertEqual(len(selection), 0)
+
+ def testSelection_ManyGroupFromSameFile(self):
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ group1 = tree.create_group("a1")
+ group2 = tree.create_group("a2")
+ group3 = tree.create_group("a3")
+ group1.create_group("b/c/d")
+ item = group2.create_group("b/c/d")
+ group3.create_group("b/c/d")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(group1)
+ model.insertH5pyObject(group2)
+ model.insertH5pyObject(group3)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(item)
+
+ selected = list(view.selectedH5Nodes())[0]
+ self.assertIs(item, selected.h5py_object)
+
+ def testSelection_RootFromSubTree(self):
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ group = tree.create_group("a1")
+ group.create_group("b/c/d")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(group)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(group)
+
+ selected = list(view.selectedH5Nodes())[0]
+ self.assertIs(group, selected.h5py_object)
+
+ def testSelection_FileFromSubTree(self):
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ group = tree.create_group("a1")
+ group.create_group("b").create_group("b").create_group("d")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(group)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(tree)
+
+ selection = list(view.selectedH5Nodes())
+ self.assertEquals(len(selection), 0)
+
+ def testSelection_Tree(self):
+ tree1 = commonh5.File("/foo/bar/1.mock", "w")
+ tree2 = commonh5.File("/foo/bar/2.mock", "w")
+ tree3 = commonh5.File("/foo/bar/3.mock", "w")
+ tree1.create_group("a/b/c")
+ tree2.create_group("a/b/c")
+ tree3.create_group("a/b/c")
+ item = tree2
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(tree1)
+ model.insertH5pyObject(tree2)
+ model.insertH5pyObject(tree3)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(item)
+
+ selected = list(view.selectedH5Nodes())[0]
+ self.assertIs(item, selected.h5py_object)
+
+ def testSelection_RecurssiveLink(self):
+ """
+ Recurssive link selection
+
+ This example is not really working as expected cause commonh5 do not
+ support recurssive links.
+ But item.name == "/a/b" and the result is found.
+ """
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+ group = tree.create_group("a")
+ group.add_node(commonh5.SoftLink("b", "/"))
+
+ item = tree["/a/b/a/b/a/b/a/b/a/b/a/b/a/b/a/b"]
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(tree)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(item)
+
+ selected = list(view.selectedH5Nodes())[0]
+ self.assertEqual(item.name, selected.h5py_object.name)
+
+ def testSelection_SelectNone(self):
+ tree = commonh5.File("/foo/bar/1.mock", "w")
+
+ model = hdf5.Hdf5TreeModel()
+ model.insertH5pyObject(tree)
+ view = hdf5.Hdf5TreeView()
+ view.setModel(model)
+ view.setSelectedH5Node(tree)
+ view.setSelectedH5Node(None)
+
+ selection = list(view.selectedH5Nodes())
+ self.assertEqual(len(selection), 0)
+
def suite():
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestHdf5TreeModel))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestNexusSortFilterProxyModel))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestHdf5))
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestHdf5TreeModel))
+ test_suite.addTest(loadTests(TestNexusSortFilterProxyModel))
+ test_suite.addTest(loadTests(TestHdf5TreeView))
+ test_suite.addTest(loadTests(TestH5Node))
return test_suite
diff --git a/silx/gui/icons.py b/silx/gui/icons.py
index eaf83b8..07654c1 100644
--- a/silx/gui/icons.py
+++ b/silx/gui/icons.py
@@ -29,15 +29,16 @@ Use :func:`getQIcon` to create Qt QIcon from the name identifying an icon.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "25/04/2017"
+__date__ = "06/09/2017"
+import os
import logging
import weakref
from . import qt
-from silx.resources import resource_filename
+import silx.resources
from silx.utils import weakref as silxweakref
-from silx.utils.decorators import deprecated
+from silx.utils.deprecation import deprecated
_logger = logging.getLogger(__name__)
@@ -192,7 +193,7 @@ class MultiImageAnimatedIcon(AbstractAnimatedIcon):
self.__frames = []
for i in range(100):
try:
- pixmap = getQPixmap("animated/%s-%02d" % (filename, i))
+ pixmap = getQPixmap("%s/%02d" % (filename, i))
except ValueError:
break
icon = qt.QIcon(pixmap)
@@ -258,13 +259,22 @@ def getWaitIcon():
def getAnimatedIcon(name):
- """Create an AbstractAnimatedIcon from a name.
+ """Create an AbstractAnimatedIcon from a resource name.
+
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx".
+
+ If no prefix are specified, the file with be returned from the silx
+ resource directory with a specific path "gui/icons".
+
+ See also :func:`silx.resources.register_resource_directory`.
Try to load a mng or a gif file, then try to load a multi-image animated
icon.
- In Qt5 mng or gif are not used. It does not take care very well of the
- transparency.
+ In Qt5 mng or gif are not used, because the transparency is not very well
+ managed.
:param str name: Name of the icon, in one of the defined icons
in this module.
@@ -302,6 +312,15 @@ def getAnimatedIcon(name):
def getQIcon(name):
"""Create a QIcon from its name.
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx".
+
+ If no prefix are specified, the file with be returned from the silx
+ resource directory with a specific path "gui/icons".
+
+ See also :func:`silx.resources.register_resource_directory`.
+
:param str name: Name of the icon, in one of the defined icons
in this module.
:return: Corresponding QIcon
@@ -319,6 +338,15 @@ def getQIcon(name):
def getQPixmap(name):
"""Create a QPixmap from its name.
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx".
+
+ If no prefix are specified, the file with be returned from the silx
+ resource directory with a specific path "gui/icons".
+
+ See also :func:`silx.resources.register_resource_directory`.
+
:param str name: Name of the icon, in one of the defined icons
in this module.
:return: Corresponding QPixmap
@@ -332,6 +360,15 @@ def getQFile(name):
"""Create a QFile from an icon name. Filename is found
according to supported Qt formats.
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx".
+
+ If no prefix are specified, the file with be returned from the silx
+ resource directory with a specific path "gui/icons".
+
+ See also :func:`silx.resources.register_resource_directory`.
+
:param str name: Name of the icon, in one of the defined icons
in this module.
:return: Corresponding QFile
@@ -353,7 +390,8 @@ def getQFile(name):
for format_ in _supported_formats:
format_ = str(format_)
- filename = resource_filename('gui/icons/%s.%s' % (name, format_))
+ filename = silx.resources._resource_filename('%s.%s' % (name, format_),
+ default_directory=os.path.join('gui', 'icons'))
qfile = qt.QFile(filename)
if qfile.exists():
return qfile
diff --git a/silx/gui/plot/ColorBar.py b/silx/gui/plot/ColorBar.py
index 93e3c36..8f4bde2 100644
--- a/silx/gui/plot/ColorBar.py
+++ b/silx/gui/plot/ColorBar.py
@@ -33,11 +33,8 @@ __date__ = "11/04/2017"
import logging
import numpy
from ._utils import ticklayout
-from ._utils import clipColormapLogRange
-
-
-from .. import qt
-from silx.gui.plot import Colors
+from .. import qt, icons
+from silx.gui.plot import Colormap
_logger = logging.getLogger(__name__)
@@ -66,12 +63,17 @@ class ColorBarWidget(qt.QWidget):
:param parent: See :class:`QWidget`
:param plot: PlotWidget the colorbar is attached to (optional)
- :param str legend: the label to set to the colormap
+ :param str legend: the label to set to the colorbar
"""
def __init__(self, parent=None, plot=None, legend=None):
- super(ColorBarWidget, self).__init__(parent)
+ self._isConnected = False
self._plot = None
+ self._viewAction = None
+ self._colormap = None
+ self._data = None
+
+ super(ColorBarWidget, self).__init__(parent)
self.__buildGUI()
self.setLegend(legend)
@@ -90,8 +92,6 @@ class ColorBarWidget(qt.QWidget):
self.layout().addWidget(self.legend)
self.layout().setSizeConstraint(qt.QLayout.SetMinAndMaxSize)
- self.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Expanding)
- self.layout().setContentsMargins(0, 0, 0, 0)
def getPlot(self):
"""Returns the :class:`Plot` associated to this widget or None"""
@@ -100,46 +100,75 @@ class ColorBarWidget(qt.QWidget):
def setPlot(self, plot):
"""Associate a plot to the ColorBar
- :param plot: the plot to associate with the colorbar. If None will remove
- any connection with a previous plot.
+ :param plot: the plot to associate with the colorbar.
+ If None will remove any connection with a previous plot.
"""
- # removing previous plot if any
- if self._plot is not None:
- self._plot.sigActiveImageChanged.disconnect(self._activeImageChanged)
-
- # setting the new plot
+ self._disconnectPlot()
self._plot = plot
- if self._plot is not None:
+ self._connectPlot()
+
+ def _disconnectPlot(self):
+ """Disconnect from Plot signals"""
+ if self._plot is not None and self._isConnected:
+ self._isConnected = False
+ self._plot.sigActiveImageChanged.disconnect(
+ self._activeImageChanged)
+ self._plot.sigPlotSignal.disconnect(self._defaultColormapChanged)
+
+ def _connectPlot(self):
+ """Connect to Plot signals"""
+ if self._plot is not None and not self._isConnected:
+ activeImageLegend = self._plot.getActiveImage(just_legend=True)
+ if activeImageLegend is None: # Show plot default colormap
+ self._syncWithDefaultColormap()
+ else: # Show active image colormap
+ self._activeImageChanged(None, activeImageLegend)
self._plot.sigActiveImageChanged.connect(self._activeImageChanged)
- self._activeImageChanged(self._plot.getActiveImage(just_legend=True))
+ self._plot.sigPlotSignal.connect(self._defaultColormapChanged)
+ self._isConnected = True
+
+ def showEvent(self, event):
+ self._connectPlot()
+ if self._viewAction is not None:
+ self._viewAction.setChecked(True)
+
+ def hideEvent(self, event):
+ self._disconnectPlot()
+ if self._viewAction is not None:
+ self._viewAction.setChecked(False)
def getColormap(self):
- """Return the colormap displayed in the colorbar as a dict.
+ """
+
+ :return: the :class:`.Colormap` colormap displayed in the colorbar.
- It returns None if no colormap is set.
- See :class:`silx.gui.plot.Plot` documentation for the description of the colormap
- dict description.
"""
- return self._colormap.copy()
+ return self.getColorScaleBar().getColormap()
- def setColormap(self, colormap):
+ def setColormap(self, colormap, data=None):
"""Set the colormap to be displayed.
- :param dict colormap: The colormap to apply on the ColorBarWidget
+ :param colormap: The colormap to apply on the
+ ColorBarWidget
+ :type colormap: :class:`.Colormap`
+ :param numpy.ndarray data: the data to display, needed if the colormap
+ require an autoscale
"""
+ self._data = data
+ self.getColorScaleBar().setColormap(colormap=colormap,
+ data=data)
+ if self._colormap is not None:
+ self._colormap.sigChanged.disconnect(self._colormapHasChanged)
self._colormap = colormap
- if self._colormap is None:
- return
-
- if self._colormap['normalization'] not in ('log', 'linear'):
- raise ValueError('Wrong normalization %s' % self._colormap['normalization'])
+ if self._colormap is not None:
+ self._colormap.sigChanged.connect(self._colormapHasChanged)
- if self._colormap['normalization'] is 'log':
- if self._colormap['vmin'] < 1. or self._colormap['vmax'] < 1.:
- _logger.warning('Log colormap with bound <= 1: changing bounds.')
- clipColormapLogRange(colormap)
-
- self.getColorScaleBar().setColormap(self._colormap)
+ def _colormapHasChanged(self):
+ """handler of the Colormap.sigChanged signal
+ """
+ assert self._colormap is not None
+ self.setColormap(colormap=self._colormap,
+ data=self._data)
def setLegend(self, legend):
"""Set the legend displayed along the colorbar
@@ -150,7 +179,7 @@ class ColorBarWidget(qt.QWidget):
self.legend.hide()
self.legend.setText("")
else:
- assert(type(legend) is str)
+ assert type(legend) is str
self.legend.show()
self.legend.setText(legend)
@@ -163,10 +192,10 @@ class ColorBarWidget(qt.QWidget):
"""
return self.legend.getText()
- def _activeImageChanged(self, legend):
+ def _activeImageChanged(self, previous, legend):
"""Handle plot active curve changed"""
- if legend is None: # No active image, display default colormap
- self._syncWithDefaultColormap()
+ if legend is None: # No active image, display no colormap
+ self.setColormap(colormap=None)
return
# Sync with active image
@@ -174,32 +203,25 @@ class ColorBarWidget(qt.QWidget):
# RGB(A) image, display default colormap
if image.ndim != 2:
- self._syncWithDefaultColormap()
+ self.setColormap(colormap=None)
return
# data image, sync with image colormap
# do we need the copy here : used in the case we are changing
# vmin and vmax but should have already be done by the plot
- cmap = self._plot.getActiveImage().getColormap().copy()
- if cmap['autoscale']:
- if cmap['normalization'] == 'log':
- data = image[
- numpy.logical_and(image > 0, numpy.isfinite(image))]
- else:
- data = image[numpy.isfinite(image)]
- cmap['vmin'], cmap['vmax'] = data.min(), data.max()
-
- self.setColormap(cmap)
+ self.setColormap(colormap=self._plot.getActiveImage().getColormap(),
+ data=image)
- def _defaultColormapChanged(self):
+ def _defaultColormapChanged(self, event):
"""Handle plot default colormap changed"""
- if self._plot.getActiveImage() is None:
+ if (event['event'] == 'defaultColormapChanged' and
+ self._plot.getActiveImage() is None):
# No active image, take default colormap update into account
self._syncWithDefaultColormap()
- def _syncWithDefaultColormap(self):
+ def _syncWithDefaultColormap(self, data=None):
"""Update colorbar according to plot default colormap"""
- self.setColormap(self._plot.getDefaultColormap())
+ self.setColormap(self._plot.getDefaultColormap(), data)
def getColorScaleBar(self):
"""
@@ -208,6 +230,21 @@ class ColorBarWidget(qt.QWidget):
and ticks"""
return self._colorScale
+ def getToggleViewAction(self):
+ """Returns a checkable action controlling this widget's visibility.
+
+ :rtype: QAction
+ """
+ if self._viewAction is None:
+ self._viewAction = qt.QAction(self)
+ self._viewAction.setText('Colorbar')
+ self._viewAction.setIcon(icons.getQIcon('colorbar'))
+ self._viewAction.setToolTip('Show/Hide the colorbar')
+ self._viewAction.setCheckable(True)
+ self._viewAction.setChecked(self.isVisible())
+ self._viewAction.toggled[bool].connect(self.setVisible)
+ return self._viewAction
+
class _VerticalLegend(qt.QLabel):
"""Display vertically the given text
@@ -251,12 +288,11 @@ class ColorScaleBar(qt.QWidget):
To run the following sample code, a QApplication must be initialized.
- >>> colormap={'name':'gray',
- ... 'normalization':'log',
- ... 'vmin':1,
- ... 'vmax':100000,
- ... 'autoscale':False
- ... }
+ >>> colormap = Colormap(name='gray',
+ ... norm='log',
+ ... vmin=1,
+ ... vmax=100000,
+ ... )
>>> colorscale = ColorScaleBar(parent=None,
... colormap=colormap )
>>> colorscale.show()
@@ -272,15 +308,8 @@ class ColorScaleBar(qt.QWidget):
"""The tick bar need a margin to display all labels at the correct place.
So the ColorScale should have the same margin in order for both to fit"""
- _MIN_LIM_SCI_FORM = -1000
- """Used for the min and max label to know when we should display it under
- the scientific form"""
-
- _MAX_LIM_SCI_FORM = 1000
- """Used for the min and max label to know when we should display it under
- the scientific form"""
-
- def __init__(self, parent=None, colormap=None, displayTicksValues=True):
+ def __init__(self, parent=None, colormap=None, data=None,
+ displayTicksValues=True):
super(ColorScaleBar, self).__init__(parent)
self.minVal = None
@@ -292,33 +321,41 @@ class ColorScaleBar(qt.QWidget):
# create the left side group (ColorScale)
self.colorScale = _ColorScale(colormap=colormap,
- parent=self,
- margin=ColorScaleBar._TEXT_MARGIN)
+ data=data,
+ parent=self,
+ margin=ColorScaleBar._TEXT_MARGIN)
+ if colormap:
+ vmin, vmax = colormap.getColormapRange(data)
+ else:
+ vmin, vmax = Colormap.DEFAULT_MIN_LIN, Colormap.DEFAULT_MAX_LIN
- self.tickbar = _TickBar(vmin=colormap['vmin'] if colormap else 0.0,
- vmax=colormap['vmax'] if colormap else 1.0,
- norm=colormap['normalization'] if colormap else 'linear',
- parent=self,
- displayValues=displayTicksValues,
- margin=ColorScaleBar._TEXT_MARGIN)
+ norm = colormap.getNormalization() if colormap else Colormap.Colormap.LINEAR
+ self.tickbar = _TickBar(vmin=vmin,
+ vmax=vmax,
+ norm=norm,
+ parent=self,
+ displayValues=displayTicksValues,
+ margin=ColorScaleBar._TEXT_MARGIN)
- self.layout().addWidget(self.tickbar, 1, 0)
- self.layout().addWidget(self.colorScale, 1, 1)
+ self.layout().addWidget(self.tickbar, 1, 0, 1, 1, qt.Qt.AlignRight)
+ self.layout().addWidget(self.colorScale, 1, 1, qt.Qt.AlignLeft)
self.layout().setContentsMargins(0, 0, 0, 0)
self.layout().setSpacing(0)
# max label
self._maxLabel = qt.QLabel(str(1.0), parent=self)
- self._maxLabel.setAlignment(qt.Qt.AlignHCenter)
- self._maxLabel.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum)
- self.layout().addWidget(self._maxLabel, 0, 1)
+ self._maxLabel.setToolTip(str(0.0))
+ self.layout().addWidget(self._maxLabel, 0, 0, 1, 2, qt.Qt.AlignRight)
# min label
self._minLabel = qt.QLabel(str(0.0), parent=self)
- self._minLabel.setAlignment(qt.Qt.AlignHCenter)
- self._minLabel.setSizePolicy(qt.QSizePolicy.Minimum, qt.QSizePolicy.Minimum)
- self.layout().addWidget(self._minLabel, 2, 1)
+ self._minLabel.setToolTip(str(0.0))
+ self.layout().addWidget(self._minLabel, 2, 0, 1, 2, qt.Qt.AlignRight)
+
+ self.layout().setSizeConstraint(qt.QLayout.SetMinAndMaxSize)
+ self.layout().setColumnStretch(0, 1)
+ self.layout().setRowStretch(1, 1)
def getTickBar(self):
"""
@@ -334,19 +371,34 @@ class ColorScaleBar(qt.QWidget):
"""
return self.colorScale
- def setColormap(self, colormap):
+ def getColormap(self):
+ """
+
+ :returns: the colormap.
+ :rtype: :class:`.Colormap`
+ """
+ return self.colorScale.getColormap()
+
+ def setColormap(self, colormap, data=None):
"""Set the new colormap to be displayed
- :param dict colormap: the colormap to set
+ :param Colormap colormap: the colormap to set
+ :param numpy.ndarray data: the data to display, needed if the colormap
+ require an autoscale
"""
- if colormap is not None:
- self.colorScale.setColormap(colormap)
+ self.colorScale.setColormap(colormap, data)
- self.tickbar.update(vmin=colormap['vmin'],
- vmax=colormap['vmax'],
- norm=colormap['normalization'])
+ if colormap is not None:
+ vmin, vmax = colormap.getColormapRange(data)
+ norm = colormap.getNormalization()
+ else:
+ vmin, vmax = None, None
+ norm = None
- self._setMinMaxLabels(colormap['vmin'], colormap['vmax'])
+ self.tickbar.update(vmin=vmin,
+ vmax=vmax,
+ norm=norm)
+ self._setMinMaxLabels(vmin, vmax)
def setMinMaxVisible(self, val=True):
"""Change visibility of the min label and the max label
@@ -359,17 +411,29 @@ class ColorScaleBar(qt.QWidget):
def _updateMinMax(self):
"""Update the min and max label if we are in the case of the
configuration 'minMaxValueOnly'"""
- if self._minLabel is not None and self._maxLabel is not None:
- if self.minVal is not None:
- if ColorScaleBar._MIN_LIM_SCI_FORM <= self.minVal <= ColorScaleBar._MAX_LIM_SCI_FORM:
- self._minLabel.setText(str(self.minVal))
- else:
- self._minLabel.setText("{0:.0e}".format(self.minVal))
- if self.maxVal is not None:
- if ColorScaleBar._MIN_LIM_SCI_FORM <= self.maxVal <= ColorScaleBar._MAX_LIM_SCI_FORM:
- self._maxLabel.setText(str(self.maxVal))
- else:
- self._maxLabel.setText("{0:.0e}".format(self.maxVal))
+ if self.minVal is None:
+ text, tooltip = '', ''
+ else:
+ if self.minVal == 0 or 0 <= numpy.log10(abs(self.minVal)) < 7:
+ text = '%.7g' % self.minVal
+ else:
+ text = '%.2e' % self.minVal
+ tooltip = repr(self.minVal)
+
+ self._minLabel.setText(text)
+ self._minLabel.setToolTip(tooltip)
+
+ if self.maxVal is None:
+ text, tooltip = '', ''
+ else:
+ if self.maxVal == 0 or 0 <= numpy.log10(abs(self.maxVal)) < 7:
+ text = '%.7g' % self.maxVal
+ else:
+ text = '%.2e' % self.maxVal
+ tooltip = repr(self.maxVal)
+
+ self._maxLabel.setText(text)
+ self._maxLabel.setToolTip(tooltip)
def _setMinMaxLabels(self, minVal, maxVal):
"""Change the value of the min and max labels to be displayed.
@@ -400,12 +464,11 @@ class _ColorScale(qt.QWidget):
To run the following sample code, a QApplication must be initialized.
- >>> colormap={'name':'viridis',
- ... 'normalization':'log',
- ... 'vmin':1,
- ... 'vmax':100000,
- ... 'autoscale':False
- ... }
+ >>> colormap = Colormap(name='viridis',
+ ... norm='log',
+ ... vmin=1,
+ ... vmax=100000,
+ ... )
>>> colorscale = ColorScale(parent=None,
... colormap=colormap)
>>> colorscale.show()
@@ -423,83 +486,94 @@ class _ColorScale(qt.QWidget):
_NB_CONTROL_POINTS = 256
- def __init__(self, colormap, parent=None, margin=5):
+ def __init__(self, colormap, parent=None, margin=5, data=None):
qt.QWidget.__init__(self, parent)
- self.colormap = None
- self.setColormap(colormap)
+ self._colormap = None
+ self.margin = margin
+ self.setColormap(colormap, data)
self.setLayout(qt.QVBoxLayout())
- self.setSizePolicy(qt.QSizePolicy.Expanding, qt.QSizePolicy.Expanding)
+ self.setSizePolicy(qt.QSizePolicy.Fixed, qt.QSizePolicy.Expanding)
# needed to get the mouse event without waiting for button click
self.setMouseTracking(True)
self.setMargin(margin)
self.setContentsMargins(0, 0, 0, 0)
- def setColormap(self, colormap):
+ self.setMinimumHeight(self._NB_CONTROL_POINTS // 2 + 2 * self.margin)
+ self.setFixedWidth(25)
+
+ def setColormap(self, colormap, data=None):
"""Set the new colormap to be displayed
:param dict colormap: the colormap to set
+ :param data: Optional data for which to compute colormap range.
"""
- if colormap is None:
- return
+ self._colormap = colormap
+ self.setEnabled(colormap is not None)
- if colormap['normalization'] not in ('log', 'linear'):
- raise ValueError("Unrecognized normalization, should be 'linear' or 'log'")
+ if colormap is None:
+ self.vmin, self.vmax = None, None
+ else:
+ assert colormap.getNormalization() in Colormap.Colormap.NORMALIZATIONS
+ self.vmin, self.vmax = self._colormap.getColormapRange(data=data)
+ self._updateColorGradient()
+ self.update()
- if colormap['normalization'] is 'log':
- if not (colormap['vmin'] > 0 and colormap['vmax'] > 0):
- raise ValueError('vmin and vmax should be positives')
- self.colormap = colormap
- self._computeColorPoints()
+ def getColormap(self):
+ """Returns the colormap
- def _computeColorPoints(self):
- """Compute the color points for the gradient
+ :rtype: :class:`.Colormap`
"""
- if self.colormap is None:
+ return None if self._colormap is None else self._colormap
+
+ def _updateColorGradient(self):
+ """Compute the color gradient"""
+ colormap = self.getColormap()
+ if colormap is None:
return
- vmin = self.colormap['vmin']
- vmax = self.colormap['vmax']
- steps = (vmax - vmin)/float(_ColorScale._NB_CONTROL_POINTS)
- self.ctrPoints = numpy.arange(vmin, vmax, steps)
- self.colorsCtrPts = Colors.applyColormapToData(self.ctrPoints,
- name=self.colormap['name'],
- normalization='linear',
- autoscale=self.colormap['autoscale'],
- vmin=vmin,
- vmax=vmax)
+ indices = numpy.linspace(0., 1., self._NB_CONTROL_POINTS)
+ colormapDisp = Colormap.Colormap(name=colormap.getName(),
+ normalization=Colormap.Colormap.LINEAR,
+ vmin=None,
+ vmax=None,
+ colors=colormap.getColormapLUT())
+ colors = colormapDisp.applyToData(indices)
+ self._gradient = qt.QLinearGradient(0, 1, 0, 0)
+ self._gradient.setCoordinateMode(qt.QGradient.StretchToDeviceMode)
+ self._gradient.setStops(
+ [(i, qt.QColor(*color)) for i, color in zip(indices, colors)]
+ )
def paintEvent(self, event):
""""""
- qt.QWidget.paintEvent(self, event)
- if self.colormap is None:
- return
-
- vmin = self.colormap['vmin']
- vmax = self.colormap['vmax']
-
painter = qt.QPainter(self)
- gradient = qt.QLinearGradient(0, 0, 0, self.rect().height() - 2*self.margin)
- for iPt, pt in enumerate(self.ctrPoints):
- colormapPosition = 1 - (pt-vmin) / (vmax-vmin)
- assert(colormapPosition >= 0.0)
- assert(colormapPosition <= 1.0)
- gradient.setColorAt(colormapPosition, qt.QColor(*(self.colorsCtrPts[iPt])))
+ if self.getColormap() is not None:
+ painter.setBrush(self._gradient)
+ penColor = self.palette().color(qt.QPalette.Active,
+ qt.QPalette.Foreground)
+ else:
+ penColor = self.palette().color(qt.QPalette.Disabled,
+ qt.QPalette.Foreground)
+ painter.setPen(penColor)
- painter.setBrush(gradient)
- painter.drawRect(
- qt.QRect(0, self.margin, self.width(), self.height() - 2.*self.margin))
+ painter.drawRect(qt.QRect(
+ 0,
+ self.margin,
+ self.width() - 1.,
+ self.height() - 2. * self.margin - 1.))
def mouseMoveEvent(self, event):
- """"""
- self.setToolTip(str(self.getValueFromRelativePosition(self._getRelativePosition(event.y()))))
+ tooltip = str(self.getValueFromRelativePosition(
+ self._getRelativePosition(event.y())))
+ qt.QToolTip.showText(event.globalPos(), tooltip, self)
super(_ColorScale, self).mouseMoveEvent(event)
def _getRelativePosition(self, yPixel):
"""yPixel : pixel position into _ColorScale widget reference
"""
# widgets are bottom-top referencial but we display in top-bottom referential
- return 1 - float(yPixel)/float(self.height() - 2*self.margin)
+ return 1. - (yPixel - self.margin) / float(self.height() - 2 * self.margin)
def getValueFromRelativePosition(self, value):
"""Return the value in the colorMap from a relative position in the
@@ -508,17 +582,22 @@ class _ColorScale(qt.QWidget):
:param value: float value in [0, 1]
:return: the value in [colormap['vmin'], colormap['vmax']]
"""
+ colormap = self.getColormap()
+ if colormap is None:
+ return
+
value = max(0.0, value)
value = min(value, 1.0)
- vmin = self.colormap['vmin']
- vmax = self.colormap['vmax']
- if self.colormap['normalization'] is 'linear':
+
+ vmin = self.vmin
+ vmax = self.vmax
+ if colormap.getNormalization() == Colormap.Colormap.LINEAR:
return vmin + (vmax - vmin) * value
- elif self.colormap['normalization'] is 'log':
+ elif colormap.getNormalization() == Colormap.Colormap.LOGARITHM:
rpos = (numpy.log10(vmax) - numpy.log10(vmin)) * value + numpy.log10(vmin)
return numpy.power(10., rpos)
else:
- err = "normalization type (%s) is not managed by the _ColorScale Widget" % self.colormap['normalization']
+ err = "normalization type (%s) is not managed by the _ColorScale Widget" % colormap['normalization']
raise ValueError(err)
def setMargin(self, margin):
@@ -529,6 +608,7 @@ class _ColorScale(qt.QWidget):
:param int margin: the margin to apply on the top and bottom.
"""
self.margin = margin
+ self.update()
class _TickBar(qt.QWidget):
@@ -536,7 +616,7 @@ class _TickBar(qt.QWidget):
To run the following sample code, a QApplication must be initialized.
- >>> bar = TickBar(1, 1000, norm='log', parent=None, displayValues=True)
+ >>> bar = _TickBar(1, 1000, norm='log', parent=None, displayValues=True)
>>> bar.show()
.. image:: img/tickbar.png
@@ -569,24 +649,19 @@ class _TickBar(qt.QWidget):
def __init__(self, vmin, vmax, norm, parent=None, displayValues=True,
nticks=None, margin=5):
super(_TickBar, self).__init__(parent)
+ self.margin = margin
+ self._nticks = None
+ self.ticks = ()
+ self.subTicks = ()
self._forcedDisplayType = None
self.ticksDensity = _TickBar.DEFAULT_TICK_DENSITY
self._vmin = vmin
self._vmax = vmax
- # TODO : should be grouped into a global function, called by all
- # logScale displayer to make sure we have the same behavior everywhere
- if self._vmin < 1. or self._vmax < 1.:
- _logger.warning(
- 'Log colormap with bound <= 1: changing bounds.')
- self._vmin, self._vmax = 1., 10.
-
self._norm = norm
self.displayValues = displayValues
self.setTicksNumber(nticks)
- self.setMargin(margin)
- self.setLayout(qt.QVBoxLayout())
self.setMargin(margin)
self.setContentsMargins(0, 0, 0, 0)
@@ -597,8 +672,8 @@ class _TickBar(qt.QWidget):
self._resetWidth()
def _resetWidth(self):
- self.width = _TickBar._WIDTH_DISP_VAL if self.displayValues else _TickBar._WIDTH_NO_DISP_VAL
- self.setFixedWidth(self.width)
+ width = self._WIDTH_DISP_VAL if self.displayValues else self._WIDTH_NO_DISP_VAL
+ self.setFixedWidth(width)
def update(self, vmin, vmax, norm):
self._vmin = vmin
@@ -623,7 +698,6 @@ class _TickBar(qt.QWidget):
optimal number of ticks from the tick density.
"""
self._nticks = nticks
- self.ticks = None
self.computeTicks()
qt.QWidget.update(self)
@@ -644,9 +718,13 @@ class _TickBar(qt.QWidget):
if nticks is None:
nticks = self._getOptimalNbTicks()
- if self._norm == 'log':
+ if self._vmin == self._vmax:
+ # No range: no ticks
+ self.ticks = ()
+ self.subTicks = ()
+ elif self._norm == Colormap.Colormap.LOGARITHM:
self._computeTicksLog(nticks)
- elif self._norm == 'linear':
+ elif self._norm == Colormap.Colormap.LINEAR:
self._computeTicksLin(nticks)
else:
err = 'TickBar - Wrong normalization %s' % self._norm
@@ -693,22 +771,19 @@ class _TickBar(qt.QWidget):
painter.setFont(font)
# paint ticks
- if self.ticks is not None:
- for val in self.ticks:
- self._paintTick(val, painter, majorTick=True)
-
- # paint subticks
- for val in self.subTicks:
- self._paintTick(val, painter, majorTick=False)
+ for val in self.ticks:
+ self._paintTick(val, painter, majorTick=True)
- qt.QWidget.paintEvent(self, event)
+ # paint subticks
+ for val in self.subTicks:
+ self._paintTick(val, painter, majorTick=False)
def _getRelativePosition(self, val):
"""Return the relative position of val according to min and max value
"""
- if self._norm == 'linear':
+ if self._norm == Colormap.Colormap.LINEAR:
return 1 - (val - self._vmin) / (self._vmax - self._vmin)
- elif self._norm == 'log':
+ elif self._norm == Colormap.Colormap.LOGARITHM:
return 1 - (numpy.log10(val) - numpy.log10(self._vmin))/(numpy.log10(self._vmax) - numpy.log(self._vmin))
else:
raise ValueError('Norm is not recognized')
@@ -720,7 +795,7 @@ class _TickBar(qt.QWidget):
with a smaller width
"""
fm = qt.QFontMetrics(painter.font())
- viewportHeight = self.rect().height() - self.margin * 2
+ viewportHeight = self.rect().height() - self.margin * 2 - 1
relativePos = self._getRelativePosition(val)
height = viewportHeight * relativePos
height += self.margin
@@ -728,9 +803,9 @@ class _TickBar(qt.QWidget):
if majorTick is False:
lineWidth /= 2
- painter.drawLine(qt.QLine(self.width - lineWidth,
+ painter.drawLine(qt.QLine(self.width() - lineWidth,
height,
- self.width,
+ self.width(),
height))
if self.displayValues and majorTick is True:
@@ -774,7 +849,6 @@ class _TickBar(qt.QWidget):
:param QFont font: the font we want want to use durint the painting
"""
- assert(type(self._vmin) == type(self._vmax))
form = self._getStandardFormat()
fm = qt.QFontMetrics(font)
diff --git a/silx/gui/plot/Colormap.py b/silx/gui/plot/Colormap.py
new file mode 100644
index 0000000..abe8546
--- /dev/null
+++ b/silx/gui/plot/Colormap.py
@@ -0,0 +1,410 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2017 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.
+#
+# ###########################################################################*/
+"""This module provides the Colormap object
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["T. Vincent", "H.Payno"]
+__license__ = "MIT"
+__date__ = "05/12/2016"
+
+from silx.gui import qt
+import copy as copy_mdl
+import numpy
+from .matplotlib import Colormap as MPLColormap
+import logging
+from silx.math.combo import min_max
+
+_logger = logging.getLogger(__file__)
+
+DEFAULT_COLORMAPS = (
+ 'gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
+"""Tuple of supported colormap names."""
+
+DEFAULT_MIN_LIN = 0
+"""Default min value if in linear normalization"""
+DEFAULT_MAX_LIN = 1
+"""Default max value if in linear normalization"""
+DEFAULT_MIN_LOG = 1
+"""Default min value if in log normalization"""
+DEFAULT_MAX_LOG = 10
+"""Default max value if in log normalization"""
+
+
+class Colormap(qt.QObject):
+ """Description of a colormap
+
+ :param str name: Name of the colormap
+ :param tuple colors: optional, custom colormap.
+ Nx3 or Nx4 numpy array of RGB(A) colors,
+ either uint8 or float in [0, 1].
+ If 'name' is None, then this array is used as the colormap.
+ :param str norm: Normalization: 'linear' (default) or 'log'
+ :param float vmin:
+ Lower bound of the colormap or None for autoscale (default)
+ :param float vmax:
+ Upper bounds of the colormap or None for autoscale (default)
+ """
+
+ LINEAR = 'linear'
+ """constant for linear normalization"""
+
+ LOGARITHM = 'log'
+ """constant for logarithmic normalization"""
+
+ NORMALIZATIONS = (LINEAR, LOGARITHM)
+ """Tuple of managed normalizations"""
+
+ sigChanged = qt.Signal()
+
+ def __init__(self, name='gray', colors=None, normalization=LINEAR, vmin=None, vmax=None):
+ qt.QObject.__init__(self)
+ assert normalization in Colormap.NORMALIZATIONS
+ assert not (name is None and colors is None)
+ if normalization is Colormap.LOGARITHM:
+ if (vmin is not None and vmin < 0) or (vmax is not None and vmax < 0):
+ m = "Unsuported vmin (%s) and/or vmax (%s) given for a log scale."
+ m += ' Autoscale will be performed.'
+ m = m % (vmin, vmax)
+ _logger.warning(m)
+ vmin = None
+ vmax = None
+
+ self._name = str(name) if name is not None else None
+ self._setColors(colors)
+ self._normalization = str(normalization)
+ self._vmin = float(vmin) if vmin is not None else None
+ self._vmax = float(vmax) if vmax is not None else None
+
+ def isAutoscale(self):
+ """Return True if both min and max are in autoscale mode"""
+ return self._vmin is None or self._vmax is None
+
+ def getName(self):
+ """Return the name of the colormap
+ :rtype: str
+ """
+ return self._name
+
+ def _setColors(self, colors):
+ if colors is None:
+ self._colors = None
+ else:
+ self._colors = numpy.array(colors, copy=True)
+
+ def setName(self, name):
+ """Set the name of the colormap and load the colors corresponding to
+ the name
+
+ :param str name: the name of the colormap (should be in ['gray',
+ 'reversed gray', 'temperature', 'red', 'green', 'blue', 'jet',
+ 'viridis', 'magma', 'inferno', 'plasma']
+ """
+ assert name in self.getSupportedColormaps()
+ self._name = str(name)
+ self._colors = None
+ self.sigChanged.emit()
+
+ def getColormapLUT(self):
+ """Return the list of colors for the colormap. None if not setted
+
+ :return: the list of colors for the colormap. None if not setted
+ :rtype: numpy.ndarray
+ """
+ return self._colors
+
+ def setColormapLUT(self, colors):
+ """
+ Set the colors of the colormap.
+
+ :param numpy.ndarray colors: the colors of the LUT
+
+ .. warning: this will set the value of name to an empty string
+ """
+ self._setColors(colors)
+ if len(colors) is 0:
+ self._colors = None
+
+ self._name = None
+ self.sigChanged.emit()
+
+ def getNormalization(self):
+ """Return the normalization of the colormap ('log' or 'linear')
+
+ :return: the normalization of the colormap
+ :rtype: str
+ """
+ return self._normalization
+
+ def setNormalization(self, norm):
+ """Set the norm ('log', 'linear')
+
+ :param str norm: the norm to set
+ """
+ self._normalization = str(norm)
+ self.sigChanged.emit()
+
+ def getVMin(self):
+ """Return the lower bound of the colormap
+
+ :return: the lower bound of the colormap
+ :rtype: float or None
+ """
+ return self._vmin
+
+ def setVMin(self, vmin):
+ """Set the minimal value of the colormap
+
+ :param float vmin: Lower bound of the colormap or None for autoscale
+ (default)
+ value)
+ """
+ if vmin is not None:
+ if self._vmax is not None and vmin >= self._vmax:
+ err = "Can't set vmin because vmin >= vmax."
+ err += "vmin = %s, vmax = %s" %(vmin, self._vmax)
+ raise ValueError(err)
+
+ self._vmin = vmin
+ self.sigChanged.emit()
+
+ def getVMax(self):
+ """Return the upper bounds of the colormap or None
+
+ :return: the upper bounds of the colormap or None
+ :rtype: float or None
+ """
+ return self._vmax
+
+ def setVMax(self, vmax):
+ """Set the maximal value of the colormap
+
+ :param float vmax: Upper bounds of the colormap or None for autoscale
+ (default)
+ """
+ if vmax is not None:
+ if self._vmin is not None and vmax <= self._vmin:
+ err = "Can't set vmax because vmax <= vmin."
+ err += "vmin = %s, vmax = %s" %(self._vmin, vmax)
+ raise ValueError(err)
+
+ self._vmax = vmax
+ self.sigChanged.emit()
+
+ def getColormapRange(self, data=None):
+ """Return (vmin, vmax)
+
+ :return: the tuple vmin, vmax fitting vmin, vmax, normalization and
+ data if any given
+ :rtype: tuple
+ """
+ vmin = self._vmin
+ vmax = self._vmax
+ assert vmin is None or vmax is None or vmin <= vmax # TODO handle this in setters
+
+ if self.getNormalization() == self.LOGARITHM:
+ # Handle negative bounds as autoscale
+ if vmin is not None and (vmin is not None and vmin <= 0.):
+ mess = 'negative vmin, moving to autoscale for lower bound'
+ _logger.warning(mess)
+ vmin = None
+ if vmax is not None and (vmax is not None and vmax <= 0.):
+ mess = 'negative vmax, moving to autoscale for upper bound'
+ _logger.warning(mess)
+ vmax = None
+
+ if vmin is None or vmax is None: # Handle autoscale
+ # Get min/max from data
+ if data is not None:
+ data = numpy.array(data, copy=False)
+ if data.size == 0: # Fallback an array but no data
+ min_, max_ = self._getDefaultMin(), self._getDefaultMax()
+ else:
+ if self.getNormalization() == self.LOGARITHM:
+ result = min_max(data, min_positive=True, finite=True)
+ min_ = result.min_positive # >0 or None
+ max_ = result.maximum # can be <= 0
+ else:
+ min_, max_ = min_max(data, min_positive=False, finite=True)
+
+ # Handle fallback
+ if min_ is None or not numpy.isfinite(min_):
+ min_ = self._getDefaultMin()
+ if max_ is None or not numpy.isfinite(max_):
+ max_ = self._getDefaultMax()
+ else: # Fallback if no data is provided
+ min_, max_ = self._getDefaultMin(), self._getDefaultMax()
+
+ if vmin is None: # Set vmin respecting provided vmax
+ vmin = min_ if vmax is None else min(min_, vmax)
+
+ if vmax is None:
+ vmax = max(max_, vmin) # Handle max_ <= 0 for log scale
+
+ return vmin, vmax
+
+ def setVRange(self, vmin, vmax):
+ """
+ Set bounds to the colormap
+
+ :param vmin: Lower bound of the colormap or None for autoscale
+ (default)
+ :param vmax: Upper bounds of the colormap or None for autoscale
+ (default)
+ """
+ if vmin is not None and vmax is not None:
+ if vmin >= vmax:
+ err = "Can't set vmin and vmax because vmin >= vmax"
+ err += "vmin = %s, vmax = %s" %(vmin, self._vmax)
+ raise ValueError(err)
+
+ self._vmin = vmin
+ self._vmax = vmax
+ self.sigChanged.emit()
+
+ def __getitem__(self, item):
+ if item == 'autoscale':
+ return self.isAutoscale()
+ elif item == 'name':
+ return self.getName()
+ elif item == 'normalization':
+ return self.getNormalization()
+ elif item == 'vmin':
+ return self.getVMin()
+ elif item == 'vmax':
+ return self.getVMax()
+ elif item == 'colors':
+ return self.getColormapLUT()
+ else:
+ raise KeyError(item)
+
+ def _toDict(self):
+ """Return the equivalent colormap as a dictionary
+ (old colormap representation)
+
+ :return: the representation of the Colormap as a dictionary
+ :rtype: dict
+ """
+ return {
+ 'name': self._name,
+ 'colors': copy_mdl.copy(self._colors),
+ 'vmin': self._vmin,
+ 'vmax': self._vmax,
+ 'autoscale': self.isAutoscale(),
+ 'normalization': self._normalization
+ }
+
+ def _setFromDict(self, dic):
+ """Set values to the colormap from a dictionary
+
+ :param dict dic: the colormap as a dictionary
+ """
+ name = dic['name'] if 'name' in dic else None
+ colors = dic['colors'] if 'colors' in dic else None
+ vmin = dic['vmin'] if 'vmin' in dic else None
+ vmax = dic['vmax'] if 'vmax' in dic else None
+ if 'normalization' in dic:
+ normalization = dic['normalization']
+ else:
+ warn = 'Normalization not given in the dictionary, '
+ warn += 'set by default to ' + Colormap.LINEAR
+ _logger.warning(warn)
+ normalization = Colormap.LINEAR
+
+ if name is None and colors is None:
+ err = 'The colormap should have a name defined or a tuple of colors'
+ raise ValueError(err)
+ if normalization not in Colormap.NORMALIZATIONS:
+ err = 'Given normalization is not recoginized (%s)' % normalization
+ raise ValueError(err)
+
+ # If autoscale, then set boundaries to None
+ if dic.get('autoscale', False):
+ vmin, vmax = None, None
+
+ self._name = name
+ self._colors = colors
+ self._vmin = vmin
+ self._vmax = vmax
+ self._autoscale = True if (vmin is None and vmax is None) else False
+ self._normalization = normalization
+
+ self.sigChanged.emit()
+
+ @staticmethod
+ def _fromDict(dic):
+ colormap = Colormap(name="")
+ colormap._setFromDict(dic)
+ return colormap
+
+ def copy(self):
+ """
+
+ :return: a copy of the Colormap object
+ """
+ return Colormap(name=self._name,
+ colors=copy_mdl.copy(self._colors),
+ vmin=self._vmin,
+ vmax=self._vmax,
+ normalization=self._normalization)
+
+ def applyToData(self, data):
+ """Apply the colormap to the data
+
+ :param numpy.ndarray data: The data to convert.
+ """
+ rgbaImage = MPLColormap.applyColormapToData(colormap=self, data=data)
+ return rgbaImage
+
+ @staticmethod
+ def getSupportedColormaps():
+ """Get the supported colormap names as a tuple of str.
+
+ The list should at least contain and start by:
+ ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
+ :rtype: tuple
+ """
+ maps = MPLColormap.getSupportedColormaps()
+ return DEFAULT_COLORMAPS + maps
+
+ def __str__(self):
+ return str(self._toDict())
+
+ def _getDefaultMin(self):
+ return DEFAULT_MIN_LIN if self._normalization == Colormap.LINEAR else DEFAULT_MIN_LOG
+
+ def _getDefaultMax(self):
+ return DEFAULT_MAX_LIN if self._normalization == Colormap.LINEAR else DEFAULT_MAX_LOG
+
+ def __eq__(self, other):
+ """Compare colormap values and not pointers"""
+ return (self.getName() == other.getName() and
+ self.getNormalization() == other.getNormalization() and
+ self.getVMin() == other.getVMin() and
+ self.getVMax() == other.getVMax() and
+ numpy.array_equal(self.getColormapLUT(), other.getColormapLUT())
+ )
+
diff --git a/silx/gui/plot/ColormapDialog.py b/silx/gui/plot/ColormapDialog.py
index ad1425c..748dd72 100644
--- a/silx/gui/plot/ColormapDialog.py
+++ b/silx/gui/plot/ColormapDialog.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2017 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
@@ -42,7 +42,7 @@ Create the colormap dialog and set the colormap description and data range:
Get the colormap description (compatible with :class:`Plot`) from the dialog:
>>> cmap = dialog.getColormap()
->>> cmap['name']
+>>> cmap.getName()
'red'
It is also possible to display an histogram of the image in the dialog.
@@ -61,7 +61,7 @@ from __future__ import division
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "29/03/2016"
+__date__ = "02/10/2017"
import logging
@@ -69,37 +69,13 @@ import logging
import numpy
from .. import qt
+from .Colormap import Colormap
from . import PlotWidget
-
+from silx.gui.widgets.FloatEdit import FloatEdit
_logger = logging.getLogger(__name__)
-class _FloatEdit(qt.QLineEdit):
- """Field to edit a float value.
-
- :param parent: See :class:`QLineEdit`
- :param float value: The value to set the QLineEdit to.
- """
- def __init__(self, parent=None, value=None):
- qt.QLineEdit.__init__(self, parent)
- self.setValidator(qt.QDoubleValidator())
- self.setAlignment(qt.Qt.AlignRight)
- if value is not None:
- self.setValue(value)
-
- def value(self):
- """Return the QLineEdit current value as a float."""
- return float(self.text())
-
- def setValue(self, value):
- """Set the current value of the LineEdit
-
- :param float value: The value to set the QLineEdit to.
- """
- self.setText('%g' % value)
-
-
class ColormapDialog(qt.QDialog):
"""A QDialog widget to set the colormap.
@@ -107,7 +83,7 @@ class ColormapDialog(qt.QDialog):
:param str title: The QDialog title
"""
- sigColormapChanged = qt.Signal(dict)
+ sigColormapChanged = qt.Signal(Colormap)
"""Signal triggered when the colormap is changed.
It provides a dict describing the colormap to the slot.
@@ -122,10 +98,13 @@ class ColormapDialog(qt.QDialog):
self._dataRange = None
self._minMaxWasEdited = False
- self._colormapList = (
+ colormaps = [
'gray', 'reversed gray',
'temperature', 'red', 'green', 'blue', 'jet',
- 'viridis', 'magma', 'inferno', 'plasma')
+ 'viridis', 'magma', 'inferno', 'plasma']
+ if 'hsv' in Colormap.getSupportedColormaps():
+ colormaps.append('hsv')
+ self._colormapList = tuple(colormaps)
# Make the GUI
vLayout = qt.QVBoxLayout(self)
@@ -172,14 +151,14 @@ class ColormapDialog(qt.QDialog):
formLayout.addRow('Range:', self._rangeAutoscaleButton)
# Min row
- self._minValue = _FloatEdit(value=1.)
+ self._minValue = FloatEdit(parent=self, value=1.)
self._minValue.setEnabled(False)
self._minValue.textEdited.connect(self._minMaxTextEdited)
self._minValue.editingFinished.connect(self._minEditingFinished)
formLayout.addRow('\tMin:', self._minValue)
# Max row
- self._maxValue = _FloatEdit(value=10.)
+ self._maxValue = FloatEdit(parent=self, value=10.)
self._maxValue.setEnabled(False)
self._maxValue.textEdited.connect(self._minMaxTextEdited)
self._maxValue.editingFinished.connect(self._maxEditingFinished)
@@ -214,8 +193,8 @@ class ColormapDialog(qt.QDialog):
"""Init the plot to display the range and the values"""
self._plot = PlotWidget()
self._plot.setDataMargins(yMinMargin=0.125, yMaxMargin=0.125)
- self._plot.setGraphXLabel("Data Values")
- self._plot.setGraphYLabel("")
+ self._plot.getXAxis().setLabel("Data Values")
+ self._plot.getYAxis().setLabel("")
self._plot.setInteractiveMode('select', zoomOnWheel=False)
self._plot.setActiveCurveHandling(False)
self._plot.setMinimumSize(qt.QSize(250, 200))
@@ -392,17 +371,22 @@ class ColormapDialog(qt.QDialog):
self._plotUpdate()
def getColormap(self):
- """Return the colormap description as a dict.
+ """Return the colormap description as a :class:`.Colormap`.
- See :class:`Plot` for documentation on the colormap dict.
"""
isNormLinear = self._normButtonLinear.isChecked()
- colormap = {
- 'name': str(self._comboBoxColormap.currentText()).lower(),
- 'normalization': 'linear' if isNormLinear else 'log',
- 'autoscale': self._rangeAutoscaleButton.isChecked(),
- 'vmin': self._minValue.value(),
- 'vmax': self._maxValue.value()}
+ if self._rangeAutoscaleButton.isChecked():
+ vmin = None
+ vmax = None
+ else:
+ vmin = self._minValue.value()
+ vmax = self._maxValue.value()
+ norm = Colormap.LINEAR if isNormLinear else Colormap.LOGARITHM
+ colormap = Colormap(
+ name=str(self._comboBoxColormap.currentText()).lower(),
+ normalization=norm,
+ vmin=vmin,
+ vmax=vmax)
return colormap
def setColormap(self, name=None, normalization=None,
@@ -423,9 +407,9 @@ class ColormapDialog(qt.QDialog):
self._comboBoxColormap.setCurrentIndex(index)
if normalization is not None:
- assert normalization in ('linear', 'log')
- self._normButtonLinear.setChecked(normalization == 'linear')
- self._normButtonLog.setChecked(normalization == 'log')
+ assert normalization in Colormap.NORMALIZATIONS
+ self._normButtonLinear.setChecked(normalization == Colormap.LINEAR)
+ self._normButtonLog.setChecked(normalization == Colormap.LOGARITHM)
if vmin is not None:
self._minValue.setValue(vmin)
diff --git a/silx/gui/plot/Colors.py b/silx/gui/plot/Colors.py
index 7a3cd97..2d44d4d 100644
--- a/silx/gui/plot/Colors.py
+++ b/silx/gui/plot/Colors.py
@@ -24,20 +24,18 @@
# ###########################################################################*/
"""Color conversion function, color dictionary and colormap tools."""
-__authors__ = ["V.A. Sole", "T. VINCENT"]
+from __future__ import absolute_import
+
+__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "16/01/2017"
+__date__ = "15/05/2017"
+from silx.utils.deprecation import deprecated
import logging
-
import numpy
-import matplotlib
-import matplotlib.colors
-import matplotlib.cm
-
-from . import MPLColormap
+from .Colormap import Colormap
_logger = logging.getLogger(__name__)
@@ -143,159 +141,7 @@ def cursorColorForColormap(colormapName):
return _COLORMAP_CURSOR_COLORS.get(colormapName, 'black')
-_CMAPS = {} # Store additional colormaps
-
-
-def getMPLColormap(name):
- """Returns matplotlib colormap corresponding to given name
-
- :param str name: The name of the colormap
- :return: The corresponding colormap
- :rtype: matplolib.colors.Colormap
- """
- if not _CMAPS: # Lazy initialization of own colormaps
- cdict = {'red': ((0.0, 0.0, 0.0),
- (1.0, 1.0, 1.0)),
- 'green': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0)),
- 'blue': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0))}
- _CMAPS['red'] = matplotlib.colors.LinearSegmentedColormap(
- 'red', cdict, 256)
-
- cdict = {'red': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0)),
- 'green': ((0.0, 0.0, 0.0),
- (1.0, 1.0, 1.0)),
- 'blue': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0))}
- _CMAPS['green'] = matplotlib.colors.LinearSegmentedColormap(
- 'green', cdict, 256)
-
- cdict = {'red': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0)),
- 'green': ((0.0, 0.0, 0.0),
- (1.0, 0.0, 0.0)),
- 'blue': ((0.0, 0.0, 0.0),
- (1.0, 1.0, 1.0))}
- _CMAPS['blue'] = matplotlib.colors.LinearSegmentedColormap(
- 'blue', cdict, 256)
-
- # Temperature as defined in spslut
- cdict = {'red': ((0.0, 0.0, 0.0),
- (0.5, 0.0, 0.0),
- (0.75, 1.0, 1.0),
- (1.0, 1.0, 1.0)),
- 'green': ((0.0, 0.0, 0.0),
- (0.25, 1.0, 1.0),
- (0.75, 1.0, 1.0),
- (1.0, 0.0, 0.0)),
- 'blue': ((0.0, 1.0, 1.0),
- (0.25, 1.0, 1.0),
- (0.5, 0.0, 0.0),
- (1.0, 0.0, 0.0))}
- # but limited to 256 colors for a faster display (of the colorbar)
- _CMAPS['temperature'] = \
- matplotlib.colors.LinearSegmentedColormap(
- 'temperature', cdict, 256)
-
- # reversed gray
- cdict = {'red': ((0.0, 1.0, 1.0),
- (1.0, 0.0, 0.0)),
- 'green': ((0.0, 1.0, 1.0),
- (1.0, 0.0, 0.0)),
- 'blue': ((0.0, 1.0, 1.0),
- (1.0, 0.0, 0.0))}
-
- _CMAPS['reversed gray'] = \
- matplotlib.colors.LinearSegmentedColormap(
- 'yerg', cdict, 256)
-
- if name in _CMAPS:
- return _CMAPS[name]
- elif hasattr(MPLColormap, name): # viridis and sister colormaps
- return getattr(MPLColormap, name)
- else:
- # matplotlib built-in
- return matplotlib.cm.get_cmap(name)
-
-
-def getMPLScalarMappable(colormap, data=None):
- """Returns matplotlib ScalarMappable corresponding to colormap
-
- :param dict colormap: The colormap to convert
- :param numpy.ndarray data:
- The data on which the colormap is applied.
- If provided, it is used to compute autoscale.
- :return: matplotlib object corresponding to colormap
- :rtype: matplotlib.cm.ScalarMappable
- """
- assert colormap is not None
-
- if colormap['name'] is not None:
- cmap = getMPLColormap(colormap['name'])
-
- else: # No name, use custom colors
- if 'colors' not in colormap:
- raise ValueError(
- 'addImage: colormap no name nor list of colors.')
- colors = numpy.array(colormap['colors'], copy=True)
- assert len(colors.shape) == 2
- assert colors.shape[-1] in (3, 4)
- if colors.dtype == numpy.uint8:
- # Convert to float in [0., 1.]
- colors = colors.astype(numpy.float32) / 255.
- cmap = matplotlib.colors.ListedColormap(colors)
-
- if colormap['normalization'].startswith('log'):
- vmin, vmax = None, None
- if not colormap['autoscale']:
- if colormap['vmin'] > 0.:
- vmin = colormap['vmin']
- if colormap['vmax'] > 0.:
- vmax = colormap['vmax']
-
- if vmin is None or vmax is None:
- _logger.warning('Log colormap with negative bounds, ' +
- 'changing bounds to positive ones.')
- elif vmin > vmax:
- _logger.warning('Colormap bounds are inverted.')
- vmin, vmax = vmax, vmin
-
- # Set unset/negative bounds to positive bounds
- if (vmin is None or vmax is None) and data is not None:
- finiteData = data[numpy.isfinite(data)]
- posData = finiteData[finiteData > 0]
- if vmax is None:
- # 1. as an ultimate fallback
- vmax = posData.max() if posData.size > 0 else 1.
- if vmin is None:
- vmin = posData.min() if posData.size > 0 else vmax
- if vmin > vmax:
- vmin = vmax
-
- norm = matplotlib.colors.LogNorm(vmin, vmax)
-
- else: # Linear normalization
- if colormap['autoscale']:
- if data is None:
- vmin, vmax = None, None
- else:
- finiteData = data[numpy.isfinite(data)]
- vmin = finiteData.min()
- vmax = finiteData.max()
- else:
- vmin = colormap['vmin']
- vmax = colormap['vmax']
- if vmin > vmax:
- _logger.warning('Colormap bounds are inverted.')
- vmin, vmax = vmax, vmin
-
- norm = matplotlib.colors.Normalize(vmin, vmax)
-
- return matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap)
-
-
+@deprecated(replacement='silx.gui.plot.Colormap.applyColormap')
def applyColormapToData(data,
name='gray',
normalization='linear',
@@ -324,36 +170,19 @@ def applyColormapToData(data,
:return: The computed RGBA image
:rtype: numpy.ndarray of uint8
"""
- # Debian 7 specific support
- # No transparent colormap with matplotlib < 1.2.0
- # Add support for transparent colormap for uint8 data with
- # colormap with 256 colors, linear norm, [0, 255] range
- if matplotlib.__version__ < '1.2.0':
- if name is None and colors is not None:
- colors = numpy.array(colors, copy=False)
- if (colors.shape[-1] == 4 and
- not numpy.all(numpy.equal(colors[3], 255))):
- # This is a transparent colormap
- if (colors.shape == (256, 4) and
- normalization == 'linear' and
- not autoscale and
- vmin == 0 and vmax == 255 and
- data.dtype == numpy.uint8):
- # Supported case, convert data to RGBA
- return colors[data.reshape(-1)].reshape(
- data.shape + (4,))
- else:
- _logger.warning(
- 'matplotlib %s does not support transparent '
- 'colormap.', matplotlib.__version__)
-
- colormap = dict(name=name,
- normalization=normalization,
- autoscale=autoscale,
- vmin=vmin,
- vmax=vmax,
- colors=colors)
- scalarMappable = getMPLScalarMappable(colormap, data)
- rgbaImage = scalarMappable.to_rgba(data, bytes=True)
-
- return rgbaImage
+ colormap = Colormap(name=name,
+ normalization=normalization,
+ vmin=vmin,
+ vmax=vmax,
+ colors=colors)
+ return colormap.applyToData(data)
+
+
+@deprecated(replacement='silx.gui.plot.Colormap.getSupportedColormaps')
+def getSupportedColormaps():
+ """Get the supported colormap names as a tuple of str.
+
+ The list should at least contain and start by:
+ ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
+ """
+ return Colormap.getSupportedColormaps()
diff --git a/silx/gui/plot/ComplexImageView.py b/silx/gui/plot/ComplexImageView.py
new file mode 100644
index 0000000..1463293
--- /dev/null
+++ b/silx/gui/plot/ComplexImageView.py
@@ -0,0 +1,670 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides a widget to view 2D complex data.
+
+The :class:`ComplexImageView` widget is dedicated to visualize a single 2D dataset
+of complex data.
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["Vincent Favre-Nicolin", "T. Vincent"]
+__license__ = "MIT"
+__date__ = "02/10/2017"
+
+
+import logging
+import numpy
+
+from .. import qt, icons
+from .PlotWindow import Plot2D
+from .Colormap import Colormap
+from . import items
+from silx.gui.widgets.FloatEdit import FloatEdit
+
+_logger = logging.getLogger(__name__)
+
+
+_PHASE_COLORMAP = Colormap(
+ name='hsv',
+ vmin=-numpy.pi,
+ vmax=numpy.pi)
+"""Colormap to use for phase"""
+
+# Complex colormap functions
+
+def _phase2rgb(data):
+ """Creates RGBA image with colour-coded phase.
+
+ :param numpy.ndarray data: The data to convert
+ :return: Array of RGBA colors
+ :rtype: numpy.ndarray
+ """
+ if data.size == 0:
+ return numpy.zeros((0, 0, 4), dtype=numpy.uint8)
+
+ phase = numpy.angle(data)
+ return _PHASE_COLORMAP.applyToData(phase)
+
+
+def _complex2rgbalog(data, amin=0., dlogs=2, smax=None):
+ """Returns RGBA colors: colour-coded phases and log10(amplitude) in alpha.
+
+ :param numpy.ndarray data: the complex data array to convert to RGBA
+ :param float amin: the minimum value for the alpha channel
+ :param float dlogs: amplitude range displayed, in log10 units
+ :param float smax:
+ if specified, all values above max will be displayed with an alpha=1
+ """
+ if data.size == 0:
+ return numpy.zeros((0, 0, 4), dtype=numpy.uint8)
+
+ rgba = _phase2rgb(data)
+ sabs = numpy.absolute(data)
+ if smax is not None:
+ sabs[sabs > smax] = smax
+ a = numpy.log10(sabs + 1e-20)
+ a -= a.max() - dlogs # display dlogs orders of magnitude
+ rgba[..., 3] = 255 * (amin + a / dlogs * (1 - amin) * (a > 0))
+ return rgba
+
+
+def _complex2rgbalin(data, gamma=1.0, smax=None):
+ """Returns RGBA colors: colour-coded phase and linear amplitude in alpha.
+
+ :param numpy.ndarray data:
+ :param float gamma: Optional exponent gamma applied to the amplitude
+ :param float smax:
+ """
+ if data.size == 0:
+ return numpy.zeros((0, 0, 4), dtype=numpy.uint8)
+
+ rgba = _phase2rgb(data)
+ a = numpy.absolute(data)
+ if smax is not None:
+ a[a > smax] = smax
+ a /= a.max()
+ rgba[..., 3] = 255 * a**gamma
+ return rgba
+
+
+# Dedicated plot item
+
+class _ImageComplexData(items.ImageData):
+ """Specific plot item to force colormap when using complex colormap.
+
+ This is returning the specific colormap when displaying
+ colored phase + amplitude.
+ """
+
+ def __init__(self):
+ super(_ImageComplexData, self).__init__()
+ self._readOnlyColormap = False
+ self._mode = 'absolute'
+ self._colormaps = { # Default colormaps for all modes
+ 'absolute': Colormap(),
+ 'phase': _PHASE_COLORMAP.copy(),
+ 'real': Colormap(),
+ 'imaginary': Colormap(),
+ 'amplitude_phase': _PHASE_COLORMAP.copy(),
+ 'log10_amplitude_phase': _PHASE_COLORMAP.copy(),
+ }
+
+ _READ_ONLY_MODES = 'amplitude_phase', 'log10_amplitude_phase'
+ """Modes that requires a read-only colormap."""
+
+ def setVisualizationMode(self, mode):
+ """Set the visualization mode to use.
+
+ :param str mode:
+ """
+ mode = str(mode)
+ assert mode in self._colormaps
+
+ if mode != self._mode:
+ # Save current colormap
+ self._colormaps[self._mode] = self.getColormap()
+ self._mode = mode
+
+ # Set colormap for new mode
+ self.setColormap(self._colormaps[mode])
+
+ def getVisualizationMode(self):
+ """Returns the visualization mode in use."""
+ return self._mode
+
+ def _isReadOnlyColormap(self):
+ """Returns True if colormap should not be modified."""
+ return self.getVisualizationMode() in self._READ_ONLY_MODES
+
+ def setColormap(self, colormap):
+ if not self._isReadOnlyColormap():
+ super(_ImageComplexData, self).setColormap(colormap)
+
+ def getColormap(self):
+ if self._isReadOnlyColormap():
+ return _PHASE_COLORMAP.copy()
+ else:
+ return super(_ImageComplexData, self).getColormap()
+
+
+# Widgets
+
+class _AmplitudeRangeDialog(qt.QDialog):
+ """QDialog asking for the amplitude range to display."""
+
+ sigRangeChanged = qt.Signal(tuple)
+ """Signal emitted when the range has changed.
+
+ It provides the new range as a 2-tuple: (max, delta)
+ """
+
+ def __init__(self,
+ parent=None,
+ amplitudeRange=None,
+ displayedRange=(None, 2)):
+ super(_AmplitudeRangeDialog, self).__init__(parent)
+ self.setWindowTitle('Set Displayed Amplitude Range')
+
+ if amplitudeRange is not None:
+ amplitudeRange = min(amplitudeRange), max(amplitudeRange)
+ self._amplitudeRange = amplitudeRange
+ self._defaultDisplayedRange = displayedRange
+
+ layout = qt.QFormLayout()
+ self.setLayout(layout)
+
+ if self._amplitudeRange is not None:
+ min_, max_ = self._amplitudeRange
+ layout.addRow(
+ qt.QLabel('Data Amplitude Range: [%g, %g]' % (min_, max_)))
+
+ self._maxLineEdit = FloatEdit(parent=self)
+ self._maxLineEdit.validator().setBottom(0.)
+ self._maxLineEdit.setAlignment(qt.Qt.AlignRight)
+
+ self._maxLineEdit.editingFinished.connect(self._rangeUpdated)
+ layout.addRow('Displayed Max.:', self._maxLineEdit)
+
+ self._autoscale = qt.QCheckBox('autoscale')
+ self._autoscale.toggled.connect(self._autoscaleCheckBoxToggled)
+ layout.addRow('', self._autoscale)
+
+ self._deltaLineEdit = FloatEdit(parent=self)
+ self._deltaLineEdit.validator().setBottom(1.)
+ self._deltaLineEdit.setAlignment(qt.Qt.AlignRight)
+ self._deltaLineEdit.editingFinished.connect(self._rangeUpdated)
+ layout.addRow('Displayed delta (log10 unit):', self._deltaLineEdit)
+
+ buttons = qt.QDialogButtonBox(self)
+ buttons.addButton(qt.QDialogButtonBox.Ok)
+ buttons.addButton(qt.QDialogButtonBox.Cancel)
+ buttons.accepted.connect(self.accept)
+ buttons.rejected.connect(self.reject)
+ layout.addRow(buttons)
+
+ # Set dialog from default values
+ self._resetDialogToDefault()
+
+ self.rejected.connect(self._handleRejected)
+
+ def _resetDialogToDefault(self):
+ """Set Widgets of the dialog from range information
+ """
+ max_, delta = self._defaultDisplayedRange
+
+ if max_ is not None: # Not in autoscale
+ displayedMax = max_
+ elif self._amplitudeRange is not None: # Autoscale with data
+ displayedMax = self._amplitudeRange[1]
+ else: # Autoscale without data
+ displayedMax = ''
+ if displayedMax == "":
+ self._maxLineEdit.setText("")
+ else:
+ self._maxLineEdit.setValue(displayedMax)
+ self._maxLineEdit.setEnabled(max_ is not None)
+
+ self._deltaLineEdit.setValue(delta)
+
+ self._autoscale.setChecked(self._defaultDisplayedRange[0] is None)
+
+ def getRangeInfo(self):
+ """Returns the current range as a 2-tuple (max, delta (in log10))"""
+ if self._autoscale.isChecked():
+ max_ = None
+ else:
+ maxStr = self._maxLineEdit.text()
+ max_ = self._maxLineEdit.value() if maxStr else None
+ return max_, self._deltaLineEdit.value() if self._deltaLineEdit.text() else 2
+
+ def _handleRejected(self):
+ """Reset range info to default when rejected"""
+ self._resetDialogToDefault()
+ self._rangeUpdated()
+
+ def _rangeUpdated(self):
+ """Handle QLineEdit editing finised"""
+ self.sigRangeChanged.emit(self.getRangeInfo())
+
+ def _autoscaleCheckBoxToggled(self, checked):
+ """Handle autoscale checkbox state changes"""
+ if checked: # Use default values
+ if self._amplitudeRange is None:
+ max_ = ''
+ else:
+ max_ = self._amplitudeRange[1]
+ if max_ == "":
+ self._maxLineEdit.setText("")
+ else:
+ self._maxLineEdit.setValue(max_)
+ self._maxLineEdit.setEnabled(not checked)
+ self._rangeUpdated()
+
+
+class _ComplexDataToolButton(qt.QToolButton):
+ """QToolButton providing choices of complex data visualization modes
+
+ :param parent: See :class:`QToolButton`
+ :param plot: The :class:`ComplexImageView` to control
+ """
+
+ _MODES = [
+ ('absolute', 'math-amplitude', 'Amplitude'),
+ ('phase', 'math-phase', 'Phase'),
+ ('real', 'math-real', 'Real part'),
+ ('imaginary', 'math-imaginary', 'Imaginary part'),
+ ('amplitude_phase', 'math-phase-color', 'Amplitude and Phase'),
+ ('log10_amplitude_phase', 'math-phase-color-log', 'Log10(Amp.) and Phase')]
+
+ _RANGE_DIALOG_TEXT = 'Set Amplitude Range...'
+
+ def __init__(self, parent=None, plot=None):
+ super(_ComplexDataToolButton, self).__init__(parent=parent)
+
+ assert plot is not None
+ self._plot2DComplex = plot
+
+ menu = qt.QMenu(self)
+ menu.triggered.connect(self._triggered)
+ self.setMenu(menu)
+
+ for _, icon, text in self._MODES:
+ action = qt.QAction(icons.getQIcon(icon), text, self)
+ action.setIconVisibleInMenu(True)
+ menu.addAction(action)
+
+ self._rangeDialogAction = qt.QAction(self)
+ self._rangeDialogAction.setText(self._RANGE_DIALOG_TEXT)
+ menu.addAction(self._rangeDialogAction)
+
+ self.setPopupMode(qt.QToolButton.InstantPopup)
+
+ self._modeChanged(self._plot2DComplex.getVisualizationMode())
+ self._plot2DComplex.sigVisualizationModeChanged.connect(
+ self._modeChanged)
+
+ def _modeChanged(self, mode):
+ """Handle change of visualization modes"""
+ for actionMode, icon, text in self._MODES:
+ if actionMode == mode:
+ self.setIcon(icons.getQIcon(icon))
+ self.setToolTip('Display the ' + text.lower())
+ break
+
+ self._rangeDialogAction.setEnabled(mode == 'log10_amplitude_phase')
+
+ def _triggered(self, action):
+ """Handle triggering of menu actions"""
+ actionText = action.text()
+
+ if actionText == self._RANGE_DIALOG_TEXT: # Show dialog
+ # Get amplitude range
+ data = self._plot2DComplex.getData(copy=False)
+
+ if data.size > 0:
+ absolute = numpy.absolute(data)
+ dataRange = (numpy.nanmin(absolute), numpy.nanmax(absolute))
+ else:
+ dataRange = None
+
+ # Show dialog
+ dialog = _AmplitudeRangeDialog(
+ parent=self,
+ amplitudeRange=dataRange,
+ displayedRange=self._plot2DComplex._getAmplitudeRangeInfo())
+ dialog.sigRangeChanged.connect(self._rangeChanged)
+ dialog.exec_()
+ dialog.sigRangeChanged.disconnect(self._rangeChanged)
+
+ else: # update mode
+ for mode, _, text in self._MODES:
+ if actionText == text:
+ self._plot2DComplex.setVisualizationMode(mode)
+
+ def _rangeChanged(self, range_):
+ """Handle updates of range in the dialog"""
+ self._plot2DComplex._setAmplitudeRangeInfo(*range_)
+
+
+class ComplexImageView(qt.QWidget):
+ """Display an image of complex data and allow to choose the visualization.
+
+ :param parent: See :class:`QMainWindow`
+ """
+
+ sigDataChanged = qt.Signal()
+ """Signal emitted when data has changed."""
+
+ sigVisualizationModeChanged = qt.Signal(str)
+ """Signal emitted when the visualization mode has changed.
+
+ It provides the new visualization mode.
+ """
+
+ def __init__(self, parent=None):
+ super(ComplexImageView, self).__init__(parent)
+ if parent is None:
+ self.setWindowTitle('ComplexImageView')
+
+ self._mode = 'absolute'
+ self._amplitudeRangeInfo = None, 2
+ self._data = numpy.zeros((0, 0), dtype=numpy.complex)
+ self._displayedData = numpy.zeros((0, 0), dtype=numpy.float)
+
+ self._plot2D = Plot2D(self)
+
+ layout = qt.QHBoxLayout(self)
+ layout.setSpacing(0)
+ layout.setContentsMargins(0, 0, 0, 0)
+ layout.addWidget(self._plot2D)
+ self.setLayout(layout)
+
+ # Create and add image to the plot
+ self._plotImage = _ImageComplexData()
+ self._plotImage._setLegend('__ComplexImageView__complex_image__')
+ self._plotImage.setData(self._displayedData)
+ self._plotImage.setVisualizationMode(self._mode)
+ self._plot2D._add(self._plotImage)
+ self._plot2D.setActiveImage(self._plotImage.getLegend())
+
+ toolBar = qt.QToolBar('Complex', self)
+ toolBar.addWidget(
+ _ComplexDataToolButton(parent=self, plot=self))
+
+ self._plot2D.insertToolBar(self._plot2D.getProfileToolbar(), toolBar)
+
+ def getPlot(self):
+ """Return the PlotWidget displaying the data"""
+ return self._plot2D
+
+ def _convertData(self, data, mode):
+ """Convert complex data according to provided mode.
+
+ :param numpy.ndarray data: The complex data to convert
+ :param str mode: The visualization mode
+ :return: The data corresponding to the mode
+ :rtype: 2D numpy.ndarray of float or RGBA image
+ """
+ if mode == 'absolute':
+ return numpy.absolute(data)
+ elif mode == 'phase':
+ return numpy.angle(data)
+ elif mode == 'real':
+ return numpy.real(data)
+ elif mode == 'imaginary':
+ return numpy.imag(data)
+ elif mode == 'amplitude_phase':
+ return _complex2rgbalin(data)
+ elif mode == 'log10_amplitude_phase':
+ max_, delta = self._getAmplitudeRangeInfo()
+ return _complex2rgbalog(data, dlogs=delta, smax=max_)
+ else:
+ _logger.error(
+ 'Unsupported conversion mode: %s, fallback to absolute',
+ str(mode))
+ return numpy.absolute(data)
+
+ def _updatePlot(self):
+ """Update the image in the plot"""
+
+ mode = self.getVisualizationMode()
+
+ self.getPlot().getColormapAction().setDisabled(
+ mode in ('amplitude_phase', 'log10_amplitude_phase'))
+
+ self._plotImage.setVisualizationMode(mode)
+
+ image = self.getDisplayedData(copy=False)
+ if mode in ('amplitude_phase', 'log10_amplitude_phase'):
+ # Combined view
+ absolute = numpy.absolute(self.getData(copy=False))
+ self._plotImage.setData(
+ absolute, alternative=image, copy=False)
+ else:
+ self._plotImage.setData(
+ image, alternative=None, copy=False)
+
+ def setData(self, data=None, copy=True):
+ """Set the complex data to display.
+
+ :param numpy.ndarray data: 2D complex data
+ :param bool copy: True (default) to copy the data,
+ False to use provided data (do not modify!).
+ """
+ if data is None:
+ data = numpy.zeros((0, 0), dtype=numpy.complex)
+ else:
+ data = numpy.array(data, copy=copy)
+
+ assert data.ndim == 2
+ if data.dtype.kind != 'c': # Convert to complex
+ data = numpy.array(data, dtype=numpy.complex)
+ shape_changed = (self._data.shape != data.shape)
+ self._data = data
+ self._displayedData = self._convertData(
+ data, self.getVisualizationMode())
+
+ self._updatePlot()
+ if shape_changed:
+ self.getPlot().resetZoom()
+
+ self.sigDataChanged.emit()
+
+ def getData(self, copy=True):
+ """Get the currently displayed complex data.
+
+ :param bool copy: True (default) to return a copy of the data,
+ False to return internal data (do not modify!).
+ :return: The complex data array.
+ :rtype: numpy.ndarray of complex with 2 dimensions
+ """
+ return numpy.array(self._data, copy=copy)
+
+ def getDisplayedData(self, copy=True):
+ """Returns the displayed data depending on the visualization mode
+
+ WARNING: The returned data can be a uint8 RGBA image
+
+ :param bool copy: True (default) to return a copy of the data,
+ False to return internal data (do not modify!)
+ :rtype: numpy.ndarray of float with 2 dims or RGBA image (uint8).
+ """
+ return numpy.array(self._displayedData, copy=copy)
+
+ @staticmethod
+ def getSupportedVisualizationModes():
+ """Returns the supported visualization modes.
+
+ Supported visualization modes are:
+
+ - amplitude: The absolute value provided by numpy.absolute
+ - phase: The phase (or argument) provided by numpy.angle
+ - real: Real part
+ - imaginary: Imaginary part
+ - amplitude_phase: Color-coded phase with amplitude as alpha.
+ - log10_amplitude_phase:
+ Color-coded phase with log10(amplitude) as alpha.
+
+ :rtype: tuple of str
+ """
+ return ('absolute',
+ 'phase',
+ 'real',
+ 'imaginary',
+ 'amplitude_phase',
+ 'log10_amplitude_phase')
+
+ def setVisualizationMode(self, mode):
+ """Set the mode of visualization of the complex data.
+
+ See :meth:`getSupportedVisualizationModes` for the list of
+ supported modes.
+
+ :param str mode: The mode to use.
+ """
+ assert mode in self.getSupportedVisualizationModes()
+ if mode != self._mode:
+ self._mode = mode
+ self._displayedData = self._convertData(
+ self.getData(copy=False), mode)
+ self._updatePlot()
+ self.sigVisualizationModeChanged.emit(mode)
+
+ def getVisualizationMode(self):
+ """Get the current visualization mode of the complex data.
+
+ :rtype: str
+ """
+ return self._mode
+
+ def _setAmplitudeRangeInfo(self, max_=None, delta=2):
+ """Set the amplitude range to display for 'log10_amplitude_phase' mode.
+
+ :param max_: Max of the amplitude range.
+ If None it autoscales to data max.
+ :param float delta: Delta range in log10 to display
+ """
+ self._amplitudeRangeInfo = max_, float(delta)
+ mode = self.getVisualizationMode()
+ if mode == 'log10_amplitude_phase':
+ self._displayedData = self._convertData(
+ self.getData(copy=False), mode)
+ self._updatePlot()
+
+ def _getAmplitudeRangeInfo(self):
+ """Returns the amplitude range to use for 'log10_amplitude_phase' mode.
+
+ :return: (max, delta), if max is None, then it autoscales to data max
+ :rtype: 2-tuple"""
+ return self._amplitudeRangeInfo
+
+ # Image item proxy
+
+ def setColormap(self, colormap):
+ """Set the colormap to use for amplitude, phase, real or imaginary.
+
+ WARNING: This colormap is not used when displaying both
+ amplitude and phase.
+
+ :param Colormap colormap: The colormap
+ """
+ self._plotImage.setColormap(colormap)
+
+ def getColormap(self):
+ """Returns the colormap used to display the data.
+
+ :rtype: Colormap
+ """
+ # Returns internal colormap and bypass forcing colormap
+ return items.ImageData.getColormap(self._plotImage)
+
+ def getOrigin(self):
+ """Returns the offset from origin at which to display the image.
+
+ :rtype: 2-tuple of float
+ """
+ return self._plotImage.getOrigin()
+
+ def setOrigin(self, origin):
+ """Set the offset from origin at which to display the image.
+
+ :param origin: (ox, oy) Offset from origin
+ :type origin: float or 2-tuple of float
+ """
+ self._plotImage.setOrigin(origin)
+
+ def getScale(self):
+ """Returns the scale of the image in data coordinates.
+
+ :rtype: 2-tuple of float
+ """
+ return self._plotImage.getScale()
+
+ def setScale(self, scale):
+ """Set the scale of the image
+
+ :param scale: (sx, sy) Scale of the image
+ :type scale: float or 2-tuple of float
+ """
+ self._plotImage.setScale(scale)
+
+ # PlotWidget API proxy
+
+ def getXAxis(self):
+ """Returns the X axis
+
+ :rtype: :class:`.items.Axis`
+ """
+ return self.getPlot().getXAxis()
+
+ def getYAxis(self):
+ """Returns an Y axis
+
+ :rtype: :class:`.items.Axis`
+ """
+ return self.getPlot().getYAxis(axis='left')
+
+ def getGraphTitle(self):
+ """Return the plot main title as a str."""
+ return self.getPlot().getGraphTitle()
+
+ def setGraphTitle(self, title=""):
+ """Set the plot main title.
+
+ :param str title: Main title of the plot (default: '')
+ """
+ self.getPlot().setGraphTitle(title)
+
+ def setKeepDataAspectRatio(self, flag):
+ """Set whether the plot keeps data aspect ratio or not.
+
+ :param bool flag: True to respect data aspect ratio
+ """
+ self.getPlot().setKeepDataAspectRatio(flag)
+
+ def isKeepDataAspectRatio(self):
+ """Returns whether the plot is keeping data aspect ratio or not."""
+ return self.getPlot().isKeepDataAspectRatio()
diff --git a/silx/gui/plot/CurvesROIWidget.py b/silx/gui/plot/CurvesROIWidget.py
index 13c3de0..4b10cd6 100644
--- a/silx/gui/plot/CurvesROIWidget.py
+++ b/silx/gui/plot/CurvesROIWidget.py
@@ -46,7 +46,7 @@ ROI are defined by :
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "27/06/2017"
from collections import OrderedDict
@@ -168,9 +168,9 @@ class CurvesROIWidget(qt.QWidget):
The dictionary keys are the ROI names.
Each value is a sub-dictionary of ROI info with the following fields:
- - ``"from"``: x coordinate of the left limit, as a float
- - ``"to"``: x coordinate of the right limit, as a float
- - ``"type"``: type of ROI, as a string (e.g "channels", "energy")
+ - ``"from"``: x coordinate of the left limit, as a float
+ - ``"to"``: x coordinate of the right limit, as a float
+ - ``"type"``: type of ROI, as a string (e.g "channels", "energy")
:param roidict: Dictionary of ROIs
@@ -194,9 +194,11 @@ class CurvesROIWidget(qt.QWidget):
The dictionary keys are the ROI names.
Each value is a sub-dictionary of ROI info with the following fields:
- - ``"from"``: x coordinate of the left limit, as a float
- - ``"to"``: x coordinate of the right limit, as a float
- - ``"type"``: type of ROI, as a string (e.g "channels", "energy")
+ - ``"from"``: x coordinate of the left limit, as a float
+ - ``"to"``: x coordinate of the right limit, as a float
+ - ``"type"``: type of ROI, as a string (e.g "channels", "energy")
+
+
:param order: Field used for ordering the ROIs.
One of "from", "to", "type", "netcounts", "rawcounts".
None (default) to get the same order as displayed in the widget.
@@ -742,7 +744,7 @@ class CurvesROIDockWidget(qt.QDockWidget):
"""Handle ROI widget signal"""
_logger.debug("PlotWindow._roiSignal %s", str(ddict))
if ddict['event'] == "AddROI":
- xmin, xmax = self.plot.getGraphXLimits()
+ xmin, xmax = self.plot.getXAxis().getLimits()
fromdata = xmin + 0.25 * (xmax - xmin)
todata = xmin + 0.75 * (xmax - xmin)
self.plot.remove('ROI min', kind='marker')
@@ -786,7 +788,7 @@ class CurvesROIDockWidget(qt.QDockWidget):
if newroi == "ICR":
roiDict[newroi]['type'] = "Default"
else:
- roiDict[newroi]['type'] = self.plot.getGraphXLabel()
+ roiDict[newroi]['type'] = self.plot.getXAxis().getLabel()
roiDict[newroi]['from'] = fromdata
roiDict[newroi]['to'] = todata
self.roiWidget.fillFromROIDict(roilist=roiList,
diff --git a/silx/gui/plot/ImageView.py b/silx/gui/plot/ImageView.py
index 780215e..803a2fc 100644
--- a/silx/gui/plot/ImageView.py
+++ b/silx/gui/plot/ImageView.py
@@ -34,12 +34,7 @@ Basic usage of :class:`ImageView` is through the following methods:
default colormap to use and update the currently displayed image.
- :meth:`ImageView.setImage` to update the displayed image.
-The :class:`ImageView` uses :class:`PlotWindow` and also
-exposes :class:`silx.gui.plot.Plot` API for further control
-(plot title, axes labels, adding other images, ...).
-
-For an example of use, see the implementation of :class:`ImageViewMainWindow`,
-and `example/imageview.py`.
+For an example of use, see `imageview.py` in :ref:`sample-code`.
"""
from __future__ import division
@@ -47,7 +42,7 @@ from __future__ import division
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "13/10/2016"
+__date__ = "17/08/2017"
import logging
@@ -55,7 +50,8 @@ import numpy
from .. import qt
-from . import items, PlotWindow, PlotWidget, PlotActions
+from . import items, PlotWindow, PlotWidget, actions
+from .Colormap import Colormap
from .Colors import cursorColorForColormap
from .PlotTools import LimitsToolBar
from .Profile import ProfileToolBar
@@ -253,9 +249,13 @@ class ImageView(PlotWindow):
Use :meth:`setImage` to control the displayed image.
This class also provides the :class:`silx.gui.plot.Plot` API.
+ The :class:`ImageView` inherits from :class:`.PlotWindow` (which provides
+ the toolbars) and also exposes :class:`.PlotWidget` API for further
+ plot control (plot title, axes labels, aspect ratio, ...).
+
:param parent: The parent of this widget or None.
:param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ See :class:`.PlotWidget` for the list of supported backend.
:type backend: str or :class:`BackendBase.BackendBase`
"""
@@ -318,7 +318,7 @@ class ImageView(PlotWindow):
self._histoHPlot = PlotWidget(backend=backend)
self._histoHPlot.setInteractiveMode('zoom')
- self._histoHPlot.setCallback(self._histoHPlotCB)
+ self._histoHPlot.sigPlotSignal.connect(self._histoHPlotCB)
self._histoHPlot.getWidgetHandle().sizeHint = sizeHint
self._histoHPlot.getWidgetHandle().minimumSizeHint = sizeHint
@@ -326,39 +326,39 @@ class ImageView(PlotWindow):
self.setInteractiveMode('zoom') # Color set in setColormap
self.sigPlotSignal.connect(self._imagePlotCB)
- self.sigSetYAxisInverted.connect(self._updateYAxisInverted)
+ self.getYAxis().sigInvertedChanged.connect(self._updateYAxisInverted)
self.sigActiveImageChanged.connect(self._activeImageChangedSlot)
self._histoVPlot = PlotWidget(backend=backend)
self._histoVPlot.setInteractiveMode('zoom')
- self._histoVPlot.setCallback(self._histoVPlotCB)
+ self._histoVPlot.sigPlotSignal.connect(self._histoVPlotCB)
self._histoVPlot.getWidgetHandle().sizeHint = sizeHint
self._histoVPlot.getWidgetHandle().minimumSizeHint = sizeHint
self._radarView = RadarView()
self._radarView.visibleRectDragged.connect(self._radarViewCB)
- self._layout = qt.QGridLayout()
- self._layout.addWidget(self.getWidgetHandle(), 0, 0)
- self._layout.addWidget(self._histoVPlot.getWidgetHandle(), 0, 1)
- self._layout.addWidget(self._histoHPlot.getWidgetHandle(), 1, 0)
- self._layout.addWidget(self._radarView, 1, 1)
+ layout = qt.QGridLayout()
+ layout.addWidget(self.getWidgetHandle(), 0, 0)
+ layout.addWidget(self._histoVPlot.getWidgetHandle(), 0, 1)
+ layout.addWidget(self._histoHPlot.getWidgetHandle(), 1, 0)
+ layout.addWidget(self._radarView, 1, 1)
- self._layout.setColumnMinimumWidth(0, self.IMAGE_MIN_SIZE)
- self._layout.setColumnStretch(0, 1)
- self._layout.setColumnMinimumWidth(1, self.HISTOGRAMS_HEIGHT)
- self._layout.setColumnStretch(1, 0)
+ layout.setColumnMinimumWidth(0, self.IMAGE_MIN_SIZE)
+ layout.setColumnStretch(0, 1)
+ layout.setColumnMinimumWidth(1, self.HISTOGRAMS_HEIGHT)
+ layout.setColumnStretch(1, 0)
- self._layout.setRowMinimumHeight(0, self.IMAGE_MIN_SIZE)
- self._layout.setRowStretch(0, 1)
- self._layout.setRowMinimumHeight(1, self.HISTOGRAMS_HEIGHT)
- self._layout.setRowStretch(1, 0)
+ layout.setRowMinimumHeight(0, self.IMAGE_MIN_SIZE)
+ layout.setRowStretch(0, 1)
+ layout.setRowMinimumHeight(1, self.HISTOGRAMS_HEIGHT)
+ layout.setRowStretch(1, 0)
- self._layout.setSpacing(0)
- self._layout.setContentsMargins(0, 0, 0, 0)
+ layout.setSpacing(0)
+ layout.setContentsMargins(0, 0, 0, 0)
centralWidget = qt.QWidget()
- centralWidget.setLayout(self._layout)
+ centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
def _dirtyCache(self):
@@ -376,8 +376,8 @@ class ImageView(PlotWindow):
scale = activeImage.getScale()
height, width = data.shape
- xMin, xMax = self.getGraphXLimits()
- yMin, yMax = self.getGraphYLimits()
+ xMin, xMax = self.getXAxis().getLimits()
+ yMin, yMax = self.getYAxis().getLimits()
# Convert plot area limits to image coordinates
# and work in image coordinates (i.e., in pixels)
@@ -440,8 +440,8 @@ class ImageView(PlotWindow):
vOffset = 0.1 * (vMax - vMin)
if vOffset == 0.:
vOffset = 1.
- self._histoHPlot.setGraphYLimits(vMin - vOffset,
- vMax + vOffset)
+ self._histoHPlot.getYAxis().setLimits(vMin - vOffset,
+ vMax + vOffset)
coords = numpy.arange(2 * histoVVisibleData.size)
yCoords = (coords + 1) // 2 + subsetYMin
@@ -458,8 +458,8 @@ class ImageView(PlotWindow):
vOffset = 0.1 * (vMax - vMin)
if vOffset == 0.:
vOffset = 1.
- self._histoVPlot.setGraphXLimits(vMin - vOffset,
- vMax + vOffset)
+ self._histoVPlot.getXAxis().setLimits(vMin - vOffset,
+ vMax + vOffset)
else:
self._dirtyCache()
self._histoHPlot.remove(kind='curve')
@@ -472,8 +472,8 @@ class ImageView(PlotWindow):
Takes care of y coordinate conversion.
"""
- xMin, xMax = self.getGraphXLimits()
- yMin, yMax = self.getGraphYLimits()
+ xMin, xMax = self.getXAxis().getLimits()
+ yMin, yMax = self.getYAxis().getLimits()
self._radarView.setVisibleRect(xMin, yMin, xMax - xMin, yMax - yMin)
# Plots event listeners
@@ -499,6 +499,9 @@ class ImageView(PlotWindow):
data[y][x])
elif eventDict['event'] == 'limitsChanged':
+ self._updateHistogramsLimits()
+
+ def _updateHistogramsLimits(self):
# Do not handle histograms limitsChanged while
# updating their limits from here.
self._updatingLimits = True
@@ -506,15 +509,14 @@ class ImageView(PlotWindow):
# Refresh histograms
self._updateHistograms()
- # could use eventDict['xdata'], eventDict['ydata'] instead
- xMin, xMax = self.getGraphXLimits()
- yMin, yMax = self.getGraphYLimits()
+ xMin, xMax = self.getXAxis().getLimits()
+ yMin, yMax = self.getYAxis().getLimits()
# Set horizontal histo limits
- self._histoHPlot.setGraphXLimits(xMin, xMax)
+ self._histoHPlot.getXAxis().setLimits(xMin, xMax)
# Set vertical histo limits
- self._histoVPlot.setGraphYLimits(yMin, yMax)
+ self._histoVPlot.getYAxis().setLimits(yMin, yMax)
self._updateRadarView()
@@ -542,9 +544,9 @@ class ImageView(PlotWindow):
elif eventDict['event'] == 'limitsChanged':
if (not self._updatingLimits and
- eventDict['xdata'] != self.getGraphXLimits()):
+ eventDict['xdata'] != self.getXAxis().getLimits()):
xMin, xMax = eventDict['xdata']
- self.setGraphXLimits(xMin, xMax)
+ self.getXAxis().setLimits(xMin, xMax)
def _histoVPlotCB(self, eventDict):
"""Callback for vertical histogram plot events."""
@@ -568,9 +570,9 @@ class ImageView(PlotWindow):
elif eventDict['event'] == 'limitsChanged':
if (not self._updatingLimits and
- eventDict['ydata'] != self.getGraphYLimits()):
+ eventDict['ydata'] != self.getYAxis().getLimits()):
yMin, yMax = eventDict['ydata']
- self.setGraphYLimits(yMin, yMax)
+ self.getYAxis().setLimits(yMin, yMax)
def _radarViewCB(self, left, top, width, height):
"""Slot for radar view visible rectangle changes."""
@@ -582,9 +584,9 @@ class ImageView(PlotWindow):
"""Sync image, vertical histogram and radar view axis orientation."""
if inverted is None:
# Do not perform this when called from plot signal
- inverted = self.isYAxisInverted()
+ inverted = self.getYAxis().isInverted()
- self._histoVPlot.setYAxisInverted(inverted)
+ self._histoVPlot.getYAxis().setInverted(inverted)
# Use scale to invert radarView
# RadarView default Y direction is from top to bottom
@@ -643,7 +645,7 @@ class ImageView(PlotWindow):
self._radarView.visibleRectDragged.disconnect(self._radarViewCB)
self._radarView = radarView
self._radarView.visibleRectDragged.connect(self._radarViewCB)
- self._layout.addWidget(self._radarView, 1, 1)
+ self.centralWidget().layout().addWidget(self._radarView, 1, 1)
self._updateYAxisInverted()
@@ -693,42 +695,46 @@ class ImageView(PlotWindow):
:param numpy.ndarray colors: Only used if name is None.
Custom colormap colors as Nx3 or Nx4 RGB or RGBA arrays
"""
- cmapDict = self.getDefaultColormap()
+ cmap = self.getDefaultColormap()
+
+ if isinstance(colormap, Colormap):
+ # Replace colormap
+ cmap = colormap
+
+ self.setDefaultColormap(cmap)
+
+ # Update active image colormap
+ activeImage = self.getActiveImage()
+ if isinstance(activeImage, items.ColormapMixIn):
+ activeImage.setColormap(cmap)
- if isinstance(colormap, dict):
+ elif isinstance(colormap, dict):
# Support colormap parameter as a dict
assert normalization is None
assert autoscale is None
assert vmin is None
assert vmax is None
assert colors is None
- for key, value in colormap.items():
- cmapDict[key] = value
+ cmap._setFromDict(colormap)
else:
if colormap is not None:
- cmapDict['name'] = colormap
+ cmap.setName(colormap)
if normalization is not None:
- cmapDict['normalization'] = normalization
- if autoscale is not None:
- cmapDict['autoscale'] = autoscale
- if vmin is not None:
- cmapDict['vmin'] = vmin
- if vmax is not None:
- cmapDict['vmax'] = vmax
+ cmap.setNormalization(normalization)
+ if autoscale:
+ cmap.setVRange(None, None)
+ else:
+ if vmin is not None:
+ cmap.setVMin(vmin)
+ if vmax is not None:
+ cmap.setVMax(vmax)
if colors is not None:
- cmapDict['colors'] = colors
+ cmap.setColormapLUT(colors)
- cursorColor = cursorColorForColormap(cmapDict['name'])
+ cursorColor = cursorColorForColormap(cmap.getName())
self.setInteractiveMode('zoom', color=cursorColor)
- self.setDefaultColormap(cmapDict)
-
- # Update active image colormap
- activeImage = self.getActiveImage()
- if isinstance(activeImage, items.ColormapMixIn):
- activeImage.setColormap(self.getColormap())
-
def setImage(self, image, origin=(0, 0), scale=(1., 1.),
copy=True, reset=True):
"""Set the image to display.
@@ -768,7 +774,7 @@ class ImageView(PlotWindow):
legend=self._imageLegend,
origin=origin, scale=scale,
colormap=self.getColormap(),
- replace=False)
+ replace=False, resetzoom=False)
self.setActiveImage(self._imageLegend)
self._updateHistograms()
@@ -779,6 +785,8 @@ class ImageView(PlotWindow):
if reset:
self.resetZoom()
+ else:
+ self._updateHistogramsLimits()
# ImageViewMainWindow #########################################################
@@ -793,8 +801,8 @@ class ImageViewMainWindow(ImageView):
super(ImageViewMainWindow, self).__init__(parent, backend)
self.setWindowFlags(qt.Qt.Window)
- self.setGraphXLabel('X')
- self.setGraphYLabel('Y')
+ self.getXAxis().setLabel('X')
+ self.getYAxis().setLabel('Y')
self.setGraphTitle('Image')
# Add toolbars and status bar
@@ -814,11 +822,10 @@ class ImageViewMainWindow(ImageView):
menu.addSeparator()
menu.addAction(self.resetZoomAction)
menu.addAction(self.colormapAction)
- menu.addAction(PlotActions.KeepAspectRatioAction(self, self))
- menu.addAction(PlotActions.YAxisInvertedAction(self, self))
+ menu.addAction(actions.control.KeepAspectRatioAction(self, self))
+ menu.addAction(actions.control.YAxisInvertedAction(self, self))
menu = self.menuBar().addMenu('Profile')
- menu.addAction(self.profile.browseAction)
menu.addAction(self.profile.hLineAction)
menu.addAction(self.profile.vLineAction)
menu.addAction(self.profile.lineAction)
diff --git a/silx/gui/plot/ItemsSelectionDialog.py b/silx/gui/plot/ItemsSelectionDialog.py
new file mode 100644
index 0000000..acb287a
--- /dev/null
+++ b/silx/gui/plot/ItemsSelectionDialog.py
@@ -0,0 +1,282 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides a dialog widget to select plot items.
+
+.. autoclass:: ItemsSelectionDialog
+
+"""
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "28/06/2017"
+
+import logging
+
+from silx.gui import qt
+from silx.gui.plot.PlotWidget import PlotWidget
+
+_logger = logging.getLogger(__name__)
+
+
+class KindsSelector(qt.QListWidget):
+ """List widget allowing to select plot item kinds
+ ("curve", "scatter", "image"...)
+ """
+ sigSelectedKindsChanged = qt.Signal(list)
+
+ def __init__(self, parent=None, kinds=None):
+ """
+
+ :param parent: Parent QWidget or None
+ :param tuple(str) kinds: Sequence of kinds. If None, the default
+ behavior is to provide a checkbox for all possible item kinds.
+ """
+ qt.QListWidget.__init__(self, parent)
+
+ self.plot_item_kinds = []
+
+ self.setAvailableKinds(kinds if kinds is not None else PlotWidget.ITEM_KINDS)
+
+ self.setSelectionMode(qt.QAbstractItemView.ExtendedSelection)
+ self.selectAll()
+
+ self.itemSelectionChanged.connect(self.emitSigKindsSelectionChanged)
+
+ def emitSigKindsSelectionChanged(self):
+ self.sigSelectedKindsChanged.emit(self.selectedKinds)
+
+ @property
+ def selectedKinds(self):
+ """Tuple of all selected kinds (as strings)."""
+ # check for updates when self.itemSelectionChanged
+ return [item.text() for item in self.selectedItems()]
+
+ def setAvailableKinds(self, kinds):
+ """Set a list of kinds to be displayed.
+
+ :param list[str] kinds: Sequence of kinds
+ """
+ self.plot_item_kinds = kinds
+
+ self.clear()
+ for kind in self.plot_item_kinds:
+ item = qt.QListWidgetItem(self)
+ item.setText(kind)
+ self.addItem(item)
+
+ def selectAll(self):
+ """Select all available kinds."""
+ if self.selectionMode() in [qt.QAbstractItemView.SingleSelection,
+ qt.QAbstractItemView.NoSelection]:
+ raise RuntimeError("selectAll requires a multiple selection mode")
+ for i in range(self.count()):
+ self.item(i).setSelected(True)
+
+
+class PlotItemsSelector(qt.QTableWidget):
+ """Table widget displaying the legend and kind of all
+ plot items corresponding to a list of specified kinds.
+
+ Selected plot items are provided as property :attr:`selectedPlotItems`.
+ You can be warned of selection changes by listening to signal
+ :attr:`itemSelectionChanged`.
+ """
+ def __init__(self, parent=None, plot=None):
+ if plot is None or not isinstance(plot, PlotWidget):
+ raise AttributeError("parameter plot is required")
+ self.plot = plot
+ """:class:`PlotWidget` instance"""
+
+ self.plot_item_kinds = None
+ """List of plot item kinds (strings)"""
+
+ qt.QTableWidget.__init__(self, parent)
+
+ self.setColumnCount(2)
+
+ self.setSelectionBehavior(qt.QTableWidget.SelectRows)
+
+ def _clear(self):
+ self.clear()
+ self.setHorizontalHeaderLabels(["legend", "type"])
+
+ def setAllKindsFilter(self):
+ """Display all kinds of plot items."""
+ self.setKindsFilter(PlotWidget.ITEM_KINDS)
+
+ def setKindsFilter(self, kinds):
+ """Set list of all kinds of plot items to be displayed.
+
+ :param list[str] kinds: Sequence of kinds
+ """
+ if not set(kinds) <= set(PlotWidget.ITEM_KINDS):
+ raise KeyError("Illegal plot item kinds: %s" %
+ set(kinds) - set(PlotWidget.ITEM_KINDS))
+ self.plot_item_kinds = kinds
+
+ self.updatePlotItems()
+
+ def updatePlotItems(self):
+ self._clear()
+
+ nrows = len(self.plot._getItems(kind=self.plot_item_kinds,
+ just_legend=True))
+ self.setRowCount(nrows)
+
+ # respect order of kinds as set in method setKindsFilter
+ i = 0
+ for kind in self.plot_item_kinds:
+ for plot_item in self.plot._getItems(kind=kind):
+ legend_twitem = qt.QTableWidgetItem(plot_item.getLegend())
+ self.setItem(i, 0, legend_twitem)
+
+ kind_twitem = qt.QTableWidgetItem(kind)
+ self.setItem(i, 1, kind_twitem)
+ i += 1
+
+ @property
+ def selectedPlotItems(self):
+ """List of all selected items"""
+ selection_model = self.selectionModel()
+ selected_rows_idx = selection_model.selectedRows()
+ selected_rows = [idx.row() for idx in selected_rows_idx]
+
+ items = []
+ for row in selected_rows:
+ legend = self.item(row, 0).text()
+ kind = self.item(row, 1).text()
+ items.append(self.plot._getItem(kind, legend))
+
+ return items
+
+
+class ItemsSelectionDialog(qt.QDialog):
+ """This widget is a modal dialog allowing to select one or more plot
+ items, in a table displaying their legend and kind.
+
+ Public methods:
+
+ - :meth:`getSelectedItems`
+ - :meth:`setAvailableKinds`
+ - :meth:`setItemsSelectionMode`
+
+ This widget inherits QDialog and therefore implements the usual
+ dialog methods, e.g. :meth:`exec_`.
+
+ A trivial usage example would be::
+
+ isd = ItemsSelectionDialog(plot=my_plot_widget)
+ isd.setItemsSelectionMode(qt.QTableWidget.SingleSelection)
+ result = isd.exec_()
+ if result:
+ for item in isd.getSelectedItems():
+ print(item.getLegend(), type(item))
+ else:
+ print("Selection cancelled")
+ """
+ def __init__(self, parent=None, plot=None):
+ if plot is None or not isinstance(plot, PlotWidget):
+ raise AttributeError("parameter plot is required")
+ qt.QDialog.__init__(self, parent)
+
+ self.setWindowTitle("Plot items selector")
+
+ kind_selector_label = qt.QLabel("Filter item kinds:", self)
+ item_selector_label = qt.QLabel("Select items:", self)
+
+ self.kind_selector = KindsSelector(self)
+ self.kind_selector.setToolTip(
+ "select one or more item kinds to show them in the item list")
+
+ self.item_selector = PlotItemsSelector(self, plot)
+ self.item_selector.setToolTip("select items")
+
+ self.item_selector.setKindsFilter(self.kind_selector.selectedKinds)
+ self.kind_selector.sigSelectedKindsChanged.connect(
+ self.item_selector.setKindsFilter
+ )
+
+ okb = qt.QPushButton("OK", self)
+ okb.clicked.connect(self.accept)
+
+ cancelb = qt.QPushButton("Cancel", self)
+ cancelb.clicked.connect(self.reject)
+
+ layout = qt.QGridLayout(self)
+ layout.addWidget(kind_selector_label, 0, 0)
+ layout.addWidget(item_selector_label, 0, 1)
+ layout.addWidget(self.kind_selector, 1, 0)
+ layout.addWidget(self.item_selector, 1, 1)
+ layout.addWidget(okb, 2, 0)
+ layout.addWidget(cancelb, 2, 1)
+
+ self.setLayout(layout)
+
+ def getSelectedItems(self):
+ """Return a list of selected plot items
+
+ :return: List of selected plot items
+ :rtype: list[silx.gui.plot.items.Item]"""
+ return self.item_selector.selectedPlotItems
+
+ def setAvailableKinds(self, kinds):
+ """Set a list of kinds to be displayed.
+
+ :param list[str] kinds: Sequence of kinds
+ """
+ self.kind_selector.setAvailableKinds(kinds)
+
+ def selectAllKinds(self):
+ self.kind_selector.selectAll()
+
+ def setItemsSelectionMode(self, mode):
+ """Set selection mode for plot item (single item selection,
+ multiple...).
+
+ :param mode: One of :class:`QTableWidget` selection modes
+ """
+ if mode == self.item_selector.SingleSelection:
+ self.item_selector.setToolTip(
+ "Select one item by clicking on it.")
+ elif mode == self.item_selector.MultiSelection:
+ self.item_selector.setToolTip(
+ "Select one or more items by clicking with the left mouse"
+ " button.\nYou can unselect items by clicking them again.\n"
+ "Multiple items can be toggled by dragging the mouse over them.")
+ elif mode == self.item_selector.ExtendedSelection:
+ self.item_selector.setToolTip(
+ "Select one or more items. You can select multiple items "
+ "by keeping the Ctrl key pushed when clicking.\nYou can "
+ "select a range of items by clicking on the first and "
+ "last while keeping the Shift key pushed.")
+ elif mode == self.item_selector.ContiguousSelection:
+ self.item_selector.setToolTip(
+ "Select one item by clicking on it. If you press the Shift"
+ " key while clicking on a second item,\nall items between "
+ "the two will be selected.")
+ elif mode == self.item_selector.NoSelection:
+ raise ValueError("The NoSelection mode is not allowed "
+ "in this context.")
+ self.item_selector.setSelectionMode(mode)
diff --git a/silx/gui/plot/LegendSelector.py b/silx/gui/plot/LegendSelector.py
index 3af9050..31bc3db 100644
--- a/silx/gui/plot/LegendSelector.py
+++ b/silx/gui/plot/LegendSelector.py
@@ -29,7 +29,7 @@ This widget is meant to work with :class:`PlotWindow`.
__authors__ = ["V.A. Sole", "T. Rueter", "T. Vincent"]
__license__ = "MIT"
-__data__ = "28/04/2016"
+__data__ = "08/08/2016"
import logging
@@ -259,6 +259,7 @@ class LegendModel(qt.QAbstractListModel):
legendList = []
self.legendList = []
self.insertLegendList(0, legendList)
+ self._palette = qt.QPalette()
def __getitem__(self, idx):
if idx >= len(self.legendList):
@@ -282,6 +283,7 @@ class LegendModel(qt.QAbstractListModel):
raise IndexError('list index out of range')
item = self.legendList[idx]
+ isActive = item[1].get("active", False)
if role == qt.Qt.DisplayRole:
# Data to be rendered in the form of text
legend = str(item[0])
@@ -295,14 +297,19 @@ class LegendModel(qt.QAbstractListModel):
return alignment
elif role == qt.Qt.BackgroundRole:
# Background color, must be QBrush
- if idx % 2:
+ if isActive:
+ brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.Highlight)
+ elif idx % 2:
brush = qt.QBrush(qt.QColor(240, 240, 240))
else:
brush = qt.QBrush(qt.Qt.white)
return brush
elif role == qt.Qt.ForegroundRole:
# ForegroundRole color, must be QBrush
- brush = qt.QBrush(qt.Qt.blue)
+ if isActive:
+ brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.HighlightedText)
+ else:
+ brush = self._palette.brush(qt.QPalette.Normal, qt.QPalette.WindowText)
return brush
elif role == qt.Qt.CheckStateRole:
return bool(item[2]) # item[2] == True
@@ -513,6 +520,7 @@ class LegendListItemWidget(qt.QItemDelegate):
textAlign = modelIndex.data(qt.Qt.TextAlignmentRole)
painter.setBrush(textBrush)
painter.setFont(self.legend.font())
+ painter.setPen(textBrush.color())
painter.drawText(labelRect, textAlign, legendText)
# Draw icon
@@ -614,7 +622,7 @@ class LegendListView(qt.QListView):
self.setSelectionMode(qt.QAbstractItemView.NoSelection)
if model is None:
- model = LegendModel()
+ model = LegendModel(parent=self)
self.setModel(model)
self.setContextMenu(contextMenu)
@@ -1053,15 +1061,18 @@ class LegendsDockWidget(qt.QDockWidget):
# Use active color if curve is active
if legend == self.plot.getActiveCurve(just_legend=True):
color = qt.QColor(self.plot.getActiveCurveColor())
+ isActive = True
else:
color = qt.QColor.fromRgbF(*curve.getColor())
+ isActive = False
curveInfo = {
'color': color,
'linewidth': curve.getLineWidth(),
'linestyle': curve.getLineStyle(),
'symbol': curve.getSymbol(),
- 'selected': not self.plot.isCurveHidden(legend)}
+ 'selected': not self.plot.isCurveHidden(legend),
+ 'active': isActive}
legendList.append((legend, curveInfo))
self._legendWidget.setLegendList(legendList)
diff --git a/silx/gui/plot/LimitsHistory.py b/silx/gui/plot/LimitsHistory.py
new file mode 100644
index 0000000..a323548
--- /dev/null
+++ b/silx/gui/plot/LimitsHistory.py
@@ -0,0 +1,83 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides handling of :class:`PlotWidget` limits history.
+"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "19/07/2017"
+
+
+from .. import qt
+
+
+class LimitsHistory(qt.QObject):
+ """Class handling history of limits of a :class:`PlotWidget`.
+
+ :param PlotWidget parent: The plot widget this object is bound to.
+ """
+
+ def __init__(self, parent):
+ self._history = []
+ super(LimitsHistory, self).__init__(parent)
+ self.setParent(parent)
+
+ def setParent(self, parent):
+ """See :meth:`QObject.setParent`.
+
+ :param PlotWidget parent: The PlotWidget this object is bound to.
+ """
+ self.clear() # Clear history when changing parent
+ super(LimitsHistory, self).setParent(parent)
+
+ def push(self):
+ """Append current limits to the history."""
+ plot = self.parent()
+ xmin, xmax = plot.getXAxis().getLimits()
+ ymin, ymax = plot.getYAxis(axis='left').getLimits()
+ y2min, y2max = plot.getYAxis(axis='right').getLimits()
+ self._history.append((xmin, xmax, ymin, ymax, y2min, y2max))
+
+ def pop(self):
+ """Restore previously limits stored in the history.
+
+ :return: True if limits were restored, False if history was empty.
+ :rtype: bool
+ """
+ plot = self.parent()
+ if self._history:
+ limits = self._history.pop(-1)
+ plot.setLimits(*limits)
+ return True
+ else:
+ plot.resetZoom()
+ return False
+
+ def clear(self):
+ """Clear stored limits states."""
+ self._history = []
+
+ def __len__(self):
+ return len(self._history)
diff --git a/silx/gui/plot/MPLColormap.py b/silx/gui/plot/MPLColormap.py
deleted file mode 100644
index 49b11d7..0000000
--- a/silx/gui/plot/MPLColormap.py
+++ /dev/null
@@ -1,1062 +0,0 @@
-# New matplotlib colormaps by Nathaniel J. Smith, Stefan van der Walt,
-# and (in the case of viridis) Eric Firing.
-#
-# This file and the colormaps in it are released under the CC0 license /
-# public domain dedication. We would appreciate credit if you use or
-# redistribute these colormaps, but do not impose any legal restrictions.
-#
-# To the extent possible under law, the persons who associated CC0 with
-# mpl-colormaps have waived all copyright and related or neighboring rights
-# to mpl-colormaps.
-#
-# You should have received a copy of the CC0 legalcode along with this
-# work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
-"""Matplotlib's new colormaps"""
-
-
-from matplotlib.colors import ListedColormap
-
-
-__all__ = ['magma', 'inferno', 'plasma', 'viridis']
-
-_magma_data = [[0.001462, 0.000466, 0.013866],
- [0.002258, 0.001295, 0.018331],
- [0.003279, 0.002305, 0.023708],
- [0.004512, 0.003490, 0.029965],
- [0.005950, 0.004843, 0.037130],
- [0.007588, 0.006356, 0.044973],
- [0.009426, 0.008022, 0.052844],
- [0.011465, 0.009828, 0.060750],
- [0.013708, 0.011771, 0.068667],
- [0.016156, 0.013840, 0.076603],
- [0.018815, 0.016026, 0.084584],
- [0.021692, 0.018320, 0.092610],
- [0.024792, 0.020715, 0.100676],
- [0.028123, 0.023201, 0.108787],
- [0.031696, 0.025765, 0.116965],
- [0.035520, 0.028397, 0.125209],
- [0.039608, 0.031090, 0.133515],
- [0.043830, 0.033830, 0.141886],
- [0.048062, 0.036607, 0.150327],
- [0.052320, 0.039407, 0.158841],
- [0.056615, 0.042160, 0.167446],
- [0.060949, 0.044794, 0.176129],
- [0.065330, 0.047318, 0.184892],
- [0.069764, 0.049726, 0.193735],
- [0.074257, 0.052017, 0.202660],
- [0.078815, 0.054184, 0.211667],
- [0.083446, 0.056225, 0.220755],
- [0.088155, 0.058133, 0.229922],
- [0.092949, 0.059904, 0.239164],
- [0.097833, 0.061531, 0.248477],
- [0.102815, 0.063010, 0.257854],
- [0.107899, 0.064335, 0.267289],
- [0.113094, 0.065492, 0.276784],
- [0.118405, 0.066479, 0.286321],
- [0.123833, 0.067295, 0.295879],
- [0.129380, 0.067935, 0.305443],
- [0.135053, 0.068391, 0.315000],
- [0.140858, 0.068654, 0.324538],
- [0.146785, 0.068738, 0.334011],
- [0.152839, 0.068637, 0.343404],
- [0.159018, 0.068354, 0.352688],
- [0.165308, 0.067911, 0.361816],
- [0.171713, 0.067305, 0.370771],
- [0.178212, 0.066576, 0.379497],
- [0.184801, 0.065732, 0.387973],
- [0.191460, 0.064818, 0.396152],
- [0.198177, 0.063862, 0.404009],
- [0.204935, 0.062907, 0.411514],
- [0.211718, 0.061992, 0.418647],
- [0.218512, 0.061158, 0.425392],
- [0.225302, 0.060445, 0.431742],
- [0.232077, 0.059889, 0.437695],
- [0.238826, 0.059517, 0.443256],
- [0.245543, 0.059352, 0.448436],
- [0.252220, 0.059415, 0.453248],
- [0.258857, 0.059706, 0.457710],
- [0.265447, 0.060237, 0.461840],
- [0.271994, 0.060994, 0.465660],
- [0.278493, 0.061978, 0.469190],
- [0.284951, 0.063168, 0.472451],
- [0.291366, 0.064553, 0.475462],
- [0.297740, 0.066117, 0.478243],
- [0.304081, 0.067835, 0.480812],
- [0.310382, 0.069702, 0.483186],
- [0.316654, 0.071690, 0.485380],
- [0.322899, 0.073782, 0.487408],
- [0.329114, 0.075972, 0.489287],
- [0.335308, 0.078236, 0.491024],
- [0.341482, 0.080564, 0.492631],
- [0.347636, 0.082946, 0.494121],
- [0.353773, 0.085373, 0.495501],
- [0.359898, 0.087831, 0.496778],
- [0.366012, 0.090314, 0.497960],
- [0.372116, 0.092816, 0.499053],
- [0.378211, 0.095332, 0.500067],
- [0.384299, 0.097855, 0.501002],
- [0.390384, 0.100379, 0.501864],
- [0.396467, 0.102902, 0.502658],
- [0.402548, 0.105420, 0.503386],
- [0.408629, 0.107930, 0.504052],
- [0.414709, 0.110431, 0.504662],
- [0.420791, 0.112920, 0.505215],
- [0.426877, 0.115395, 0.505714],
- [0.432967, 0.117855, 0.506160],
- [0.439062, 0.120298, 0.506555],
- [0.445163, 0.122724, 0.506901],
- [0.451271, 0.125132, 0.507198],
- [0.457386, 0.127522, 0.507448],
- [0.463508, 0.129893, 0.507652],
- [0.469640, 0.132245, 0.507809],
- [0.475780, 0.134577, 0.507921],
- [0.481929, 0.136891, 0.507989],
- [0.488088, 0.139186, 0.508011],
- [0.494258, 0.141462, 0.507988],
- [0.500438, 0.143719, 0.507920],
- [0.506629, 0.145958, 0.507806],
- [0.512831, 0.148179, 0.507648],
- [0.519045, 0.150383, 0.507443],
- [0.525270, 0.152569, 0.507192],
- [0.531507, 0.154739, 0.506895],
- [0.537755, 0.156894, 0.506551],
- [0.544015, 0.159033, 0.506159],
- [0.550287, 0.161158, 0.505719],
- [0.556571, 0.163269, 0.505230],
- [0.562866, 0.165368, 0.504692],
- [0.569172, 0.167454, 0.504105],
- [0.575490, 0.169530, 0.503466],
- [0.581819, 0.171596, 0.502777],
- [0.588158, 0.173652, 0.502035],
- [0.594508, 0.175701, 0.501241],
- [0.600868, 0.177743, 0.500394],
- [0.607238, 0.179779, 0.499492],
- [0.613617, 0.181811, 0.498536],
- [0.620005, 0.183840, 0.497524],
- [0.626401, 0.185867, 0.496456],
- [0.632805, 0.187893, 0.495332],
- [0.639216, 0.189921, 0.494150],
- [0.645633, 0.191952, 0.492910],
- [0.652056, 0.193986, 0.491611],
- [0.658483, 0.196027, 0.490253],
- [0.664915, 0.198075, 0.488836],
- [0.671349, 0.200133, 0.487358],
- [0.677786, 0.202203, 0.485819],
- [0.684224, 0.204286, 0.484219],
- [0.690661, 0.206384, 0.482558],
- [0.697098, 0.208501, 0.480835],
- [0.703532, 0.210638, 0.479049],
- [0.709962, 0.212797, 0.477201],
- [0.716387, 0.214982, 0.475290],
- [0.722805, 0.217194, 0.473316],
- [0.729216, 0.219437, 0.471279],
- [0.735616, 0.221713, 0.469180],
- [0.742004, 0.224025, 0.467018],
- [0.748378, 0.226377, 0.464794],
- [0.754737, 0.228772, 0.462509],
- [0.761077, 0.231214, 0.460162],
- [0.767398, 0.233705, 0.457755],
- [0.773695, 0.236249, 0.455289],
- [0.779968, 0.238851, 0.452765],
- [0.786212, 0.241514, 0.450184],
- [0.792427, 0.244242, 0.447543],
- [0.798608, 0.247040, 0.444848],
- [0.804752, 0.249911, 0.442102],
- [0.810855, 0.252861, 0.439305],
- [0.816914, 0.255895, 0.436461],
- [0.822926, 0.259016, 0.433573],
- [0.828886, 0.262229, 0.430644],
- [0.834791, 0.265540, 0.427671],
- [0.840636, 0.268953, 0.424666],
- [0.846416, 0.272473, 0.421631],
- [0.852126, 0.276106, 0.418573],
- [0.857763, 0.279857, 0.415496],
- [0.863320, 0.283729, 0.412403],
- [0.868793, 0.287728, 0.409303],
- [0.874176, 0.291859, 0.406205],
- [0.879464, 0.296125, 0.403118],
- [0.884651, 0.300530, 0.400047],
- [0.889731, 0.305079, 0.397002],
- [0.894700, 0.309773, 0.393995],
- [0.899552, 0.314616, 0.391037],
- [0.904281, 0.319610, 0.388137],
- [0.908884, 0.324755, 0.385308],
- [0.913354, 0.330052, 0.382563],
- [0.917689, 0.335500, 0.379915],
- [0.921884, 0.341098, 0.377376],
- [0.925937, 0.346844, 0.374959],
- [0.929845, 0.352734, 0.372677],
- [0.933606, 0.358764, 0.370541],
- [0.937221, 0.364929, 0.368567],
- [0.940687, 0.371224, 0.366762],
- [0.944006, 0.377643, 0.365136],
- [0.947180, 0.384178, 0.363701],
- [0.950210, 0.390820, 0.362468],
- [0.953099, 0.397563, 0.361438],
- [0.955849, 0.404400, 0.360619],
- [0.958464, 0.411324, 0.360014],
- [0.960949, 0.418323, 0.359630],
- [0.963310, 0.425390, 0.359469],
- [0.965549, 0.432519, 0.359529],
- [0.967671, 0.439703, 0.359810],
- [0.969680, 0.446936, 0.360311],
- [0.971582, 0.454210, 0.361030],
- [0.973381, 0.461520, 0.361965],
- [0.975082, 0.468861, 0.363111],
- [0.976690, 0.476226, 0.364466],
- [0.978210, 0.483612, 0.366025],
- [0.979645, 0.491014, 0.367783],
- [0.981000, 0.498428, 0.369734],
- [0.982279, 0.505851, 0.371874],
- [0.983485, 0.513280, 0.374198],
- [0.984622, 0.520713, 0.376698],
- [0.985693, 0.528148, 0.379371],
- [0.986700, 0.535582, 0.382210],
- [0.987646, 0.543015, 0.385210],
- [0.988533, 0.550446, 0.388365],
- [0.989363, 0.557873, 0.391671],
- [0.990138, 0.565296, 0.395122],
- [0.990871, 0.572706, 0.398714],
- [0.991558, 0.580107, 0.402441],
- [0.992196, 0.587502, 0.406299],
- [0.992785, 0.594891, 0.410283],
- [0.993326, 0.602275, 0.414390],
- [0.993834, 0.609644, 0.418613],
- [0.994309, 0.616999, 0.422950],
- [0.994738, 0.624350, 0.427397],
- [0.995122, 0.631696, 0.431951],
- [0.995480, 0.639027, 0.436607],
- [0.995810, 0.646344, 0.441361],
- [0.996096, 0.653659, 0.446213],
- [0.996341, 0.660969, 0.451160],
- [0.996580, 0.668256, 0.456192],
- [0.996775, 0.675541, 0.461314],
- [0.996925, 0.682828, 0.466526],
- [0.997077, 0.690088, 0.471811],
- [0.997186, 0.697349, 0.477182],
- [0.997254, 0.704611, 0.482635],
- [0.997325, 0.711848, 0.488154],
- [0.997351, 0.719089, 0.493755],
- [0.997351, 0.726324, 0.499428],
- [0.997341, 0.733545, 0.505167],
- [0.997285, 0.740772, 0.510983],
- [0.997228, 0.747981, 0.516859],
- [0.997138, 0.755190, 0.522806],
- [0.997019, 0.762398, 0.528821],
- [0.996898, 0.769591, 0.534892],
- [0.996727, 0.776795, 0.541039],
- [0.996571, 0.783977, 0.547233],
- [0.996369, 0.791167, 0.553499],
- [0.996162, 0.798348, 0.559820],
- [0.995932, 0.805527, 0.566202],
- [0.995680, 0.812706, 0.572645],
- [0.995424, 0.819875, 0.579140],
- [0.995131, 0.827052, 0.585701],
- [0.994851, 0.834213, 0.592307],
- [0.994524, 0.841387, 0.598983],
- [0.994222, 0.848540, 0.605696],
- [0.993866, 0.855711, 0.612482],
- [0.993545, 0.862859, 0.619299],
- [0.993170, 0.870024, 0.626189],
- [0.992831, 0.877168, 0.633109],
- [0.992440, 0.884330, 0.640099],
- [0.992089, 0.891470, 0.647116],
- [0.991688, 0.898627, 0.654202],
- [0.991332, 0.905763, 0.661309],
- [0.990930, 0.912915, 0.668481],
- [0.990570, 0.920049, 0.675675],
- [0.990175, 0.927196, 0.682926],
- [0.989815, 0.934329, 0.690198],
- [0.989434, 0.941470, 0.697519],
- [0.989077, 0.948604, 0.704863],
- [0.988717, 0.955742, 0.712242],
- [0.988367, 0.962878, 0.719649],
- [0.988033, 0.970012, 0.727077],
- [0.987691, 0.977154, 0.734536],
- [0.987387, 0.984288, 0.742002],
- [0.987053, 0.991438, 0.749504]]
-
-_inferno_data = [[0.001462, 0.000466, 0.013866],
- [0.002267, 0.001270, 0.018570],
- [0.003299, 0.002249, 0.024239],
- [0.004547, 0.003392, 0.030909],
- [0.006006, 0.004692, 0.038558],
- [0.007676, 0.006136, 0.046836],
- [0.009561, 0.007713, 0.055143],
- [0.011663, 0.009417, 0.063460],
- [0.013995, 0.011225, 0.071862],
- [0.016561, 0.013136, 0.080282],
- [0.019373, 0.015133, 0.088767],
- [0.022447, 0.017199, 0.097327],
- [0.025793, 0.019331, 0.105930],
- [0.029432, 0.021503, 0.114621],
- [0.033385, 0.023702, 0.123397],
- [0.037668, 0.025921, 0.132232],
- [0.042253, 0.028139, 0.141141],
- [0.046915, 0.030324, 0.150164],
- [0.051644, 0.032474, 0.159254],
- [0.056449, 0.034569, 0.168414],
- [0.061340, 0.036590, 0.177642],
- [0.066331, 0.038504, 0.186962],
- [0.071429, 0.040294, 0.196354],
- [0.076637, 0.041905, 0.205799],
- [0.081962, 0.043328, 0.215289],
- [0.087411, 0.044556, 0.224813],
- [0.092990, 0.045583, 0.234358],
- [0.098702, 0.046402, 0.243904],
- [0.104551, 0.047008, 0.253430],
- [0.110536, 0.047399, 0.262912],
- [0.116656, 0.047574, 0.272321],
- [0.122908, 0.047536, 0.281624],
- [0.129285, 0.047293, 0.290788],
- [0.135778, 0.046856, 0.299776],
- [0.142378, 0.046242, 0.308553],
- [0.149073, 0.045468, 0.317085],
- [0.155850, 0.044559, 0.325338],
- [0.162689, 0.043554, 0.333277],
- [0.169575, 0.042489, 0.340874],
- [0.176493, 0.041402, 0.348111],
- [0.183429, 0.040329, 0.354971],
- [0.190367, 0.039309, 0.361447],
- [0.197297, 0.038400, 0.367535],
- [0.204209, 0.037632, 0.373238],
- [0.211095, 0.037030, 0.378563],
- [0.217949, 0.036615, 0.383522],
- [0.224763, 0.036405, 0.388129],
- [0.231538, 0.036405, 0.392400],
- [0.238273, 0.036621, 0.396353],
- [0.244967, 0.037055, 0.400007],
- [0.251620, 0.037705, 0.403378],
- [0.258234, 0.038571, 0.406485],
- [0.264810, 0.039647, 0.409345],
- [0.271347, 0.040922, 0.411976],
- [0.277850, 0.042353, 0.414392],
- [0.284321, 0.043933, 0.416608],
- [0.290763, 0.045644, 0.418637],
- [0.297178, 0.047470, 0.420491],
- [0.303568, 0.049396, 0.422182],
- [0.309935, 0.051407, 0.423721],
- [0.316282, 0.053490, 0.425116],
- [0.322610, 0.055634, 0.426377],
- [0.328921, 0.057827, 0.427511],
- [0.335217, 0.060060, 0.428524],
- [0.341500, 0.062325, 0.429425],
- [0.347771, 0.064616, 0.430217],
- [0.354032, 0.066925, 0.430906],
- [0.360284, 0.069247, 0.431497],
- [0.366529, 0.071579, 0.431994],
- [0.372768, 0.073915, 0.432400],
- [0.379001, 0.076253, 0.432719],
- [0.385228, 0.078591, 0.432955],
- [0.391453, 0.080927, 0.433109],
- [0.397674, 0.083257, 0.433183],
- [0.403894, 0.085580, 0.433179],
- [0.410113, 0.087896, 0.433098],
- [0.416331, 0.090203, 0.432943],
- [0.422549, 0.092501, 0.432714],
- [0.428768, 0.094790, 0.432412],
- [0.434987, 0.097069, 0.432039],
- [0.441207, 0.099338, 0.431594],
- [0.447428, 0.101597, 0.431080],
- [0.453651, 0.103848, 0.430498],
- [0.459875, 0.106089, 0.429846],
- [0.466100, 0.108322, 0.429125],
- [0.472328, 0.110547, 0.428334],
- [0.478558, 0.112764, 0.427475],
- [0.484789, 0.114974, 0.426548],
- [0.491022, 0.117179, 0.425552],
- [0.497257, 0.119379, 0.424488],
- [0.503493, 0.121575, 0.423356],
- [0.509730, 0.123769, 0.422156],
- [0.515967, 0.125960, 0.420887],
- [0.522206, 0.128150, 0.419549],
- [0.528444, 0.130341, 0.418142],
- [0.534683, 0.132534, 0.416667],
- [0.540920, 0.134729, 0.415123],
- [0.547157, 0.136929, 0.413511],
- [0.553392, 0.139134, 0.411829],
- [0.559624, 0.141346, 0.410078],
- [0.565854, 0.143567, 0.408258],
- [0.572081, 0.145797, 0.406369],
- [0.578304, 0.148039, 0.404411],
- [0.584521, 0.150294, 0.402385],
- [0.590734, 0.152563, 0.400290],
- [0.596940, 0.154848, 0.398125],
- [0.603139, 0.157151, 0.395891],
- [0.609330, 0.159474, 0.393589],
- [0.615513, 0.161817, 0.391219],
- [0.621685, 0.164184, 0.388781],
- [0.627847, 0.166575, 0.386276],
- [0.633998, 0.168992, 0.383704],
- [0.640135, 0.171438, 0.381065],
- [0.646260, 0.173914, 0.378359],
- [0.652369, 0.176421, 0.375586],
- [0.658463, 0.178962, 0.372748],
- [0.664540, 0.181539, 0.369846],
- [0.670599, 0.184153, 0.366879],
- [0.676638, 0.186807, 0.363849],
- [0.682656, 0.189501, 0.360757],
- [0.688653, 0.192239, 0.357603],
- [0.694627, 0.195021, 0.354388],
- [0.700576, 0.197851, 0.351113],
- [0.706500, 0.200728, 0.347777],
- [0.712396, 0.203656, 0.344383],
- [0.718264, 0.206636, 0.340931],
- [0.724103, 0.209670, 0.337424],
- [0.729909, 0.212759, 0.333861],
- [0.735683, 0.215906, 0.330245],
- [0.741423, 0.219112, 0.326576],
- [0.747127, 0.222378, 0.322856],
- [0.752794, 0.225706, 0.319085],
- [0.758422, 0.229097, 0.315266],
- [0.764010, 0.232554, 0.311399],
- [0.769556, 0.236077, 0.307485],
- [0.775059, 0.239667, 0.303526],
- [0.780517, 0.243327, 0.299523],
- [0.785929, 0.247056, 0.295477],
- [0.791293, 0.250856, 0.291390],
- [0.796607, 0.254728, 0.287264],
- [0.801871, 0.258674, 0.283099],
- [0.807082, 0.262692, 0.278898],
- [0.812239, 0.266786, 0.274661],
- [0.817341, 0.270954, 0.270390],
- [0.822386, 0.275197, 0.266085],
- [0.827372, 0.279517, 0.261750],
- [0.832299, 0.283913, 0.257383],
- [0.837165, 0.288385, 0.252988],
- [0.841969, 0.292933, 0.248564],
- [0.846709, 0.297559, 0.244113],
- [0.851384, 0.302260, 0.239636],
- [0.855992, 0.307038, 0.235133],
- [0.860533, 0.311892, 0.230606],
- [0.865006, 0.316822, 0.226055],
- [0.869409, 0.321827, 0.221482],
- [0.873741, 0.326906, 0.216886],
- [0.878001, 0.332060, 0.212268],
- [0.882188, 0.337287, 0.207628],
- [0.886302, 0.342586, 0.202968],
- [0.890341, 0.347957, 0.198286],
- [0.894305, 0.353399, 0.193584],
- [0.898192, 0.358911, 0.188860],
- [0.902003, 0.364492, 0.184116],
- [0.905735, 0.370140, 0.179350],
- [0.909390, 0.375856, 0.174563],
- [0.912966, 0.381636, 0.169755],
- [0.916462, 0.387481, 0.164924],
- [0.919879, 0.393389, 0.160070],
- [0.923215, 0.399359, 0.155193],
- [0.926470, 0.405389, 0.150292],
- [0.929644, 0.411479, 0.145367],
- [0.932737, 0.417627, 0.140417],
- [0.935747, 0.423831, 0.135440],
- [0.938675, 0.430091, 0.130438],
- [0.941521, 0.436405, 0.125409],
- [0.944285, 0.442772, 0.120354],
- [0.946965, 0.449191, 0.115272],
- [0.949562, 0.455660, 0.110164],
- [0.952075, 0.462178, 0.105031],
- [0.954506, 0.468744, 0.099874],
- [0.956852, 0.475356, 0.094695],
- [0.959114, 0.482014, 0.089499],
- [0.961293, 0.488716, 0.084289],
- [0.963387, 0.495462, 0.079073],
- [0.965397, 0.502249, 0.073859],
- [0.967322, 0.509078, 0.068659],
- [0.969163, 0.515946, 0.063488],
- [0.970919, 0.522853, 0.058367],
- [0.972590, 0.529798, 0.053324],
- [0.974176, 0.536780, 0.048392],
- [0.975677, 0.543798, 0.043618],
- [0.977092, 0.550850, 0.039050],
- [0.978422, 0.557937, 0.034931],
- [0.979666, 0.565057, 0.031409],
- [0.980824, 0.572209, 0.028508],
- [0.981895, 0.579392, 0.026250],
- [0.982881, 0.586606, 0.024661],
- [0.983779, 0.593849, 0.023770],
- [0.984591, 0.601122, 0.023606],
- [0.985315, 0.608422, 0.024202],
- [0.985952, 0.615750, 0.025592],
- [0.986502, 0.623105, 0.027814],
- [0.986964, 0.630485, 0.030908],
- [0.987337, 0.637890, 0.034916],
- [0.987622, 0.645320, 0.039886],
- [0.987819, 0.652773, 0.045581],
- [0.987926, 0.660250, 0.051750],
- [0.987945, 0.667748, 0.058329],
- [0.987874, 0.675267, 0.065257],
- [0.987714, 0.682807, 0.072489],
- [0.987464, 0.690366, 0.079990],
- [0.987124, 0.697944, 0.087731],
- [0.986694, 0.705540, 0.095694],
- [0.986175, 0.713153, 0.103863],
- [0.985566, 0.720782, 0.112229],
- [0.984865, 0.728427, 0.120785],
- [0.984075, 0.736087, 0.129527],
- [0.983196, 0.743758, 0.138453],
- [0.982228, 0.751442, 0.147565],
- [0.981173, 0.759135, 0.156863],
- [0.980032, 0.766837, 0.166353],
- [0.978806, 0.774545, 0.176037],
- [0.977497, 0.782258, 0.185923],
- [0.976108, 0.789974, 0.196018],
- [0.974638, 0.797692, 0.206332],
- [0.973088, 0.805409, 0.216877],
- [0.971468, 0.813122, 0.227658],
- [0.969783, 0.820825, 0.238686],
- [0.968041, 0.828515, 0.249972],
- [0.966243, 0.836191, 0.261534],
- [0.964394, 0.843848, 0.273391],
- [0.962517, 0.851476, 0.285546],
- [0.960626, 0.859069, 0.298010],
- [0.958720, 0.866624, 0.310820],
- [0.956834, 0.874129, 0.323974],
- [0.954997, 0.881569, 0.337475],
- [0.953215, 0.888942, 0.351369],
- [0.951546, 0.896226, 0.365627],
- [0.950018, 0.903409, 0.380271],
- [0.948683, 0.910473, 0.395289],
- [0.947594, 0.917399, 0.410665],
- [0.946809, 0.924168, 0.426373],
- [0.946392, 0.930761, 0.442367],
- [0.946403, 0.937159, 0.458592],
- [0.946903, 0.943348, 0.474970],
- [0.947937, 0.949318, 0.491426],
- [0.949545, 0.955063, 0.507860],
- [0.951740, 0.960587, 0.524203],
- [0.954529, 0.965896, 0.540361],
- [0.957896, 0.971003, 0.556275],
- [0.961812, 0.975924, 0.571925],
- [0.966249, 0.980678, 0.587206],
- [0.971162, 0.985282, 0.602154],
- [0.976511, 0.989753, 0.616760],
- [0.982257, 0.994109, 0.631017],
- [0.988362, 0.998364, 0.644924]]
-
-_plasma_data = [[0.050383, 0.029803, 0.527975],
- [0.063536, 0.028426, 0.533124],
- [0.075353, 0.027206, 0.538007],
- [0.086222, 0.026125, 0.542658],
- [0.096379, 0.025165, 0.547103],
- [0.105980, 0.024309, 0.551368],
- [0.115124, 0.023556, 0.555468],
- [0.123903, 0.022878, 0.559423],
- [0.132381, 0.022258, 0.563250],
- [0.140603, 0.021687, 0.566959],
- [0.148607, 0.021154, 0.570562],
- [0.156421, 0.020651, 0.574065],
- [0.164070, 0.020171, 0.577478],
- [0.171574, 0.019706, 0.580806],
- [0.178950, 0.019252, 0.584054],
- [0.186213, 0.018803, 0.587228],
- [0.193374, 0.018354, 0.590330],
- [0.200445, 0.017902, 0.593364],
- [0.207435, 0.017442, 0.596333],
- [0.214350, 0.016973, 0.599239],
- [0.221197, 0.016497, 0.602083],
- [0.227983, 0.016007, 0.604867],
- [0.234715, 0.015502, 0.607592],
- [0.241396, 0.014979, 0.610259],
- [0.248032, 0.014439, 0.612868],
- [0.254627, 0.013882, 0.615419],
- [0.261183, 0.013308, 0.617911],
- [0.267703, 0.012716, 0.620346],
- [0.274191, 0.012109, 0.622722],
- [0.280648, 0.011488, 0.625038],
- [0.287076, 0.010855, 0.627295],
- [0.293478, 0.010213, 0.629490],
- [0.299855, 0.009561, 0.631624],
- [0.306210, 0.008902, 0.633694],
- [0.312543, 0.008239, 0.635700],
- [0.318856, 0.007576, 0.637640],
- [0.325150, 0.006915, 0.639512],
- [0.331426, 0.006261, 0.641316],
- [0.337683, 0.005618, 0.643049],
- [0.343925, 0.004991, 0.644710],
- [0.350150, 0.004382, 0.646298],
- [0.356359, 0.003798, 0.647810],
- [0.362553, 0.003243, 0.649245],
- [0.368733, 0.002724, 0.650601],
- [0.374897, 0.002245, 0.651876],
- [0.381047, 0.001814, 0.653068],
- [0.387183, 0.001434, 0.654177],
- [0.393304, 0.001114, 0.655199],
- [0.399411, 0.000859, 0.656133],
- [0.405503, 0.000678, 0.656977],
- [0.411580, 0.000577, 0.657730],
- [0.417642, 0.000564, 0.658390],
- [0.423689, 0.000646, 0.658956],
- [0.429719, 0.000831, 0.659425],
- [0.435734, 0.001127, 0.659797],
- [0.441732, 0.001540, 0.660069],
- [0.447714, 0.002080, 0.660240],
- [0.453677, 0.002755, 0.660310],
- [0.459623, 0.003574, 0.660277],
- [0.465550, 0.004545, 0.660139],
- [0.471457, 0.005678, 0.659897],
- [0.477344, 0.006980, 0.659549],
- [0.483210, 0.008460, 0.659095],
- [0.489055, 0.010127, 0.658534],
- [0.494877, 0.011990, 0.657865],
- [0.500678, 0.014055, 0.657088],
- [0.506454, 0.016333, 0.656202],
- [0.512206, 0.018833, 0.655209],
- [0.517933, 0.021563, 0.654109],
- [0.523633, 0.024532, 0.652901],
- [0.529306, 0.027747, 0.651586],
- [0.534952, 0.031217, 0.650165],
- [0.540570, 0.034950, 0.648640],
- [0.546157, 0.038954, 0.647010],
- [0.551715, 0.043136, 0.645277],
- [0.557243, 0.047331, 0.643443],
- [0.562738, 0.051545, 0.641509],
- [0.568201, 0.055778, 0.639477],
- [0.573632, 0.060028, 0.637349],
- [0.579029, 0.064296, 0.635126],
- [0.584391, 0.068579, 0.632812],
- [0.589719, 0.072878, 0.630408],
- [0.595011, 0.077190, 0.627917],
- [0.600266, 0.081516, 0.625342],
- [0.605485, 0.085854, 0.622686],
- [0.610667, 0.090204, 0.619951],
- [0.615812, 0.094564, 0.617140],
- [0.620919, 0.098934, 0.614257],
- [0.625987, 0.103312, 0.611305],
- [0.631017, 0.107699, 0.608287],
- [0.636008, 0.112092, 0.605205],
- [0.640959, 0.116492, 0.602065],
- [0.645872, 0.120898, 0.598867],
- [0.650746, 0.125309, 0.595617],
- [0.655580, 0.129725, 0.592317],
- [0.660374, 0.134144, 0.588971],
- [0.665129, 0.138566, 0.585582],
- [0.669845, 0.142992, 0.582154],
- [0.674522, 0.147419, 0.578688],
- [0.679160, 0.151848, 0.575189],
- [0.683758, 0.156278, 0.571660],
- [0.688318, 0.160709, 0.568103],
- [0.692840, 0.165141, 0.564522],
- [0.697324, 0.169573, 0.560919],
- [0.701769, 0.174005, 0.557296],
- [0.706178, 0.178437, 0.553657],
- [0.710549, 0.182868, 0.550004],
- [0.714883, 0.187299, 0.546338],
- [0.719181, 0.191729, 0.542663],
- [0.723444, 0.196158, 0.538981],
- [0.727670, 0.200586, 0.535293],
- [0.731862, 0.205013, 0.531601],
- [0.736019, 0.209439, 0.527908],
- [0.740143, 0.213864, 0.524216],
- [0.744232, 0.218288, 0.520524],
- [0.748289, 0.222711, 0.516834],
- [0.752312, 0.227133, 0.513149],
- [0.756304, 0.231555, 0.509468],
- [0.760264, 0.235976, 0.505794],
- [0.764193, 0.240396, 0.502126],
- [0.768090, 0.244817, 0.498465],
- [0.771958, 0.249237, 0.494813],
- [0.775796, 0.253658, 0.491171],
- [0.779604, 0.258078, 0.487539],
- [0.783383, 0.262500, 0.483918],
- [0.787133, 0.266922, 0.480307],
- [0.790855, 0.271345, 0.476706],
- [0.794549, 0.275770, 0.473117],
- [0.798216, 0.280197, 0.469538],
- [0.801855, 0.284626, 0.465971],
- [0.805467, 0.289057, 0.462415],
- [0.809052, 0.293491, 0.458870],
- [0.812612, 0.297928, 0.455338],
- [0.816144, 0.302368, 0.451816],
- [0.819651, 0.306812, 0.448306],
- [0.823132, 0.311261, 0.444806],
- [0.826588, 0.315714, 0.441316],
- [0.830018, 0.320172, 0.437836],
- [0.833422, 0.324635, 0.434366],
- [0.836801, 0.329105, 0.430905],
- [0.840155, 0.333580, 0.427455],
- [0.843484, 0.338062, 0.424013],
- [0.846788, 0.342551, 0.420579],
- [0.850066, 0.347048, 0.417153],
- [0.853319, 0.351553, 0.413734],
- [0.856547, 0.356066, 0.410322],
- [0.859750, 0.360588, 0.406917],
- [0.862927, 0.365119, 0.403519],
- [0.866078, 0.369660, 0.400126],
- [0.869203, 0.374212, 0.396738],
- [0.872303, 0.378774, 0.393355],
- [0.875376, 0.383347, 0.389976],
- [0.878423, 0.387932, 0.386600],
- [0.881443, 0.392529, 0.383229],
- [0.884436, 0.397139, 0.379860],
- [0.887402, 0.401762, 0.376494],
- [0.890340, 0.406398, 0.373130],
- [0.893250, 0.411048, 0.369768],
- [0.896131, 0.415712, 0.366407],
- [0.898984, 0.420392, 0.363047],
- [0.901807, 0.425087, 0.359688],
- [0.904601, 0.429797, 0.356329],
- [0.907365, 0.434524, 0.352970],
- [0.910098, 0.439268, 0.349610],
- [0.912800, 0.444029, 0.346251],
- [0.915471, 0.448807, 0.342890],
- [0.918109, 0.453603, 0.339529],
- [0.920714, 0.458417, 0.336166],
- [0.923287, 0.463251, 0.332801],
- [0.925825, 0.468103, 0.329435],
- [0.928329, 0.472975, 0.326067],
- [0.930798, 0.477867, 0.322697],
- [0.933232, 0.482780, 0.319325],
- [0.935630, 0.487712, 0.315952],
- [0.937990, 0.492667, 0.312575],
- [0.940313, 0.497642, 0.309197],
- [0.942598, 0.502639, 0.305816],
- [0.944844, 0.507658, 0.302433],
- [0.947051, 0.512699, 0.299049],
- [0.949217, 0.517763, 0.295662],
- [0.951344, 0.522850, 0.292275],
- [0.953428, 0.527960, 0.288883],
- [0.955470, 0.533093, 0.285490],
- [0.957469, 0.538250, 0.282096],
- [0.959424, 0.543431, 0.278701],
- [0.961336, 0.548636, 0.275305],
- [0.963203, 0.553865, 0.271909],
- [0.965024, 0.559118, 0.268513],
- [0.966798, 0.564396, 0.265118],
- [0.968526, 0.569700, 0.261721],
- [0.970205, 0.575028, 0.258325],
- [0.971835, 0.580382, 0.254931],
- [0.973416, 0.585761, 0.251540],
- [0.974947, 0.591165, 0.248151],
- [0.976428, 0.596595, 0.244767],
- [0.977856, 0.602051, 0.241387],
- [0.979233, 0.607532, 0.238013],
- [0.980556, 0.613039, 0.234646],
- [0.981826, 0.618572, 0.231287],
- [0.983041, 0.624131, 0.227937],
- [0.984199, 0.629718, 0.224595],
- [0.985301, 0.635330, 0.221265],
- [0.986345, 0.640969, 0.217948],
- [0.987332, 0.646633, 0.214648],
- [0.988260, 0.652325, 0.211364],
- [0.989128, 0.658043, 0.208100],
- [0.989935, 0.663787, 0.204859],
- [0.990681, 0.669558, 0.201642],
- [0.991365, 0.675355, 0.198453],
- [0.991985, 0.681179, 0.195295],
- [0.992541, 0.687030, 0.192170],
- [0.993032, 0.692907, 0.189084],
- [0.993456, 0.698810, 0.186041],
- [0.993814, 0.704741, 0.183043],
- [0.994103, 0.710698, 0.180097],
- [0.994324, 0.716681, 0.177208],
- [0.994474, 0.722691, 0.174381],
- [0.994553, 0.728728, 0.171622],
- [0.994561, 0.734791, 0.168938],
- [0.994495, 0.740880, 0.166335],
- [0.994355, 0.746995, 0.163821],
- [0.994141, 0.753137, 0.161404],
- [0.993851, 0.759304, 0.159092],
- [0.993482, 0.765499, 0.156891],
- [0.993033, 0.771720, 0.154808],
- [0.992505, 0.777967, 0.152855],
- [0.991897, 0.784239, 0.151042],
- [0.991209, 0.790537, 0.149377],
- [0.990439, 0.796859, 0.147870],
- [0.989587, 0.803205, 0.146529],
- [0.988648, 0.809579, 0.145357],
- [0.987621, 0.815978, 0.144363],
- [0.986509, 0.822401, 0.143557],
- [0.985314, 0.828846, 0.142945],
- [0.984031, 0.835315, 0.142528],
- [0.982653, 0.841812, 0.142303],
- [0.981190, 0.848329, 0.142279],
- [0.979644, 0.854866, 0.142453],
- [0.977995, 0.861432, 0.142808],
- [0.976265, 0.868016, 0.143351],
- [0.974443, 0.874622, 0.144061],
- [0.972530, 0.881250, 0.144923],
- [0.970533, 0.887896, 0.145919],
- [0.968443, 0.894564, 0.147014],
- [0.966271, 0.901249, 0.148180],
- [0.964021, 0.907950, 0.149370],
- [0.961681, 0.914672, 0.150520],
- [0.959276, 0.921407, 0.151566],
- [0.956808, 0.928152, 0.152409],
- [0.954287, 0.934908, 0.152921],
- [0.951726, 0.941671, 0.152925],
- [0.949151, 0.948435, 0.152178],
- [0.946602, 0.955190, 0.150328],
- [0.944152, 0.961916, 0.146861],
- [0.941896, 0.968590, 0.140956],
- [0.940015, 0.975158, 0.131326]]
-
-_viridis_data = [[0.267004, 0.004874, 0.329415],
- [0.268510, 0.009605, 0.335427],
- [0.269944, 0.014625, 0.341379],
- [0.271305, 0.019942, 0.347269],
- [0.272594, 0.025563, 0.353093],
- [0.273809, 0.031497, 0.358853],
- [0.274952, 0.037752, 0.364543],
- [0.276022, 0.044167, 0.370164],
- [0.277018, 0.050344, 0.375715],
- [0.277941, 0.056324, 0.381191],
- [0.278791, 0.062145, 0.386592],
- [0.279566, 0.067836, 0.391917],
- [0.280267, 0.073417, 0.397163],
- [0.280894, 0.078907, 0.402329],
- [0.281446, 0.084320, 0.407414],
- [0.281924, 0.089666, 0.412415],
- [0.282327, 0.094955, 0.417331],
- [0.282656, 0.100196, 0.422160],
- [0.282910, 0.105393, 0.426902],
- [0.283091, 0.110553, 0.431554],
- [0.283197, 0.115680, 0.436115],
- [0.283229, 0.120777, 0.440584],
- [0.283187, 0.125848, 0.444960],
- [0.283072, 0.130895, 0.449241],
- [0.282884, 0.135920, 0.453427],
- [0.282623, 0.140926, 0.457517],
- [0.282290, 0.145912, 0.461510],
- [0.281887, 0.150881, 0.465405],
- [0.281412, 0.155834, 0.469201],
- [0.280868, 0.160771, 0.472899],
- [0.280255, 0.165693, 0.476498],
- [0.279574, 0.170599, 0.479997],
- [0.278826, 0.175490, 0.483397],
- [0.278012, 0.180367, 0.486697],
- [0.277134, 0.185228, 0.489898],
- [0.276194, 0.190074, 0.493001],
- [0.275191, 0.194905, 0.496005],
- [0.274128, 0.199721, 0.498911],
- [0.273006, 0.204520, 0.501721],
- [0.271828, 0.209303, 0.504434],
- [0.270595, 0.214069, 0.507052],
- [0.269308, 0.218818, 0.509577],
- [0.267968, 0.223549, 0.512008],
- [0.266580, 0.228262, 0.514349],
- [0.265145, 0.232956, 0.516599],
- [0.263663, 0.237631, 0.518762],
- [0.262138, 0.242286, 0.520837],
- [0.260571, 0.246922, 0.522828],
- [0.258965, 0.251537, 0.524736],
- [0.257322, 0.256130, 0.526563],
- [0.255645, 0.260703, 0.528312],
- [0.253935, 0.265254, 0.529983],
- [0.252194, 0.269783, 0.531579],
- [0.250425, 0.274290, 0.533103],
- [0.248629, 0.278775, 0.534556],
- [0.246811, 0.283237, 0.535941],
- [0.244972, 0.287675, 0.537260],
- [0.243113, 0.292092, 0.538516],
- [0.241237, 0.296485, 0.539709],
- [0.239346, 0.300855, 0.540844],
- [0.237441, 0.305202, 0.541921],
- [0.235526, 0.309527, 0.542944],
- [0.233603, 0.313828, 0.543914],
- [0.231674, 0.318106, 0.544834],
- [0.229739, 0.322361, 0.545706],
- [0.227802, 0.326594, 0.546532],
- [0.225863, 0.330805, 0.547314],
- [0.223925, 0.334994, 0.548053],
- [0.221989, 0.339161, 0.548752],
- [0.220057, 0.343307, 0.549413],
- [0.218130, 0.347432, 0.550038],
- [0.216210, 0.351535, 0.550627],
- [0.214298, 0.355619, 0.551184],
- [0.212395, 0.359683, 0.551710],
- [0.210503, 0.363727, 0.552206],
- [0.208623, 0.367752, 0.552675],
- [0.206756, 0.371758, 0.553117],
- [0.204903, 0.375746, 0.553533],
- [0.203063, 0.379716, 0.553925],
- [0.201239, 0.383670, 0.554294],
- [0.199430, 0.387607, 0.554642],
- [0.197636, 0.391528, 0.554969],
- [0.195860, 0.395433, 0.555276],
- [0.194100, 0.399323, 0.555565],
- [0.192357, 0.403199, 0.555836],
- [0.190631, 0.407061, 0.556089],
- [0.188923, 0.410910, 0.556326],
- [0.187231, 0.414746, 0.556547],
- [0.185556, 0.418570, 0.556753],
- [0.183898, 0.422383, 0.556944],
- [0.182256, 0.426184, 0.557120],
- [0.180629, 0.429975, 0.557282],
- [0.179019, 0.433756, 0.557430],
- [0.177423, 0.437527, 0.557565],
- [0.175841, 0.441290, 0.557685],
- [0.174274, 0.445044, 0.557792],
- [0.172719, 0.448791, 0.557885],
- [0.171176, 0.452530, 0.557965],
- [0.169646, 0.456262, 0.558030],
- [0.168126, 0.459988, 0.558082],
- [0.166617, 0.463708, 0.558119],
- [0.165117, 0.467423, 0.558141],
- [0.163625, 0.471133, 0.558148],
- [0.162142, 0.474838, 0.558140],
- [0.160665, 0.478540, 0.558115],
- [0.159194, 0.482237, 0.558073],
- [0.157729, 0.485932, 0.558013],
- [0.156270, 0.489624, 0.557936],
- [0.154815, 0.493313, 0.557840],
- [0.153364, 0.497000, 0.557724],
- [0.151918, 0.500685, 0.557587],
- [0.150476, 0.504369, 0.557430],
- [0.149039, 0.508051, 0.557250],
- [0.147607, 0.511733, 0.557049],
- [0.146180, 0.515413, 0.556823],
- [0.144759, 0.519093, 0.556572],
- [0.143343, 0.522773, 0.556295],
- [0.141935, 0.526453, 0.555991],
- [0.140536, 0.530132, 0.555659],
- [0.139147, 0.533812, 0.555298],
- [0.137770, 0.537492, 0.554906],
- [0.136408, 0.541173, 0.554483],
- [0.135066, 0.544853, 0.554029],
- [0.133743, 0.548535, 0.553541],
- [0.132444, 0.552216, 0.553018],
- [0.131172, 0.555899, 0.552459],
- [0.129933, 0.559582, 0.551864],
- [0.128729, 0.563265, 0.551229],
- [0.127568, 0.566949, 0.550556],
- [0.126453, 0.570633, 0.549841],
- [0.125394, 0.574318, 0.549086],
- [0.124395, 0.578002, 0.548287],
- [0.123463, 0.581687, 0.547445],
- [0.122606, 0.585371, 0.546557],
- [0.121831, 0.589055, 0.545623],
- [0.121148, 0.592739, 0.544641],
- [0.120565, 0.596422, 0.543611],
- [0.120092, 0.600104, 0.542530],
- [0.119738, 0.603785, 0.541400],
- [0.119512, 0.607464, 0.540218],
- [0.119423, 0.611141, 0.538982],
- [0.119483, 0.614817, 0.537692],
- [0.119699, 0.618490, 0.536347],
- [0.120081, 0.622161, 0.534946],
- [0.120638, 0.625828, 0.533488],
- [0.121380, 0.629492, 0.531973],
- [0.122312, 0.633153, 0.530398],
- [0.123444, 0.636809, 0.528763],
- [0.124780, 0.640461, 0.527068],
- [0.126326, 0.644107, 0.525311],
- [0.128087, 0.647749, 0.523491],
- [0.130067, 0.651384, 0.521608],
- [0.132268, 0.655014, 0.519661],
- [0.134692, 0.658636, 0.517649],
- [0.137339, 0.662252, 0.515571],
- [0.140210, 0.665859, 0.513427],
- [0.143303, 0.669459, 0.511215],
- [0.146616, 0.673050, 0.508936],
- [0.150148, 0.676631, 0.506589],
- [0.153894, 0.680203, 0.504172],
- [0.157851, 0.683765, 0.501686],
- [0.162016, 0.687316, 0.499129],
- [0.166383, 0.690856, 0.496502],
- [0.170948, 0.694384, 0.493803],
- [0.175707, 0.697900, 0.491033],
- [0.180653, 0.701402, 0.488189],
- [0.185783, 0.704891, 0.485273],
- [0.191090, 0.708366, 0.482284],
- [0.196571, 0.711827, 0.479221],
- [0.202219, 0.715272, 0.476084],
- [0.208030, 0.718701, 0.472873],
- [0.214000, 0.722114, 0.469588],
- [0.220124, 0.725509, 0.466226],
- [0.226397, 0.728888, 0.462789],
- [0.232815, 0.732247, 0.459277],
- [0.239374, 0.735588, 0.455688],
- [0.246070, 0.738910, 0.452024],
- [0.252899, 0.742211, 0.448284],
- [0.259857, 0.745492, 0.444467],
- [0.266941, 0.748751, 0.440573],
- [0.274149, 0.751988, 0.436601],
- [0.281477, 0.755203, 0.432552],
- [0.288921, 0.758394, 0.428426],
- [0.296479, 0.761561, 0.424223],
- [0.304148, 0.764704, 0.419943],
- [0.311925, 0.767822, 0.415586],
- [0.319809, 0.770914, 0.411152],
- [0.327796, 0.773980, 0.406640],
- [0.335885, 0.777018, 0.402049],
- [0.344074, 0.780029, 0.397381],
- [0.352360, 0.783011, 0.392636],
- [0.360741, 0.785964, 0.387814],
- [0.369214, 0.788888, 0.382914],
- [0.377779, 0.791781, 0.377939],
- [0.386433, 0.794644, 0.372886],
- [0.395174, 0.797475, 0.367757],
- [0.404001, 0.800275, 0.362552],
- [0.412913, 0.803041, 0.357269],
- [0.421908, 0.805774, 0.351910],
- [0.430983, 0.808473, 0.346476],
- [0.440137, 0.811138, 0.340967],
- [0.449368, 0.813768, 0.335384],
- [0.458674, 0.816363, 0.329727],
- [0.468053, 0.818921, 0.323998],
- [0.477504, 0.821444, 0.318195],
- [0.487026, 0.823929, 0.312321],
- [0.496615, 0.826376, 0.306377],
- [0.506271, 0.828786, 0.300362],
- [0.515992, 0.831158, 0.294279],
- [0.525776, 0.833491, 0.288127],
- [0.535621, 0.835785, 0.281908],
- [0.545524, 0.838039, 0.275626],
- [0.555484, 0.840254, 0.269281],
- [0.565498, 0.842430, 0.262877],
- [0.575563, 0.844566, 0.256415],
- [0.585678, 0.846661, 0.249897],
- [0.595839, 0.848717, 0.243329],
- [0.606045, 0.850733, 0.236712],
- [0.616293, 0.852709, 0.230052],
- [0.626579, 0.854645, 0.223353],
- [0.636902, 0.856542, 0.216620],
- [0.647257, 0.858400, 0.209861],
- [0.657642, 0.860219, 0.203082],
- [0.668054, 0.861999, 0.196293],
- [0.678489, 0.863742, 0.189503],
- [0.688944, 0.865448, 0.182725],
- [0.699415, 0.867117, 0.175971],
- [0.709898, 0.868751, 0.169257],
- [0.720391, 0.870350, 0.162603],
- [0.730889, 0.871916, 0.156029],
- [0.741388, 0.873449, 0.149561],
- [0.751884, 0.874951, 0.143228],
- [0.762373, 0.876424, 0.137064],
- [0.772852, 0.877868, 0.131109],
- [0.783315, 0.879285, 0.125405],
- [0.793760, 0.880678, 0.120005],
- [0.804182, 0.882046, 0.114965],
- [0.814576, 0.883393, 0.110347],
- [0.824940, 0.884720, 0.106217],
- [0.835270, 0.886029, 0.102646],
- [0.845561, 0.887322, 0.099702],
- [0.855810, 0.888601, 0.097452],
- [0.866013, 0.889868, 0.095953],
- [0.876168, 0.891125, 0.095250],
- [0.886271, 0.892374, 0.095374],
- [0.896320, 0.893616, 0.096335],
- [0.906311, 0.894855, 0.098125],
- [0.916242, 0.896091, 0.100717],
- [0.926106, 0.897330, 0.104071],
- [0.935904, 0.898570, 0.108131],
- [0.945636, 0.899815, 0.112838],
- [0.955300, 0.901065, 0.118128],
- [0.964894, 0.902323, 0.123941],
- [0.974417, 0.903590, 0.130215],
- [0.983868, 0.904867, 0.136897],
- [0.993248, 0.906157, 0.143936]]
-
-
-cmaps = {}
-for (name, data) in (('magma', _magma_data),
- ('inferno', _inferno_data),
- ('plasma', _plasma_data),
- ('viridis', _viridis_data)):
-
- cmaps[name] = ListedColormap(data, name=name)
-
-magma = cmaps['magma']
-inferno = cmaps['inferno']
-plasma = cmaps['plasma']
-viridis = cmaps['viridis']
diff --git a/silx/gui/plot/MaskToolsWidget.py b/silx/gui/plot/MaskToolsWidget.py
index 6407d44..09c5ca5 100644
--- a/silx/gui/plot/MaskToolsWidget.py
+++ b/silx/gui/plot/MaskToolsWidget.py
@@ -35,13 +35,14 @@ from __future__ import division
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "20/04/2017"
+__date__ = "20/06/2017"
import os
import sys
import numpy
import logging
+import collections
from silx.image import shapes
@@ -211,17 +212,13 @@ class MaskToolsWidget(BaseMaskToolsWidget):
_maxLevelNumber = 255
def __init__(self, parent=None, plot=None):
+ super(MaskToolsWidget, self).__init__(parent, plot,
+ mask=ImageMask())
self._origin = (0., 0.) # Mask origin in plot
self._scale = (1., 1.) # Mask scale in plot
self._z = 1 # Mask layer in plot
self._data = numpy.zeros((0, 0), dtype=numpy.uint8) # Store image
- self._mask = ImageMask()
-
- super(MaskToolsWidget, self).__init__(parent, plot)
-
- self._initWidgets()
-
def setSelectionMask(self, mask, copy=True):
"""Set the mask to a new array.
@@ -239,6 +236,13 @@ class MaskToolsWidget(BaseMaskToolsWidget):
_logger.error('Not an image, shape: %d', len(mask.shape))
return None
+ # ensure all mask attributes are synchronized with the active image
+ # and connect listener
+ activeImage = self.plot.getActiveImage()
+ if activeImage is not None and activeImage.getLegend() != self._maskName:
+ self._activeImageChanged()
+ self.plot.sigActiveImageChanged.connect(self._activeImageChanged)
+
if self._data.shape[0:2] == (0, 0) or mask.shape == self._data.shape[0:2]:
self._mask.setMask(mask, copy=copy)
self._mask.commit()
@@ -262,12 +266,22 @@ class MaskToolsWidget(BaseMaskToolsWidget):
"""Update mask image in plot"""
mask = self.getSelectionMask(copy=False)
if len(mask):
- self.plot.addImage(mask, legend=self._maskName,
- colormap=self._colormap,
- origin=self._origin,
- scale=self._scale,
- z=self._z,
- replace=False, resetzoom=False)
+ # get the mask from the plot
+ maskItem = self.plot.getImage(self._maskName)
+ mustBeAdded = maskItem is None
+ if mustBeAdded:
+ maskItem = items.MaskImageData()
+ maskItem._setLegend(self._maskName)
+ # update the items
+ maskItem.setData(mask, copy=False)
+ maskItem.setColormap(self._colormap)
+ maskItem.setOrigin(self._origin)
+ maskItem.setScale(self._scale)
+ maskItem.setZValue(self._z)
+
+ if mustBeAdded:
+ self.plot._add(maskItem)
+
elif self.plot.getImage(self._maskName):
self.plot.remove(self._maskName, kind='image')
@@ -281,7 +295,11 @@ class MaskToolsWidget(BaseMaskToolsWidget):
self.plot.sigActiveImageChanged.connect(self._activeImageChanged)
def hideEvent(self, event):
- self.plot.sigActiveImageChanged.disconnect(self._activeImageChanged)
+ try:
+ self.plot.sigActiveImageChanged.disconnect(
+ self._activeImageChanged)
+ except (RuntimeError, TypeError):
+ pass
if not self.browseAction.isChecked():
self.browseAction.trigger() # Disable drawing tool
@@ -337,8 +355,9 @@ class MaskToolsWidget(BaseMaskToolsWidget):
def _activeImageChanged(self, *args):
"""Update widget and mask according to active image changes"""
activeImage = self.plot.getActiveImage()
- if activeImage is None or activeImage.getLegend() == self._maskName:
- # No active image or active image is the mask...
+ if (activeImage is None or activeImage.getLegend() == self._maskName or
+ activeImage.getData(copy=False).size == 0):
+ # No active image or active image is the mask or image has no data...
self.setEnabled(False)
self._data = numpy.zeros((0, 0), dtype=numpy.uint8)
@@ -390,6 +409,14 @@ class MaskToolsWidget(BaseMaskToolsWidget):
_logger.error("Can't load filename '%s'", filename)
_logger.debug("Backtrace", exc_info=True)
raise RuntimeError('File "%s" is not a numpy file.', filename)
+ elif extension in ["tif", "tiff"]:
+ try:
+ image = TiffIO(filename, mode="r")
+ mask = image.getImage(0)
+ except Exception as e:
+ _logger.error("Can't load filename %s", filename)
+ _logger.debug("Backtrace", exc_info=True)
+ raise e
elif extension == "edf":
try:
mask = EdfFile(filename, access='r').GetData(0)
@@ -423,14 +450,21 @@ class MaskToolsWidget(BaseMaskToolsWidget):
dialog = qt.QFileDialog(self)
dialog.setWindowTitle("Load Mask")
dialog.setModal(1)
- filters = [
- 'EDF (*.edf)',
- 'TIFF (*.tif)',
- 'NumPy binary file (*.npy)',
- # Fit2D mask is displayed anyway fabio is here or not
- # to show to the user that the option exists
- 'Fit2D mask (*.msk)',
- ]
+
+ extensions = collections.OrderedDict()
+ extensions["EDF files"] = "*.edf"
+ extensions["TIFF files"] = "*.tif *.tiff"
+ extensions["NumPy binary files"] = "*.npy"
+ # Fit2D mask is displayed anyway fabio is here or not
+ # to show to the user that the option exists
+ extensions["Fit2D mask files"] = "*.msk"
+
+ filters = []
+ filters.append("All supported files (%s)" % " ".join(extensions.values()))
+ for name, extension in extensions.items():
+ filters.append("%s (%s)" % (name, extension))
+ filters.append("All files (*)")
+
dialog.setNameFilters(filters)
dialog.setFileMode(qt.QFileDialog.ExistingFile)
dialog.setDirectory(self.maskFileDir)
@@ -610,6 +644,5 @@ class MaskToolsDockWidget(BaseMaskToolsDockWidget):
:paran str name: The title of this widget
"""
def __init__(self, parent=None, plot=None, name='Mask'):
- super(MaskToolsDockWidget, self).__init__(parent, name)
- self.setWidget(MaskToolsWidget(plot=plot))
- self.widget().sigMaskChanged.connect(self._emitSigMaskChanged)
+ widget = MaskToolsWidget(plot=plot)
+ super(MaskToolsDockWidget, self).__init__(parent, name, widget)
diff --git a/silx/gui/plot/Plot.py b/silx/gui/plot/Plot.py
deleted file mode 100644
index fe0a7b8..0000000
--- a/silx/gui/plot/Plot.py
+++ /dev/null
@@ -1,2925 +0,0 @@
-# coding: utf-8
-# /*##########################################################################
-#
-# Copyright (c) 2004-2017 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.
-# ###########################################################################*/
-"""Plot API for 1D and 2D data.
-
-The :class:`Plot` implements the plot API initially provided in PyMca.
-
-
-Colormap
---------
-
-The :class:`Plot` uses a dictionary to describe a colormap.
-This dictionary has the following keys:
-
-- 'name': str, name of the colormap. Available colormap are returned by
- :meth:`Plot.getSupportedColormaps`.
- At least 'gray', 'reversed gray', 'temperature',
- 'red', 'green', 'blue' are supported.
-- 'normalization': Either 'linear' or 'log'
-- 'autoscale': bool, True to get bounds from the min and max of the
- data, False to use [vmin, vmax]
-- 'vmin': float, min value, ignored if autoscale is True
-- 'vmax': float, max value, ignored if autoscale is True
-- 'colors': optional, custom colormap.
- Nx3 or Nx4 numpy array of RGB(A) colors,
- either uint8 or float in [0, 1].
- If 'name' is None, then this array is used as the colormap.
-
-
-Plot Events
------------
-
-The Plot sends some event to the registered callback
-(See :meth:`Plot.setCallback`).
-Those events are sent as a dictionary with a key 'event' describing the kind
-of event.
-
-Drawing events
-..............
-
-'drawingProgress' and 'drawingFinished' events are sent during drawing
-interaction (See :meth:`Plot.setInteractiveMode`).
-
-- 'event': 'drawingProgress' or 'drawingFinished'
-- 'parameters': dict of parameters used by the drawing mode.
- It has the following keys: 'shape', 'label', 'color'.
- See :meth:`Plot.setInteractiveMode`.
-- 'points': Points (x, y) in data coordinates of the drawn shape.
- For 'hline' and 'vline', it is the 2 points defining the line.
- For 'line' and 'rectangle', it is the coordinates of the start
- drawing point and the latest drawing point.
- For 'polygon', it is the coordinates of all points of the shape.
-- 'type': The type of drawing in 'line', 'hline', 'polygon', 'rectangle',
- 'vline'.
-- 'xdata' and 'ydata': X coords and Y coords of shape points in data
- coordinates (as in 'points').
-
-When the type is 'rectangle', the following additional keys are provided:
-
-- 'x' and 'y': The origin of the rectangle in data coordinates
-- 'widht' and 'height': The size of the rectangle in data coordinates
-
-
-Mouse events
-............
-
-'mouseMoved', 'mouseClicked' and 'mouseDoubleClicked' events are sent for
-mouse events.
-
-They provide the following keys:
-
-- 'event': 'mouseMoved', 'mouseClicked' or 'mouseDoubleClicked'
-- 'button': the mouse button that was pressed in 'left', 'middle', 'right'
-- 'x' and 'y': The mouse position in data coordinates
-- 'xpixel' and 'ypixel': The mouse position in pixels
-
-
-Marker events
-.............
-
-'hover', 'markerClicked', 'markerMoving' and 'markerMoved' events are
-sent during interaction with markers.
-
-'hover' is sent when the mouse cursor is over a marker.
-'markerClicker' is sent when the user click on a selectable marker.
-'markerMoving' and 'markerMoved' are sent when a draggable marker is moved.
-
-They provide the following keys:
-
-- 'event': 'hover', 'markerClicked', 'markerMoving' or 'markerMoved'
-- 'button': the mouse button that is pressed in 'left', 'middle', 'right'
-- 'draggable': True if the marker is draggable, False otherwise
-- 'label': The legend associated with the clicked image or curve
-- 'selectable': True if the marker is selectable, False otherwise
-- 'type': 'marker'
-- 'x' and 'y': The mouse position in data coordinates
-- 'xdata' and 'ydata': The marker position in data coordinates
-
-'markerClicked' and 'markerMoving' events have a 'xpixel' and a 'ypixel'
-additional keys, that provide the mouse position in pixels.
-
-
-Image and curve events
-......................
-
-'curveClicked' and 'imageClicked' events are sent when a selectable curve
-or image is clicked.
-
-Both share the following keys:
-
-- 'event': 'curveClicked' or 'imageClicked'
-- 'button': the mouse button that was pressed in 'left', 'middle', 'right'
-- 'label': The legend associated with the clicked image or curve
-- 'type': The type of item in 'curve', 'image'
-- 'x' and 'y': The clicked position in data coordinates
-- 'xpixel' and 'ypixel': The clicked position in pixels
-
-'curveClicked' events have a 'xdata' and a 'ydata' additional keys, that
-provide the coordinates of the picked points of the curve.
-There can be more than one point of the curve being picked, and if a line of
-the curve is picked, only the first point of the line is included in the list.
-
-'imageClicked' have a 'col' and a 'row' additional keys, that provide
-the column and row index in the image array that was clicked.
-
-
-Limits changed events
-.....................
-
-'limitsChanged' events are sent when the limits of the plot are changed.
-This can results from user interaction or API calls.
-
-It provides the following keys:
-
-- 'event': 'limitsChanged'
-- 'source': id of the widget that emitted this event.
-- 'xdata': Range of X in graph coordinates: (xMin, xMax).
-- 'ydata': Range of Y in graph coordinates: (yMin, yMax).
-- 'y2data': Range of right axis in graph coordinates (y2Min, y2Max) or None.
-
-Plot state change events
-........................
-
-The following events are emitted when the plot is modified.
-They provide the new state:
-
-- 'setGraphCursor' event with a 'state' key (bool)
-- 'setGraphGrid' event with a 'which' key (str), see :meth:`setGraphGrid`
-- 'setKeepDataAspectRatio' event with a 'state' key (bool)
-- 'setXAxisAutoScale' event with a 'state' key (bool)
-- 'setXAxisLogarithmic' event with a 'state' key (bool)
-- 'setYAxisAutoScale' event with a 'state' key (bool)
-- 'setYAxisInverted' event with a 'state' key (bool)
-- 'setYAxisLogarithmic' event with a 'state' key (bool)
-
-A 'contentChanged' event is triggered when the content of the plot is updated.
-It provides the following keys:
-
-- 'action': The change of the plot: 'add' or 'remove'
-- 'kind': The kind of primitive changed: 'curve', 'image', 'item' or 'marker'
-- 'legend': The legend of the primitive changed.
-
-'activeCurveChanged' and 'activeImageChanged' events with the following keys:
-
-- 'legend': Name (str) of the current active item or None if no active item.
-- 'previous': Name (str) of the previous active item or None if no item was
- active. It is the same as 'legend' if 'updated' == True
-- 'updated': (bool) True if active item name did not changed,
- but active item data or style was updated.
-
-'interactiveModeChanged' event with a 'source' key identifying the object
-setting the interactive mode.
-"""
-
-from __future__ import division
-
-
-__authors__ = ["V.A. Sole", "T. Vincent"]
-__license__ = "MIT"
-__date__ = "16/02/2017"
-
-
-from collections import OrderedDict, namedtuple
-import itertools
-import logging
-
-import numpy
-
-# Import matplotlib backend here to init matplotlib our way
-from .backends.BackendMatplotlib import BackendMatplotlibQt
-
-try:
- from matplotlib import cm as matplotlib_cm
-except ImportError:
- matplotlib_cm = None
-
-from . import Colors
-from . import PlotInteraction
-from . import PlotEvents
-from . import _utils
-
-from . import items
-
-
-_logger = logging.getLogger(__name__)
-
-
-_COLORDICT = Colors.COLORDICT
-_COLORLIST = [_COLORDICT['black'],
- _COLORDICT['blue'],
- _COLORDICT['red'],
- _COLORDICT['green'],
- _COLORDICT['pink'],
- _COLORDICT['yellow'],
- _COLORDICT['brown'],
- _COLORDICT['cyan'],
- _COLORDICT['magenta'],
- _COLORDICT['orange'],
- _COLORDICT['violet'],
- # _COLORDICT['bluegreen'],
- _COLORDICT['grey'],
- _COLORDICT['darkBlue'],
- _COLORDICT['darkRed'],
- _COLORDICT['darkGreen'],
- _COLORDICT['darkCyan'],
- _COLORDICT['darkMagenta'],
- _COLORDICT['darkYellow'],
- _COLORDICT['darkBrown']]
-
-
-"""
-Object returned when requesting the data range.
-"""
-_PlotDataRange = namedtuple('PlotDataRange',
- ['x', 'y', 'yright'])
-
-
-class Plot(object):
- """This class implements the plot API initially provided in PyMca.
-
- Supported backends:
-
- - 'matplotlib' and 'mpl': Matplotlib with Qt.
- - 'opengl' and 'gl': OpenGL backend (requires PyOpenGL and OpenGL >= 2.1)
- - 'none': No backend, to run headless for testing purpose.
-
- :param parent: The parent widget of the plot (Default: None)
- :param backend: The backend to use. A str in:
- 'matplotlib', 'mpl', 'opengl', 'gl', 'none'
- or a :class:`BackendBase.BackendBase` class
- """
-
- DEFAULT_BACKEND = 'matplotlib'
- """Class attribute setting the default backend for all instances."""
-
- colorList = _COLORLIST
- colorDict = _COLORDICT
-
- def __init__(self, parent=None, backend=None):
- self._autoreplot = False
- self._dirty = False
- self._cursorInPlot = False
-
- if backend is None:
- backend = self.DEFAULT_BACKEND
-
- if hasattr(backend, "__call__"):
- self._backend = backend(self, parent)
-
- elif hasattr(backend, "lower"):
- lowerCaseString = backend.lower()
- if lowerCaseString in ("matplotlib", "mpl"):
- backendClass = BackendMatplotlibQt
- elif lowerCaseString in ('gl', 'opengl'):
- from .backends.BackendOpenGL import BackendOpenGL
- backendClass = BackendOpenGL
- elif lowerCaseString == 'none':
- from .backends.BackendBase import BackendBase as backendClass
- else:
- raise ValueError("Backend not supported %s" % backend)
- self._backend = backendClass(self, parent)
-
- else:
- raise ValueError("Backend not supported %s" % str(backend))
-
- super(Plot, self).__init__()
-
- self.setCallback() # set _callback
-
- # Items handling
- self._content = OrderedDict()
- self._contentToUpdate = set()
-
- self._dataRange = None
-
- # line types
- self._styleList = ['-', '--', '-.', ':']
- self._colorIndex = 0
- self._styleIndex = 0
-
- self._activeCurveHandling = True
- self._activeCurveColor = "#000000"
- self._activeLegend = {'curve': None, 'image': None,
- 'scatter': None}
-
- # default properties
- self._cursorConfiguration = None
-
- self._logY = False
- self._logX = False
- self._xAutoScale = True
- self._yAutoScale = True
- self._grid = None
-
- # Store default labels provided to setGraph[X|Y]Label
- self._defaultLabels = {'x': '', 'y': '', 'yright': ''}
- # Store currently displayed labels
- # Current label can differ from input one with active curve handling
- self._currentLabels = {'x': '', 'y': '', 'yright': ''}
-
- self._graphTitle = ''
-
- self.setGraphTitle()
- self.setGraphXLabel()
- self.setGraphYLabel()
- self.setGraphYLabel('', axis='right')
-
- self.setDefaultColormap() # Init default colormap
-
- self.setDefaultPlotPoints(False)
- self.setDefaultPlotLines(True)
-
- self._eventHandler = PlotInteraction.PlotInteraction(self)
- self._eventHandler.setInteractiveMode('zoom', color=(0., 0., 0., 1.))
-
- self._pressedButtons = [] # Currently pressed mouse buttons
-
- self._defaultDataMargins = (0., 0., 0., 0.)
-
- # Only activate autoreplot at the end
- # This avoids errors when loaded in Qt designer
- self._dirty = False
- self._autoreplot = True
-
- def _getDirtyPlot(self):
- """Return the plot dirty flag.
-
- If False, the plot has not changed since last replot.
- If True, the full plot need to be redrawn.
- If 'overlay', only the overlay has changed since last replot.
-
- It can be accessed by backend to check the dirty state.
-
- :return: False, True, 'overlay'
- """
- return self._dirty
-
- def _setDirtyPlot(self, overlayOnly=False):
- """Mark the plot as needing redraw
-
- :param bool overlayOnly: True to redraw only the overlay,
- False to redraw everything
- """
- wasDirty = self._dirty
-
- if not self._dirty and overlayOnly:
- self._dirty = 'overlay'
- else:
- self._dirty = True
-
- if self._autoreplot and not wasDirty:
- self._backend.postRedisplay()
-
- def _invalidateDataRange(self):
- """
- Notifies this Plot instance that the range has changed and will have
- to be recomputed.
- """
- self._dataRange = None
-
- def _updateDataRange(self):
- """
- Recomputes the range of the data displayed on this Plot.
- """
- xMin = yMinLeft = yMinRight = float('nan')
- xMax = yMaxLeft = yMaxRight = float('nan')
-
- for item in self._content.values():
- if item.isVisible():
- bounds = item.getBounds()
- if bounds is not None:
- xMin = numpy.nanmin([xMin, bounds[0]])
- xMax = numpy.nanmax([xMax, bounds[1]])
- # Take care of right axis
- if (isinstance(item, items.YAxisMixIn) and
- item.getYAxis() == 'right'):
- yMinRight = numpy.nanmin([yMinRight, bounds[2]])
- yMaxRight = numpy.nanmax([yMaxRight, bounds[3]])
- else:
- yMinLeft = numpy.nanmin([yMinLeft, bounds[2]])
- yMaxLeft = numpy.nanmax([yMaxLeft, bounds[3]])
-
- def lGetRange(x, y):
- return None if numpy.isnan(x) and numpy.isnan(y) else (x, y)
- xRange = lGetRange(xMin, xMax)
- yLeftRange = lGetRange(yMinLeft, yMaxLeft)
- yRightRange = lGetRange(yMinRight, yMaxRight)
-
- self._dataRange = _PlotDataRange(x=xRange,
- y=yLeftRange,
- yright=yRightRange)
-
- def getDataRange(self):
- """
- Returns this Plot's data range.
-
- :return: a namedtuple with the following members :
- x, y (left y axis), yright. Each member is a tuple (min, max)
- or None if no data is associated with the axis.
- :rtype: namedtuple
- """
- if self._dataRange is None:
- self._updateDataRange()
- return self._dataRange
-
- # Content management
-
- @staticmethod
- def _itemKey(item):
- """Build the key of given :class:`Item` in the plot
-
- :param Item item: The item to make the key from
- :return: (legend, kind)
- :rtype: (str, str)
- """
- if isinstance(item, items.Curve):
- kind = 'curve'
- elif isinstance(item, items.ImageBase):
- kind = 'image'
- elif isinstance(item, items.Scatter):
- kind = 'scatter'
- elif isinstance(item, (items.Marker,
- items.XMarker, items.YMarker)):
- kind = 'marker'
- elif isinstance(item, items.Shape):
- kind = 'item'
- elif isinstance(item, items.Histogram):
- kind = 'histogram'
- else:
- raise ValueError('Unsupported item type %s' % type(item))
-
- return item.getLegend(), kind
-
- def _add(self, item):
- """Add the given :class:`Item` to the plot.
-
- :param Item item: The item to append to the plot content
- """
- key = self._itemKey(item)
- if key in self._content:
- raise RuntimeError('Item already in the plot')
-
- # Add item to plot
- self._content[key] = item
- item._setPlot(self)
- if item.isVisible():
- self._itemRequiresUpdate(item)
- if isinstance(item, (items.Curve, items.ImageBase)):
- self._invalidateDataRange() # TODO handle this automatically
-
- def _remove(self, item):
- """Remove the given :class:`Item` from the plot.
-
- :param Item item: The item to remove from the plot content
- """
- key = self._itemKey(item)
- if key not in self._content:
- raise RuntimeError('Item not in the plot')
-
- # Remove item from plot
- self._content.pop(key)
- self._contentToUpdate.discard(item)
- if item.isVisible():
- self._setDirtyPlot(overlayOnly=item.isOverlay())
- if item.getBounds() is not None:
- self._invalidateDataRange()
- item._removeBackendRenderer(self._backend)
- item._setPlot(None)
-
- def _itemRequiresUpdate(self, item):
- """Called by items in the plot for asynchronous update
-
- :param Item item: The item that required update
- """
- assert item.getPlot() == self
- self._contentToUpdate.add(item)
- self._setDirtyPlot(overlayOnly=item.isOverlay())
-
- # Add
-
- # add * input arguments management:
- # If an arg is set, then use it.
- # Else:
- # If a curve with the same legend exists, then use its arg value
- # Else, use a default value.
- # Store used value.
- # This value is used when curve is updated either internally or by user.
-
- def addCurve(self, x, y, legend=None, info=None,
- replace=False, replot=None,
- color=None, symbol=None,
- linewidth=None, linestyle=None,
- xlabel=None, ylabel=None, yaxis=None,
- xerror=None, yerror=None, z=None, selectable=None,
- fill=None, resetzoom=True,
- histogram=None, copy=True, **kw):
- """Add a 1D curve given by x an y to the graph.
-
- Curves are uniquely identified by their legend.
- To add multiple curves, call :meth:`addCurve` multiple times with
- different legend argument.
- To replace an existing curve, call :meth:`addCurve` with the
- existing curve legend.
- If you want to display the curve values as an histogram see the
- histogram parameter or :meth:`addHistogram`.
-
- When curve parameters are not provided, if a curve with the
- same legend is displayed in the plot, its parameters are used.
-
- :param numpy.ndarray x: The data corresponding to the x coordinates.
- If you attempt to plot an histogram you can set edges values in x.
- In this case len(x) = len(y) + 1
- :param numpy.ndarray y: The data corresponding to the y coordinates
- :param str legend: The legend to be associated to the curve (or None)
- :param info: User-defined information associated to the curve
- :param bool replace: True (the default) to delete already existing
- curves
- :param color: color(s) to be used
- :type color: str ("#RRGGBB") or (npoints, 4) unsigned byte array or
- one of the predefined color names defined in Colors.py
- :param str symbol: Symbol to be drawn at each (x, y) position::
-
- - 'o' circle
- - '.' point
- - ',' pixel
- - '+' cross
- - 'x' x-cross
- - 'd' diamond
- - 's' square
- - None (the default) to use default symbol
-
- :param float linewidth: The width of the curve in pixels (Default: 1).
- :param str linestyle: Type of line::
-
- - ' ' no line
- - '-' solid line
- - '--' dashed line
- - '-.' dash-dot line
- - ':' dotted line
- - None (the default) to use default line style
-
- :param str xlabel: Label to show on the X axis when the curve is active
- or None to keep default axis label.
- :param str ylabel: Label to show on the Y axis when the curve is active
- or None to keep default axis label.
- :param str yaxis: The Y axis this curve is attached to.
- Either 'left' (the default) or 'right'
- :param xerror: Values with the uncertainties on the x values
- :type xerror: A float, or a numpy.ndarray of float32.
- If it is an array, it can either be a 1D array of
- same length as the data or a 2D array with 2 rows
- of same length as the data: row 0 for positive errors,
- row 1 for negative errors.
- :param yerror: Values with the uncertainties on the y values
- :type yerror: A float, or a numpy.ndarray of float32. See xerror.
- :param int z: Layer on which to draw the curve (default: 1)
- This allows to control the overlay.
- :param bool selectable: Indicate if the curve can be selected.
- (Default: True)
- :param bool fill: True to fill the curve, False otherwise (default).
- :param bool resetzoom: True (the default) to reset the zoom.
- :param str histogram: if not None then the curve will be draw as an
- histogram. The step for each values of the curve can be set to the
- left, center or right of the original x curve values.
- If histogram is not None and len(x) == len(y)+1 then x is directly
- take as edges of the histogram.
- Type of histogram::
-
- - None (default)
- - 'left'
- - 'right'
- - 'center'
- :param bool copy: True make a copy of the data (default),
- False to use provided arrays.
- :returns: The key string identify this curve
- """
- # Deprecation warnings
- if replot is not None:
- _logger.warning(
- 'addCurve deprecated replot argument, use resetzoom instead')
- resetzoom = replot and resetzoom
-
- if kw:
- _logger.warning('addCurve: deprecated extra arguments')
-
- # This is an histogram, use addHistogram
- if histogram is not None:
- histoLegend = self.addHistogram(histogram=y,
- edges=x,
- legend=legend,
- color=color,
- fill=fill,
- align=histogram,
- copy=copy)
- histo = self.getHistogram(histoLegend)
-
- histo.setInfo(info)
- if linewidth is not None:
- histo.setLineWidth(linewidth)
- if linestyle is not None:
- histo.setLineStyle(linestyle)
- if xlabel is not None:
- _logger.warning(
- 'addCurve: Histogram does not support xlabel argument')
- if ylabel is not None:
- _logger.warning(
- 'addCurve: Histogram does not support ylabel argument')
- if yaxis is not None:
- histo.setYAxis(yaxis)
- if z is not None:
- histo.setZValue(z)
- if selectable is not None:
- _logger.warning(
- 'addCurve: Histogram does not support selectable argument')
-
- return
-
- legend = 'Unnamed curve 1.1' if legend is None else str(legend)
-
- # Check if curve was previously active
- wasActive = self.getActiveCurve(just_legend=True) == legend
-
- # Create/Update curve object
- curve = self.getCurve(legend)
- if curve is None:
- # No previous curve, create a default one and add it to the plot
- curve = items.Curve() if histogram is None else items.Histogram()
- curve._setLegend(legend)
- # Set default color, linestyle and symbol
- default_color, default_linestyle = self._getColorAndStyle()
- curve.setColor(default_color)
- curve.setLineStyle(default_linestyle)
- curve.setSymbol(self._defaultPlotPoints)
- self._add(curve)
-
- # Override previous/default values with provided ones
- curve.setInfo(info)
- if color is not None:
- curve.setColor(color)
- if symbol is not None:
- curve.setSymbol(symbol)
- if linewidth is not None:
- curve.setLineWidth(linewidth)
- if linestyle is not None:
- curve.setLineStyle(linestyle)
- if xlabel is not None:
- curve._setXLabel(xlabel)
- if ylabel is not None:
- curve._setYLabel(ylabel)
- if yaxis is not None:
- curve.setYAxis(yaxis)
- if z is not None:
- curve.setZValue(z)
- if selectable is not None:
- curve._setSelectable(selectable)
- if fill is not None:
- curve.setFill(fill)
-
- # Set curve data
- # If errors not provided, reuse previous ones
- # TODO: Issue if size of data change but not that of errors
- if xerror is None:
- xerror = curve.getXErrorData(copy=False)
- if yerror is None:
- yerror = curve.getYErrorData(copy=False)
-
- curve.setData(x, y, xerror, yerror, copy=copy)
-
- if replace: # Then remove all other curves
- for c in self.getAllCurves(withhidden=True):
- if c is not curve:
- self._remove(c)
-
- self.notify(
- 'contentChanged', action='add', kind='curve', legend=legend)
-
- if wasActive:
- self.setActiveCurve(curve.getLegend())
-
- if resetzoom:
- # We ask for a zoom reset in order to handle the plot scaling
- # if the user does not want that, autoscale of the different
- # axes has to be set to off.
- self.resetZoom()
-
- return legend
-
- def addHistogram(self,
- histogram,
- edges,
- legend=None,
- color=None,
- fill=None,
- align='center',
- resetzoom=True,
- copy=True):
- """Add an histogram to the graph.
-
- This is NOT computing the histogram, this method takes as parameter
- already computed histogram values.
-
- Histogram are uniquely identified by their legend.
- To add multiple histograms, call :meth:`addHistogram` multiple times
- with different legend argument.
-
- When histogram parameters are not provided, if an histogram with the
- same legend is displayed in the plot, its parameters are used.
-
- :param numpy.ndarray histogram: The values of the histogram.
- :param numpy.ndarray edges:
- The bin edges of the histogram.
- If histogram and edges have the same length, the bin edges
- are computed according to the align parameter.
- :param str legend:
- The legend to be associated to the histogram (or None)
- :param color: color to be used
- :type color: str ("#RRGGBB") or RGB unsigned byte array or
- one of the predefined color names defined in Colors.py
- :param bool fill: True to fill the curve, False otherwise (default).
- :param str align:
- In case histogram values and edges have the same length N,
- the N+1 bin edges are computed according to the alignment in:
- 'center' (default), 'left', 'right'.
- :param bool resetzoom: True (the default) to reset the zoom.
- :param bool copy: True make a copy of the data (default),
- False to use provided arrays.
- :returns: The key string identify this histogram
- """
- legend = 'Unnamed histogram' if legend is None else str(legend)
-
- # Create/Update histogram object
- histo = self.getHistogram(legend)
- if histo is None:
- # No previous histogram, create a default one and
- # add it to the plot
- histo = items.Histogram()
- histo._setLegend(legend)
- histo.setColor(self._getColorAndStyle()[0])
- self._add(histo)
-
- # Override previous/default values with provided ones
- if color is not None:
- histo.setColor(color)
- if fill is not None:
- histo.setFill(fill)
-
- # Set histogram data
- histo.setData(histogram, edges, align=align, copy=copy)
-
- self.notify(
- 'contentChanged', action='add', kind='histogram', legend=legend)
-
- if resetzoom:
- # We ask for a zoom reset in order to handle the plot scaling
- # if the user does not want that, autoscale of the different
- # axes has to be set to off.
- self.resetZoom()
-
- return legend
-
- def addImage(self, data, legend=None, info=None,
- replace=True, replot=None,
- xScale=None, yScale=None, z=None,
- selectable=None, draggable=None,
- colormap=None, pixmap=None,
- xlabel=None, ylabel=None,
- origin=None, scale=None,
- resetzoom=True, copy=True, **kw):
- """Add a 2D dataset or an image to the plot.
-
- It displays either an array of data using a colormap or a RGB(A) image.
-
- Images are uniquely identified by their legend.
- To add multiple images, call :meth:`addImage` multiple times with
- different legend argument.
- To replace/update an existing image, call :meth:`addImage` with the
- existing image legend.
-
- When image parameters are not provided, if an image with the
- same legend is displayed in the plot, its parameters are used.
-
- :param numpy.ndarray data: (nrows, ncolumns) data or
- (nrows, ncolumns, RGBA) ubyte array
- :param str legend: The legend to be associated to the image (or None)
- :param info: User-defined information associated to the image
- :param bool replace: True (default) to delete already existing images
- :param int z: Layer on which to draw the image (default: 0)
- This allows to control the overlay.
- :param bool selectable: Indicate if the image can be selected.
- (default: False)
- :param bool draggable: Indicate if the image can be moved.
- (default: False)
- :param dict colormap: Description of the colormap to use (or None)
- This is ignored if data is a RGB(A) image.
- See :mod:`Plot` for the documentation
- of the colormap dict.
- :param pixmap: Pixmap representation of the data (if any)
- :type pixmap: (nrows, ncolumns, RGBA) ubyte array or None (default)
- :param str xlabel: X axis label to show when this curve is active,
- or None to keep default axis label.
- :param str ylabel: Y axis label to show when this curve is active,
- or None to keep default axis label.
- :param origin: (origin X, origin Y) of the data.
- It is possible to pass a single float if both
- coordinates are equal.
- Default: (0., 0.)
- :type origin: float or 2-tuple of float
- :param scale: (scale X, scale Y) of the data.
- It is possible to pass a single float if both
- coordinates are equal.
- Default: (1., 1.)
- :type scale: float or 2-tuple of float
- :param bool resetzoom: True (the default) to reset the zoom.
- :param bool copy: True make a copy of the data (default),
- False to use provided arrays.
- :returns: The key string identify this image
- """
- # Deprecation warnings
- if xScale is not None or yScale is not None:
- _logger.warning(
- 'addImage deprecated xScale and yScale arguments,'
- 'use origin, scale arguments instead.')
- if origin is None and scale is None:
- origin = xScale[0], yScale[0]
- scale = xScale[1], yScale[1]
- else:
- _logger.warning(
- 'addCurve: xScale, yScale and origin, scale arguments'
- ' are conflicting. xScale and yScale are ignored.'
- ' Use only origin, scale arguments.')
-
- if replot is not None:
- _logger.warning(
- 'addImage deprecated replot argument, use resetzoom instead')
- resetzoom = replot and resetzoom
-
- if kw:
- _logger.warning('addImage: deprecated extra arguments')
-
- legend = "Unnamed Image 1.1" if legend is None else str(legend)
-
- # Check if image was previously active
- wasActive = self.getActiveImage(just_legend=True) == legend
-
- data = numpy.array(data, copy=False)
- assert data.ndim in (2, 3)
-
- image = self.getImage(legend)
- if image is not None and image.getData(copy=False).ndim != data.ndim:
- # Update a data image with RGBA image or the other way around:
- # Remove previous image
- # In this case, we don't retrieve defaults from the previous image
- self._remove(image)
- image = None
-
- if image is None:
- # No previous image, create a default one and add it to the plot
- if data.ndim == 2:
- image = items.ImageData()
- image.setColormap(self.getDefaultColormap())
- else:
- image = items.ImageRgba()
- image._setLegend(legend)
- self._add(image)
-
- # Override previous/default values with provided ones
- image.setInfo(info)
- if origin is not None:
- image.setOrigin(origin)
- if scale is not None:
- image.setScale(scale)
- if z is not None:
- image.setZValue(z)
- if selectable is not None:
- image._setSelectable(selectable)
- if draggable is not None:
- image._setDraggable(draggable)
- if colormap is not None and isinstance(image, items.ColormapMixIn):
- image.setColormap(colormap)
- if xlabel is not None:
- image._setXLabel(xlabel)
- if ylabel is not None:
- image._setYLabel(ylabel)
-
- if data.ndim == 2:
- image.setData(data, alternative=pixmap, copy=copy)
- else: # RGB(A) image
- if pixmap is not None:
- _logger.warning(
- 'addImage: pixmap argument ignored when data is RGB(A)')
- image.setData(data, copy=copy)
-
- if replace:
- for img in self.getAllImages():
- if img is not image:
- self._remove(img)
-
- if len(self.getAllImages()) == 1 or wasActive:
- self.setActiveImage(legend)
-
- self.notify(
- 'contentChanged', action='add', kind='image', legend=legend)
-
- if resetzoom:
- # We ask for a zoom reset in order to handle the plot scaling
- # if the user does not want that, autoscale of the different
- # axes has to be set to off.
- self.resetZoom()
-
- return legend
-
- def addScatter(self, x, y, value, legend=None, colormap=None,
- info=None, symbol=None, xerror=None, yerror=None,
- z=None, copy=True):
- """Add a (x, y, value) scatter to the graph.
-
- Scatters are uniquely identified by their legend.
- To add multiple scatters, call :meth:`addScatter` multiple times with
- different legend argument.
- To replace/update an existing scatter, call :meth:`addScatter` with the
- existing scatter legend.
-
- When scatter parameters are not provided, if a scatter with the
- same legend is displayed in the plot, its parameters are used.
-
- :param numpy.ndarray x: The data corresponding to the x coordinates.
- :param numpy.ndarray y: The data corresponding to the y coordinates
- :param numpy.ndarray value: The data value associated with each point
- :param str legend: The legend to be associated to the scatter (or None)
- :param dict colormap: The colormap to be used for the scatter (or None)
- See :mod:`Plot` for the documentation
- of the colormap dict.
- :param info: User-defined information associated to the curve
- :param str symbol: Symbol to be drawn at each (x, y) position::
-
- - 'o' circle
- - '.' point
- - ',' pixel
- - '+' cross
- - 'x' x-cross
- - 'd' diamond
- - 's' square
- - None (the default) to use default symbol
-
- :param xerror: Values with the uncertainties on the x values
- :type xerror: A float, or a numpy.ndarray of float32.
- If it is an array, it can either be a 1D array of
- same length as the data or a 2D array with 2 rows
- of same length as the data: row 0 for positive errors,
- row 1 for negative errors.
- :param yerror: Values with the uncertainties on the y values
- :type yerror: A float, or a numpy.ndarray of float32. See xerror.
- :param int z: Layer on which to draw the scatter (default: 1)
- This allows to control the overlay.
-
- :param bool copy: True make a copy of the data (default),
- False to use provided arrays.
- :returns: The key string identify this scatter
- """
- legend = 'Unnamed scatter 1.1' if legend is None else str(legend)
-
- # Check if scatter was previously active
- wasActive = self._getActiveItem(kind='scatter',
- just_legend=True) == legend
-
- # Create/Update curve object
- scatter = self._getItem(kind='scatter', legend=legend)
- if scatter is None:
- # No previous scatter, create a default one and add it to the plot
- scatter = items.Scatter()
- scatter._setLegend(legend)
- scatter.setColormap(self.getDefaultColormap())
- self._add(scatter)
-
- # Override previous/default values with provided ones
- scatter.setInfo(info)
- if symbol is not None:
- scatter.setSymbol(symbol)
- if z is not None:
- scatter.setZValue(z)
- if colormap is not None:
- scatter.setColormap(colormap)
-
- # Set scatter data
- # If errors not provided, reuse previous ones
- if xerror is None:
- xerror = scatter.getXErrorData(copy=False)
- if xerror is not None and len(xerror) != len(x):
- xerror = None
- if yerror is None:
- yerror = scatter.getYErrorData(copy=False)
- if yerror is not None and len(yerror) != len(y):
- yerror = None
-
- scatter.setData(x, y, value, xerror, yerror, copy=copy)
-
- self.notify(
- 'contentChanged', action='add', kind='scatter', legend=legend)
-
- if len(self._getItems(kind="scatter")) == 1 or wasActive:
- self._setActiveItem('scatter', scatter.getLegend())
-
- return legend
-
- def addItem(self, xdata, ydata, legend=None, info=None,
- replace=False,
- shape="polygon", color='black', fill=True,
- overlay=False, z=None, **kw):
- """Add an item (i.e. a shape) to the plot.
-
- Items are uniquely identified by their legend.
- To add multiple items, call :meth:`addItem` multiple times with
- different legend argument.
- To replace/update an existing item, call :meth:`addItem` with the
- existing item legend.
-
- :param numpy.ndarray xdata: The X coords of the points of the shape
- :param numpy.ndarray ydata: The Y coords of the points of the shape
- :param str legend: The legend to be associated to the item
- :param info: User-defined information associated to the item
- :param bool replace: True (default) to delete already existing images
- :param str shape: Type of item to be drawn in
- hline, polygon (the default), rectangle, vline,
- polylines
- :param str color: Color of the item, e.g., 'blue', 'b', '#FF0000'
- (Default: 'black')
- :param bool fill: True (the default) to fill the shape
- :param bool overlay: True if item is an overlay (Default: False).
- This allows for rendering optimization if this
- item is changed often.
- :param int z: Layer on which to draw the item (default: 2)
- :returns: The key string identify this item
- """
- # expected to receive the same parameters as the signal
-
- if kw:
- _logger.warning('addItem deprecated parameters: %s', str(kw))
-
- legend = "Unnamed Item 1.1" if legend is None else str(legend)
-
- z = int(z) if z is not None else 2
-
- if replace:
- self.remove(kind='item')
- else:
- self.remove(legend, kind='item')
-
- item = items.Shape(shape)
- item._setLegend(legend)
- item.setInfo(info)
- item.setColor(color)
- item.setFill(fill)
- item.setOverlay(overlay)
- item.setZValue(z)
- item.setPoints(numpy.array((xdata, ydata)).T)
-
- self._add(item)
-
- self.notify('contentChanged', action='add', kind='item', legend=legend)
-
- return legend
-
- def addXMarker(self, x, legend=None,
- text=None,
- color=None,
- selectable=False,
- draggable=False,
- constraint=None,
- **kw):
- """Add a vertical line marker to the plot.
-
- Markers are uniquely identified by their legend.
- As opposed to curves, images and items, two calls to
- :meth:`addXMarker` without legend argument adds two markers with
- different identifying legends.
-
- :param float x: Position of the marker on the X axis in data
- coordinates
- :param str legend: Legend associated to the marker to identify it
- :param str text: Text to display on the marker.
- :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
- (Default: 'black')
- :param bool selectable: Indicate if the marker can be selected.
- (default: False)
- :param bool draggable: Indicate if the marker can be moved.
- (default: False)
- :param constraint: A function filtering marker displacement by
- dragging operations or None for no filter.
- This function is called each time a marker is
- moved.
- This parameter is only used if draggable is True.
- :type constraint: None or a callable that takes the coordinates of
- the current cursor position in the plot as input
- and that returns the filtered coordinates.
- :return: The key string identify this marker
- """
- if kw:
- _logger.warning(
- 'addXMarker deprecated extra parameters: %s', str(kw))
-
- return self._addMarker(x=x, y=None, legend=legend,
- text=text, color=color,
- selectable=selectable, draggable=draggable,
- symbol=None, constraint=constraint)
-
- def addYMarker(self, y,
- legend=None,
- text=None,
- color=None,
- selectable=False,
- draggable=False,
- constraint=None,
- **kw):
- """Add a horizontal line marker to the plot.
-
- Markers are uniquely identified by their legend.
- As opposed to curves, images and items, two calls to
- :meth:`addYMarker` without legend argument adds two markers with
- different identifying legends.
-
- :param float y: Position of the marker on the Y axis in data
- coordinates
- :param str legend: Legend associated to the marker to identify it
- :param str text: Text to display next to the marker.
- :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
- (Default: 'black')
- :param bool selectable: Indicate if the marker can be selected.
- (default: False)
- :param bool draggable: Indicate if the marker can be moved.
- (default: False)
- :param constraint: A function filtering marker displacement by
- dragging operations or None for no filter.
- This function is called each time a marker is
- moved.
- This parameter is only used if draggable is True.
- :type constraint: None or a callable that takes the coordinates of
- the current cursor position in the plot as input
- and that returns the filtered coordinates.
- :return: The key string identify this marker
- """
- if kw:
- _logger.warning(
- 'addYMarker deprecated extra parameters: %s', str(kw))
-
- return self._addMarker(x=None, y=y, legend=legend,
- text=text, color=color,
- selectable=selectable, draggable=draggable,
- symbol=None, constraint=constraint)
-
- def addMarker(self, x, y, legend=None,
- text=None,
- color=None,
- selectable=False,
- draggable=False,
- symbol='+',
- constraint=None,
- **kw):
- """Add a point marker to the plot.
-
- Markers are uniquely identified by their legend.
- As opposed to curves, images and items, two calls to
- :meth:`addMarker` without legend argument adds two markers with
- different identifying legends.
-
- :param float x: Position of the marker on the X axis in data
- coordinates
- :param float y: Position of the marker on the Y axis in data
- coordinates
- :param str legend: Legend associated to the marker to identify it
- :param str text: Text to display next to the marker
- :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
- (Default: 'black')
- :param bool selectable: Indicate if the marker can be selected.
- (default: False)
- :param bool draggable: Indicate if the marker can be moved.
- (default: False)
- :param str symbol: Symbol representing the marker in::
-
- - 'o' circle
- - '.' point
- - ',' pixel
- - '+' cross (the default)
- - 'x' x-cross
- - 'd' diamond
- - 's' square
-
- :param constraint: A function filtering marker displacement by
- dragging operations or None for no filter.
- This function is called each time a marker is
- moved.
- This parameter is only used if draggable is True.
- :type constraint: None or a callable that takes the coordinates of
- the current cursor position in the plot as input
- and that returns the filtered coordinates.
- :return: The key string identify this marker
- """
- if kw:
- _logger.warning(
- 'addMarker deprecated extra parameters: %s', str(kw))
-
- if x is None:
- xmin, xmax = self.getGraphXLimits()
- x = 0.5 * (xmax + xmin)
-
- if y is None:
- ymin, ymax = self.getGraphYLimits()
- y = 0.5 * (ymax + ymin)
-
- return self._addMarker(x=x, y=y, legend=legend,
- text=text, color=color,
- selectable=selectable, draggable=draggable,
- symbol=symbol, constraint=constraint)
-
- def _addMarker(self, x, y, legend,
- text, color,
- selectable, draggable,
- symbol, constraint):
- """Common method for adding point, vline and hline marker.
-
- See :meth:`addMarker` for argument documentation.
- """
- assert (x, y) != (None, None)
-
- if legend is None: # Find an unused legend
- markerLegends = self._getAllMarkers(just_legend=True)
- for index in itertools.count():
- legend = "Unnamed Marker %d" % index
- if legend not in markerLegends:
- break # Keep this legend
- legend = str(legend)
-
- if x is None:
- markerClass = items.YMarker
- elif y is None:
- markerClass = items.XMarker
- else:
- markerClass = items.Marker
-
- # Create/Update marker object
- marker = self._getMarker(legend)
- if marker is not None and not isinstance(marker, markerClass):
- _logger.warning('Adding marker with same legend'
- ' but different type replaces it')
- self._remove(marker)
- marker = None
-
- if marker is None:
- # No previous marker, create one
- marker = markerClass()
- marker._setLegend(legend)
- self._add(marker)
-
- if text is not None:
- marker.setText(text)
- if color is not None:
- marker.setColor(color)
- if selectable is not None:
- marker._setSelectable(selectable)
- if draggable is not None:
- marker._setDraggable(draggable)
- if symbol is not None:
- marker.setSymbol(symbol)
-
- # TODO to improve, but this ensure constraint is applied
- marker.setPosition(x, y)
- if constraint is not None:
- marker._setConstraint(constraint)
- marker.setPosition(x, y)
-
- self.notify(
- 'contentChanged', action='add', kind='marker', legend=legend)
-
- return legend
-
- # Hide
-
- def isCurveHidden(self, legend):
- """Returns True if the curve associated to legend is hidden, else False
-
- :param str legend: The legend key identifying the curve
- :return: True if the associated curve is hidden, False otherwise
- """
- curve = self._getItem('curve', legend)
- return curve is not None and not curve.isVisible()
-
- def hideCurve(self, legend, flag=True, replot=None):
- """Show/Hide the curve associated to legend.
-
- Even when hidden, the curve is kept in the list of curves.
-
- :param str legend: The legend associated to the curve to be hidden
- :param bool flag: True (default) to hide the curve, False to show it
- """
- if replot is not None:
- _logger.warning('hideCurve deprecated replot parameter')
-
- curve = self._getItem('curve', legend)
- if curve is None:
- _logger.warning('Curve not in plot: %s', legend)
- return
-
- isVisible = not flag
- if isVisible != curve.isVisible():
- curve.setVisible(isVisible)
-
- # Remove
-
- ITEM_KINDS = 'curve', 'image', 'scatter', 'item', 'marker', 'histogram'
-
- def remove(self, legend=None, kind=ITEM_KINDS):
- """Remove one or all element(s) of the given legend and kind.
-
- Examples:
-
- - ``remove()`` clears the plot
- - ``remove(kind='curve')`` removes all curves from the plot
- - ``remove('myCurve', kind='curve')`` removes the curve with
- legend 'myCurve' from the plot.
- - ``remove('myImage, kind='image')`` removes the image with
- legend 'myImage' from the plot.
- - ``remove('myImage')`` removes elements (for instance curve, image,
- item and marker) with legend 'myImage'.
-
- :param str legend: The legend associated to the element to remove,
- or None to remove
- :param kind: The kind of elements to remove from the plot.
- In: 'all', 'curve', 'image', 'item', 'marker'.
- By default, it removes all kind of elements.
- :type kind: str or tuple of str to specify multiple kinds.
- """
- if kind is 'all': # Replace all by tuple of all kinds
- kind = self.ITEM_KINDS
-
- if kind in self.ITEM_KINDS: # Kind is a str, make it a tuple
- kind = (kind,)
-
- for aKind in kind:
- assert aKind in self.ITEM_KINDS
-
- if legend is None: # This is a clear
- # Clear each given kind
- for aKind in kind:
- for legend in self._getItems(
- kind=aKind, just_legend=True, withhidden=True):
- self.remove(legend=legend, kind=aKind)
-
- else: # This is removing a single element
- # Remove each given kind
- for aKind in kind:
- item = self._getItem(aKind, legend)
- if item is not None:
- if aKind in ('curve', 'image'):
- if self._getActiveItem(aKind) == item:
- # Reset active item
- self._setActiveItem(aKind, None)
-
- self._remove(item)
-
- if (aKind == 'curve' and
- not self.getAllCurves(just_legend=True,
- withhidden=True)):
- self._colorIndex = 0
- self._styleIndex = 0
-
- self.notify('contentChanged', action='remove',
- kind=aKind, legend=legend)
-
- def removeCurve(self, legend):
- """Remove the curve associated to legend from the graph.
-
- :param str legend: The legend associated to the curve to be deleted
- """
- if legend is None:
- return
- self.remove(legend, kind='curve')
-
- def removeImage(self, legend):
- """Remove the image associated to legend from the graph.
-
- :param str legend: The legend associated to the image to be deleted
- """
- if legend is None:
- return
- self.remove(legend, kind='image')
-
- def removeItem(self, legend):
- """Remove the item associated to legend from the graph.
-
- :param str legend: The legend associated to the item to be deleted
- """
- if legend is None:
- return
- self.remove(legend, kind='item')
-
- def removeMarker(self, legend):
- """Remove the marker associated to legend from the graph.
-
- :param str legend: The legend associated to the marker to be deleted
- """
- if legend is None:
- return
- self.remove(legend, kind='marker')
-
- # Clear
-
- def clear(self):
- """Remove everything from the plot."""
- self.remove()
-
- def clearCurves(self):
- """Remove all the curves from the plot."""
- self.remove(kind='curve')
-
- def clearImages(self):
- """Remove all the images from the plot."""
- self.remove(kind='image')
-
- def clearItems(self):
- """Remove all the items from the plot. """
- self.remove(kind='item')
-
- def clearMarkers(self):
- """Remove all the markers from the plot."""
- self.remove(kind='marker')
-
- # Interaction
-
- def getGraphCursor(self):
- """Returns the state of the crosshair cursor.
-
- See :meth:`setGraphCursor`.
-
- :return: None if the crosshair cursor is not active,
- else a tuple (color, linewidth, linestyle).
- """
- return self._cursorConfiguration
-
- def setGraphCursor(self, flag=False, color='black',
- linewidth=1, linestyle='-'):
- """Toggle the display of a crosshair cursor and set its attributes.
-
- :param bool flag: Toggle the display of a crosshair cursor.
- The crosshair cursor is hidden by default.
- :param color: The color to use for the crosshair.
- :type color: A string (either a predefined color name in Colors.py
- or "#RRGGBB")) or a 4 columns unsigned byte array
- (Default: black).
- :param int linewidth: The width of the lines of the crosshair
- (Default: 1).
- :param str linestyle: Type of line::
-
- - ' ' no line
- - '-' solid line (the default)
- - '--' dashed line
- - '-.' dash-dot line
- - ':' dotted line
- """
- if flag:
- self._cursorConfiguration = color, linewidth, linestyle
- else:
- self._cursorConfiguration = None
-
- self._backend.setGraphCursor(flag=flag, color=color,
- linewidth=linewidth, linestyle=linestyle)
- self._setDirtyPlot()
- self.notify('setGraphCursor',
- state=self._cursorConfiguration is not None)
-
- def pan(self, direction, factor=0.1):
- """Pan the graph in the given direction by the given factor.
-
- Warning: Pan of right Y axis not implemented!
-
- :param str direction: One of 'up', 'down', 'left', 'right'.
- :param float factor: Proportion of the range used to pan the graph.
- Must be strictly positive.
- """
- assert direction in ('up', 'down', 'left', 'right')
- assert factor > 0.
-
- if direction in ('left', 'right'):
- xFactor = factor if direction == 'right' else - factor
- xMin, xMax = self.getGraphXLimits()
-
- xMin, xMax = _utils.applyPan(xMin, xMax, xFactor,
- self.isXAxisLogarithmic())
- self.setGraphXLimits(xMin, xMax)
-
- else: # direction in ('up', 'down')
- sign = -1. if self.isYAxisInverted() else 1.
- yFactor = sign * (factor if direction == 'up' else -factor)
- yMin, yMax = self.getGraphYLimits()
- yIsLog = self.isYAxisLogarithmic()
-
- yMin, yMax = _utils.applyPan(yMin, yMax, yFactor, yIsLog)
- self.setGraphYLimits(yMin, yMax, axis='left')
-
- y2Min, y2Max = self.getGraphYLimits(axis='right')
-
- y2Min, y2Max = _utils.applyPan(y2Min, y2Max, yFactor, yIsLog)
- self.setGraphYLimits(y2Min, y2Max, axis='right')
-
- # Active Curve/Image
-
- def isActiveCurveHandling(self):
- """Returns True if active curve selection is enabled."""
- return self._activeCurveHandling
-
- def setActiveCurveHandling(self, flag=True):
- """Enable/Disable active curve selection.
-
- :param bool flag: True (the default) to enable active curve selection.
- """
- if not flag:
- self.setActiveCurve(None) # Reset active curve
-
- self._activeCurveHandling = bool(flag)
-
- def getActiveCurveColor(self):
- """Get the color used to display the currently active curve.
-
- See :meth:`setActiveCurveColor`.
- """
- return self._activeCurveColor
-
- def setActiveCurveColor(self, color="#000000"):
- """Set the color to use to display the currently active curve.
-
- :param str color: Color of the active curve,
- e.g., 'blue', 'b', '#FF0000' (Default: 'black')
- """
- if color is None:
- color = "black"
- if color in self.colorDict:
- color = self.colorDict[color]
- self._activeCurveColor = color
-
- def getActiveCurve(self, just_legend=False):
- """Return the currently active curve.
-
- It returns None in case of not having an active curve.
-
- :param bool just_legend: True to get the legend of the curve,
- False (the default) to get the curve data
- and info.
- :return: Active curve's legend or corresponding
- :class:`.items.Curve`
- :rtype: str or :class:`.items.Curve` or None
- """
- if not self.isActiveCurveHandling():
- return None
-
- return self._getActiveItem(kind='curve', just_legend=just_legend)
-
- def setActiveCurve(self, legend, replot=None):
- """Make the curve associated to legend the active curve.
-
- :param legend: The legend associated to the curve
- or None to have no active curve.
- :type legend: str or None
- """
- if replot is not None:
- _logger.warning('setActiveCurve deprecated replot parameter')
-
- if not self.isActiveCurveHandling():
- return
-
- return self._setActiveItem(kind='curve', legend=legend)
-
- def getActiveImage(self, just_legend=False):
- """Returns the currently active image.
-
- It returns None in case of not having an active image.
-
- :param bool just_legend: True to get the legend of the image,
- False (the default) to get the image data
- and info.
- :return: Active image's legend or corresponding image object
- :rtype: str, :class:`.items.ImageData`, :class:`.items.ImageRgba`
- or None
- """
- return self._getActiveItem(kind='image', just_legend=just_legend)
-
- def setActiveImage(self, legend, replot=None):
- """Make the image associated to legend the active image.
-
- :param str legend: The legend associated to the image
- or None to have no active image.
- """
- if replot is not None:
- _logger.warning('setActiveImage deprecated replot parameter')
-
- return self._setActiveItem(kind='image', legend=legend)
-
- def _getActiveItem(self, kind, just_legend=False):
- """Return the currently active item of that kind if any
-
- :param str kind: Type of item: 'curve', 'scatter' or 'image'
- :param bool just_legend: True to get the legend,
- False (default) to get the item
- :return: legend or item or None if no active item
- """
- assert kind in ('curve', 'scatter', 'image')
-
- if self._activeLegend[kind] is None:
- return None
-
- if (self._activeLegend[kind], kind) not in self._content:
- self._activeLegend[kind] = None
- return None
-
- if just_legend:
- return self._activeLegend[kind]
- else:
- return self._getItem(kind, self._activeLegend[kind])
-
- def _setActiveItem(self, kind, legend):
- """Make the curve associated to legend the active curve.
-
- :param str kind: Type of item: 'curve' or 'image'
- :param legend: The legend associated to the curve
- or None to have no active curve.
- :type legend: str or None
- """
- assert kind in ('curve', 'image', 'scatter')
-
- xLabel = self._defaultLabels['x']
- yLabel = self._defaultLabels['y']
- yRightLabel = self._defaultLabels['yright']
-
- oldActiveItem = self._getActiveItem(kind=kind)
-
- # Curve specific: Reset highlight of previous active curve
- if kind == 'curve' and oldActiveItem is not None:
- oldActiveItem.setHighlighted(False)
-
- if legend is None:
- self._activeLegend[kind] = None
- else:
- legend = str(legend)
- item = self._getItem(kind, legend)
- if item is None:
- _logger.warning("This %s does not exist: %s", kind, legend)
- self._activeLegend[kind] = None
- else:
- self._activeLegend[kind] = legend
-
- # Curve specific: handle highlight
- if kind == 'curve':
- item.setHighlightedColor(self.getActiveCurveColor())
- item.setHighlighted(True)
-
- if isinstance(item, items.LabelsMixIn):
- if item.getXLabel() is not None:
- xLabel = item.getXLabel()
- if item.getYLabel() is not None:
- if (isinstance(item, items.YAxisMixIn) and
- item.getYAxis() == 'right'):
- yRightLabel = item.getYLabel()
- else:
- yLabel = item.getYLabel()
-
- # Store current labels and update plot
- self._currentLabels['x'] = xLabel
- self._currentLabels['y'] = yLabel
- self._currentLabels['yright'] = yRightLabel
-
- self._backend.setGraphXLabel(xLabel)
- self._backend.setGraphYLabel(yLabel, axis='left')
- self._backend.setGraphYLabel(yRightLabel, axis='right')
-
- self._setDirtyPlot()
-
- activeLegend = self._activeLegend[kind]
- if oldActiveItem is not None or activeLegend is not None:
- if oldActiveItem is None:
- oldActiveLegend = None
- else:
- oldActiveLegend = oldActiveItem.getLegend()
- self.notify(
- 'active' + kind[0].upper() + kind[1:] + 'Changed',
- updated=oldActiveLegend != activeLegend,
- previous=oldActiveLegend,
- legend=activeLegend)
-
- return activeLegend
-
- # Getters
-
- def getAllCurves(self, just_legend=False, withhidden=False):
- """Returns all curves legend or info and data.
-
- It returns an empty list in case of not having any curve.
-
- If just_legend is False, it returns a list of :class:`items.Curve`
- objects describing the curves.
- If just_legend is True, it returns a list of curves' legend.
-
- :param bool just_legend: True to get the legend of the curves,
- False (the default) to get the curves' data
- and info.
- :param bool withhidden: False (default) to skip hidden curves.
- :return: list of curves' legend or :class:`.items.Curve`
- :rtype: list of str or list of :class:`.items.Curve`
- """
- return self._getItems(kind='curve',
- just_legend=just_legend,
- withhidden=withhidden)
-
- def getCurve(self, legend=None):
- """Get the object describing a specific curve.
-
- It returns None in case no matching curve is found.
-
- :param str legend:
- The legend identifying the curve.
- If not provided or None (the default), the active curve is returned
- or if there is no active curve, the latest updated curve that is
- not hidden is returned if there are curves in the plot.
- :return: None or :class:`.items.Curve` object
- """
- return self._getItem(kind='curve', legend=legend)
-
- def getAllImages(self, just_legend=False):
- """Returns all images legend or objects.
-
- It returns an empty list in case of not having any image.
-
- If just_legend is False, it returns a list of :class:`items.ImageBase`
- objects describing the images.
- If just_legend is True, it returns a list of legends.
-
- :param bool just_legend: True to get the legend of the images,
- False (the default) to get the images'
- object.
- :return: list of images' legend or :class:`.items.ImageBase`
- :rtype: list of str or list of :class:`.items.ImageBase`
- """
- return self._getItems(kind='image',
- just_legend=just_legend,
- withhidden=True)
-
- def getImage(self, legend=None):
- """Get the object describing a specific image.
-
- It returns None in case no matching image is found.
-
- :param str legend:
- The legend identifying the image.
- If not provided or None (the default), the active image is returned
- or if there is no active image, the latest updated image
- is returned if there are images in the plot.
- :return: None or :class:`.items.ImageBase` object
- """
- return self._getItem(kind='image', legend=legend)
-
- def getScatter(self, legend=None):
- """Get the object describing a specific scatter.
-
- It returns None in case no matching scatter is found.
-
- :param str legend:
- The legend identifying the scatter.
- If not provided or None (the default), the active scatter is
- returned or if there is no active scatter, the latest updated
- scatter is returned if there are scatters in the plot.
- :return: None or :class:`.items.Scatter` object
- """
- return self._getItem(kind='scatter', legend=legend)
-
- def getHistogram(self, legend=None):
- """Get the object describing a specific histogram.
-
- It returns None in case no matching histogram is found.
-
- :param str legend:
- The legend identifying the histogram.
- If not provided or None (the default), the latest updated scatter
- is returned if there are histograms in the plot.
- :return: None or :class:`.items.Histogram` object
- """
- return self._getItem(kind='histogram', legend=legend)
-
- def _getItems(self, kind, just_legend=False, withhidden=False):
- """Retrieve all items of a kind in the plot
-
- :param str kind: Type of item: 'curve' or 'image'
- :param bool just_legend: True to get the legend of the curves,
- False (the default) to get the curves' data
- and info.
- :param bool withhidden: False (default) to skip hidden curves.
- :return: list of legends or item objects
- """
- assert kind in self.ITEM_KINDS
- output = []
- for (legend, type_), item in self._content.items():
- if type_ == kind and (withhidden or item.isVisible()):
- output.append(legend if just_legend else item)
- return output
-
- def _getItem(self, kind, legend=None):
- """Get an item from the plot: either an image or a curve.
-
- Returns None if no match found
-
- :param str kind: Type of item: 'curve' or 'image'
- :param str legend: Legend of the item or
- None to get active or last item
- :return: Object describing the item or None
- """
- assert kind in self.ITEM_KINDS
-
- if legend is not None:
- return self._content.get((legend, kind), None)
- else:
- if kind in ('curve', 'image', 'scatter'):
- item = self._getActiveItem(kind=kind)
- if item is not None: # Return active item if available
- return item
- # Return last visible item if any
- allItems = self._getItems(
- kind=kind, just_legend=False, withhidden=False)
- return allItems[-1] if allItems else None
-
- # Limits
-
- def _notifyLimitsChanged(self):
- """Send an event when plot area limits are changed."""
- xRange = self.getGraphXLimits()
- yRange = self.getGraphYLimits(axis='left')
- y2Range = self.getGraphYLimits(axis='right')
- event = PlotEvents.prepareLimitsChangedSignal(
- id(self.getWidgetHandle()), xRange, yRange, y2Range)
- self.notify(**event)
-
- def _checkLimits(self, min_, max_, axis):
- """Makes sure axis range is not empty
-
- :param float min_: Min axis value
- :param float max_: Max axis value
- :param str axis: 'x', 'y' or 'y2' the axis to deal with
- :return: (min, max) making sure min < max
- :rtype: 2-tuple of float
- """
- if max_ < min_:
- _logger.info('%s axis: max < min, inverting limits.', axis)
- min_, max_ = max_, min_
- elif max_ == min_:
- _logger.info('%s axis: max == min, expanding limits.', axis)
- if min_ == 0.:
- min_, max_ = -0.1, 0.1
- elif min_ < 0:
- min_, max_ = min_ * 1.1, min_ * 0.9
- else: # xmin > 0
- min_, max_ = min_ * 0.9, min_ * 1.1
-
- return min_, max_
-
- def getGraphXLimits(self):
- """Get the graph X (bottom) limits.
-
- :return: Minimum and maximum values of the X axis
- """
- return self._backend.getGraphXLimits()
-
- def setGraphXLimits(self, xmin, xmax, replot=None):
- """Set the graph X (bottom) limits.
-
- :param float xmin: minimum bottom axis value
- :param float xmax: maximum bottom axis value
- """
- if replot is not None:
- _logger.warning('setGraphXLimits deprecated replot parameter')
-
- xmin, xmax = self._checkLimits(xmin, xmax, axis='x')
-
- self._backend.setGraphXLimits(xmin, xmax)
- self._setDirtyPlot()
-
- self._notifyLimitsChanged()
-
- def getGraphYLimits(self, axis='left'):
- """Get the graph Y limits.
-
- :param str axis: The axis for which to get the limits:
- Either 'left' or 'right'
- :return: Minimum and maximum values of the X axis
- """
- assert axis in ('left', 'right')
- return self._backend.getGraphYLimits(axis)
-
- def setGraphYLimits(self, ymin, ymax, axis='left', replot=None):
- """Set the graph Y limits.
-
- :param float ymin: minimum bottom axis value
- :param float ymax: maximum bottom axis value
- :param str axis: The axis for which to get the limits:
- Either 'left' or 'right'
- """
- if replot is not None:
- _logger.warning('setGraphYLimits deprecated replot parameter')
-
- assert axis in ('left', 'right')
-
- ymin, ymax = self._checkLimits(ymin, ymax,
- axis='y' if axis == 'left' else 'y2')
-
- self._backend.setGraphYLimits(ymin, ymax, axis)
- self._setDirtyPlot()
-
- self._notifyLimitsChanged()
-
- def setLimits(self, xmin, xmax, ymin, ymax, y2min=None, y2max=None):
- """Set the limits of the X and Y axes at once.
-
- If y2min or y2max is None, the right Y axis limits are not updated.
-
- :param float xmin: minimum bottom axis value
- :param float xmax: maximum bottom axis value
- :param float ymin: minimum left axis value
- :param float ymax: maximum left axis value
- :param float y2min: minimum right axis value or None (the default)
- :param float y2max: maximum right axis value or None (the default)
- """
- # Deal with incorrect values
- xmin, xmax = self._checkLimits(xmin, xmax, axis='x')
- ymin, ymax = self._checkLimits(ymin, ymax, axis='y')
-
- if y2min is None or y2max is None:
- # if one limit is None, both are ignored
- y2min, y2max = None, None
- else:
- y2min, y2max = self._checkLimits(y2min, y2max, axis='y2')
-
- self._backend.setLimits(xmin, xmax, ymin, ymax, y2min, y2max)
- self._setDirtyPlot()
- self._notifyLimitsChanged()
-
- # Title and labels
-
- def getGraphTitle(self):
- """Return the plot main title as a str."""
- return self._graphTitle
-
- def setGraphTitle(self, title=""):
- """Set the plot main title.
-
- :param str title: Main title of the plot (default: '')
- """
- self._graphTitle = str(title)
- self._backend.setGraphTitle(title)
- self._setDirtyPlot()
-
- def getGraphXLabel(self):
- """Return the current X axis label as a str."""
- return self._currentLabels['x']
-
- def setGraphXLabel(self, label="X"):
- """Set the plot X axis label.
-
- The provided label can be temporarily replaced by the X label of the
- active curve if any.
-
- :param str label: The X axis label (default: 'X')
- """
- self._defaultLabels['x'] = label
- self._currentLabels['x'] = label
- self._backend.setGraphXLabel(label)
- self._setDirtyPlot()
-
- def getGraphYLabel(self, axis='left'):
- """Return the current Y axis label as a str.
-
- :param str axis: The Y axis for which to get the label (left or right)
- """
- assert axis in ('left', 'right')
-
- return self._currentLabels['y' if axis == 'left' else 'yright']
-
- def setGraphYLabel(self, label="Y", axis='left'):
- """Set the plot Y axis label.
-
- The provided label can be temporarily replaced by the Y label of the
- active curve if any.
-
- :param str label: The Y axis label (default: 'Y')
- :param str axis: The Y axis for which to set the label (left or right)
- """
- assert axis in ('left', 'right')
-
- if axis == 'left':
- self._defaultLabels['y'] = label
- self._currentLabels['y'] = label
- else:
- self._defaultLabels['yright'] = label
- self._currentLabels['yright'] = label
-
- self._backend.setGraphYLabel(label, axis=axis)
- self._setDirtyPlot()
-
- # Axes
-
- def setYAxisInverted(self, flag=True):
- """Set the Y axis orientation.
-
- :param bool flag: True for Y axis going from top to bottom,
- False for Y axis going from bottom to top
- """
- flag = bool(flag)
- self._backend.setYAxisInverted(flag)
- self._setDirtyPlot()
- self.notify('setYAxisInverted', state=flag)
-
- def isYAxisInverted(self):
- """Return True if Y axis goes from top to bottom, False otherwise."""
- return self._backend.isYAxisInverted()
-
- def isXAxisLogarithmic(self):
- """Return True if X axis scale is logarithmic, False if linear."""
- return self._logX
-
- def setXAxisLogarithmic(self, flag):
- """Set the bottom X axis scale (either linear or logarithmic).
-
- :param bool flag: True to use a logarithmic scale, False for linear.
- """
- if bool(flag) == self._logX:
- return
- self._logX = bool(flag)
-
- self._backend.setXAxisLogarithmic(self._logX)
-
- # TODO hackish way of forcing update of curves and images
- for curve in self.getAllCurves():
- curve._updated()
- for image in self.getAllImages():
- image._updated()
- self._invalidateDataRange()
-
- self.resetZoom()
- self.notify('setXAxisLogarithmic', state=self._logX)
-
- def isYAxisLogarithmic(self):
- """Return True if Y axis scale is logarithmic, False if linear."""
- return self._logY
-
- def setYAxisLogarithmic(self, flag):
- """Set the Y axes scale (either linear or logarithmic).
-
- :param bool flag: True to use a logarithmic scale, False for linear.
- """
- if bool(flag) == self._logY:
- return
- self._logY = bool(flag)
-
- self._backend.setYAxisLogarithmic(self._logY)
-
- # TODO hackish way of forcing update of curves and images
- for curve in self.getAllCurves():
- curve._updated()
- for image in self.getAllImages():
- image._updated()
- self._invalidateDataRange()
-
- self.resetZoom()
- self.notify('setYAxisLogarithmic', state=self._logY)
-
- def isXAxisAutoScale(self):
- """Return True if X axis is automatically adjusting its limits."""
- return self._xAutoScale
-
- def setXAxisAutoScale(self, flag=True):
- """Set the X axis limits adjusting behavior of :meth:`resetZoom`.
-
- :param bool flag: True to resize limits automatically,
- False to disable it.
- """
- self._xAutoScale = bool(flag)
- self.notify('setXAxisAutoScale', state=self._xAutoScale)
-
- def isYAxisAutoScale(self):
- """Return True if Y axes are automatically adjusting its limits."""
- return self._yAutoScale
-
- def setYAxisAutoScale(self, flag=True):
- """Set the Y axis limits adjusting behavior of :meth:`resetZoom`.
-
- :param bool flag: True to resize limits automatically,
- False to disable it.
- """
- self._yAutoScale = bool(flag)
- self.notify('setYAxisAutoScale', state=self._yAutoScale)
-
- def isKeepDataAspectRatio(self):
- """Returns whether the plot is keeping data aspect ratio or not."""
- return self._backend.isKeepDataAspectRatio()
-
- def setKeepDataAspectRatio(self, flag=True):
- """Set whether the plot keeps data aspect ratio or not.
-
- :param bool flag: True to respect data aspect ratio
- """
- flag = bool(flag)
- self._backend.setKeepDataAspectRatio(flag=flag)
- self._setDirtyPlot()
- self.resetZoom()
- self.notify('setKeepDataAspectRatio', state=flag)
-
- def getGraphGrid(self):
- """Return the current grid mode, either None, 'major' or 'both'.
-
- See :meth:`setGraphGrid`.
- """
- return self._grid
-
- def setGraphGrid(self, which=True):
- """Set the type of grid to display.
-
- :param which: None or False to disable the grid,
- 'major' or True for grid on major ticks (the default),
- 'both' for grid on both major and minor ticks.
- :type which: str of bool
- """
- assert which in (None, True, False, 'both', 'major')
- if not which:
- which = None
- elif which is True:
- which = 'major'
- self._grid = which
- self._backend.setGraphGrid(which)
- self._setDirtyPlot()
- self.notify('setGraphGrid', which=str(which))
-
- # Defaults
-
- def isDefaultPlotPoints(self):
- """Return True if default Curve symbol is 'o', False for no symbol."""
- return self._defaultPlotPoints == 'o'
-
- def setDefaultPlotPoints(self, flag):
- """Set the default symbol of all curves.
-
- When called, this reset the symbol of all existing curves.
-
- :param bool flag: True to use 'o' as the default curve symbol,
- False to use no symbol.
- """
- self._defaultPlotPoints = 'o' if flag else ''
-
- # Reset symbol of all curves
- curves = self.getAllCurves(just_legend=False, withhidden=True)
-
- if curves:
- for curve in curves:
- curve.setSymbol(self._defaultPlotPoints)
-
- def isDefaultPlotLines(self):
- """Return True for line as default line style, False for no line."""
- return self._plotLines
-
- def setDefaultPlotLines(self, flag):
- """Toggle the use of lines as the default curve line style.
-
- :param bool flag: True to use a line as the default line style,
- False to use no line as the default line style.
- """
- self._plotLines = bool(flag)
-
- linestyle = '-' if self._plotLines else ' '
-
- # Reset linestyle of all curves
- curves = self.getAllCurves(withhidden=True)
-
- if curves:
- for curve in curves:
- curve.setLineStyle(linestyle)
-
- def getDefaultColormap(self):
- """Return the default colormap used by :meth:`addImage` as a dict.
-
- See :mod:`Plot` for the documentation of the colormap dict.
- """
- return self._defaultColormap.copy()
-
- def setDefaultColormap(self, colormap=None):
- """Set the default colormap used by :meth:`addImage`.
-
- Setting the default colormap do not change any currently displayed
- image.
- It only affects future calls to :meth:`addImage` without the colormap
- parameter.
-
- :param dict colormap: The description of the default colormap, or
- None to set the colormap to a linear autoscale
- gray colormap.
- See :mod:`Plot` for the documentation
- of the colormap dict.
- """
- if colormap is None:
- colormap = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
- self._defaultColormap = colormap.copy()
-
- def getSupportedColormaps(self):
- """Get the supported colormap names as a tuple of str.
-
- The list should at least contain and start by:
- ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
- """
- default = ('gray', 'reversed gray',
- 'temperature',
- 'red', 'green', 'blue')
- if matplotlib_cm is None:
- return default
- else:
- maps = [m for m in matplotlib_cm.datad]
- maps.sort()
- return default + tuple(maps)
-
- def _getColorAndStyle(self):
- color = self.colorList[self._colorIndex]
- style = self._styleList[self._styleIndex]
-
- # Loop over color and then styles
- self._colorIndex += 1
- if self._colorIndex >= len(self.colorList):
- self._colorIndex = 0
- self._styleIndex = (self._styleIndex + 1) % len(self._styleList)
-
- # If color is the one of active curve, take the next one
- if color == self.getActiveCurveColor():
- color, style = self._getColorAndStyle()
-
- if not self._plotLines:
- style = ' '
-
- return color, style
-
- # Misc.
-
- def getWidgetHandle(self):
- """Return the widget the plot is displayed in.
-
- This widget is owned by the backend.
- """
- return self._backend.getWidgetHandle()
-
- def notify(self, event, **kwargs):
- """Send an event to the listeners.
-
- Event are passed to the registered callback as a dict with an 'event'
- key for backward compatibility with PyMca.
-
- :param str event: The type of event
- :param kwargs: The information of the event.
- """
- eventDict = kwargs.copy()
- eventDict['event'] = event
- self._callback(eventDict)
-
- def setCallback(self, callbackFunction=None):
- """Attach a listener to the backend.
-
- Limitation: Only one listener at a time.
-
- :param callbackFunction: function accepting a dictionary as input
- to handle the graph events
- If None (default), use a default listener.
- """
- # TODO allow multiple listeners, keep a weakref on it
- # allow register listener by event type
- if callbackFunction is None:
- callbackFunction = self.graphCallback
- self._callback = callbackFunction
-
- def graphCallback(self, ddict=None):
- """This callback is going to receive all the events from the plot.
-
- Those events will consist on a dictionary and among the dictionary
- keys the key 'event' is mandatory to describe the type of event.
- This default implementation only handles setting the active curve.
- """
-
- if ddict is None:
- ddict = {}
- _logger.debug("Received dict keys = %s", str(ddict.keys()))
- _logger.debug(str(ddict))
- if ddict['event'] in ["legendClicked", "curveClicked"]:
- if ddict['button'] == "left":
- self.setActiveCurve(ddict['label'])
-
- def saveGraph(self, filename, fileFormat=None, dpi=None, **kw):
- """Save a snapshot of the plot.
-
- Supported file formats: "png", "svg", "pdf", "ps", "eps",
- "tif", "tiff", "jpeg", "jpg".
-
- :param filename: Destination
- :type filename: str, StringIO or BytesIO
- :param str fileFormat: String specifying the format
- :return: False if cannot save the plot, True otherwise
- """
- if kw:
- _logger.warning('Extra parameters ignored: %s', str(kw))
-
- if fileFormat is None:
- if not hasattr(filename, 'lower'):
- _logger.warning(
- 'saveGraph cancelled, cannot define file format.')
- return False
- else:
- fileFormat = (filename.split(".")[-1]).lower()
-
- supportedFormats = ("png", "svg", "pdf", "ps", "eps",
- "tif", "tiff", "jpeg", "jpg")
-
- if fileFormat not in supportedFormats:
- _logger.warning('Unsupported format %s', fileFormat)
- return False
- else:
- self._backend.saveGraph(filename,
- fileFormat=fileFormat,
- dpi=dpi)
- return True
-
- def getDataMargins(self):
- """Get the default data margin ratios, see :meth:`setDataMargins`.
-
- :return: The margin ratios for each side (xMin, xMax, yMin, yMax).
- :rtype: A 4-tuple of floats.
- """
- return self._defaultDataMargins
-
- def setDataMargins(self, xMinMargin=0., xMaxMargin=0.,
- yMinMargin=0., yMaxMargin=0.):
- """Set the default data margins to use in :meth:`resetZoom`.
-
- Set the default ratios of margins (as floats) to add around the data
- inside the plot area for each side.
- """
- self._defaultDataMargins = (xMinMargin, xMaxMargin,
- yMinMargin, yMaxMargin)
-
- def getAutoReplot(self):
- """Return True if replot is automatically handled, False otherwise.
-
- See :meth`setAutoReplot`.
- """
- return self._autoreplot
-
- def setAutoReplot(self, autoreplot=True):
- """Set automatic replot mode.
-
- When enabled, the plot is redrawn automatically when changed.
- When disabled, the plot is not redrawn when its content change.
- Instead, it :meth:`replot` must be called.
-
- :param bool autoreplot: True to enable it (default),
- False to disable it.
- """
- self._autoreplot = bool(autoreplot)
-
- # If the plot is dirty before enabling autoreplot,
- # then _backend.postRedisplay will never be called from _setDirtyPlot
- if self._autoreplot and self._getDirtyPlot():
- self._backend.postRedisplay()
-
- def replot(self):
- """Redraw the plot immediately."""
- for item in self._contentToUpdate:
- item._update(self._backend)
- self._contentToUpdate.clear()
- self._backend.replot()
- self._dirty = False # reset dirty flag
-
- def resetZoom(self, dataMargins=None):
- """Reset the plot limits to the bounds of the data and redraw the plot.
-
- It automatically scale limits of axes that are in autoscale mode
- (See :meth:`setXAxisAutoScale`, :meth:`setYAxisAutoScale`).
- It keeps current limits on axes that are not in autoscale mode.
-
- Extra margins can be added around the data inside the plot area.
- Margins are given as one ratio of the data range per limit of the
- data (xMin, xMax, yMin and yMax limits).
- For log scale, extra margins are applied in log10 of the data.
-
- :param dataMargins: Ratios of margins to add around the data inside
- the plot area for each side (Default: no margins).
- :type dataMargins: A 4-tuple of float as (xMin, xMax, yMin, yMax).
- """
- if dataMargins is None:
- dataMargins = self._defaultDataMargins
-
- xLimits = self.getGraphXLimits()
- yLimits = self.getGraphYLimits(axis='left')
- y2Limits = self.getGraphYLimits(axis='right')
-
- xAuto = self.isXAxisAutoScale()
- yAuto = self.isYAxisAutoScale()
-
- if not xAuto and not yAuto:
- _logger.debug("Nothing to autoscale")
- else: # Some axes to autoscale
-
- # Get data range
- ranges = self.getDataRange()
- xmin, xmax = (1., 100.) if ranges.x is None else ranges.x
- ymin, ymax = (1., 100.) if ranges.y is None else ranges.y
- if ranges.yright is None:
- ymin2, ymax2 = None, None
- else:
- ymin2, ymax2 = ranges.yright
-
- # Add margins around data inside the plot area
- newLimits = list(_utils.addMarginsToLimits(
- dataMargins,
- self.isXAxisLogarithmic(),
- self.isYAxisLogarithmic(),
- xmin, xmax, ymin, ymax, ymin2, ymax2))
-
- if self.isKeepDataAspectRatio():
- # Use limits with margins to keep ratio
- xmin, xmax, ymin, ymax = newLimits[:4]
-
- # Compute bbox wth figure aspect ratio
- plotWidth, plotHeight = self.getPlotBoundsInPixels()[2:]
- plotRatio = plotHeight / plotWidth
-
- if plotRatio > 0.:
- dataRatio = (ymax - ymin) / (xmax - xmin)
- if dataRatio < plotRatio:
- # Increase y range
- ycenter = 0.5 * (ymax + ymin)
- yrange = (xmax - xmin) * plotRatio
- newLimits[2] = ycenter - 0.5 * yrange
- newLimits[3] = ycenter + 0.5 * yrange
-
- elif dataRatio > plotRatio:
- # Increase x range
- xcenter = 0.5 * (xmax + xmin)
- xrange_ = (ymax - ymin) / plotRatio
- newLimits[0] = xcenter - 0.5 * xrange_
- newLimits[1] = xcenter + 0.5 * xrange_
-
- self.setLimits(*newLimits)
-
- if not xAuto and yAuto:
- self.setGraphXLimits(*xLimits)
- elif xAuto and not yAuto:
- if y2Limits is not None:
- self.setGraphYLimits(
- y2Limits[0], y2Limits[1], axis='right')
- if yLimits is not None:
- self.setGraphYLimits(yLimits[0], yLimits[1], axis='left')
-
- self._setDirtyPlot()
-
- if (xLimits != self.getGraphXLimits() or
- yLimits != self.getGraphYLimits(axis='left') or
- y2Limits != self.getGraphYLimits(axis='right')):
- self._notifyLimitsChanged()
-
- # Coord conversion
-
- def dataToPixel(self, x=None, y=None, axis="left", check=True):
- """Convert a position in data coordinates to a position in pixels.
-
- :param float x: The X coordinate in data space. If None (default)
- the middle position of the displayed data is used.
- :param float y: The Y coordinate in data space. If None (default)
- the middle position of the displayed data is used.
- :param str axis: The Y axis to use for the conversion
- ('left' or 'right').
- :param bool check: True to return None if outside displayed area,
- False to convert to pixels anyway
- :returns: The corresponding position in pixels or
- None if the data position is not in the displayed area and
- check is True.
- :rtype: A tuple of 2 floats: (xPixel, yPixel) or None.
- """
- assert axis in ("left", "right")
-
- xmin, xmax = self.getGraphXLimits()
- ymin, ymax = self.getGraphYLimits(axis=axis)
-
- if x is None:
- x = 0.5 * (xmax + xmin)
- if y is None:
- y = 0.5 * (ymax + ymin)
-
- if check:
- if x > xmax or x < xmin:
- return None
-
- if y > ymax or y < ymin:
- return None
-
- return self._backend.dataToPixel(x, y, axis=axis)
-
- def pixelToData(self, x, y, axis="left", check=False):
- """Convert a position in pixels to a position in data coordinates.
-
- :param float x: The X coordinate in pixels. If None (default)
- the center of the widget is used.
- :param float y: The Y coordinate in pixels. If None (default)
- the center of the widget is used.
- :param str axis: The Y axis to use for the conversion
- ('left' or 'right').
- :param bool check: Toggle checking if pixel is in plot area.
- If False, this method never returns None.
- :returns: The corresponding position in data space or
- None if the pixel position is not in the plot area.
- :rtype: A tuple of 2 floats: (xData, yData) or None.
- """
- assert axis in ("left", "right")
- return self._backend.pixelToData(x, y, axis=axis, check=check)
-
- def getPlotBoundsInPixels(self):
- """Plot area bounds in widget coordinates in pixels.
-
- :return: bounds as a 4-tuple of int: (left, top, width, height)
- """
- return self._backend.getPlotBoundsInPixels()
-
- # Interaction support
-
- def setGraphCursorShape(self, cursor=None):
- """Set the cursor shape.
-
- :param str cursor: Name of the cursor shape
- """
- self._backend.setGraphCursorShape(cursor)
-
- def _pickMarker(self, x, y, test=None):
- """Pick a marker at the given position.
-
- To use for interaction implementation.
-
- :param float x: X position in pixels.
- :param float y: Y position in pixels.
- :param test: A callable to call for each picked marker to filter
- picked markers. If None (default), do not filter markers.
- """
- if test is None:
- def test(mark):
- return True
-
- markers = self._backend.pickItems(x, y)
- legends = [m['legend'] for m in markers if m['kind'] == 'marker']
-
- for legend in reversed(legends):
- marker = self._getMarker(legend)
- if marker is not None and test(marker):
- return marker
- return None
-
- def _getAllMarkers(self, just_legend=False):
- """Returns all markers' legend or objects
-
- :param bool just_legend: True to get the legend of the markers,
- False (the default) to get marker objects.
- :return: list of legend of list of marker objects
- :rtype: list of str or list of marker objects
- """
- return self._getItems(
- kind='marker', just_legend=just_legend, withhidden=True)
-
- def _getMarker(self, legend=None):
- """Get the object describing a specific marker.
-
- It returns None in case no matching marker is found
-
- :param str legend: The legend of the marker to retrieve
- :rtype: None of marker object
- """
- return self._getItem(kind='marker', legend=legend)
-
- def _pickImageOrCurve(self, x, y, test=None):
- """Pick an image or a curve at the given position.
-
- To use for interaction implementation.
-
- :param float x: X position in pixelsparam float y: Y position in pixels
- :param test: A callable to call for each picked item to filter
- picked items. If None (default), do not filter items.
- """
- if test is None:
- def test(i):
- return True
-
- allItems = self._backend.pickItems(x, y)
- allItems = [item for item in allItems
- if item['kind'] in ['curve', 'image']]
-
- for item in reversed(allItems):
- kind, legend = item['kind'], item['legend']
- if kind == 'curve':
- curve = self.getCurve(legend)
- if curve is not None and test(curve):
- return kind, curve, item['xdata'], item['ydata']
-
- elif kind == 'image':
- image = self.getImage(legend)
- if image is not None and test(image):
- return kind, image, None
-
- else:
- _logger.warning('Unsupported kind: %s', kind)
-
- return None
-
- # User event handling #
-
- def _isPositionInPlotArea(self, x, y):
- """Project position in pixel to the closest point in the plot area
-
- :param float x: X coordinate in widget coordinate (in pixel)
- :param float y: Y coordinate in widget coordinate (in pixel)
- :return: (x, y) in widget coord (in pixel) in the plot area
- """
- left, top, width, height = self.getPlotBoundsInPixels()
- xPlot = numpy.clip(x, left, left + width)
- yPlot = numpy.clip(y, top, top + height)
- return xPlot, yPlot
-
- def onMousePress(self, xPixel, yPixel, btn):
- """Handle mouse press event.
-
- :param float xPixel: X mouse position in pixels
- :param float yPixel: Y mouse position in pixels
- :param str btn: Mouse button in 'left', 'middle', 'right'
- """
- if self._isPositionInPlotArea(xPixel, yPixel) == (xPixel, yPixel):
- self._pressedButtons.append(btn)
- self._eventHandler.handleEvent('press', xPixel, yPixel, btn)
-
- def onMouseMove(self, xPixel, yPixel):
- """Handle mouse move event.
-
- :param float xPixel: X mouse position in pixels
- :param float yPixel: Y mouse position in pixels
- """
- inXPixel, inYPixel = self._isPositionInPlotArea(xPixel, yPixel)
- isCursorInPlot = inXPixel == xPixel and inYPixel == yPixel
-
- if self._cursorInPlot != isCursorInPlot:
- self._cursorInPlot = isCursorInPlot
- self._eventHandler.handleEvent(
- 'enter' if self._cursorInPlot else 'leave')
-
- if isCursorInPlot:
- # Signal mouse move event
- dataPos = self.pixelToData(inXPixel, inYPixel)
- assert dataPos is not None
-
- btn = self._pressedButtons[-1] if self._pressedButtons else None
- event = PlotEvents.prepareMouseSignal(
- 'mouseMoved', btn, dataPos[0], dataPos[1], xPixel, yPixel)
- self.notify(**event)
-
- # Either button was pressed in the plot or cursor is in the plot
- if isCursorInPlot or self._pressedButtons:
- self._eventHandler.handleEvent('move', inXPixel, inYPixel)
-
- def onMouseRelease(self, xPixel, yPixel, btn):
- """Handle mouse release event.
-
- :param float xPixel: X mouse position in pixels
- :param float yPixel: Y mouse position in pixels
- :param str btn: Mouse button in 'left', 'middle', 'right'
- """
- try:
- self._pressedButtons.remove(btn)
- except ValueError:
- pass
- else:
- xPixel, yPixel = self._isPositionInPlotArea(xPixel, yPixel)
- self._eventHandler.handleEvent('release', xPixel, yPixel, btn)
-
- def onMouseWheel(self, xPixel, yPixel, angleInDegrees):
- """Handle mouse wheel event.
-
- :param float xPixel: X mouse position in pixels
- :param float yPixel: Y mouse position in pixels
- :param float angleInDegrees: Angle corresponding to wheel motion.
- Positive for movement away from the user,
- negative for movement toward the user.
- """
- if self._isPositionInPlotArea(xPixel, yPixel) == (xPixel, yPixel):
- self._eventHandler.handleEvent(
- 'wheel', xPixel, yPixel, angleInDegrees)
-
- def onMouseLeaveWidget(self):
- """Handle mouse leave widget event."""
- if self._cursorInPlot:
- self._cursorInPlot = False
- self._eventHandler.handleEvent('leave')
-
- # Interaction modes #
-
- def getInteractiveMode(self):
- """Returns the current interactive mode as a dict.
-
- The returned dict contains at least the key 'mode'.
- Mode can be: 'draw', 'pan', 'select', 'zoom'.
- It can also contains extra keys (e.g., 'color') specific to a mode
- as provided to :meth:`setInteractiveMode`.
- """
- return self._eventHandler.getInteractiveMode()
-
- def setInteractiveMode(self, mode, color='black',
- shape='polygon', label=None,
- zoomOnWheel=True, source=None, width=None):
- """Switch the interactive mode.
-
- :param str mode: The name of the interactive mode.
- In 'draw', 'pan', 'select', 'zoom'.
- :param color: Only for 'draw' and 'zoom' modes.
- Color to use for drawing selection area. Default black.
- :type color: Color description: The name as a str or
- a tuple of 4 floats.
- :param str shape: Only for 'draw' mode. The kind of shape to draw.
- In 'polygon', 'rectangle', 'line', 'vline', 'hline',
- 'freeline'.
- Default is 'polygon'.
- :param str label: Only for 'draw' mode, sent in drawing events.
- :param bool zoomOnWheel: Toggle zoom on wheel support
- :param source: A user-defined object (typically the caller object)
- that will be send in the interactiveModeChanged event,
- to identify which object required a mode change.
- Default: None
- :param float width: Width of the pencil. Only for draw pencil mode.
- """
- self._eventHandler.setInteractiveMode(mode, color, shape, label, width)
- self._eventHandler.zoomOnWheel = zoomOnWheel
-
- self.notify(
- 'interactiveModeChanged', source=source)
-
- # Deprecated #
-
- def isDrawModeEnabled(self):
- """Deprecated, use :meth:`getInteractiveMode` instead.
-
- Return True if the current interactive state is drawing."""
- _logger.warning(
- 'isDrawModeEnabled deprecated, use getInteractiveMode instead')
- return self.getInteractiveMode()['mode'] == 'draw'
-
- def setDrawModeEnabled(self, flag=True, shape='polygon', label=None,
- color=None, **kwargs):
- """Deprecated, use :meth:`setInteractiveMode` instead.
-
- Set the drawing mode if flag is True and its parameters.
-
- If flag is False, only item selection is enabled.
-
- Warning: Zoom and drawing are not compatible and cannot be enabled
- simultaneously.
-
- :param bool flag: True to enable drawing and disable zoom and select.
- :param str shape: Type of item to be drawn in:
- hline, vline, rectangle, polygon (default)
- :param str label: Associated text for identifying draw signals
- :param color: The color to use to draw the selection area
- :type color: string ("#RRGGBB") or 4 column unsigned byte array or
- one of the predefined color names defined in Colors.py
- """
- _logger.warning(
- 'setDrawModeEnabled deprecated, use setInteractiveMode instead')
-
- if kwargs:
- _logger.warning('setDrawModeEnabled ignores additional parameters')
-
- if color is None:
- color = 'black'
-
- if flag:
- self.setInteractiveMode('draw', shape=shape,
- label=label, color=color)
- elif self.getInteractiveMode()['mode'] == 'draw':
- self.setInteractiveMode('select')
-
- def getDrawMode(self):
- """Deprecated, use :meth:`getInteractiveMode` instead.
-
- Return the draw mode parameters as a dict of None.
-
- It returns None if the interactive mode is not a drawing mode,
- otherwise, it returns a dict containing the drawing mode parameters
- as provided to :meth:`setDrawModeEnabled`.
- """
- _logger.warning(
- 'getDrawMode deprecated, use getInteractiveMode instead')
- mode = self.getInteractiveMode()
- return mode if mode['mode'] == 'draw' else None
-
- def isZoomModeEnabled(self):
- """Deprecated, use :meth:`getInteractiveMode` instead.
-
- Return True if the current interactive state is zooming."""
- _logger.warning(
- 'isZoomModeEnabled deprecated, use getInteractiveMode instead')
- return self.getInteractiveMode()['mode'] == 'zoom'
-
- def setZoomModeEnabled(self, flag=True, color=None):
- """Deprecated, use :meth:`setInteractiveMode` instead.
-
- Set the zoom mode if flag is True, else item selection is enabled.
-
- Warning: Zoom and drawing are not compatible and cannot be enabled
- simultaneously
-
- :param bool flag: If True, enable zoom and select mode.
- :param color: The color to use to draw the selection area.
- (Default: 'black')
- :param color: The color to use to draw the selection area
- :type color: string ("#RRGGBB") or 4 column unsigned byte array or
- one of the predefined color names defined in Colors.py
- """
- _logger.warning(
- 'setZoomModeEnabled deprecated, use setInteractiveMode instead')
- if color is None:
- color = 'black'
-
- if flag:
- self.setInteractiveMode('zoom', color=color)
- elif self.getInteractiveMode()['mode'] == 'zoom':
- self.setInteractiveMode('select')
-
- def insertMarker(self, *args, **kwargs):
- """Deprecated, use :meth:`addMarker` instead."""
- _logger.warning(
- 'insertMarker deprecated, use addMarker instead.')
- return self.addMarker(*args, **kwargs)
-
- def insertXMarker(self, *args, **kwargs):
- """Deprecated, use :meth:`addXMarker` instead."""
- _logger.warning(
- 'insertXMarker deprecated, use addXMarker instead.')
- return self.addXMarker(*args, **kwargs)
-
- def insertYMarker(self, *args, **kwargs):
- """Deprecated, use :meth:`addYMarker` instead."""
- _logger.warning(
- 'insertYMarker deprecated, use addYMarker instead.')
- return self.addYMarker(*args, **kwargs)
-
- def isActiveCurveHandlingEnabled(self):
- """Deprecated, use :meth:`isActiveCurveHandling` instead."""
- _logger.warning(
- 'isActiveCurveHandlingEnabled deprecated, '
- 'use isActiveCurveHandling instead.')
- return self.isActiveCurveHandling()
-
- def enableActiveCurveHandling(self, *args, **kwargs):
- """Deprecated, use :meth:`setActiveCurveHandling` instead."""
- _logger.warning(
- 'enableActiveCurveHandling deprecated, '
- 'use setActiveCurveHandling instead.')
- return self.setActiveCurveHandling(*args, **kwargs)
-
- def invertYAxis(self, *args, **kwargs):
- """Deprecated, use :meth:`setYAxisInverted` instead."""
- _logger.warning('invertYAxis deprecated, '
- 'use setYAxisInverted instead.')
- return self.setYAxisInverted(*args, **kwargs)
-
- def showGrid(self, flag=True):
- """Deprecated, use :meth:`setGraphGrid` instead."""
- _logger.warning("showGrid deprecated, use setGraphGrid instead")
- if flag in (0, False):
- flag = None
- elif flag in (1, True):
- flag = 'major'
- else:
- flag = 'both'
- return self.setGraphGrid(flag)
-
- def keepDataAspectRatio(self, *args, **kwargs):
- """Deprecated, use :meth:`setKeepDataAspectRatio`."""
- _logger.warning('keepDataAspectRatio deprecated,'
- 'use setKeepDataAspectRatio instead')
- return self.setKeepDataAspectRatio(*args, **kwargs)
diff --git a/silx/gui/plot/PlotActions.py b/silx/gui/plot/PlotActions.py
index aad27d2..dd16221 100644
--- a/silx/gui/plot/PlotActions.py
+++ b/silx/gui/plot/PlotActions.py
@@ -22,1365 +22,46 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This module provides a set of QAction to use with :class:`.PlotWidget`.
+"""Depracted module linking old PlotAction with the actions.xxx"""
-The following QAction are available:
-- :class:`ColormapAction`
-- :class:`CopyAction`
-- :class:`CrosshairAction`
-- :class:`CurveStyleAction`
-- :class:`FitAction`
-- :class:`GridAction`
-- :class:`KeepAspectRatioAction`
-- :class:`PanWithArrowKeysAction`
-- :class:`PrintAction`
-- :class:`ResetZoomAction`
-- :class:`SaveAction`
-- :class:`XAxisLogarithmicAction`
-- :class:`XAxisAutoScaleAction`
-- :class:`YAxisInvertedAction`
-- :class:`YAxisLogarithmicAction`
-- :class:`YAxisAutoScaleAction`
-- :class:`ZoomInAction`
-- :class:`ZoomOutAction`
-"""
-
-from __future__ import division
-
-
-__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__author__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "20/04/2017"
-
-
-from collections import OrderedDict
-import logging
-import sys
-import traceback
-import weakref
-
-if sys.version_info[0] == 3:
- from io import BytesIO
-else:
- import cStringIO as _StringIO
- BytesIO = _StringIO.StringIO
-
-import numpy
-
-from .. import icons
-from .. import qt
-from .._utils import convertArrayToQImage
-from . import Colors, items
-from .ColormapDialog import ColormapDialog
-from ._utils import applyZoomToPlot as _applyZoomToPlot
-from silx.third_party.EdfFile import EdfFile
-from silx.third_party.TiffIO import TiffIO
-from silx.math.histogram import Histogramnd
-from silx.math.medianfilter import medfilt2d
-from silx.gui.widgets.MedianFilterDialog import MedianFilterDialog
-
-from silx.io.utils import save1D, savespec
-
-
-_logger = logging.getLogger(__name__)
-
-
-class PlotAction(qt.QAction):
- """Base class for QAction that operates on a PlotWidget.
-
- :param plot: :class:`.PlotWidget` instance on which to operate.
- :param icon: QIcon or str name of icon to use
- :param str text: The name of this action to be used for menu label
- :param str tooltip: The text of the tooltip
- :param triggered: The callback to connect to the action's triggered
- signal or None for no callback.
- :param bool checkable: True for checkable action, False otherwise (default)
- :param parent: See :class:`QAction`.
- """
-
- def __init__(self, plot, icon, text, tooltip=None,
- triggered=None, checkable=False, parent=None):
- assert plot is not None
- self._plotRef = weakref.ref(plot)
-
- if not isinstance(icon, qt.QIcon):
- # Try with icon as a string and load corresponding icon
- icon = icons.getQIcon(icon)
-
- super(PlotAction, self).__init__(icon, text, parent)
-
- if tooltip is not None:
- self.setToolTip(tooltip)
-
- self.setCheckable(checkable)
-
- if triggered is not None:
- self.triggered[bool].connect(triggered)
-
- @property
- def plot(self):
- """The :class:`.PlotWidget` this action group is controlling."""
- return self._plotRef()
-
-
-class ResetZoomAction(PlotAction):
- """QAction controlling reset zoom on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(ResetZoomAction, self).__init__(
- plot, icon='zoom-original', text='Reset Zoom',
- tooltip='Auto-scale the graph',
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
- self._autoscaleChanged(True)
- plot.sigSetXAxisAutoScale.connect(self._autoscaleChanged)
- plot.sigSetYAxisAutoScale.connect(self._autoscaleChanged)
-
- def _autoscaleChanged(self, enabled):
- self.setEnabled(
- self.plot.isXAxisAutoScale() or self.plot.isYAxisAutoScale())
-
- if self.plot.isXAxisAutoScale() and self.plot.isYAxisAutoScale():
- tooltip = 'Auto-scale the graph'
- elif self.plot.isXAxisAutoScale(): # And not Y axis
- tooltip = 'Auto-scale the x-axis of the graph only'
- elif self.plot.isYAxisAutoScale(): # And not X axis
- tooltip = 'Auto-scale the y-axis of the graph only'
- else: # no axis in autoscale
- tooltip = 'Auto-scale the graph'
- self.setToolTip(tooltip)
-
- def _actionTriggered(self, checked=False):
- self.plot.resetZoom()
-
-
-class ZoomInAction(PlotAction):
- """QAction performing a zoom-in on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(ZoomInAction, self).__init__(
- plot, icon='zoom-in', text='Zoom In',
- tooltip='Zoom in the plot',
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
- self.setShortcut(qt.QKeySequence.ZoomIn)
- self.setShortcutContext(qt.Qt.WidgetShortcut)
-
- def _actionTriggered(self, checked=False):
- _applyZoomToPlot(self.plot, 1.1)
-
-
-class ZoomOutAction(PlotAction):
- """QAction performing a zoom-out on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(ZoomOutAction, self).__init__(
- plot, icon='zoom-out', text='Zoom Out',
- tooltip='Zoom out the plot',
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
- self.setShortcut(qt.QKeySequence.ZoomOut)
- self.setShortcutContext(qt.Qt.WidgetShortcut)
-
- def _actionTriggered(self, checked=False):
- _applyZoomToPlot(self.plot, 1. / 1.1)
-
-
-class XAxisAutoScaleAction(PlotAction):
- """QAction controlling X axis autoscale on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(XAxisAutoScaleAction, self).__init__(
- plot, icon='plot-xauto', text='X Autoscale',
- tooltip='Enable x-axis auto-scale when checked.\n'
- 'If unchecked, x-axis does not change when reseting zoom.',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.isXAxisAutoScale())
- plot.sigSetXAxisAutoScale.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setXAxisAutoScale(checked)
- if checked:
- self.plot.resetZoom()
-
-
-class YAxisAutoScaleAction(PlotAction):
- """QAction controlling Y axis autoscale on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(YAxisAutoScaleAction, self).__init__(
- plot, icon='plot-yauto', text='Y Autoscale',
- tooltip='Enable y-axis auto-scale when checked.\n'
- 'If unchecked, y-axis does not change when reseting zoom.',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.isXAxisAutoScale())
- plot.sigSetYAxisAutoScale.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setYAxisAutoScale(checked)
- if checked:
- self.plot.resetZoom()
-
-
-class XAxisLogarithmicAction(PlotAction):
- """QAction controlling X axis log scale on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(XAxisLogarithmicAction, self).__init__(
- plot, icon='plot-xlog', text='X Log. scale',
- tooltip='Logarithmic x-axis when checked',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.isXAxisLogarithmic())
- plot.sigSetXAxisLogarithmic.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setXAxisLogarithmic(checked)
-
-
-class YAxisLogarithmicAction(PlotAction):
- """QAction controlling Y axis log scale on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(YAxisLogarithmicAction, self).__init__(
- plot, icon='plot-ylog', text='Y Log. scale',
- tooltip='Logarithmic y-axis when checked',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.isYAxisLogarithmic())
- plot.sigSetYAxisLogarithmic.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setYAxisLogarithmic(checked)
-
-
-class GridAction(PlotAction):
- """QAction controlling grid mode on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param str gridMode: The grid mode to use in 'both', 'major'.
- See :meth:`.PlotWidget.setGraphGrid`
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, gridMode='both', parent=None):
- assert gridMode in ('both', 'major')
- self._gridMode = gridMode
-
- super(GridAction, self).__init__(
- plot, icon='plot-grid', text='Grid',
- tooltip='Toggle grid (on/off)',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.getGraphGrid() is not None)
- plot.sigSetGraphGrid.connect(self._gridChanged)
-
- def _gridChanged(self, which):
- """Slot listening for PlotWidget grid mode change."""
- self.setChecked(which != 'None')
-
- def _actionTriggered(self, checked=False):
- self.plot.setGraphGrid(self._gridMode if checked else None)
-
-
-class CurveStyleAction(PlotAction):
- """QAction controlling curve style on a :class:`.PlotWidget`.
-
- It changes the default line and markers style which updates all
- curves on the plot.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(CurveStyleAction, self).__init__(
- plot, icon='plot-toggle-points', text='Curve style',
- tooltip='Change curve line and markers style',
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
-
- def _actionTriggered(self, checked=False):
- currentState = (self.plot.isDefaultPlotLines(),
- self.plot.isDefaultPlotPoints())
-
- # line only, line and symbol, symbol only
- states = (True, False), (True, True), (False, True)
- newState = states[(states.index(currentState) + 1) % 3]
-
- self.plot.setDefaultPlotLines(newState[0])
- self.plot.setDefaultPlotPoints(newState[1])
-
-
-class ColormapAction(PlotAction):
- """QAction opening a ColormapDialog to update the colormap.
-
- Both the active image colormap and the default colormap are updated.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
- def __init__(self, plot, parent=None):
- self._dialog = None # To store an instance of ColormapDialog
- super(ColormapAction, self).__init__(
- plot, icon='colormap', text='Colormap',
- tooltip="Change colormap",
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
-
- def _actionTriggered(self, checked=False):
- """Create a cmap dialog and update active image and default cmap."""
- # Create the dialog if not already existing
- if self._dialog is None:
- self._dialog = ColormapDialog()
-
- image = self.plot.getActiveImage()
- if not isinstance(image, items.ColormapMixIn):
- # No active image or active image is RGBA,
- # set dialog from default info
- colormap = self.plot.getDefaultColormap()
-
- self._dialog.setHistogram() # Reset histogram and range if any
-
- else:
- # Set dialog from active image
- colormap = image.getColormap()
-
- data = image.getData(copy=False)
-
- goodData = data[numpy.isfinite(data)]
- if goodData.size > 0:
- dataMin = goodData.min()
- dataMax = goodData.max()
- else:
- qt.QMessageBox.warning(
- self, "No Data",
- "Image data does not contain any real value")
- dataMin, dataMax = 1., 10.
-
- self._dialog.setHistogram() # Reset histogram if any
- self._dialog.setDataRange(dataMin, dataMax)
- # The histogram should be done in a worker thread
- # hist, bin_edges = numpy.histogram(goodData, bins=256)
- # self._dialog.setHistogram(hist, bin_edges)
-
- self._dialog.setColormap(**colormap)
-
- # Run the dialog listening to colormap change
- self._dialog.sigColormapChanged.connect(self._colormapChanged)
- result = self._dialog.exec_()
- self._dialog.sigColormapChanged.disconnect(self._colormapChanged)
-
- if not result: # Restore the previous colormap
- self._colormapChanged(colormap)
-
- def _colormapChanged(self, colormap):
- # Update default colormap
- self.plot.setDefaultColormap(colormap)
-
- # Update active image colormap
- activeImage = self.plot.getActiveImage()
- if isinstance(activeImage, items.ColormapMixIn):
- activeImage.setColormap(colormap)
-
-
-class KeepAspectRatioAction(PlotAction):
- """QAction controlling aspect ratio on a :class:`.PlotWidget`.
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- # Uses two images for checked/unchecked states
- self._states = {
- False: (icons.getQIcon('shape-circle-solid'),
- "Keep data aspect ratio"),
- True: (icons.getQIcon('shape-ellipse-solid'),
- "Do no keep data aspect ratio")
- }
-
- icon, tooltip = self._states[plot.isKeepDataAspectRatio()]
- super(KeepAspectRatioAction, self).__init__(
- plot,
- icon=icon,
- text='Toggle keep aspect ratio',
- tooltip=tooltip,
- triggered=self._actionTriggered,
- checkable=False,
- parent=parent)
- plot.sigSetKeepDataAspectRatio.connect(
- self._keepDataAspectRatioChanged)
-
- def _keepDataAspectRatioChanged(self, aspectRatio):
- """Handle Plot set keep aspect ratio signal"""
- icon, tooltip = self._states[aspectRatio]
- self.setIcon(icon)
- self.setToolTip(tooltip)
-
- def _actionTriggered(self, checked=False):
- # This will trigger _keepDataAspectRatioChanged
- self.plot.setKeepDataAspectRatio(not self.plot.isKeepDataAspectRatio())
-
-
-class YAxisInvertedAction(PlotAction):
- """QAction controlling Y orientation on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- # Uses two images for checked/unchecked states
- self._states = {
- False: (icons.getQIcon('plot-ydown'),
- "Orient Y axis downward"),
- True: (icons.getQIcon('plot-yup'),
- "Orient Y axis upward"),
- }
-
- icon, tooltip = self._states[plot.isYAxisInverted()]
- super(YAxisInvertedAction, self).__init__(
- plot,
- icon=icon,
- text='Invert Y Axis',
- tooltip=tooltip,
- triggered=self._actionTriggered,
- checkable=False,
- parent=parent)
- plot.sigSetYAxisInverted.connect(self._yAxisInvertedChanged)
-
- def _yAxisInvertedChanged(self, inverted):
- """Handle Plot set y axis inverted signal"""
- icon, tooltip = self._states[inverted]
- self.setIcon(icon)
- self.setToolTip(tooltip)
-
- def _actionTriggered(self, checked=False):
- # This will trigger _yAxisInvertedChanged
- self.plot.setYAxisInverted(not self.plot.isYAxisInverted())
-
-
-class SaveAction(PlotAction):
- """QAction for saving Plot content.
-
- It opens a Save as... dialog.
-
- :param plot: :class:`.PlotWidget` instance on which to operate.
- :param parent: See :class:`QAction`.
- """
- # TODO find a way to make the filter list selectable and extensible
-
- SNAPSHOT_FILTER_SVG = 'Plot Snapshot as SVG (*.svg)'
-
- SNAPSHOT_FILTERS = ('Plot Snapshot as PNG (*.png)',
- 'Plot Snapshot as JPEG (*.jpg)',
- SNAPSHOT_FILTER_SVG)
-
- # Dict of curve filters with CSV-like format
- # Using ordered dict to guarantee filters order
- # Note: '%.18e' is numpy.savetxt default format
- CURVE_FILTERS_TXT = OrderedDict((
- ('Curve as Raw ASCII (*.txt)',
- {'fmt': '%.18e', 'delimiter': ' ', 'header': False}),
- ('Curve as ";"-separated CSV (*.csv)',
- {'fmt': '%.18e', 'delimiter': ';', 'header': True}),
- ('Curve as ","-separated CSV (*.csv)',
- {'fmt': '%.18e', 'delimiter': ',', 'header': True}),
- ('Curve as tab-separated CSV (*.csv)',
- {'fmt': '%.18e', 'delimiter': '\t', 'header': True}),
- ('Curve as OMNIC CSV (*.csv)',
- {'fmt': '%.7E', 'delimiter': ',', 'header': False}),
- ('Curve as SpecFile (*.dat)',
- {'fmt': '%.7g', 'delimiter': '', 'header': False})
- ))
-
- CURVE_FILTER_NPY = 'Curve as NumPy binary file (*.npy)'
-
- CURVE_FILTERS = list(CURVE_FILTERS_TXT.keys()) + [CURVE_FILTER_NPY]
-
- ALL_CURVES_FILTERS = ("All curves as SpecFile (*.dat)", )
-
- IMAGE_FILTER_EDF = 'Image data as EDF (*.edf)'
- IMAGE_FILTER_TIFF = 'Image data as TIFF (*.tif)'
- IMAGE_FILTER_NUMPY = 'Image data as NumPy binary file (*.npy)'
- IMAGE_FILTER_ASCII = 'Image data as ASCII (*.dat)'
- IMAGE_FILTER_CSV_COMMA = 'Image data as ,-separated CSV (*.csv)'
- IMAGE_FILTER_CSV_SEMICOLON = 'Image data as ;-separated CSV (*.csv)'
- IMAGE_FILTER_CSV_TAB = 'Image data as tab-separated CSV (*.csv)'
- IMAGE_FILTER_RGB_PNG = 'Image as PNG (*.png)'
- IMAGE_FILTER_RGB_TIFF = 'Image as TIFF (*.tif)'
- IMAGE_FILTERS = (IMAGE_FILTER_EDF,
- IMAGE_FILTER_TIFF,
- IMAGE_FILTER_NUMPY,
- IMAGE_FILTER_ASCII,
- IMAGE_FILTER_CSV_COMMA,
- IMAGE_FILTER_CSV_SEMICOLON,
- IMAGE_FILTER_CSV_TAB,
- IMAGE_FILTER_RGB_PNG,
- IMAGE_FILTER_RGB_TIFF)
-
- def __init__(self, plot, parent=None):
- super(SaveAction, self).__init__(
- plot, icon='document-save', text='Save as...',
- tooltip='Save curve/image/plot snapshot dialog',
- triggered=self._actionTriggered,
- checkable=False, parent=parent)
- self.setShortcut(qt.QKeySequence.Save)
- self.setShortcutContext(qt.Qt.WidgetShortcut)
-
- def _errorMessage(self, informativeText=''):
- """Display an error message."""
- # TODO issue with QMessageBox size fixed and too small
- msg = qt.QMessageBox(self.plot)
- msg.setIcon(qt.QMessageBox.Critical)
- msg.setInformativeText(informativeText + ' ' + str(sys.exc_info()[1]))
- msg.setDetailedText(traceback.format_exc())
- msg.exec_()
-
- def _saveSnapshot(self, filename, nameFilter):
- """Save a snapshot of the :class:`PlotWindow` widget.
-
- :param str filename: The name of the file to write
- :param str nameFilter: The selected name filter
- :return: False if format is not supported or save failed,
- True otherwise.
- """
- if nameFilter == self.SNAPSHOT_FILTER_SVG:
- self.plot.saveGraph(filename, fileFormat='svg')
-
- else:
- if hasattr(qt.QPixmap, "grabWidget"):
- # Qt 4
- pixmap = qt.QPixmap.grabWidget(self.plot.getWidgetHandle())
- else:
- # Qt 5
- pixmap = self.plot.getWidgetHandle().grab()
- if not pixmap.save(filename):
- self._errorMessage()
- return False
- return True
-
- def _saveCurve(self, filename, nameFilter):
- """Save a curve from the plot.
-
- :param str filename: The name of the file to write
- :param str nameFilter: The selected name filter
- :return: False if format is not supported or save failed,
- True otherwise.
- """
- if nameFilter not in self.CURVE_FILTERS:
- return False
-
- # Check if a curve is to be saved
- curve = self.plot.getActiveCurve()
- # before calling _saveCurve, if there is no selected curve, we
- # make sure there is only one curve on the graph
- if curve is None:
- curves = self.plot.getAllCurves()
- if not curves:
- self._errorMessage("No curve to be saved")
- return False
- curve = curves[0]
-
- if nameFilter in self.CURVE_FILTERS_TXT:
- filter_ = self.CURVE_FILTERS_TXT[nameFilter]
- fmt = filter_['fmt']
- csvdelim = filter_['delimiter']
- autoheader = filter_['header']
- else:
- # .npy
- fmt, csvdelim, autoheader = ("", "", False)
-
- # If curve has no associated label, get the default from the plot
- xlabel = curve.getXLabel()
- if xlabel is None:
- xlabel = self.plot.getGraphXLabel()
- ylabel = curve.getYLabel()
- if ylabel is None:
- ylabel = self.plot.getGraphYLabel()
-
- try:
- save1D(filename,
- curve.getXData(copy=False),
- curve.getYData(copy=False),
- xlabel, [ylabel],
- fmt=fmt, csvdelim=csvdelim,
- autoheader=autoheader)
- except IOError:
- self._errorMessage('Save failed\n')
- return False
-
- return True
-
- def _saveCurves(self, filename, nameFilter):
- """Save all curves from the plot.
-
- :param str filename: The name of the file to write
- :param str nameFilter: The selected name filter
- :return: False if format is not supported or save failed,
- True otherwise.
- """
- if nameFilter not in self.ALL_CURVES_FILTERS:
- return False
-
- curves = self.plot.getAllCurves()
- if not curves:
- self._errorMessage("No curves to be saved")
- return False
-
- curve = curves[0]
- scanno = 1
- try:
- specfile = savespec(filename,
- curve.getXData(copy=False),
- curve.getYData(copy=False),
- curve.getXLabel(),
- curve.getYLabel(),
- fmt="%.7g", scan_number=1, mode="w",
- write_file_header=True,
- close_file=False)
- except IOError:
- self._errorMessage('Save failed\n')
- return False
-
- for curve in curves[1:]:
- try:
- scanno += 1
- specfile = savespec(specfile,
- curve.getXData(copy=False),
- curve.getYData(copy=False),
- curve.getXLabel(),
- curve.getYLabel(),
- fmt="%.7g", scan_number=scanno, mode="w",
- write_file_header=False,
- close_file=False)
- except IOError:
- self._errorMessage('Save failed\n')
- return False
- specfile.close()
-
- return True
-
- def _saveImage(self, filename, nameFilter):
- """Save an image from the plot.
-
- :param str filename: The name of the file to write
- :param str nameFilter: The selected name filter
- :return: False if format is not supported or save failed,
- True otherwise.
- """
- if nameFilter not in self.IMAGE_FILTERS:
- return False
-
- image = self.plot.getActiveImage()
- if image is None:
- qt.QMessageBox.warning(
- self.plot, "No Data", "No image to be saved")
- return False
-
- data = image.getData(copy=False)
-
- # TODO Use silx.io for writing files
- if nameFilter == self.IMAGE_FILTER_EDF:
- edfFile = EdfFile(filename, access="w+")
- edfFile.WriteImage({}, data, Append=0)
- return True
-
- elif nameFilter == self.IMAGE_FILTER_TIFF:
- tiffFile = TiffIO(filename, mode='w')
- tiffFile.writeImage(data, software='silx')
- return True
-
- elif nameFilter == self.IMAGE_FILTER_NUMPY:
- try:
- numpy.save(filename, data)
- except IOError:
- self._errorMessage('Save failed\n')
- return False
- return True
-
- elif nameFilter in (self.IMAGE_FILTER_ASCII,
- self.IMAGE_FILTER_CSV_COMMA,
- self.IMAGE_FILTER_CSV_SEMICOLON,
- self.IMAGE_FILTER_CSV_TAB):
- csvdelim, filetype = {
- self.IMAGE_FILTER_ASCII: (' ', 'txt'),
- self.IMAGE_FILTER_CSV_COMMA: (',', 'csv'),
- self.IMAGE_FILTER_CSV_SEMICOLON: (';', 'csv'),
- self.IMAGE_FILTER_CSV_TAB: ('\t', 'csv'),
- }[nameFilter]
-
- height, width = data.shape
- rows, cols = numpy.mgrid[0:height, 0:width]
- try:
- save1D(filename, rows.ravel(), (cols.ravel(), data.ravel()),
- filetype=filetype,
- xlabel='row',
- ylabels=['column', 'value'],
- csvdelim=csvdelim,
- autoheader=True)
-
- except IOError:
- self._errorMessage('Save failed\n')
- return False
- return True
-
- elif nameFilter in (self.IMAGE_FILTER_RGB_PNG,
- self.IMAGE_FILTER_RGB_TIFF):
- # Get displayed image
- rgbaImage = image.getRbgaImageData(copy=False)
- # Convert RGB QImage
- qimage = convertArrayToQImage(rgbaImage[:, :, :3])
-
- if nameFilter == self.IMAGE_FILTER_RGB_PNG:
- fileFormat = 'PNG'
- else:
- fileFormat = 'TIFF'
-
- if qimage.save(filename, fileFormat):
- return True
- else:
- _logger.error('Failed to save image as %s', filename)
- qt.QMessageBox.critical(
- self.parent(),
- 'Save image as',
- 'Failed to save image')
-
- return False
-
- def _actionTriggered(self, checked=False):
- """Handle save action."""
- # Set-up filters
- filters = []
-
- # Add image filters if there is an active image
- if self.plot.getActiveImage() is not None:
- filters.extend(self.IMAGE_FILTERS)
-
- # Add curve filters if there is a curve to save
- if (self.plot.getActiveCurve() is not None or
- len(self.plot.getAllCurves()) == 1):
- filters.extend(self.CURVE_FILTERS)
- if len(self.plot.getAllCurves()) > 1:
- filters.extend(self.ALL_CURVES_FILTERS)
-
- filters.extend(self.SNAPSHOT_FILTERS)
-
- # Create and run File dialog
- dialog = qt.QFileDialog(self.plot)
- dialog.setWindowTitle("Output File Selection")
- dialog.setModal(1)
- dialog.setNameFilters(filters)
-
- dialog.setFileMode(dialog.AnyFile)
- dialog.setAcceptMode(dialog.AcceptSave)
-
- if not dialog.exec_():
- return False
-
- nameFilter = dialog.selectedNameFilter()
- filename = dialog.selectedFiles()[0]
- dialog.close()
-
- # Forces the filename extension to match the chosen filter
- extension = nameFilter.split()[-1][2:-1]
- if (len(filename) <= len(extension) or
- filename[-len(extension):].lower() != extension.lower()):
- filename += extension
-
- # Handle save
- if nameFilter in self.SNAPSHOT_FILTERS:
- return self._saveSnapshot(filename, nameFilter)
- elif nameFilter in self.CURVE_FILTERS:
- return self._saveCurve(filename, nameFilter)
- elif nameFilter in self.ALL_CURVES_FILTERS:
- return self._saveCurves(filename, nameFilter)
- elif nameFilter in self.IMAGE_FILTERS:
- return self._saveImage(filename, nameFilter)
- else:
- _logger.warning('Unsupported file filter: %s', nameFilter)
- return False
-
-
-def _plotAsPNG(plot):
- """Save a :class:`Plot` as PNG and return the payload.
-
- :param plot: The :class:`Plot` to save
- """
- pngFile = BytesIO()
- plot.saveGraph(pngFile, fileFormat='png')
- pngFile.flush()
- pngFile.seek(0)
- data = pngFile.read()
- pngFile.close()
- return data
-
-
-class PrintAction(PlotAction):
- """QAction for printing the plot.
-
- It opens a Print dialog.
-
- Current implementation print a bitmap of the plot area and not vector
- graphics, so printing quality is not great.
-
- :param plot: :class:`.PlotWidget` instance on which to operate.
- :param parent: See :class:`QAction`.
- """
-
- # Share QPrinter instance to propose latest used as default
- _printer = None
-
- def __init__(self, plot, parent=None):
- super(PrintAction, self).__init__(
- plot, icon='document-print', text='Print...',
- tooltip='Open print dialog',
- triggered=self.printPlot,
- checkable=False, parent=parent)
- self.setShortcut(qt.QKeySequence.Print)
- self.setShortcutContext(qt.Qt.WidgetShortcut)
-
- @property
- def printer(self):
- """The QPrinter instance used by the actions.
-
- This is shared accross all instances of PrintAct
- """
- if self._printer is None:
- PrintAction._printer = qt.QPrinter()
- return self._printer
-
- def printPlotAsWidget(self):
- """Open the print dialog and print the plot.
-
- Use :meth:`QWidget.render` to print the plot
-
- :return: True if successful
- """
- dialog = qt.QPrintDialog(self.printer, self.plot)
- dialog.setWindowTitle('Print Plot')
- if not dialog.exec_():
- return False
-
- # Print a snapshot of the plot widget at the top of the page
- widget = self.plot.centralWidget()
-
- painter = qt.QPainter()
- if not painter.begin(self.printer):
- return False
-
- pageRect = self.printer.pageRect()
- xScale = pageRect.width() / widget.width()
- yScale = pageRect.height() / widget.height()
- scale = min(xScale, yScale)
-
- painter.translate(pageRect.width() / 2., 0.)
- painter.scale(scale, scale)
- painter.translate(-widget.width() / 2., 0.)
- widget.render(painter)
- painter.end()
-
- return True
-
- def printPlot(self):
- """Open the print dialog and print the plot.
-
- Use :meth:`Plot.saveGraph` to print the plot.
-
- :return: True if successful
- """
- # Init printer and start printer dialog
- dialog = qt.QPrintDialog(self.printer, self.plot)
- dialog.setWindowTitle('Print Plot')
- if not dialog.exec_():
- return False
-
- # Save Plot as PNG and make a pixmap from it with default dpi
- pngData = _plotAsPNG(self.plot)
-
- pixmap = qt.QPixmap()
- pixmap.loadFromData(pngData, 'png')
-
- xScale = self.printer.pageRect().width() / pixmap.width()
- yScale = self.printer.pageRect().height() / pixmap.height()
- scale = min(xScale, yScale)
-
- # Draw pixmap with painter
- painter = qt.QPainter()
- if not painter.begin(self.printer):
- return False
-
- painter.drawPixmap(0, 0,
- pixmap.width() * scale,
- pixmap.height() * scale,
- pixmap)
- painter.end()
-
- return True
-
-
-class CopyAction(PlotAction):
- """QAction to copy :class:`.PlotWidget` content to clipboard.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- super(CopyAction, self).__init__(
- plot, icon='edit-copy', text='Copy plot',
- tooltip='Copy a snapshot of the plot into the clipboard',
- triggered=self.copyPlot,
- checkable=False, parent=parent)
- self.setShortcut(qt.QKeySequence.Copy)
- self.setShortcutContext(qt.Qt.WidgetShortcut)
-
- def copyPlot(self):
- """Copy plot content to the clipboard as a bitmap."""
- # Save Plot as PNG and make a QImage from it with default dpi
- pngData = _plotAsPNG(self.plot)
- image = qt.QImage.fromData(pngData, 'png')
- qt.QApplication.clipboard().setImage(image)
-
-
-class CrosshairAction(PlotAction):
- """QAction toggling crosshair cursor on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param str color: Color to use to draw the crosshair
- :param int linewidth: Width of the crosshair cursor
- :param str linestyle: Style of line. See :meth:`.Plot.setGraphCursor`
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, color='black', linewidth=1, linestyle='-',
- parent=None):
- self.color = color
- """Color used to draw the crosshair (str)."""
-
- self.linewidth = linewidth
- """Width of the crosshair cursor (int)."""
-
- self.linestyle = linestyle
- """Style of line of the cursor (str)."""
-
- super(CrosshairAction, self).__init__(
- plot, icon='crosshair', text='Crosshair Cursor',
- tooltip='Enable crosshair cursor when checked',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.getGraphCursor() is not None)
- plot.sigSetGraphCursor.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setGraphCursor(checked,
- color=self.color,
- linestyle=self.linestyle,
- linewidth=self.linewidth)
-
-
-class PanWithArrowKeysAction(PlotAction):
- """QAction toggling pan with arrow keys on a :class:`.PlotWidget`.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
-
- super(PanWithArrowKeysAction, self).__init__(
- plot, icon='arrow-keys', text='Pan with arrow keys',
- tooltip='Enable pan with arrow keys when checked',
- triggered=self._actionTriggered,
- checkable=True, parent=parent)
- self.setChecked(plot.isPanWithArrowKeys())
- plot.sigSetPanWithArrowKeys.connect(self.setChecked)
-
- def _actionTriggered(self, checked=False):
- self.plot.setPanWithArrowKeys(checked)
-
-
-def _warningMessage(informativeText='', detailedText='', parent=None):
- """Display a popup warning message."""
- msg = qt.QMessageBox(parent)
- msg.setIcon(qt.QMessageBox.Warning)
- msg.setInformativeText(informativeText)
- msg.setDetailedText(detailedText)
- msg.exec_()
-
-
-def _getOneCurve(plt, mode="unique"):
- """Get a single curve from the plot.
- By default, get the active curve if any, else if a single curve is plotted
- get it, else return None and display a warning popup.
-
- This behavior can be adjusted by modifying the *mode* parameter: always
- return the active curve if any, but adjust the behavior in case no curve
- is active.
-
- :param plt: :class:`.PlotWidget` instance on which to operate
- :param mode: Parameter defining the behavior when no curve is active.
- Possible modes:
- - "none": return None (enforce curve activation)
- - "unique": return the unique curve or None if multiple curves
- - "first": return first curve
- - "last": return last curve (most recently added one)
- :return: return value of plt.getActiveCurve(), or plt.getAllCurves()[0],
- or plt.getAllCurves()[-1], or None
- """
- curve = plt.getActiveCurve()
- if curve is not None:
- return curve
-
- if mode is None or mode.lower() == "none":
- _warningMessage("You must activate a curve!",
- parent=plt)
- return None
-
- curves = plt.getAllCurves()
- if len(curves) == 0:
- _warningMessage("No curve on this plot.",
- parent=plt)
- return None
-
- if len(curves) == 1:
- return curves[0]
-
- if len(curves) > 1:
- if mode == "unique":
- _warningMessage("Multiple curves are plotted. " +
- "Please activate the one you want to use.",
- parent=plt)
- return None
- if mode.lower() == "first":
- return curves[0]
- if mode.lower() == "last":
- return curves[-1]
-
- raise ValueError("Illegal value for parameter 'mode'." +
- " Allowed values: 'none', 'unique', 'first', 'last'.")
-
-
-class FitAction(PlotAction):
- """QAction to open a :class:`FitWidget` and set its data to the
- active curve if any, or to the first curve.
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
- def __init__(self, plot, parent=None):
- super(FitAction, self).__init__(
- plot, icon='math-fit', text='Fit curve',
- tooltip='Open a fit dialog',
- triggered=self._getFitWindow,
- checkable=False, parent=parent)
- self.fit_window = None
-
- def _getFitWindow(self):
- curve = _getOneCurve(self.plot)
- if curve is None:
- return
- self.xlabel = self.plot.getGraphXLabel()
- self.ylabel = self.plot.getGraphYLabel()
- self.x = curve.getXData(copy=False)
- self.y = curve.getYData(copy=False)
- self.legend = curve.getLegend()
- self.xmin, self.xmax = self.plot.getGraphXLimits()
-
- # open a window with a FitWidget
- if self.fit_window is None:
- self.fit_window = qt.QMainWindow()
- # import done here rather than at module level to avoid circular import
- # FitWidget -> BackgroundWidget -> PlotWindow -> PlotActions -> FitWidget
- from ..fit.FitWidget import FitWidget
- self.fit_widget = FitWidget(parent=self.fit_window)
- self.fit_window.setCentralWidget(
- self.fit_widget)
- self.fit_widget.guibuttons.DismissButton.clicked.connect(
- self.fit_window.close)
- self.fit_widget.sigFitWidgetSignal.connect(
- self.handle_signal)
- self.fit_window.show()
- else:
- if self.fit_window.isHidden():
- self.fit_window.show()
- self.fit_widget.show()
- self.fit_window.raise_()
-
- self.fit_widget.setData(self.x, self.y,
- xmin=self.xmin, xmax=self.xmax)
- self.fit_window.setWindowTitle(
- "Fitting " + self.legend +
- " on x range %f-%f" % (self.xmin, self.xmax))
-
- def handle_signal(self, ddict):
- x_fit = self.x[self.xmin <= self.x]
- x_fit = x_fit[x_fit <= self.xmax]
- fit_legend = "Fit <%s>" % self.legend
- fit_curve = self.plot.getCurve(fit_legend)
-
- if ddict["event"] == "FitFinished":
- y_fit = self.fit_widget.fitmanager.gendata()
- if fit_curve is None:
- self.plot.addCurve(x_fit, y_fit,
- fit_legend,
- xlabel=self.xlabel, ylabel=self.ylabel,
- resetzoom=False)
- else:
- fit_curve.setData(x_fit, y_fit)
- fit_curve.setVisible(True)
-
- if ddict["event"] in ["FitStarted", "FitFailed"]:
- if fit_curve is not None:
- fit_curve.setVisible(False)
-
-
-class PixelIntensitiesHistoAction(PlotAction):
- """QAction to plot the pixels intensities diagram
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- PlotAction.__init__(self,
- plot,
- icon='pixel-intensities',
- text='pixels intensity',
- tooltip='Compute image intensity distribution',
- triggered=self._triggered,
- parent=parent,
- checkable=True)
- self._plotHistogram = None
- self._connectedToActiveImage = False
- self._histo = None
-
- def _triggered(self, checked):
- """Update the plot of the histogram visibility status
-
- :param bool checked: status of the action button
- """
- if checked:
- if not self._connectedToActiveImage:
- self.plot.sigActiveImageChanged.connect(
- self._activeImageChanged)
- self._connectedToActiveImage = True
- self.computeIntensityDistribution()
-
- self.getHistogramPlotWidget().show()
-
- else:
- if self._connectedToActiveImage:
- self.plot.sigActiveImageChanged.disconnect(
- self._activeImageChanged)
- self._connectedToActiveImage = False
-
- self.getHistogramPlotWidget().hide()
-
- def _activeImageChanged(self, previous, legend):
- """Handle active image change: toggle enabled toolbar, update curve"""
- if self.isChecked():
- self.computeIntensityDistribution()
-
- def computeIntensityDistribution(self):
- """Get the active image and compute the image intensity distribution
- """
- activeImage = self.plot.getActiveImage()
-
- if activeImage is not None:
- image = activeImage.getData(copy=False)
- if image.ndim == 3: # RGB(A) images
- _logger.info('Converting current image from RGB(A) to grayscale\
- in order to compute the intensity distribution')
- image = (image[:, :, 0] * 0.299 +
- image[:, :, 1] * 0.587 +
- image[:, :, 2] * 0.114)
-
- xmin = numpy.nanmin(image)
- xmax = numpy.nanmax(image)
- nbins = min(1024, int(numpy.sqrt(image.size)))
- data_range = xmin, xmax
-
- # bad hack: get 256 bins in the case we have a B&W
- if numpy.issubdtype(image.dtype, numpy.integer):
- if nbins > xmax - xmin:
- nbins = xmax - xmin
-
- nbins = max(2, nbins)
-
- data = image.ravel().astype(numpy.float32)
- histogram = Histogramnd(data, n_bins=nbins, histo_range=data_range)
- assert len(histogram.edges) == 1
- self._histo = histogram.histo
- edges = histogram.edges[0]
- plot = self.getHistogramPlotWidget()
- plot.addHistogram(histogram=self._histo,
- edges=edges,
- legend='pixel intensity',
- fill=True,
- color='red')
- plot.resetZoom()
-
- def eventFilter(self, qobject, event):
- """Observe when the close event is emitted then
- simply uncheck the action button
-
- :param qobject: the object observe
- :param event: the event received by qobject
- """
- if event.type() == qt.QEvent.Close:
- if self._plotHistogram is not None:
- self._plotHistogram.hide()
- self.setChecked(False)
-
- return PlotAction.eventFilter(self, qobject, event)
-
- def getHistogramPlotWidget(self):
- """Create the plot histogram if needed, otherwise create it
-
- :return: the PlotWidget showing the histogram of the pixel intensities
- """
- from silx.gui.plot.PlotWindow import Plot1D
- if self._plotHistogram is None:
- self._plotHistogram = Plot1D(parent=self.plot)
- self._plotHistogram.setWindowFlags(qt.Qt.Window)
- self._plotHistogram.setWindowTitle('Image Intensity Histogram')
- self._plotHistogram.installEventFilter(self)
- self._plotHistogram.setGraphXLabel("Value")
- self._plotHistogram.setGraphYLabel("Count")
-
- return self._plotHistogram
-
- def getHistogram(self):
- """Return the last computed histogram
-
- :return: the histogram displayed in the HistogramPlotWiget
- """
- return self._histo
-
-
-class MedianFilterAction(PlotAction):
- """QAction to plot the pixels intensities diagram
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
-
- def __init__(self, plot, parent=None):
- PlotAction.__init__(self,
- plot,
- icon='median-filter',
- text='median filter',
- tooltip='Apply a median filter on the image',
- triggered=self._triggered,
- parent=parent)
- self._originalImage = None
- self._legend = None
- self._filteredImage = None
- self._popup = MedianFilterDialog(parent=None)
- self._popup.sigFilterOptChanged.connect(self._updateFilter)
- self.plot.sigActiveImageChanged.connect( self._updateActiveImage)
- self._updateActiveImage()
-
- def _triggered(self, checked):
- """Update the plot of the histogram visibility status
-
- :param bool checked: status of the action button
- """
- self._popup.show()
-
- def _updateActiveImage(self):
- """Set _activeImageLegend and _originalImage from the active image"""
- self._activeImageLegend = self.plot.getActiveImage(just_legend=True)
- if self._activeImageLegend is None:
- self._originalImage = None
- self._legend = None
- else:
- self._originalImage = self.plot.getImage(self._activeImageLegend).getData(copy=False)
- self._legend = self.plot.getImage(self._activeImageLegend).getLegend()
-
- def _updateFilter(self, kernelWidth, conditional=False):
- if self._originalImage is None:
- return
-
- self.plot.sigActiveImageChanged.disconnect(self._updateActiveImage)
- filteredImage = self._computeFilteredImage(kernelWidth, conditional)
- self.plot.addImage(data=filteredImage,
- legend=self._legend,
- replace=True)
- self.plot.sigActiveImageChanged.connect(self._updateActiveImage)
-
- def _computeFilteredImage(self, kernelWidth, conditional):
- raise NotImplemented('MedianFilterAction is a an abstract class')
-
- def getFilteredImage(self):
- """
- :return: the image with the median filter apply on"""
- return self._filteredImage
-
-
-class MedianFilter1DAction(MedianFilterAction):
- """Define the MedianFilterAction for 1D
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
- def __init__(self, plot, parent=None):
- MedianFilterAction.__init__(self,
- plot,
- parent=parent)
-
- def _computeFilteredImage(self, kernelWidth, conditional):
- assert(self.plot is not None)
- return medfilt2d(self._originalImage,
- (kernelWidth, 1),
- conditional)
-
-
-class MedianFilter2DAction(MedianFilterAction):
- """Define the MedianFilterAction for 2D
-
- :param plot: :class:`.PlotWidget` instance on which to operate
- :param parent: See :class:`QAction`
- """
- def __init__(self, plot, parent=None):
- MedianFilterAction.__init__(self,
- plot,
- parent=parent)
-
- def _computeFilteredImage(self, kernelWidth, conditional):
- assert(self.plot is not None)
- return medfilt2d(self._originalImage,
- (kernelWidth, kernelWidth),
- conditional)
+__date__ = "01/06/2017"
+
+from silx.utils.deprecation import deprecated_warning
+
+deprecated_warning(type_='module',
+ name=__file__,
+ reason='PlotActions refactoring',
+ replacement='plot.actions',
+ since_version='0.6')
+
+from .actions import PlotAction
+
+from .actions.io import CopyAction
+from .actions.io import PrintAction
+from .actions.io import SaveAction
+
+from .actions.control import ColormapAction
+from .actions.control import CrosshairAction
+from .actions.control import CurveStyleAction
+from .actions.control import GridAction
+from .actions.control import KeepAspectRatioAction
+from .actions.control import PanWithArrowKeysAction
+from .actions.control import ResetZoomAction
+from .actions.control import XAxisAutoScaleAction
+from .actions.control import XAxisLogarithmicAction
+from .actions.control import YAxisAutoScaleAction
+from .actions.control import YAxisLogarithmicAction
+from .actions.control import YAxisInvertedAction
+from .actions.control import ZoomInAction
+from .actions.control import ZoomOutAction
+
+from .actions.medfilt import MedianFilter1DAction
+from .actions.medfilt import MedianFilter2DAction
+from .actions.medfilt import MedianFilterAction
+
+from .actions.histogram import PixelIntensitiesHistoAction
+
+from .actions.fit import FitAction
diff --git a/silx/gui/plot/PlotInteraction.py b/silx/gui/plot/PlotInteraction.py
index fbc9c1f..865073b 100644
--- a/silx/gui/plot/PlotInteraction.py
+++ b/silx/gui/plot/PlotInteraction.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "27/06/2017"
import math
@@ -153,11 +153,11 @@ class Pan(_ZoomOnWheel):
xData, yData, y2Data = self._pixelToData(x, y)
lastX, lastY, lastY2 = self._previousDataPos
- xMin, xMax = self.plot.getGraphXLimits()
- yMin, yMax = self.plot.getGraphYLimits(axis='left')
- y2Min, y2Max = self.plot.getGraphYLimits(axis='right')
+ xMin, xMax = self.plot.getXAxis().getLimits()
+ yMin, yMax = self.plot.getYAxis().getLimits()
+ y2Min, y2Max = self.plot.getYAxis(axis='right').getLimits()
- if self.plot.isXAxisLogarithmic():
+ if self.plot.getXAxis()._isLogarithmic():
try:
dx = math.log10(xData) - math.log10(lastX)
newXMin = pow(10., (math.log10(xMin) - dx))
@@ -176,7 +176,7 @@ class Pan(_ZoomOnWheel):
if newXMin < FLOAT32_SAFE_MIN or newXMax > FLOAT32_SAFE_MAX:
newXMin, newXMax = xMin, xMax
- if self.plot.isYAxisLogarithmic():
+ if self.plot.getYAxis()._isLogarithmic():
try:
dy = math.log10(yData) - math.log10(lastY)
newYMin = pow(10., math.log10(yMin) - dy)
@@ -233,10 +233,10 @@ class Zoom(_ZoomOnWheel):
def __init__(self, plot, color):
self.color = color
- self.zoomStack = []
self._lastClick = 0., None
super(Zoom, self).__init__(plot)
+ self.plot.getLimitsHistory().clear()
def _areaWithAspectRatio(self, x0, y0, x1, y1):
_plotLeft, _plotTop, plotW, plotH = self.plot.getPlotBoundsInPixels()
@@ -286,25 +286,14 @@ class Zoom(_ZoomOnWheel):
self._lastClick = time.time(), (dataPos[0], dataPos[1], x, y)
- # Zoom-in centered on mouse cursor
- # xMin, xMax = self.plot.getGraphXLimits()
- # yMin, yMax = self.plot.getGraphYLimits()
- # y2Min, y2Max = self.plot.getGraphYLimits(axis="right")
- # self.zoomStack.append((xMin, xMax, yMin, yMax, y2Min, y2Max))
- # self._zoom(x, y, 2)
elif btn == RIGHT_BTN:
- try:
- xMin, xMax, yMin, yMax, y2Min, y2Max = self.zoomStack.pop()
- except IndexError:
- # Signal mouse clicked event
- dataPos = self.plot.pixelToData(x, y)
- assert dataPos is not None
- eventDict = prepareMouseSignal('mouseClicked', 'right',
- dataPos[0], dataPos[1],
- x, y)
- self.plot.notify(**eventDict)
- else:
- self.plot.setLimits(xMin, xMax, yMin, yMax, y2Min, y2Max)
+ # Signal mouse clicked event
+ dataPos = self.plot.pixelToData(x, y)
+ assert dataPos is not None
+ eventDict = prepareMouseSignal('mouseClicked', 'right',
+ dataPos[0], dataPos[1],
+ x, y)
+ self.plot.notify(**eventDict)
def beginDrag(self, x, y):
dataPos = self.plot.pixelToData(x, y)
@@ -354,10 +343,7 @@ class Zoom(_ZoomOnWheel):
if x0 != x1 or y0 != y1: # Avoid empty zoom area
# Store current zoom state in stack
- xMin, xMax = self.plot.getGraphXLimits()
- yMin, yMax = self.plot.getGraphYLimits()
- y2Min, y2Max = self.plot.getGraphYLimits(axis="right")
- self.zoomStack.append((xMin, xMax, yMin, yMax, y2Min, y2Max))
+ self.plot.getLimitsHistory().push()
if self.plot.isKeepDataAspectRatio():
x0, y0, x1, y1 = self._areaWithAspectRatio(x0, y0, x1, y1)
@@ -510,33 +496,6 @@ class SelectPolygon(Select):
self.points[-1] = dataPos
return True
-
- elif btn == RIGHT_BTN:
- self.machine.resetSelectionArea()
-
- firstPos = self.machine.plot.dataToPixel(*self._firstPos,
- check=False)
- dx, dy = abs(firstPos[0] - x), abs(firstPos[1] - y)
-
- if (dx < self.machine.DRAG_THRESHOLD_DIST and
- dy < self.machine.DRAG_THRESHOLD_DIST):
- self.points[-1] = self.points[0]
- else:
- dataPos = self.machine.plot.pixelToData(x, y)
- assert dataPos is not None
- self.points[-1] = dataPos
- if self.points[-2] == self.points[-1]:
- self.points.pop()
- self.points.append(self.points[0])
-
- eventDict = prepareDrawingSignal('drawingFinished',
- 'polygon',
- self.points,
- self.machine.parameters)
- self.machine.plot.notify(**eventDict)
- self.goto('idle')
- return False
-
return False
def onMove(self, x, y):
@@ -1100,14 +1059,19 @@ class ItemsInteraction(ClickOrDrag, _PlotInteraction):
elif picked[0] == 'curve':
curve = picked[1]
+ indices = picked[2]
dataPos = self.plot.pixelToData(x, y)
assert dataPos is not None
+ xData = curve.getXData(copy=False)
+ yData = curve.getYData(copy=False)
+
eventDict = prepareCurveSignal('left',
curve.getLegend(),
'curve',
- picked[2], picked[3],
+ xData[indices],
+ yData[indices],
dataPos[0], dataPos[1],
x, y)
return eventDict
@@ -1123,7 +1087,6 @@ class ItemsInteraction(ClickOrDrag, _PlotInteraction):
scale = image.getScale()
column = int((dataPos[0] - origin[0]) / float(scale[0]))
row = int((dataPos[1] - origin[1]) / float(scale[1]))
-
eventDict = prepareImageSignal('left',
image.getLegend(),
'image',
diff --git a/silx/gui/plot/PlotToolButtons.py b/silx/gui/plot/PlotToolButtons.py
index 8042391..430489d 100644
--- a/silx/gui/plot/PlotToolButtons.py
+++ b/silx/gui/plot/PlotToolButtons.py
@@ -34,7 +34,7 @@ The following QToolButton are available:
__authors__ = ["V. Valls", "H. Payno"]
__license__ = "MIT"
-__date__ = "26/01/2017"
+__date__ = "27/06/2017"
import logging
@@ -197,25 +197,26 @@ class YAxisOriginToolButton(PlotToolButton):
return qt.QAction(icon, text, self)
def _connectPlot(self, plot):
- plot.sigSetYAxisInverted.connect(self._yAxisInvertedChanged)
- self._yAxisInvertedChanged(plot.isYAxisInverted())
+ yAxis = plot.getYAxis()
+ yAxis.sigInvertedChanged.connect(self._yAxisInvertedChanged)
+ self._yAxisInvertedChanged(yAxis.isInverted())
def _disconnectPlot(self, plot):
- plot.sigSetYAxisInverted.disconnect(self._yAxisInvertedChanged)
+ plot.getYAxis().sigInvertedChanged.disconnect(self._yAxisInvertedChanged)
def setYAxisUpward(self):
"""Configure the plot to use y-axis upward"""
plot = self.plot()
if plot is not None:
# This will trigger _yAxisInvertedChanged
- plot.setYAxisInverted(False)
+ plot.getYAxis().setInverted(False)
def setYAxisDownward(self):
"""Configure the plot to use y-axis downward"""
plot = self.plot()
if plot is not None:
# This will trigger _yAxisInvertedChanged
- plot.setYAxisInverted(True)
+ plot.getYAxis().setInverted(True)
def _yAxisInvertedChanged(self, inverted):
"""Handle Plot set y axis inverted signal"""
diff --git a/silx/gui/plot/PlotTools.py b/silx/gui/plot/PlotTools.py
index 7158d0e..85dcc31 100644
--- a/silx/gui/plot/PlotTools.py
+++ b/silx/gui/plot/PlotTools.py
@@ -29,7 +29,7 @@ from __future__ import division
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "03/03/2017"
+__date__ = "02/10/2017"
import logging
@@ -40,9 +40,9 @@ import weakref
import numpy
from .. import qt
+from silx.gui.widgets.FloatEdit import FloatEdit
_logger = logging.getLogger(__name__)
-_logger.setLevel(logging.DEBUG)
# PositionInfo ################################################################
@@ -150,56 +150,70 @@ class PositionInfo(qt.QWidget):
:param dict event: Plot event
"""
if event['event'] == 'mouseMoved':
- x, y = event['x'], event['y'] # Position in data
- styleSheet = "color: rgb(0, 0, 0);" # Default style
-
- if self.autoSnapToActiveCurve and self.plot.getGraphCursor():
- # Check if near active curve with symbols.
-
- styleSheet = "color: rgb(255, 0, 0);" # Style far from curve
-
- activeCurve = self.plot.getActiveCurve()
- if activeCurve:
- xData = activeCurve.getXData(copy=False)
- yData = activeCurve.getYData(copy=False)
- if activeCurve.getSymbol(): # Only handled if symbols on curve
- closestIndex = numpy.argmin(
- pow(xData - x, 2) + pow(yData - y, 2))
-
- xClosest = xData[closestIndex]
- yClosest = yData[closestIndex]
-
- closestInPixels = self.plot.dataToPixel(
- xClosest, yClosest, axis=activeCurve.getYAxis())
- if closestInPixels is not None:
- xPixel, yPixel = event['xpixel'], event['ypixel']
-
- if (abs(closestInPixels[0] - xPixel) < 5 and
- abs(closestInPixels[1] - yPixel) < 5):
- # Update label style sheet
- styleSheet = "color: rgb(0, 0, 0);"
-
- # if close enough, wrap to data point coords
- x, y = xClosest, yClosest
-
- for label, name, func in self._fields:
- label.setStyleSheet(styleSheet)
-
- try:
- value = func(x, y)
- except:
- label.setText('Error')
- _logger.error(
- "Error while converting coordinates (%f, %f)"
- "with converter '%s'" % (x, y, name))
- _logger.error(traceback.format_exc())
- else:
- if isinstance(value, numbers.Real):
- value = '%.7g' % value # Use this for floats and int
- else:
- value = str(value) # Fallback for other types
- label.setText(value)
+ x, y = event['x'], event['y']
+ self._updateStatusBar(x, y)
+ def _updateStatusBar(self, x, y):
+ """Update information from the status bar using the definitions.
+
+ :param float x: Position-x in data
+ :param float y: Position-y in data
+ """
+ styleSheet = "color: rgb(0, 0, 0);" # Default style
+
+ if self.autoSnapToActiveCurve and self.plot.getGraphCursor():
+ # Check if near active curve with symbols.
+
+ styleSheet = "color: rgb(255, 0, 0);" # Style far from curve
+
+ activeCurve = self.plot.getActiveCurve()
+ if activeCurve:
+ xData = activeCurve.getXData(copy=False)
+ yData = activeCurve.getYData(copy=False)
+ if activeCurve.getSymbol(): # Only handled if symbols on curve
+ closestIndex = numpy.argmin(
+ pow(xData - x, 2) + pow(yData - y, 2))
+
+ xClosest = xData[closestIndex]
+ yClosest = yData[closestIndex]
+
+ closestInPixels = self.plot.dataToPixel(
+ xClosest, yClosest, axis=activeCurve.getYAxis())
+ if closestInPixels is not None:
+ xPixel, yPixel = event['xpixel'], event['ypixel']
+
+ if (abs(closestInPixels[0] - xPixel) < 5 and
+ abs(closestInPixels[1] - yPixel) < 5):
+ # Update label style sheet
+ styleSheet = "color: rgb(0, 0, 0);"
+
+ # if close enough, wrap to data point coords
+ x, y = xClosest, yClosest
+
+ for label, name, func in self._fields:
+ label.setStyleSheet(styleSheet)
+
+ try:
+ value = func(x, y)
+ text = self.valueToString(value)
+ label.setText(text)
+ except:
+ label.setText('Error')
+ _logger.error(
+ "Error while converting coordinates (%f, %f)"
+ "with converter '%s'" % (x, y, name))
+ _logger.error(traceback.format_exc())
+
+ def valueToString(self, value):
+ if isinstance(value, (tuple, list)):
+ value = [self.valueToString(v) for v in value]
+ return ", ".join(value)
+ elif isinstance(value, numbers.Real):
+ # Use this for floats and int
+ return '%.7g' % value
+ else:
+ # Fallback for other types
+ return str(value)
# LimitsToolBar ##############################################################
@@ -226,22 +240,6 @@ class LimitsToolBar(qt.QToolBar):
:param str title: See :class:`QToolBar`.
"""
- class _FloatEdit(qt.QLineEdit):
- """Field to edit a float value."""
- def __init__(self, value=None, *args, **kwargs):
- qt.QLineEdit.__init__(self, *args, **kwargs)
- self.setValidator(qt.QDoubleValidator())
- self.setFixedWidth(100)
- self.setAlignment(qt.Qt.AlignLeft)
- if value is not None:
- self.setValue(value)
-
- def value(self):
- return float(self.text())
-
- def setValue(self, value):
- self.setText('%g' % value)
-
def __init__(self, parent=None, plot=None, title='Limits'):
super(LimitsToolBar, self).__init__(title, parent)
assert plot is not None
@@ -257,28 +255,28 @@ class LimitsToolBar(qt.QToolBar):
def _initWidgets(self):
"""Create and init Toolbar widgets."""
- xMin, xMax = self.plot.getGraphXLimits()
- yMin, yMax = self.plot.getGraphYLimits()
+ xMin, xMax = self.plot.getXAxis().getLimits()
+ yMin, yMax = self.plot.getYAxis().getLimits()
self.addWidget(qt.QLabel('Limits: '))
self.addWidget(qt.QLabel(' X: '))
- self._xMinFloatEdit = self._FloatEdit(xMin)
+ self._xMinFloatEdit = FloatEdit(self, xMin)
self._xMinFloatEdit.editingFinished[()].connect(
self._xFloatEditChanged)
self.addWidget(self._xMinFloatEdit)
- self._xMaxFloatEdit = self._FloatEdit(xMax)
+ self._xMaxFloatEdit = FloatEdit(self, xMax)
self._xMaxFloatEdit.editingFinished[()].connect(
self._xFloatEditChanged)
self.addWidget(self._xMaxFloatEdit)
self.addWidget(qt.QLabel(' Y: '))
- self._yMinFloatEdit = self._FloatEdit(yMin)
+ self._yMinFloatEdit = FloatEdit(self, yMin)
self._yMinFloatEdit.editingFinished[()].connect(
self._yFloatEditChanged)
self.addWidget(self._yMinFloatEdit)
- self._yMaxFloatEdit = self._FloatEdit(yMax)
+ self._yMaxFloatEdit = FloatEdit(self, yMax)
self._yMaxFloatEdit.editingFinished[()].connect(
self._yFloatEditChanged)
self.addWidget(self._yMaxFloatEdit)
@@ -288,8 +286,8 @@ class LimitsToolBar(qt.QToolBar):
if event['event'] not in ('limitsChanged',):
return
- xMin, xMax = self.plot.getGraphXLimits()
- yMin, yMax = self.plot.getGraphYLimits()
+ xMin, xMax = self.plot.getXAxis().getLimits()
+ yMin, yMax = self.plot.getYAxis().getLimits()
self._xMinFloatEdit.setValue(xMin)
self._xMaxFloatEdit.setValue(xMax)
@@ -302,7 +300,7 @@ class LimitsToolBar(qt.QToolBar):
if xMax < xMin:
xMin, xMax = xMax, xMin
- self.plot.setGraphXLimits(xMin, xMax)
+ self.plot.getXAxis().setLimits(xMin, xMax)
def _yFloatEditChanged(self):
"""Handle Y limits changed from the GUI."""
@@ -310,4 +308,4 @@ class LimitsToolBar(qt.QToolBar):
if yMax < yMin:
yMin, yMax = yMax, yMin
- self.plot.setGraphYLimits(yMin, yMax)
+ self.plot.getYAxis().setLimits(yMin, yMax)
diff --git a/silx/gui/plot/PlotWidget.py b/silx/gui/plot/PlotWidget.py
index 5666d56..8fd5a5e 100644
--- a/silx/gui/plot/PlotWidget.py
+++ b/silx/gui/plot/PlotWidget.py
@@ -20,64 +20,253 @@
# 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.
-#
# ###########################################################################*/
-"""Qt widget providing Plot API for 1D and 2D data.
+"""Qt widget providing plot API for 1D and 2D data.
+
+Widget with plot API for 1D and 2D data.
+
+The :class:`PlotWidget` implements the plot API initially provided in PyMca.
+
+Plot Events
+-----------
+
+The :class:`PlotWidget` sends some event to the registered callback
+(See :meth:`PlotWidget.setCallback`).
+Those events are sent as a dictionary with a key 'event' describing the kind
+of event.
+
+Drawing events
+..............
+
+'drawingProgress' and 'drawingFinished' events are sent during drawing
+interaction (See :meth:`PlotWidget.setInteractiveMode`).
+
+- 'event': 'drawingProgress' or 'drawingFinished'
+- 'parameters': dict of parameters used by the drawing mode.
+ It has the following keys: 'shape', 'label', 'color'.
+ See :meth:`PlotWidget.setInteractiveMode`.
+- 'points': Points (x, y) in data coordinates of the drawn shape.
+ For 'hline' and 'vline', it is the 2 points defining the line.
+ For 'line' and 'rectangle', it is the coordinates of the start
+ drawing point and the latest drawing point.
+ For 'polygon', it is the coordinates of all points of the shape.
+- 'type': The type of drawing in 'line', 'hline', 'polygon', 'rectangle',
+ 'vline'.
+- 'xdata' and 'ydata': X coords and Y coords of shape points in data
+ coordinates (as in 'points').
+
+When the type is 'rectangle', the following additional keys are provided:
+
+- 'x' and 'y': The origin of the rectangle in data coordinates
+- 'widht' and 'height': The size of the rectangle in data coordinates
+
+
+Mouse events
+............
+
+'mouseMoved', 'mouseClicked' and 'mouseDoubleClicked' events are sent for
+mouse events.
+
+They provide the following keys:
+
+- 'event': 'mouseMoved', 'mouseClicked' or 'mouseDoubleClicked'
+- 'button': the mouse button that was pressed in 'left', 'middle', 'right'
+- 'x' and 'y': The mouse position in data coordinates
+- 'xpixel' and 'ypixel': The mouse position in pixels
+
+
+Marker events
+.............
+
+'hover', 'markerClicked', 'markerMoving' and 'markerMoved' events are
+sent during interaction with markers.
+
+'hover' is sent when the mouse cursor is over a marker.
+'markerClicker' is sent when the user click on a selectable marker.
+'markerMoving' and 'markerMoved' are sent when a draggable marker is moved.
+
+They provide the following keys:
+
+- 'event': 'hover', 'markerClicked', 'markerMoving' or 'markerMoved'
+- 'button': the mouse button that is pressed in 'left', 'middle', 'right'
+- 'draggable': True if the marker is draggable, False otherwise
+- 'label': The legend associated with the clicked image or curve
+- 'selectable': True if the marker is selectable, False otherwise
+- 'type': 'marker'
+- 'x' and 'y': The mouse position in data coordinates
+- 'xdata' and 'ydata': The marker position in data coordinates
+
+'markerClicked' and 'markerMoving' events have a 'xpixel' and a 'ypixel'
+additional keys, that provide the mouse position in pixels.
+
-This provides the plot API of :class:`silx.gui.plot.Plot.Plot` as a
-Qt widget.
+Image and curve events
+......................
+
+'curveClicked' and 'imageClicked' events are sent when a selectable curve
+or image is clicked.
+
+Both share the following keys:
+
+- 'event': 'curveClicked' or 'imageClicked'
+- 'button': the mouse button that was pressed in 'left', 'middle', 'right'
+- 'label': The legend associated with the clicked image or curve
+- 'type': The type of item in 'curve', 'image'
+- 'x' and 'y': The clicked position in data coordinates
+- 'xpixel' and 'ypixel': The clicked position in pixels
+
+'curveClicked' events have a 'xdata' and a 'ydata' additional keys, that
+provide the coordinates of the picked points of the curve.
+There can be more than one point of the curve being picked, and if a line of
+the curve is picked, only the first point of the line is included in the list.
+
+'imageClicked' have a 'col' and a 'row' additional keys, that provide
+the column and row index in the image array that was clicked.
+
+
+Limits changed events
+.....................
+
+'limitsChanged' events are sent when the limits of the plot are changed.
+This can results from user interaction or API calls.
+
+It provides the following keys:
+
+- 'event': 'limitsChanged'
+- 'source': id of the widget that emitted this event.
+- 'xdata': Range of X in graph coordinates: (xMin, xMax).
+- 'ydata': Range of Y in graph coordinates: (yMin, yMax).
+- 'y2data': Range of right axis in graph coordinates (y2Min, y2Max) or None.
+
+Plot state change events
+........................
+
+The following events are emitted when the plot is modified.
+They provide the new state:
+
+- 'setGraphCursor' event with a 'state' key (bool)
+- 'setGraphGrid' event with a 'which' key (str), see :meth:`setGraphGrid`
+- 'setKeepDataAspectRatio' event with a 'state' key (bool)
+
+A 'contentChanged' event is triggered when the content of the plot is updated.
+It provides the following keys:
+
+- 'action': The change of the plot: 'add' or 'remove'
+- 'kind': The kind of primitive changed: 'curve', 'image', 'item' or 'marker'
+- 'legend': The legend of the primitive changed.
+
+'activeCurveChanged' and 'activeImageChanged' events with the following keys:
+
+- 'legend': Name (str) of the current active item or None if no active item.
+- 'previous': Name (str) of the previous active item or None if no item was
+ active. It is the same as 'legend' if 'updated' == True
+- 'updated': (bool) True if active item name did not changed,
+ but active item data or style was updated.
+
+'interactiveModeChanged' event with a 'source' key identifying the object
+setting the interactive mode.
+
+'defaultColormapChanged' event is triggered when the default colormap of
+the plot is updated.
"""
+from __future__ import division
+
+
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "22/02/2016"
+__date__ = "30/08/2017"
+from collections import OrderedDict, namedtuple
+from contextlib import contextmanager
+import itertools
import logging
-from . import Plot
+import numpy
+
+from silx.utils.deprecation import deprecated
+# Import matplotlib backend here to init matplotlib our way
+from .backends.BackendMatplotlib import BackendMatplotlibQt
+
+from .Colormap import Colormap
+from . import Colors
+from . import PlotInteraction
+from . import PlotEvents
+from .LimitsHistory import LimitsHistory
+from . import _utils
+
+from . import items
from .. import qt
+from ._utils.panzoom import ViewConstraints
_logger = logging.getLogger(__name__)
-class PlotWidget(qt.QMainWindow, Plot.Plot):
+_COLORDICT = Colors.COLORDICT
+_COLORLIST = [_COLORDICT['black'],
+ _COLORDICT['blue'],
+ _COLORDICT['red'],
+ _COLORDICT['green'],
+ _COLORDICT['pink'],
+ _COLORDICT['yellow'],
+ _COLORDICT['brown'],
+ _COLORDICT['cyan'],
+ _COLORDICT['magenta'],
+ _COLORDICT['orange'],
+ _COLORDICT['violet'],
+ # _COLORDICT['bluegreen'],
+ _COLORDICT['grey'],
+ _COLORDICT['darkBlue'],
+ _COLORDICT['darkRed'],
+ _COLORDICT['darkGreen'],
+ _COLORDICT['darkCyan'],
+ _COLORDICT['darkMagenta'],
+ _COLORDICT['darkYellow'],
+ _COLORDICT['darkBrown']]
+
+
+"""
+Object returned when requesting the data range.
+"""
+_PlotDataRange = namedtuple('PlotDataRange',
+ ['x', 'y', 'yright'])
+
+
+class PlotWidget(qt.QMainWindow):
"""Qt Widget providing a 1D/2D plot.
This widget is a QMainWindow.
- It provides Qt signals for the Plot and add supports for panning
- with arrow keys.
+ This class implements the plot API initially provided in PyMca.
+
+ Supported backends:
- :param parent: The parent of this widget or None.
- :param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ - 'matplotlib' and 'mpl': Matplotlib with Qt.
+ - 'opengl' and 'gl': OpenGL backend (requires PyOpenGL and OpenGL >= 2.1)
+ - 'none': No backend, to run headless for testing purpose.
+
+ :param parent: The parent of this widget or None (default).
+ :param backend: The backend to use, in:
+ 'matplotlib' (default), 'mpl', 'opengl', 'gl', 'none'
+ or a :class:`BackendBase.BackendBase` class
:type backend: str or :class:`BackendBase.BackendBase`
"""
+ DEFAULT_BACKEND = 'matplotlib'
+ """Class attribute setting the default backend for all instances."""
+
+ colorList = _COLORLIST
+ colorDict = _COLORDICT
+
sigPlotSignal = qt.Signal(object)
"""Signal for all events of the plot.
The signal information is provided as a dict.
- See :class:`.Plot` for documentation of the content of the dict.
+ See :class:`PlotWidget` for documentation of the content of the dict.
"""
- sigSetYAxisInverted = qt.Signal(bool)
- """Signal emitted when Y axis orientation has changed"""
-
- sigSetXAxisLogarithmic = qt.Signal(bool)
- """Signal emitted when X axis scale has changed"""
-
- sigSetYAxisLogarithmic = qt.Signal(bool)
- """Signal emitted when Y axis scale has changed"""
-
- sigSetXAxisAutoScale = qt.Signal(bool)
- """Signal emitted when X axis autoscale has changed"""
-
- sigSetYAxisAutoScale = qt.Signal(bool)
- """Signal emitted when Y axis autoscale has changed"""
-
sigSetKeepDataAspectRatio = qt.Signal(bool)
"""Signal emitted when plot keep aspect ratio has changed"""
@@ -90,10 +279,13 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
sigSetPanWithArrowKeys = qt.Signal(bool)
"""Signal emitted when pan with arrow keys has changed"""
+ _sigAxesVisibilityChanged = qt.Signal(bool)
+ """Signal emitted when the axes visibility changed"""
+
sigContentChanged = qt.Signal(str, str, str)
"""Signal emitted when the content of the plot is changed.
- It provides 3 informations:
+ It provides the following information:
- action: The change of the plot: 'add' or 'remove'
- kind: The kind of primitive changed:
@@ -104,7 +296,7 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
sigActiveCurveChanged = qt.Signal(object, object)
"""Signal emitted when the active curve has changed.
- It provides 2 informations:
+ It provides the following information:
- previous: The legend of the previous active curve or None
- legend: The legend of the new active curve or None if no curve is active
@@ -113,7 +305,7 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
sigActiveImageChanged = qt.Signal(object, object)
"""Signal emitted when the active image has changed.
- It provides 2 informations:
+ It provides the following information:
- previous: The legend of the previous active image or None
- legend: The legend of the new active image or None if no image is active
@@ -122,7 +314,7 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
sigActiveScatterChanged = qt.Signal(object, object)
"""Signal emitted when the active Scatter has changed.
- It provides following information:
+ It provides the following information:
- previous: The legend of the previous active scatter or None
- legend: The legend of the new active image or None if no image is active
@@ -136,6 +328,10 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
def __init__(self, parent=None, backend=None,
legends=False, callback=None, **kw):
+ self._autoreplot = False
+ self._dirty = False
+ self._cursorInPlot = False
+ self.__muteActiveItemChanged = False
if kw:
_logger.warning(
@@ -146,42 +342,2137 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
_logger.warning('deprecated: __init__ callback argument')
self._panWithArrowKeys = True
+ self._viewConstrains = None
- qt.QMainWindow.__init__(self, parent)
+ super(PlotWidget, self).__init__(parent)
if parent is not None:
# behave as a widget
self.setWindowFlags(qt.Qt.Widget)
else:
self.setWindowTitle('PlotWidget')
- Plot.Plot.__init__(self, parent, backend=backend)
+ if backend is None:
+ backend = self.DEFAULT_BACKEND
+
+ if hasattr(backend, "__call__"):
+ self._backend = backend(self, parent)
+
+ elif hasattr(backend, "lower"):
+ lowerCaseString = backend.lower()
+ if lowerCaseString in ("matplotlib", "mpl"):
+ backendClass = BackendMatplotlibQt
+ elif lowerCaseString in ('gl', 'opengl'):
+ from .backends.BackendOpenGL import BackendOpenGL
+ backendClass = BackendOpenGL
+ elif lowerCaseString == 'none':
+ from .backends.BackendBase import BackendBase as backendClass
+ else:
+ raise ValueError("Backend not supported %s" % backend)
+ self._backend = backendClass(self, parent)
+
+ else:
+ raise ValueError("Backend not supported %s" % str(backend))
+
+ self.setCallback() # set _callback
+
+ # Items handling
+ self._content = OrderedDict()
+ self._contentToUpdate = [] # Used as an OrderedSet
+
+ self._dataRange = None
+
+ # line types
+ self._styleList = ['-', '--', '-.', ':']
+ self._colorIndex = 0
+ self._styleIndex = 0
+
+ self._activeCurveHandling = True
+ self._activeCurveColor = "#000000"
+ self._activeLegend = {'curve': None, 'image': None,
+ 'scatter': None}
+
+ # default properties
+ self._cursorConfiguration = None
+
+ self._xAxis = items.XAxis(self)
+ self._yAxis = items.YAxis(self)
+ self._yRightAxis = items.YRightAxis(self, self._yAxis)
+
+ self._grid = None
+ self._graphTitle = ''
+
+ self.setGraphTitle()
+ self.setGraphXLabel()
+ self.setGraphYLabel()
+ self.setGraphYLabel('', axis='right')
+
+ self.setDefaultColormap() # Init default colormap
+
+ self.setDefaultPlotPoints(False)
+ self.setDefaultPlotLines(True)
+
+ self._limitsHistory = LimitsHistory(self)
+
+ self._eventHandler = PlotInteraction.PlotInteraction(self)
+ self._eventHandler.setInteractiveMode('zoom', color=(0., 0., 0., 1.))
+
+ self._pressedButtons = [] # Currently pressed mouse buttons
+
+ self._defaultDataMargins = (0., 0., 0., 0.)
+
+ # Only activate autoreplot at the end
+ # This avoids errors when loaded in Qt designer
+ self._dirty = False
+ self._autoreplot = True
widget = self.getWidgetHandle()
if widget is not None:
self.setCentralWidget(widget)
else:
- _logger.warning("Plot backend does not support widget")
+ _logger.info("PlotWidget backend does not support widget")
self.setFocusPolicy(qt.Qt.StrongFocus)
self.setFocus(qt.Qt.OtherFocusReason)
+ # Set default limits
+ self.setGraphXLimits(0., 100.)
+ self.setGraphYLimits(0., 100., axis='right')
+ self.setGraphYLimits(0., 100., axis='left')
+
+ @staticmethod
+ def setDefaultBackend(backend):
+ """Set system wide default plot backend.
+
+ .. versionadded:: 0.6
+
+ :param backend: The backend to use, in:
+ 'matplotlib' (default), 'mpl', 'opengl', 'gl', 'none'
+ or a :class:`BackendBase.BackendBase` class
+ """
+ PlotWidget.DEFAULT_BACKEND = backend
+
+ def _getDirtyPlot(self):
+ """Return the plot dirty flag.
+
+ If False, the plot has not changed since last replot.
+ If True, the full plot need to be redrawn.
+ If 'overlay', only the overlay has changed since last replot.
+
+ It can be accessed by backend to check the dirty state.
+
+ :return: False, True, 'overlay'
+ """
+ return self._dirty
+
+ def _setDirtyPlot(self, overlayOnly=False):
+ """Mark the plot as needing redraw
+
+ :param bool overlayOnly: True to redraw only the overlay,
+ False to redraw everything
+ """
+ wasDirty = self._dirty
+
+ if not self._dirty and overlayOnly:
+ self._dirty = 'overlay'
+ else:
+ self._dirty = True
+
+ if self._autoreplot and not wasDirty:
+ self._backend.postRedisplay()
+
+ def _invalidateDataRange(self):
+ """
+ Notifies this PlotWidget instance that the range has changed
+ and will have to be recomputed.
+ """
+ self._dataRange = None
+
+ def _updateDataRange(self):
+ """
+ Recomputes the range of the data displayed on this PlotWidget.
+ """
+ xMin = yMinLeft = yMinRight = float('nan')
+ xMax = yMaxLeft = yMaxRight = float('nan')
+
+ for item in self._content.values():
+ if item.isVisible():
+ bounds = item.getBounds()
+ if bounds is not None:
+ xMin = numpy.nanmin([xMin, bounds[0]])
+ xMax = numpy.nanmax([xMax, bounds[1]])
+ # Take care of right axis
+ if (isinstance(item, items.YAxisMixIn) and
+ item.getYAxis() == 'right'):
+ yMinRight = numpy.nanmin([yMinRight, bounds[2]])
+ yMaxRight = numpy.nanmax([yMaxRight, bounds[3]])
+ else:
+ yMinLeft = numpy.nanmin([yMinLeft, bounds[2]])
+ yMaxLeft = numpy.nanmax([yMaxLeft, bounds[3]])
+
+ def lGetRange(x, y):
+ return None if numpy.isnan(x) and numpy.isnan(y) else (x, y)
+ xRange = lGetRange(xMin, xMax)
+ yLeftRange = lGetRange(yMinLeft, yMaxLeft)
+ yRightRange = lGetRange(yMinRight, yMaxRight)
+
+ self._dataRange = _PlotDataRange(x=xRange,
+ y=yLeftRange,
+ yright=yRightRange)
+
+ def getDataRange(self):
+ """
+ Returns this PlotWidget's data range.
+
+ :return: a namedtuple with the following members :
+ x, y (left y axis), yright. Each member is a tuple (min, max)
+ or None if no data is associated with the axis.
+ :rtype: namedtuple
+ """
+ if self._dataRange is None:
+ self._updateDataRange()
+ return self._dataRange
+
+ # Content management
+
+ @staticmethod
+ def _itemKey(item):
+ """Build the key of given :class:`Item` in the plot
+
+ :param Item item: The item to make the key from
+ :return: (legend, kind)
+ :rtype: (str, str)
+ """
+ if isinstance(item, items.Curve):
+ kind = 'curve'
+ elif isinstance(item, items.ImageBase):
+ kind = 'image'
+ elif isinstance(item, items.Scatter):
+ kind = 'scatter'
+ elif isinstance(item, (items.Marker,
+ items.XMarker, items.YMarker)):
+ kind = 'marker'
+ elif isinstance(item, items.Shape):
+ kind = 'item'
+ elif isinstance(item, items.Histogram):
+ kind = 'histogram'
+ else:
+ raise ValueError('Unsupported item type %s' % type(item))
+
+ return item.getLegend(), kind
+
+ def _add(self, item):
+ """Add the given :class:`Item` to the plot.
+
+ :param Item item: The item to append to the plot content
+ """
+ key = self._itemKey(item)
+ if key in self._content:
+ raise RuntimeError('Item already in the plot')
+
+ # Add item to plot
+ self._content[key] = item
+ item._setPlot(self)
+ if item.isVisible():
+ self._itemRequiresUpdate(item)
+ if isinstance(item, (items.Curve, items.ImageBase)):
+ self._invalidateDataRange() # TODO handle this automatically
+
+ self._notifyContentChanged(item)
+
+ def _notifyContentChanged(self, item):
+ legend, kind = self._itemKey(item)
+ self.notify('contentChanged', action='add', kind=kind, legend=legend)
+
+ def _remove(self, item):
+ """Remove the given :class:`Item` from the plot.
+
+ :param Item item: The item to remove from the plot content
+ """
+ key = self._itemKey(item)
+ if key not in self._content:
+ raise RuntimeError('Item not in the plot')
+
+ legend, kind = key
+
+ if kind in self._ACTIVE_ITEM_KINDS:
+ if self._getActiveItem(kind) == item:
+ # Reset active item
+ self._setActiveItem(kind, None)
+
+ # Remove item from plot
+ self._content.pop(key)
+ if item in self._contentToUpdate:
+ self._contentToUpdate.remove(item)
+ if item.isVisible():
+ self._setDirtyPlot(overlayOnly=item.isOverlay())
+ if item.getBounds() is not None:
+ self._invalidateDataRange()
+ item._removeBackendRenderer(self._backend)
+ item._setPlot(None)
+
+ if (kind == 'curve' and not self.getAllCurves(just_legend=True,
+ withhidden=True)):
+ self._colorIndex = 0
+ self._styleIndex = 0
+
+ self.notify('contentChanged', action='remove',
+ kind=kind, legend=legend)
+
+ def _itemRequiresUpdate(self, item):
+ """Called by items in the plot for asynchronous update
+
+ :param Item item: The item that required update
+ """
+ assert item.getPlot() == self
+ # Pu item at the end of the list
+ if item in self._contentToUpdate:
+ self._contentToUpdate.remove(item)
+ self._contentToUpdate.append(item)
+ self._setDirtyPlot(overlayOnly=item.isOverlay())
+
+ @contextmanager
+ def _muteActiveItemChangedSignal(self):
+ self.__muteActiveItemChanged = True
+ yield
+ self.__muteActiveItemChanged = False
+
+ # Add
+
+ # add * input arguments management:
+ # If an arg is set, then use it.
+ # Else:
+ # If a curve with the same legend exists, then use its arg value
+ # Else, use a default value.
+ # Store used value.
+ # This value is used when curve is updated either internally or by user.
+
+ def addCurve(self, x, y, legend=None, info=None,
+ replace=False, replot=None,
+ color=None, symbol=None,
+ linewidth=None, linestyle=None,
+ xlabel=None, ylabel=None, yaxis=None,
+ xerror=None, yerror=None, z=None, selectable=None,
+ fill=None, resetzoom=True,
+ histogram=None, copy=True, **kw):
+ """Add a 1D curve given by x an y to the graph.
+
+ Curves are uniquely identified by their legend.
+ To add multiple curves, call :meth:`addCurve` multiple times with
+ different legend argument.
+ To replace an existing curve, call :meth:`addCurve` with the
+ existing curve legend.
+ If you want to display the curve values as an histogram see the
+ histogram parameter or :meth:`addHistogram`.
+
+ When curve parameters are not provided, if a curve with the
+ same legend is displayed in the plot, its parameters are used.
+
+ :param numpy.ndarray x: The data corresponding to the x coordinates.
+ If you attempt to plot an histogram you can set edges values in x.
+ In this case len(x) = len(y) + 1
+ :param numpy.ndarray y: The data corresponding to the y coordinates
+ :param str legend: The legend to be associated to the curve (or None)
+ :param info: User-defined information associated to the curve
+ :param bool replace: True (the default) to delete already existing
+ curves
+ :param color: color(s) to be used
+ :type color: str ("#RRGGBB") or (npoints, 4) unsigned byte array or
+ one of the predefined color names defined in Colors.py
+ :param str symbol: Symbol to be drawn at each (x, y) position::
+
+ - 'o' circle
+ - '.' point
+ - ',' pixel
+ - '+' cross
+ - 'x' x-cross
+ - 'd' diamond
+ - 's' square
+ - None (the default) to use default symbol
+
+ :param float linewidth: The width of the curve in pixels (Default: 1).
+ :param str linestyle: Type of line::
+
+ - ' ' no line
+ - '-' solid line
+ - '--' dashed line
+ - '-.' dash-dot line
+ - ':' dotted line
+ - None (the default) to use default line style
+
+ :param str xlabel: Label to show on the X axis when the curve is active
+ or None to keep default axis label.
+ :param str ylabel: Label to show on the Y axis when the curve is active
+ or None to keep default axis label.
+ :param str yaxis: The Y axis this curve is attached to.
+ Either 'left' (the default) or 'right'
+ :param xerror: Values with the uncertainties on the x values
+ :type xerror: A float, or a numpy.ndarray of float32.
+ If it is an array, it can either be a 1D array of
+ same length as the data or a 2D array with 2 rows
+ of same length as the data: row 0 for positive errors,
+ row 1 for negative errors.
+ :param yerror: Values with the uncertainties on the y values
+ :type yerror: A float, or a numpy.ndarray of float32. See xerror.
+ :param int z: Layer on which to draw the curve (default: 1)
+ This allows to control the overlay.
+ :param bool selectable: Indicate if the curve can be selected.
+ (Default: True)
+ :param bool fill: True to fill the curve, False otherwise (default).
+ :param bool resetzoom: True (the default) to reset the zoom.
+ :param str histogram: if not None then the curve will be draw as an
+ histogram. The step for each values of the curve can be set to the
+ left, center or right of the original x curve values.
+ If histogram is not None and len(x) == len(y)+1 then x is directly
+ take as edges of the histogram.
+ Type of histogram::
+
+ - None (default)
+ - 'left'
+ - 'right'
+ - 'center'
+ :param bool copy: True make a copy of the data (default),
+ False to use provided arrays.
+ :returns: The key string identify this curve
+ """
+ # Deprecation warnings
+ if replot is not None:
+ _logger.warning(
+ 'addCurve deprecated replot argument, use resetzoom instead')
+ resetzoom = replot and resetzoom
+
+ if kw:
+ _logger.warning('addCurve: deprecated extra arguments')
+
+ # This is an histogram, use addHistogram
+ if histogram is not None:
+ histoLegend = self.addHistogram(histogram=y,
+ edges=x,
+ legend=legend,
+ color=color,
+ fill=fill,
+ align=histogram,
+ copy=copy)
+ histo = self.getHistogram(histoLegend)
+
+ histo.setInfo(info)
+ if linewidth is not None:
+ histo.setLineWidth(linewidth)
+ if linestyle is not None:
+ histo.setLineStyle(linestyle)
+ if xlabel is not None:
+ _logger.warning(
+ 'addCurve: Histogram does not support xlabel argument')
+ if ylabel is not None:
+ _logger.warning(
+ 'addCurve: Histogram does not support ylabel argument')
+ if yaxis is not None:
+ histo.setYAxis(yaxis)
+ if z is not None:
+ histo.setZValue(z)
+ if selectable is not None:
+ _logger.warning(
+ 'addCurve: Histogram does not support selectable argument')
+
+ return
+
+ legend = 'Unnamed curve 1.1' if legend is None else str(legend)
+
+ # Check if curve was previously active
+ wasActive = self.getActiveCurve(just_legend=True) == legend
+
+ # Create/Update curve object
+ curve = self.getCurve(legend)
+ mustBeAdded = curve is None
+ if curve is None:
+ # No previous curve, create a default one and add it to the plot
+ curve = items.Curve() if histogram is None else items.Histogram()
+ curve._setLegend(legend)
+ # Set default color, linestyle and symbol
+ default_color, default_linestyle = self._getColorAndStyle()
+ curve.setColor(default_color)
+ curve.setLineStyle(default_linestyle)
+ curve.setSymbol(self._defaultPlotPoints)
+
+ # Do not emit sigActiveCurveChanged,
+ # it will be sent once with _setActiveItem
+ with self._muteActiveItemChangedSignal():
+ # Override previous/default values with provided ones
+ curve.setInfo(info)
+ if color is not None:
+ curve.setColor(color)
+ if symbol is not None:
+ curve.setSymbol(symbol)
+ if linewidth is not None:
+ curve.setLineWidth(linewidth)
+ if linestyle is not None:
+ curve.setLineStyle(linestyle)
+ if xlabel is not None:
+ curve._setXLabel(xlabel)
+ if ylabel is not None:
+ curve._setYLabel(ylabel)
+ if yaxis is not None:
+ curve.setYAxis(yaxis)
+ if z is not None:
+ curve.setZValue(z)
+ if selectable is not None:
+ curve._setSelectable(selectable)
+ if fill is not None:
+ curve.setFill(fill)
+
+ # Set curve data
+ # If errors not provided, reuse previous ones
+ # TODO: Issue if size of data change but not that of errors
+ if xerror is None:
+ xerror = curve.getXErrorData(copy=False)
+ if yerror is None:
+ yerror = curve.getYErrorData(copy=False)
+
+ curve.setData(x, y, xerror, yerror, copy=copy)
+
+ if replace: # Then remove all other curves
+ for c in self.getAllCurves(withhidden=True):
+ if c is not curve:
+ self._remove(c)
+
+ if mustBeAdded:
+ self._add(curve)
+ else:
+ self._notifyContentChanged(curve)
+
+ if wasActive:
+ self.setActiveCurve(curve.getLegend())
+
+ if resetzoom:
+ # We ask for a zoom reset in order to handle the plot scaling
+ # if the user does not want that, autoscale of the different
+ # axes has to be set to off.
+ self.resetZoom()
+
+ return legend
+
+ def addHistogram(self,
+ histogram,
+ edges,
+ legend=None,
+ color=None,
+ fill=None,
+ align='center',
+ resetzoom=True,
+ copy=True):
+ """Add an histogram to the graph.
+
+ This is NOT computing the histogram, this method takes as parameter
+ already computed histogram values.
+
+ Histogram are uniquely identified by their legend.
+ To add multiple histograms, call :meth:`addHistogram` multiple times
+ with different legend argument.
+
+ When histogram parameters are not provided, if an histogram with the
+ same legend is displayed in the plot, its parameters are used.
+
+ :param numpy.ndarray histogram: The values of the histogram.
+ :param numpy.ndarray edges:
+ The bin edges of the histogram.
+ If histogram and edges have the same length, the bin edges
+ are computed according to the align parameter.
+ :param str legend:
+ The legend to be associated to the histogram (or None)
+ :param color: color to be used
+ :type color: str ("#RRGGBB") or RGB unsigned byte array or
+ one of the predefined color names defined in Colors.py
+ :param bool fill: True to fill the curve, False otherwise (default).
+ :param str align:
+ In case histogram values and edges have the same length N,
+ the N+1 bin edges are computed according to the alignment in:
+ 'center' (default), 'left', 'right'.
+ :param bool resetzoom: True (the default) to reset the zoom.
+ :param bool copy: True make a copy of the data (default),
+ False to use provided arrays.
+ :returns: The key string identify this histogram
+ """
+ legend = 'Unnamed histogram' if legend is None else str(legend)
+
+ # Create/Update histogram object
+ histo = self.getHistogram(legend)
+ mustBeAdded = histo is None
+ if histo is None:
+ # No previous histogram, create a default one and
+ # add it to the plot
+ histo = items.Histogram()
+ histo._setLegend(legend)
+ histo.setColor(self._getColorAndStyle()[0])
+
+ # Override previous/default values with provided ones
+ if color is not None:
+ histo.setColor(color)
+ if fill is not None:
+ histo.setFill(fill)
+
+ # Set histogram data
+ histo.setData(histogram, edges, align=align, copy=copy)
+
+ if mustBeAdded:
+ self._add(histo)
+ else:
+ self._notifyContentChanged(histo)
+
+ if resetzoom:
+ # We ask for a zoom reset in order to handle the plot scaling
+ # if the user does not want that, autoscale of the different
+ # axes has to be set to off.
+ self.resetZoom()
+
+ return legend
+
+ def addImage(self, data, legend=None, info=None,
+ replace=True, replot=None,
+ xScale=None, yScale=None, z=None,
+ selectable=None, draggable=None,
+ colormap=None, pixmap=None,
+ xlabel=None, ylabel=None,
+ origin=None, scale=None,
+ resetzoom=True, copy=True, **kw):
+ """Add a 2D dataset or an image to the plot.
+
+ It displays either an array of data using a colormap or a RGB(A) image.
+
+ Images are uniquely identified by their legend.
+ To add multiple images, call :meth:`addImage` multiple times with
+ different legend argument.
+ To replace/update an existing image, call :meth:`addImage` with the
+ existing image legend.
+
+ When image parameters are not provided, if an image with the
+ same legend is displayed in the plot, its parameters are used.
+
+ :param numpy.ndarray data:
+ (nrows, ncolumns) data or
+ (nrows, ncolumns, RGBA) ubyte array
+ Note: boolean values are converted to int8.
+ :param str legend: The legend to be associated to the image (or None)
+ :param info: User-defined information associated to the image
+ :param bool replace: True (default) to delete already existing images
+ :param int z: Layer on which to draw the image (default: 0)
+ This allows to control the overlay.
+ :param bool selectable: Indicate if the image can be selected.
+ (default: False)
+ :param bool draggable: Indicate if the image can be moved.
+ (default: False)
+ :param colormap: Description of the :class:`.Colormap` to use
+ (or None).
+ This is ignored if data is a RGB(A) image.
+ :type colormap: Colormap or dict (old API )
+ :param pixmap: Pixmap representation of the data (if any)
+ :type pixmap: (nrows, ncolumns, RGBA) ubyte array or None (default)
+ :param str xlabel: X axis label to show when this curve is active,
+ or None to keep default axis label.
+ :param str ylabel: Y axis label to show when this curve is active,
+ or None to keep default axis label.
+ :param origin: (origin X, origin Y) of the data.
+ It is possible to pass a single float if both
+ coordinates are equal.
+ Default: (0., 0.)
+ :type origin: float or 2-tuple of float
+ :param scale: (scale X, scale Y) of the data.
+ It is possible to pass a single float if both
+ coordinates are equal.
+ Default: (1., 1.)
+ :type scale: float or 2-tuple of float
+ :param bool resetzoom: True (the default) to reset the zoom.
+ :param bool copy: True make a copy of the data (default),
+ False to use provided arrays.
+ :returns: The key string identify this image
+ """
+ # Deprecation warnings
+ if xScale is not None or yScale is not None:
+ _logger.warning(
+ 'addImage deprecated xScale and yScale arguments,'
+ 'use origin, scale arguments instead.')
+ if origin is None and scale is None:
+ origin = xScale[0], yScale[0]
+ scale = xScale[1], yScale[1]
+ else:
+ _logger.warning(
+ 'addCurve: xScale, yScale and origin, scale arguments'
+ ' are conflicting. xScale and yScale are ignored.'
+ ' Use only origin, scale arguments.')
+
+ if replot is not None:
+ _logger.warning(
+ 'addImage deprecated replot argument, use resetzoom instead')
+ resetzoom = replot and resetzoom
+
+ if kw:
+ _logger.warning('addImage: deprecated extra arguments')
+
+ legend = "Unnamed Image 1.1" if legend is None else str(legend)
+
+ # Check if image was previously active
+ wasActive = self.getActiveImage(just_legend=True) == legend
+
+ data = numpy.array(data, copy=False)
+ assert data.ndim in (2, 3)
+
+ image = self.getImage(legend)
+ if image is not None and image.getData(copy=False).ndim != data.ndim:
+ # Update a data image with RGBA image or the other way around:
+ # Remove previous image
+ # In this case, we don't retrieve defaults from the previous image
+ self._remove(image)
+ image = None
+
+ mustBeAdded = image is None
+ if image is None:
+ # No previous image, create a default one and add it to the plot
+ if data.ndim == 2:
+ image = items.ImageData()
+ image.setColormap(self.getDefaultColormap())
+ else:
+ image = items.ImageRgba()
+ image._setLegend(legend)
+
+ # Do not emit sigActiveImageChanged,
+ # it will be sent once with _setActiveItem
+ with self._muteActiveItemChangedSignal():
+ # Override previous/default values with provided ones
+ image.setInfo(info)
+ if origin is not None:
+ image.setOrigin(origin)
+ if scale is not None:
+ image.setScale(scale)
+ if z is not None:
+ image.setZValue(z)
+ if selectable is not None:
+ image._setSelectable(selectable)
+ if draggable is not None:
+ image._setDraggable(draggable)
+ if colormap is not None and isinstance(image, items.ColormapMixIn):
+ if isinstance(colormap, dict):
+ image.setColormap(Colormap._fromDict(colormap))
+ else:
+ assert isinstance(colormap, Colormap)
+ image.setColormap(colormap)
+ if xlabel is not None:
+ image._setXLabel(xlabel)
+ if ylabel is not None:
+ image._setYLabel(ylabel)
+
+ if data.ndim == 2:
+ image.setData(data, alternative=pixmap, copy=copy)
+ else: # RGB(A) image
+ if pixmap is not None:
+ _logger.warning(
+ 'addImage: pixmap argument ignored when data is RGB(A)')
+ image.setData(data, copy=copy)
+
+ if replace:
+ for img in self.getAllImages():
+ if img is not image:
+ self._remove(img)
+
+ if mustBeAdded:
+ self._add(image)
+ else:
+ self._notifyContentChanged(image)
+
+ if len(self.getAllImages()) == 1 or wasActive:
+ self.setActiveImage(legend)
+
+ if resetzoom:
+ # We ask for a zoom reset in order to handle the plot scaling
+ # if the user does not want that, autoscale of the different
+ # axes has to be set to off.
+ self.resetZoom()
+
+ return legend
+
+ def addScatter(self, x, y, value, legend=None, colormap=None,
+ info=None, symbol=None, xerror=None, yerror=None,
+ z=None, copy=True):
+ """Add a (x, y, value) scatter to the graph.
+
+ Scatters are uniquely identified by their legend.
+ To add multiple scatters, call :meth:`addScatter` multiple times with
+ different legend argument.
+ To replace/update an existing scatter, call :meth:`addScatter` with the
+ existing scatter legend.
+
+ When scatter parameters are not provided, if a scatter with the
+ same legend is displayed in the plot, its parameters are used.
+
+ :param numpy.ndarray x: The data corresponding to the x coordinates.
+ :param numpy.ndarray y: The data corresponding to the y coordinates
+ :param numpy.ndarray value: The data value associated with each point
+ :param str legend: The legend to be associated to the scatter (or None)
+ :param Colormap colormap: The :class:`.Colormap`. to be used for the
+ scatter (or None)
+ :param info: User-defined information associated to the curve
+ :param str symbol: Symbol to be drawn at each (x, y) position::
+
+ - 'o' circle
+ - '.' point
+ - ',' pixel
+ - '+' cross
+ - 'x' x-cross
+ - 'd' diamond
+ - 's' square
+ - None (the default) to use default symbol
+
+ :param xerror: Values with the uncertainties on the x values
+ :type xerror: A float, or a numpy.ndarray of float32.
+ If it is an array, it can either be a 1D array of
+ same length as the data or a 2D array with 2 rows
+ of same length as the data: row 0 for positive errors,
+ row 1 for negative errors.
+ :param yerror: Values with the uncertainties on the y values
+ :type yerror: A float, or a numpy.ndarray of float32. See xerror.
+ :param int z: Layer on which to draw the scatter (default: 1)
+ This allows to control the overlay.
+
+ :param bool copy: True make a copy of the data (default),
+ False to use provided arrays.
+ :returns: The key string identify this scatter
+ """
+ legend = 'Unnamed scatter 1.1' if legend is None else str(legend)
+
+ # Check if scatter was previously active
+ wasActive = self._getActiveItem(kind='scatter',
+ just_legend=True) == legend
+
+ # Create/Update curve object
+ scatter = self._getItem(kind='scatter', legend=legend)
+ mustBeAdded = scatter is None
+ if scatter is None:
+ # No previous scatter, create a default one and add it to the plot
+ scatter = items.Scatter()
+ scatter._setLegend(legend)
+ scatter.setColormap(self.getDefaultColormap())
+
+ # Do not emit sigActiveScatterChanged,
+ # it will be sent once with _setActiveItem
+ with self._muteActiveItemChangedSignal():
+ # Override previous/default values with provided ones
+ scatter.setInfo(info)
+ if symbol is not None:
+ scatter.setSymbol(symbol)
+ if z is not None:
+ scatter.setZValue(z)
+ if colormap is not None:
+ if isinstance(colormap, dict):
+ scatter.setColormap(Colormap._fromDict(colormap))
+ else:
+ assert isinstance(colormap, Colormap)
+ scatter.setColormap(colormap)
+
+ # Set scatter data
+ # If errors not provided, reuse previous ones
+ if xerror is None:
+ xerror = scatter.getXErrorData(copy=False)
+ if xerror is not None and len(xerror) != len(x):
+ xerror = None
+ if yerror is None:
+ yerror = scatter.getYErrorData(copy=False)
+ if yerror is not None and len(yerror) != len(y):
+ yerror = None
+
+ scatter.setData(x, y, value, xerror, yerror, copy=copy)
+
+ if mustBeAdded:
+ self._add(scatter)
+ else:
+ self._notifyContentChanged(scatter)
+
+ if len(self._getItems(kind="scatter")) == 1 or wasActive:
+ self._setActiveItem('scatter', scatter.getLegend())
+
+ return legend
+
+ def addItem(self, xdata, ydata, legend=None, info=None,
+ replace=False,
+ shape="polygon", color='black', fill=True,
+ overlay=False, z=None, **kw):
+ """Add an item (i.e. a shape) to the plot.
+
+ Items are uniquely identified by their legend.
+ To add multiple items, call :meth:`addItem` multiple times with
+ different legend argument.
+ To replace/update an existing item, call :meth:`addItem` with the
+ existing item legend.
+
+ :param numpy.ndarray xdata: The X coords of the points of the shape
+ :param numpy.ndarray ydata: The Y coords of the points of the shape
+ :param str legend: The legend to be associated to the item
+ :param info: User-defined information associated to the item
+ :param bool replace: True (default) to delete already existing images
+ :param str shape: Type of item to be drawn in
+ hline, polygon (the default), rectangle, vline,
+ polylines
+ :param str color: Color of the item, e.g., 'blue', 'b', '#FF0000'
+ (Default: 'black')
+ :param bool fill: True (the default) to fill the shape
+ :param bool overlay: True if item is an overlay (Default: False).
+ This allows for rendering optimization if this
+ item is changed often.
+ :param int z: Layer on which to draw the item (default: 2)
+ :returns: The key string identify this item
+ """
+ # expected to receive the same parameters as the signal
+
+ if kw:
+ _logger.warning('addItem deprecated parameters: %s', str(kw))
+
+ legend = "Unnamed Item 1.1" if legend is None else str(legend)
+
+ z = int(z) if z is not None else 2
+
+ if replace:
+ self.remove(kind='item')
+ else:
+ self.remove(legend, kind='item')
+
+ item = items.Shape(shape)
+ item._setLegend(legend)
+ item.setInfo(info)
+ item.setColor(color)
+ item.setFill(fill)
+ item.setOverlay(overlay)
+ item.setZValue(z)
+ item.setPoints(numpy.array((xdata, ydata)).T)
+
+ self._add(item)
+
+ return legend
+
+ def addXMarker(self, x, legend=None,
+ text=None,
+ color=None,
+ selectable=False,
+ draggable=False,
+ constraint=None,
+ **kw):
+ """Add a vertical line marker to the plot.
+
+ Markers are uniquely identified by their legend.
+ As opposed to curves, images and items, two calls to
+ :meth:`addXMarker` without legend argument adds two markers with
+ different identifying legends.
+
+ :param float x: Position of the marker on the X axis in data
+ coordinates
+ :param str legend: Legend associated to the marker to identify it
+ :param str text: Text to display on the marker.
+ :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
+ (Default: 'black')
+ :param bool selectable: Indicate if the marker can be selected.
+ (default: False)
+ :param bool draggable: Indicate if the marker can be moved.
+ (default: False)
+ :param constraint: A function filtering marker displacement by
+ dragging operations or None for no filter.
+ This function is called each time a marker is
+ moved.
+ This parameter is only used if draggable is True.
+ :type constraint: None or a callable that takes the coordinates of
+ the current cursor position in the plot as input
+ and that returns the filtered coordinates.
+ :return: The key string identify this marker
+ """
+ if kw:
+ _logger.warning(
+ 'addXMarker deprecated extra parameters: %s', str(kw))
+
+ return self._addMarker(x=x, y=None, legend=legend,
+ text=text, color=color,
+ selectable=selectable, draggable=draggable,
+ symbol=None, constraint=constraint)
+
+ def addYMarker(self, y,
+ legend=None,
+ text=None,
+ color=None,
+ selectable=False,
+ draggable=False,
+ constraint=None,
+ **kw):
+ """Add a horizontal line marker to the plot.
+
+ Markers are uniquely identified by their legend.
+ As opposed to curves, images and items, two calls to
+ :meth:`addYMarker` without legend argument adds two markers with
+ different identifying legends.
+
+ :param float y: Position of the marker on the Y axis in data
+ coordinates
+ :param str legend: Legend associated to the marker to identify it
+ :param str text: Text to display next to the marker.
+ :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
+ (Default: 'black')
+ :param bool selectable: Indicate if the marker can be selected.
+ (default: False)
+ :param bool draggable: Indicate if the marker can be moved.
+ (default: False)
+ :param constraint: A function filtering marker displacement by
+ dragging operations or None for no filter.
+ This function is called each time a marker is
+ moved.
+ This parameter is only used if draggable is True.
+ :type constraint: None or a callable that takes the coordinates of
+ the current cursor position in the plot as input
+ and that returns the filtered coordinates.
+ :return: The key string identify this marker
+ """
+ if kw:
+ _logger.warning(
+ 'addYMarker deprecated extra parameters: %s', str(kw))
+
+ return self._addMarker(x=None, y=y, legend=legend,
+ text=text, color=color,
+ selectable=selectable, draggable=draggable,
+ symbol=None, constraint=constraint)
+
+ def addMarker(self, x, y, legend=None,
+ text=None,
+ color=None,
+ selectable=False,
+ draggable=False,
+ symbol='+',
+ constraint=None,
+ **kw):
+ """Add a point marker to the plot.
+
+ Markers are uniquely identified by their legend.
+ As opposed to curves, images and items, two calls to
+ :meth:`addMarker` without legend argument adds two markers with
+ different identifying legends.
+
+ :param float x: Position of the marker on the X axis in data
+ coordinates
+ :param float y: Position of the marker on the Y axis in data
+ coordinates
+ :param str legend: Legend associated to the marker to identify it
+ :param str text: Text to display next to the marker
+ :param str color: Color of the marker, e.g., 'blue', 'b', '#FF0000'
+ (Default: 'black')
+ :param bool selectable: Indicate if the marker can be selected.
+ (default: False)
+ :param bool draggable: Indicate if the marker can be moved.
+ (default: False)
+ :param str symbol: Symbol representing the marker in::
+
+ - 'o' circle
+ - '.' point
+ - ',' pixel
+ - '+' cross (the default)
+ - 'x' x-cross
+ - 'd' diamond
+ - 's' square
+
+ :param constraint: A function filtering marker displacement by
+ dragging operations or None for no filter.
+ This function is called each time a marker is
+ moved.
+ This parameter is only used if draggable is True.
+ :type constraint: None or a callable that takes the coordinates of
+ the current cursor position in the plot as input
+ and that returns the filtered coordinates.
+ :return: The key string identify this marker
+ """
+ if kw:
+ _logger.warning(
+ 'addMarker deprecated extra parameters: %s', str(kw))
+
+ if x is None:
+ xmin, xmax = self._xAxis.getLimits()
+ x = 0.5 * (xmax + xmin)
+
+ if y is None:
+ ymin, ymax = self._yAxis.getLimits()
+ y = 0.5 * (ymax + ymin)
+
+ return self._addMarker(x=x, y=y, legend=legend,
+ text=text, color=color,
+ selectable=selectable, draggable=draggable,
+ symbol=symbol, constraint=constraint)
+
+ def _addMarker(self, x, y, legend,
+ text, color,
+ selectable, draggable,
+ symbol, constraint):
+ """Common method for adding point, vline and hline marker.
+
+ See :meth:`addMarker` for argument documentation.
+ """
+ assert (x, y) != (None, None)
+
+ if legend is None: # Find an unused legend
+ markerLegends = self._getAllMarkers(just_legend=True)
+ for index in itertools.count():
+ legend = "Unnamed Marker %d" % index
+ if legend not in markerLegends:
+ break # Keep this legend
+ legend = str(legend)
+
+ if x is None:
+ markerClass = items.YMarker
+ elif y is None:
+ markerClass = items.XMarker
+ else:
+ markerClass = items.Marker
+
+ # Create/Update marker object
+ marker = self._getMarker(legend)
+ if marker is not None and not isinstance(marker, markerClass):
+ _logger.warning('Adding marker with same legend'
+ ' but different type replaces it')
+ self._remove(marker)
+ marker = None
+
+ mustBeAdded = marker is None
+ if marker is None:
+ # No previous marker, create one
+ marker = markerClass()
+ marker._setLegend(legend)
+
+ if text is not None:
+ marker.setText(text)
+ if color is not None:
+ marker.setColor(color)
+ if selectable is not None:
+ marker._setSelectable(selectable)
+ if draggable is not None:
+ marker._setDraggable(draggable)
+ if symbol is not None:
+ marker.setSymbol(symbol)
+
+ # TODO to improve, but this ensure constraint is applied
+ marker.setPosition(x, y)
+ if constraint is not None:
+ marker._setConstraint(constraint)
+ marker.setPosition(x, y)
+
+ if mustBeAdded:
+ self._add(marker)
+ else:
+ self._notifyContentChanged(marker)
+
+ return legend
+
+ # Hide
+
+ def isCurveHidden(self, legend):
+ """Returns True if the curve associated to legend is hidden, else False
+
+ :param str legend: The legend key identifying the curve
+ :return: True if the associated curve is hidden, False otherwise
+ """
+ curve = self._getItem('curve', legend)
+ return curve is not None and not curve.isVisible()
+
+ def hideCurve(self, legend, flag=True, replot=None):
+ """Show/Hide the curve associated to legend.
+
+ Even when hidden, the curve is kept in the list of curves.
+
+ :param str legend: The legend associated to the curve to be hidden
+ :param bool flag: True (default) to hide the curve, False to show it
+ """
+ if replot is not None:
+ _logger.warning('hideCurve deprecated replot parameter')
+
+ curve = self._getItem('curve', legend)
+ if curve is None:
+ _logger.warning('Curve not in plot: %s', legend)
+ return
+
+ isVisible = not flag
+ if isVisible != curve.isVisible():
+ curve.setVisible(isVisible)
+
+ # Remove
+
+ ITEM_KINDS = 'curve', 'image', 'scatter', 'item', 'marker', 'histogram'
+ """List of supported kind of items in the plot."""
+
+ _ACTIVE_ITEM_KINDS = 'curve', 'scatter', 'image'
+ """List of item's kind which have a active item."""
+
+ def remove(self, legend=None, kind=ITEM_KINDS):
+ """Remove one or all element(s) of the given legend and kind.
+
+ Examples:
+
+ - ``remove()`` clears the plot
+ - ``remove(kind='curve')`` removes all curves from the plot
+ - ``remove('myCurve', kind='curve')`` removes the curve with
+ legend 'myCurve' from the plot.
+ - ``remove('myImage, kind='image')`` removes the image with
+ legend 'myImage' from the plot.
+ - ``remove('myImage')`` removes elements (for instance curve, image,
+ item and marker) with legend 'myImage'.
+
+ :param str legend: The legend associated to the element to remove,
+ or None to remove
+ :param kind: The kind of elements to remove from the plot.
+ See :attr:`ITEM_KINDS`.
+ By default, it removes all kind of elements.
+ :type kind: str or tuple of str to specify multiple kinds.
+ """
+ if kind is 'all': # Replace all by tuple of all kinds
+ kind = self.ITEM_KINDS
+
+ if kind in self.ITEM_KINDS: # Kind is a str, make it a tuple
+ kind = (kind,)
+
+ for aKind in kind:
+ assert aKind in self.ITEM_KINDS
+
+ if legend is None: # This is a clear
+ # Clear each given kind
+ for aKind in kind:
+ for legend in self._getItems(
+ kind=aKind, just_legend=True, withhidden=True):
+ self.remove(legend=legend, kind=aKind)
+
+ else: # This is removing a single element
+ # Remove each given kind
+ for aKind in kind:
+ item = self._getItem(aKind, legend)
+ if item is not None:
+ self._remove(item)
+
+ def removeCurve(self, legend):
+ """Remove the curve associated to legend from the graph.
+
+ :param str legend: The legend associated to the curve to be deleted
+ """
+ if legend is None:
+ return
+ self.remove(legend, kind='curve')
+
+ def removeImage(self, legend):
+ """Remove the image associated to legend from the graph.
+
+ :param str legend: The legend associated to the image to be deleted
+ """
+ if legend is None:
+ return
+ self.remove(legend, kind='image')
+
+ def removeItem(self, legend):
+ """Remove the item associated to legend from the graph.
+
+ :param str legend: The legend associated to the item to be deleted
+ """
+ if legend is None:
+ return
+ self.remove(legend, kind='item')
+
+ def removeMarker(self, legend):
+ """Remove the marker associated to legend from the graph.
+
+ :param str legend: The legend associated to the marker to be deleted
+ """
+ if legend is None:
+ return
+ self.remove(legend, kind='marker')
+
+ # Clear
+
+ def clear(self):
+ """Remove everything from the plot."""
+ self.remove()
+
+ def clearCurves(self):
+ """Remove all the curves from the plot."""
+ self.remove(kind='curve')
+
+ def clearImages(self):
+ """Remove all the images from the plot."""
+ self.remove(kind='image')
+
+ def clearItems(self):
+ """Remove all the items from the plot. """
+ self.remove(kind='item')
+
+ def clearMarkers(self):
+ """Remove all the markers from the plot."""
+ self.remove(kind='marker')
+
+ # Interaction
+
+ def getGraphCursor(self):
+ """Returns the state of the crosshair cursor.
+
+ See :meth:`setGraphCursor`.
+
+ :return: None if the crosshair cursor is not active,
+ else a tuple (color, linewidth, linestyle).
+ """
+ return self._cursorConfiguration
+
+ def setGraphCursor(self, flag=False, color='black',
+ linewidth=1, linestyle='-'):
+ """Toggle the display of a crosshair cursor and set its attributes.
+
+ :param bool flag: Toggle the display of a crosshair cursor.
+ The crosshair cursor is hidden by default.
+ :param color: The color to use for the crosshair.
+ :type color: A string (either a predefined color name in Colors.py
+ or "#RRGGBB")) or a 4 columns unsigned byte array
+ (Default: black).
+ :param int linewidth: The width of the lines of the crosshair
+ (Default: 1).
+ :param str linestyle: Type of line::
+
+ - ' ' no line
+ - '-' solid line (the default)
+ - '--' dashed line
+ - '-.' dash-dot line
+ - ':' dotted line
+ """
+ if flag:
+ self._cursorConfiguration = color, linewidth, linestyle
+ else:
+ self._cursorConfiguration = None
+
+ self._backend.setGraphCursor(flag=flag, color=color,
+ linewidth=linewidth, linestyle=linestyle)
+ self._setDirtyPlot()
+ self.notify('setGraphCursor',
+ state=self._cursorConfiguration is not None)
+
+ def pan(self, direction, factor=0.1):
+ """Pan the graph in the given direction by the given factor.
+
+ Warning: Pan of right Y axis not implemented!
+
+ :param str direction: One of 'up', 'down', 'left', 'right'.
+ :param float factor: Proportion of the range used to pan the graph.
+ Must be strictly positive.
+ """
+ assert direction in ('up', 'down', 'left', 'right')
+ assert factor > 0.
+
+ if direction in ('left', 'right'):
+ xFactor = factor if direction == 'right' else - factor
+ xMin, xMax = self._xAxis.getLimits()
+
+ xMin, xMax = _utils.applyPan(xMin, xMax, xFactor,
+ self._xAxis.getScale() == self._xAxis.LOGARITHMIC)
+ self._xAxis.setLimits(xMin, xMax)
+
+ else: # direction in ('up', 'down')
+ sign = -1. if self._yAxis.isInverted() else 1.
+ yFactor = sign * (factor if direction == 'up' else -factor)
+ yMin, yMax = self._yAxis.getLimits()
+ yIsLog = self._yAxis.getScale() == self._yAxis.LOGARITHMIC
+
+ yMin, yMax = _utils.applyPan(yMin, yMax, yFactor, yIsLog)
+ self._yAxis.setLimits(yMin, yMax)
+
+ y2Min, y2Max = self._yRightAxis.getLimits()
+
+ y2Min, y2Max = _utils.applyPan(y2Min, y2Max, yFactor, yIsLog)
+ self._yRightAxis.setLimits(y2Min, y2Max)
+
+ # Active Curve/Image
+
+ def isActiveCurveHandling(self):
+ """Returns True if active curve selection is enabled."""
+ return self._activeCurveHandling
+
+ def setActiveCurveHandling(self, flag=True):
+ """Enable/Disable active curve selection.
+
+ :param bool flag: True (the default) to enable active curve selection.
+ """
+ if not flag:
+ self.setActiveCurve(None) # Reset active curve
+
+ self._activeCurveHandling = bool(flag)
+
+ def getActiveCurveColor(self):
+ """Get the color used to display the currently active curve.
+
+ See :meth:`setActiveCurveColor`.
+ """
+ return self._activeCurveColor
+
+ def setActiveCurveColor(self, color="#000000"):
+ """Set the color to use to display the currently active curve.
+
+ :param str color: Color of the active curve,
+ e.g., 'blue', 'b', '#FF0000' (Default: 'black')
+ """
+ if color is None:
+ color = "black"
+ if color in self.colorDict:
+ color = self.colorDict[color]
+ self._activeCurveColor = color
+
+ def getActiveCurve(self, just_legend=False):
+ """Return the currently active curve.
+
+ It returns None in case of not having an active curve.
+
+ :param bool just_legend: True to get the legend of the curve,
+ False (the default) to get the curve data
+ and info.
+ :return: Active curve's legend or corresponding
+ :class:`.items.Curve`
+ :rtype: str or :class:`.items.Curve` or None
+ """
+ if not self.isActiveCurveHandling():
+ return None
+
+ return self._getActiveItem(kind='curve', just_legend=just_legend)
+
+ def setActiveCurve(self, legend, replot=None):
+ """Make the curve associated to legend the active curve.
+
+ :param legend: The legend associated to the curve
+ or None to have no active curve.
+ :type legend: str or None
+ """
+ if replot is not None:
+ _logger.warning('setActiveCurve deprecated replot parameter')
+
+ if not self.isActiveCurveHandling():
+ return
+
+ return self._setActiveItem(kind='curve', legend=legend)
+
+ def getActiveImage(self, just_legend=False):
+ """Returns the currently active image.
+
+ It returns None in case of not having an active image.
+
+ :param bool just_legend: True to get the legend of the image,
+ False (the default) to get the image data
+ and info.
+ :return: Active image's legend or corresponding image object
+ :rtype: str, :class:`.items.ImageData`, :class:`.items.ImageRgba`
+ or None
+ """
+ return self._getActiveItem(kind='image', just_legend=just_legend)
+
+ def setActiveImage(self, legend, replot=None):
+ """Make the image associated to legend the active image.
+
+ :param str legend: The legend associated to the image
+ or None to have no active image.
+ """
+ if replot is not None:
+ _logger.warning('setActiveImage deprecated replot parameter')
+
+ return self._setActiveItem(kind='image', legend=legend)
+
+ def _getActiveItem(self, kind, just_legend=False):
+ """Return the currently active item of that kind if any
+
+ :param str kind: Type of item: 'curve', 'scatter' or 'image'
+ :param bool just_legend: True to get the legend,
+ False (default) to get the item
+ :return: legend or item or None if no active item
+ """
+ assert kind in self._ACTIVE_ITEM_KINDS
+
+ if self._activeLegend[kind] is None:
+ return None
+
+ if (self._activeLegend[kind], kind) not in self._content:
+ self._activeLegend[kind] = None
+ return None
+
+ if just_legend:
+ return self._activeLegend[kind]
+ else:
+ return self._getItem(kind, self._activeLegend[kind])
+
+ def _setActiveItem(self, kind, legend):
+ """Make the curve associated to legend the active curve.
+
+ :param str kind: Type of item: 'curve' or 'image'
+ :param legend: The legend associated to the curve
+ or None to have no active curve.
+ :type legend: str or None
+ """
+ assert kind in self._ACTIVE_ITEM_KINDS
+
+ xLabel = None
+ yLabel = None
+ yRightLabel = None
+
+ oldActiveItem = self._getActiveItem(kind=kind)
+
+ if oldActiveItem is not None: # Stop listening previous active image
+ oldActiveItem.sigItemChanged.disconnect(self._activeItemChanged)
+
+ # Curve specific: Reset highlight of previous active curve
+ if kind == 'curve' and oldActiveItem is not None:
+ oldActiveItem.setHighlighted(False)
+
+ if legend is None:
+ self._activeLegend[kind] = None
+ else:
+ legend = str(legend)
+ item = self._getItem(kind, legend)
+ if item is None:
+ _logger.warning("This %s does not exist: %s", kind, legend)
+ self._activeLegend[kind] = None
+ else:
+ self._activeLegend[kind] = legend
+
+ # Curve specific: handle highlight
+ if kind == 'curve':
+ item.setHighlightedColor(self.getActiveCurveColor())
+ item.setHighlighted(True)
+
+ if isinstance(item, items.LabelsMixIn):
+ if item.getXLabel() is not None:
+ xLabel = item.getXLabel()
+ if item.getYLabel() is not None:
+ if (isinstance(item, items.YAxisMixIn) and
+ item.getYAxis() == 'right'):
+ yRightLabel = item.getYLabel()
+ else:
+ yLabel = item.getYLabel()
+
+ # Start listening new active item
+ item.sigItemChanged.connect(self._activeItemChanged)
+
+ # Store current labels and update plot
+ self._xAxis._setCurrentLabel(xLabel)
+ self._yAxis._setCurrentLabel(yLabel)
+ self._yRightAxis._setCurrentLabel(yRightLabel)
+
+ self._setDirtyPlot()
+
+ activeLegend = self._activeLegend[kind]
+ if oldActiveItem is not None or activeLegend is not None:
+ if oldActiveItem is None:
+ oldActiveLegend = None
+ else:
+ oldActiveLegend = oldActiveItem.getLegend()
+ self.notify(
+ 'active' + kind[0].upper() + kind[1:] + 'Changed',
+ updated=oldActiveLegend != activeLegend,
+ previous=oldActiveLegend,
+ legend=activeLegend)
+
+ return activeLegend
+
+ def _activeItemChanged(self, type_):
+ """Listen for active item changed signal and broadcast signal
+
+ :param item.ItemChangedType type_: The type of item change
+ """
+ if not self.__muteActiveItemChanged:
+ item = self.sender()
+ if item is not None:
+ legend, kind = self._itemKey(item)
+ self.notify(
+ 'active' + kind[0].upper() + kind[1:] + 'Changed',
+ updated=False,
+ previous=legend,
+ legend=legend)
+
+ # Getters
+
+ def getAllCurves(self, just_legend=False, withhidden=False):
+ """Returns all curves legend or info and data.
+
+ It returns an empty list in case of not having any curve.
+
+ If just_legend is False, it returns a list of :class:`items.Curve`
+ objects describing the curves.
+ If just_legend is True, it returns a list of curves' legend.
+
+ :param bool just_legend: True to get the legend of the curves,
+ False (the default) to get the curves' data
+ and info.
+ :param bool withhidden: False (default) to skip hidden curves.
+ :return: list of curves' legend or :class:`.items.Curve`
+ :rtype: list of str or list of :class:`.items.Curve`
+ """
+ return self._getItems(kind='curve',
+ just_legend=just_legend,
+ withhidden=withhidden)
+
+ def getCurve(self, legend=None):
+ """Get the object describing a specific curve.
+
+ It returns None in case no matching curve is found.
+
+ :param str legend:
+ The legend identifying the curve.
+ If not provided or None (the default), the active curve is returned
+ or if there is no active curve, the latest updated curve that is
+ not hidden is returned if there are curves in the plot.
+ :return: None or :class:`.items.Curve` object
+ """
+ return self._getItem(kind='curve', legend=legend)
+
+ def getAllImages(self, just_legend=False):
+ """Returns all images legend or objects.
+
+ It returns an empty list in case of not having any image.
+
+ If just_legend is False, it returns a list of :class:`items.ImageBase`
+ objects describing the images.
+ If just_legend is True, it returns a list of legends.
+
+ :param bool just_legend: True to get the legend of the images,
+ False (the default) to get the images'
+ object.
+ :return: list of images' legend or :class:`.items.ImageBase`
+ :rtype: list of str or list of :class:`.items.ImageBase`
+ """
+ return self._getItems(kind='image',
+ just_legend=just_legend,
+ withhidden=True)
+
+ def getImage(self, legend=None):
+ """Get the object describing a specific image.
+
+ It returns None in case no matching image is found.
+
+ :param str legend:
+ The legend identifying the image.
+ If not provided or None (the default), the active image is returned
+ or if there is no active image, the latest updated image
+ is returned if there are images in the plot.
+ :return: None or :class:`.items.ImageBase` object
+ """
+ return self._getItem(kind='image', legend=legend)
+
+ def getScatter(self, legend=None):
+ """Get the object describing a specific scatter.
+
+ It returns None in case no matching scatter is found.
+
+ :param str legend:
+ The legend identifying the scatter.
+ If not provided or None (the default), the active scatter is
+ returned or if there is no active scatter, the latest updated
+ scatter is returned if there are scatters in the plot.
+ :return: None or :class:`.items.Scatter` object
+ """
+ return self._getItem(kind='scatter', legend=legend)
+
+ def getHistogram(self, legend=None):
+ """Get the object describing a specific histogram.
+
+ It returns None in case no matching histogram is found.
+
+ :param str legend:
+ The legend identifying the histogram.
+ If not provided or None (the default), the latest updated scatter
+ is returned if there are histograms in the plot.
+ :return: None or :class:`.items.Histogram` object
+ """
+ return self._getItem(kind='histogram', legend=legend)
+
+ def _getItems(self, kind=ITEM_KINDS, just_legend=False, withhidden=False):
+ """Retrieve all items of a kind in the plot
+
+ :param kind: The kind of elements to retrieve from the plot.
+ See :attr:`ITEM_KINDS`.
+ By default, it removes all kind of elements.
+ :type kind: str or tuple of str to specify multiple kinds.
+ :param str kind: Type of item: 'curve' or 'image'
+ :param bool just_legend: True to get the legend of the curves,
+ False (the default) to get the curves' data
+ and info.
+ :param bool withhidden: False (default) to skip hidden curves.
+ :return: list of legends or item objects
+ """
+ if kind is 'all': # Replace all by tuple of all kinds
+ kind = self.ITEM_KINDS
+
+ if kind in self.ITEM_KINDS: # Kind is a str, make it a tuple
+ kind = (kind,)
+
+ for aKind in kind:
+ assert aKind in self.ITEM_KINDS
+
+ output = []
+ for (legend, type_), item in self._content.items():
+ if type_ in kind and (withhidden or item.isVisible()):
+ output.append(legend if just_legend else item)
+ return output
+
+ def _getItem(self, kind, legend=None):
+ """Get an item from the plot: either an image or a curve.
+
+ Returns None if no match found.
+
+ :param str kind: Type of item to retrieve,
+ see :attr:`ITEM_KINDS`.
+ :param str legend: Legend of the item or
+ None to get active or last item
+ :return: Object describing the item or None
+ """
+ assert kind in self.ITEM_KINDS
+
+ if legend is not None:
+ return self._content.get((legend, kind), None)
+ else:
+ if kind in self._ACTIVE_ITEM_KINDS:
+ item = self._getActiveItem(kind=kind)
+ if item is not None: # Return active item if available
+ return item
+ # Return last visible item if any
+ allItems = self._getItems(
+ kind=kind, just_legend=False, withhidden=False)
+ return allItems[-1] if allItems else None
+
+ # Limits
+
+ def _notifyLimitsChanged(self, emitSignal=True):
+ """Send an event when plot area limits are changed."""
+ xRange = self._xAxis.getLimits()
+ yRange = self._yAxis.getLimits()
+ y2Range = self._yRightAxis.getLimits()
+ if emitSignal:
+ axes = self.getXAxis(), self.getYAxis(), self.getYAxis(axis="right")
+ ranges = xRange, yRange, y2Range
+ for axis, limits in zip(axes, ranges):
+ axis.sigLimitsChanged.emit(*limits)
+ event = PlotEvents.prepareLimitsChangedSignal(
+ id(self.getWidgetHandle()), xRange, yRange, y2Range)
+ self.notify(**event)
+
+ def getLimitsHistory(self):
+ """Returns the object handling the history of limits of the plot"""
+ return self._limitsHistory
+
+ def getGraphXLimits(self):
+ """Get the graph X (bottom) limits.
+
+ :return: Minimum and maximum values of the X axis
+ """
+ return self._backend.getGraphXLimits()
+
+ def setGraphXLimits(self, xmin, xmax, replot=None):
+ """Set the graph X (bottom) limits.
+
+ :param float xmin: minimum bottom axis value
+ :param float xmax: maximum bottom axis value
+ """
+ if replot is not None:
+ _logger.warning('setGraphXLimits deprecated replot parameter')
+ self._xAxis.setLimits(xmin, xmax)
+
+ def getGraphYLimits(self, axis='left'):
+ """Get the graph Y limits.
+
+ :param str axis: The axis for which to get the limits:
+ Either 'left' or 'right'
+ :return: Minimum and maximum values of the X axis
+ """
+ assert axis in ('left', 'right')
+ yAxis = self._yAxis if axis == 'left' else self._yRightAxis
+ return yAxis.getLimits()
+
+ def setGraphYLimits(self, ymin, ymax, axis='left', replot=None):
+ """Set the graph Y limits.
+
+ :param float ymin: minimum bottom axis value
+ :param float ymax: maximum bottom axis value
+ :param str axis: The axis for which to get the limits:
+ Either 'left' or 'right'
+ """
+ if replot is not None:
+ _logger.warning('setGraphYLimits deprecated replot parameter')
+ assert axis in ('left', 'right')
+ yAxis = self._yAxis if axis == 'left' else self._yRightAxis
+ return yAxis.setLimits(ymin, ymax)
+
+ def setLimits(self, xmin, xmax, ymin, ymax, y2min=None, y2max=None):
+ """Set the limits of the X and Y axes at once.
+
+ If y2min or y2max is None, the right Y axis limits are not updated.
+
+ :param float xmin: minimum bottom axis value
+ :param float xmax: maximum bottom axis value
+ :param float ymin: minimum left axis value
+ :param float ymax: maximum left axis value
+ :param float y2min: minimum right axis value or None (the default)
+ :param float y2max: maximum right axis value or None (the default)
+ """
+ # Deal with incorrect values
+ axis = self.getXAxis()
+ xmin, xmax = axis._checkLimits(xmin, xmax)
+ axis = self.getYAxis()
+ ymin, ymax = axis._checkLimits(ymin, ymax)
+
+ if y2min is None or y2max is None:
+ # if one limit is None, both are ignored
+ y2min, y2max = None, None
+ else:
+ axis = self.getYAxis(axis="right")
+ y2min, y2max = axis._checkLimits(y2min, y2max)
+
+ if self._viewConstrains:
+ view = self._viewConstrains.normalize(xmin, xmax, ymin, ymax)
+ xmin, xmax, ymin, ymax = view
+
+ self._backend.setLimits(xmin, xmax, ymin, ymax, y2min, y2max)
+ self._setDirtyPlot()
+ self._notifyLimitsChanged()
+
+ def _getViewConstraints(self):
+ """Return the plot object managing constaints on the plot view.
+
+ :rtype: ViewConstraints
+ """
+ if self._viewConstrains is None:
+ self._viewConstrains = ViewConstraints()
+ return self._viewConstrains
+
+ # Title and labels
+
+ def getGraphTitle(self):
+ """Return the plot main title as a str."""
+ return self._graphTitle
+
+ def setGraphTitle(self, title=""):
+ """Set the plot main title.
+
+ :param str title: Main title of the plot (default: '')
+ """
+ self._graphTitle = str(title)
+ self._backend.setGraphTitle(title)
+ self._setDirtyPlot()
+
+ def getGraphXLabel(self):
+ """Return the current X axis label as a str."""
+ return self._xAxis.getLabel()
+
+ def setGraphXLabel(self, label="X"):
+ """Set the plot X axis label.
+
+ The provided label can be temporarily replaced by the X label of the
+ active curve if any.
+
+ :param str label: The X axis label (default: 'X')
+ """
+ self._xAxis.setLabel(label)
+
+ def getGraphYLabel(self, axis='left'):
+ """Return the current Y axis label as a str.
+
+ :param str axis: The Y axis for which to get the label (left or right)
+ """
+ assert axis in ('left', 'right')
+ yAxis = self._yAxis if axis == 'left' else self._yRightAxis
+ return yAxis.getLabel()
+
+ def setGraphYLabel(self, label="Y", axis='left'):
+ """Set the plot Y axis label.
+
+ The provided label can be temporarily replaced by the Y label of the
+ active curve if any.
+
+ :param str label: The Y axis label (default: 'Y')
+ :param str axis: The Y axis for which to set the label (left or right)
+ """
+ assert axis in ('left', 'right')
+ yAxis = self._yAxis if axis == 'left' else self._yRightAxis
+ return yAxis.setLabel(label)
+
+ # Axes
+
+ def getXAxis(self):
+ """Returns the X axis
+
+ .. versionadded:: 0.6
+
+ :rtype: :class:`.items.Axis`
+ """
+ return self._xAxis
+
+ def getYAxis(self, axis="left"):
+ """Returns an Y axis
+
+ .. versionadded:: 0.6
+
+ :param str axis: The Y axis to return
+ ('left' or 'right').
+ :rtype: :class:`.items.Axis`
+ """
+ assert(axis in ["left", "right"])
+ return self._yAxis if axis == "left" else self._yRightAxis
+
+ def setAxesDisplayed(self, displayed):
+ """Display or not the axes.
+
+ :param bool displayed: If `True` axes are displayed. If `False` axes
+ are not anymore visible and the margin used for them is removed.
+ """
+ self._backend.setAxesDisplayed(displayed)
+ self._setDirtyPlot()
+ self._sigAxesVisibilityChanged.emit(displayed)
+
+ def _isAxesDisplayed(self):
+ return self._backend.isAxesDisplayed()
+
+ @property
+ @deprecated(since_version='0.6')
+ def sigSetYAxisInverted(self):
+ """Signal emitted when Y axis orientation has changed"""
+ return self._yAxis.sigInvertedChanged
+
+ @property
+ @deprecated(since_version='0.6')
+ def sigSetXAxisLogarithmic(self):
+ """Signal emitted when X axis scale has changed"""
+ return self._xAxis._sigLogarithmicChanged
+
+ @property
+ @deprecated(since_version='0.6')
+ def sigSetYAxisLogarithmic(self):
+ """Signal emitted when Y axis scale has changed"""
+ return self._yAxis._sigLogarithmicChanged
+
+ @property
+ @deprecated(since_version='0.6')
+ def sigSetXAxisAutoScale(self):
+ """Signal emitted when X axis autoscale has changed"""
+ return self._xAxis.sigAutoScaleChanged
+
+ @property
+ @deprecated(since_version='0.6')
+ def sigSetYAxisAutoScale(self):
+ """Signal emitted when Y axis autoscale has changed"""
+ return self._yAxis.sigAutoScaleChanged
+
+ def setYAxisInverted(self, flag=True):
+ """Set the Y axis orientation.
+
+ :param bool flag: True for Y axis going from top to bottom,
+ False for Y axis going from bottom to top
+ """
+ self._yAxis.setInverted(flag)
+
+ def isYAxisInverted(self):
+ """Return True if Y axis goes from top to bottom, False otherwise."""
+ return self._yAxis.isInverted()
+
+ def isXAxisLogarithmic(self):
+ """Return True if X axis scale is logarithmic, False if linear."""
+ return self._xAxis._isLogarithmic()
+
+ def setXAxisLogarithmic(self, flag):
+ """Set the bottom X axis scale (either linear or logarithmic).
+
+ :param bool flag: True to use a logarithmic scale, False for linear.
+ """
+ self._xAxis._setLogarithmic(flag)
+
+ def isYAxisLogarithmic(self):
+ """Return True if Y axis scale is logarithmic, False if linear."""
+ return self._yAxis._isLogarithmic()
+
+ def setYAxisLogarithmic(self, flag):
+ """Set the Y axes scale (either linear or logarithmic).
+
+ :param bool flag: True to use a logarithmic scale, False for linear.
+ """
+ self._yAxis._setLogarithmic(flag)
+
+ def isXAxisAutoScale(self):
+ """Return True if X axis is automatically adjusting its limits."""
+ return self._xAxis.isAutoScale()
+
+ def setXAxisAutoScale(self, flag=True):
+ """Set the X axis limits adjusting behavior of :meth:`resetZoom`.
+
+ :param bool flag: True to resize limits automatically,
+ False to disable it.
+ """
+ self._xAxis.setAutoScale(flag)
+
+ def isYAxisAutoScale(self):
+ """Return True if Y axes are automatically adjusting its limits."""
+ return self._yAxis.isAutoScale()
+
+ def setYAxisAutoScale(self, flag=True):
+ """Set the Y axis limits adjusting behavior of :meth:`resetZoom`.
+
+ :param bool flag: True to resize limits automatically,
+ False to disable it.
+ """
+ self._yAxis.setAutoScale(flag)
+
+ def isKeepDataAspectRatio(self):
+ """Returns whether the plot is keeping data aspect ratio or not."""
+ return self._backend.isKeepDataAspectRatio()
+
+ def setKeepDataAspectRatio(self, flag=True):
+ """Set whether the plot keeps data aspect ratio or not.
+
+ :param bool flag: True to respect data aspect ratio
+ """
+ flag = bool(flag)
+ self._backend.setKeepDataAspectRatio(flag=flag)
+ self._setDirtyPlot()
+ self.resetZoom()
+ self.notify('setKeepDataAspectRatio', state=flag)
+
+ def getGraphGrid(self):
+ """Return the current grid mode, either None, 'major' or 'both'.
+
+ See :meth:`setGraphGrid`.
+ """
+ return self._grid
+
+ def setGraphGrid(self, which=True):
+ """Set the type of grid to display.
+
+ :param which: None or False to disable the grid,
+ 'major' or True for grid on major ticks (the default),
+ 'both' for grid on both major and minor ticks.
+ :type which: str of bool
+ """
+ assert which in (None, True, False, 'both', 'major')
+ if not which:
+ which = None
+ elif which is True:
+ which = 'major'
+ self._grid = which
+ self._backend.setGraphGrid(which)
+ self._setDirtyPlot()
+ self.notify('setGraphGrid', which=str(which))
+
+ # Defaults
+
+ def isDefaultPlotPoints(self):
+ """Return True if default Curve symbol is 'o', False for no symbol."""
+ return self._defaultPlotPoints == 'o'
+
+ def setDefaultPlotPoints(self, flag):
+ """Set the default symbol of all curves.
+
+ When called, this reset the symbol of all existing curves.
+
+ :param bool flag: True to use 'o' as the default curve symbol,
+ False to use no symbol.
+ """
+ self._defaultPlotPoints = 'o' if flag else ''
+
+ # Reset symbol of all curves
+ curves = self.getAllCurves(just_legend=False, withhidden=True)
+
+ if curves:
+ for curve in curves:
+ curve.setSymbol(self._defaultPlotPoints)
+
+ def isDefaultPlotLines(self):
+ """Return True for line as default line style, False for no line."""
+ return self._plotLines
+
+ def setDefaultPlotLines(self, flag):
+ """Toggle the use of lines as the default curve line style.
+
+ :param bool flag: True to use a line as the default line style,
+ False to use no line as the default line style.
+ """
+ self._plotLines = bool(flag)
+
+ linestyle = '-' if self._plotLines else ' '
+
+ # Reset linestyle of all curves
+ curves = self.getAllCurves(withhidden=True)
+
+ if curves:
+ for curve in curves:
+ curve.setLineStyle(linestyle)
+
+ def getDefaultColormap(self):
+ """Return the default :class:`.Colormap` used by :meth:`addImage`.
+
+ """
+ return self._defaultColormap
+
+ def setDefaultColormap(self, colormap=None):
+ """Set the default colormap used by :meth:`addImage`.
+
+ Setting the default colormap do not change any currently displayed
+ image.
+ It only affects future calls to :meth:`addImage` without the colormap
+ parameter.
+
+ :param Colormap colormap: The description of the default colormap, or
+ None to set the :class:`.Colormap` to a linear
+ autoscale gray colormap.
+ """
+ if colormap is None:
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
+ if isinstance(colormap, dict):
+ self._defaultColormap = Colormap._fromDict(colormap)
+ else:
+ assert isinstance(colormap, Colormap)
+ self._defaultColormap = colormap
+ self.notify('defaultColormapChanged')
+
+ @staticmethod
+ def getSupportedColormaps():
+ """Get the supported colormap names as a tuple of str.
+
+ The list contains at least:
+ ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue',
+ 'magma', 'inferno', 'plasma', 'viridis')
+ """
+ return Colormap.getSupportedColormaps()
+
+ def _getColorAndStyle(self):
+ color = self.colorList[self._colorIndex]
+ style = self._styleList[self._styleIndex]
+
+ # Loop over color and then styles
+ self._colorIndex += 1
+ if self._colorIndex >= len(self.colorList):
+ self._colorIndex = 0
+ self._styleIndex = (self._styleIndex + 1) % len(self._styleList)
+
+ # If color is the one of active curve, take the next one
+ if color == self.getActiveCurveColor():
+ color, style = self._getColorAndStyle()
+
+ if not self._plotLines:
+ style = ' '
+
+ return color, style
+
+ # Misc.
+
+ def getWidgetHandle(self):
+ """Return the widget the plot is displayed in.
+
+ This widget is owned by the backend.
+ """
+ return self._backend.getWidgetHandle()
+
def notify(self, event, **kwargs):
- """Override :meth:`Plot.notify` to send Qt signals."""
+ """Send an event to the listeners and send signals.
+
+ Event are passed to the registered callback as a dict with an 'event'
+ key for backward compatibility with PyMca.
+
+ :param str event: The type of event
+ :param kwargs: The information of the event.
+ """
eventDict = kwargs.copy()
eventDict['event'] = event
self.sigPlotSignal.emit(eventDict)
- if event == 'setYAxisInverted':
- self.sigSetYAxisInverted.emit(kwargs['state'])
- elif event == 'setXAxisLogarithmic':
- self.sigSetXAxisLogarithmic.emit(kwargs['state'])
- elif event == 'setYAxisLogarithmic':
- self.sigSetYAxisLogarithmic.emit(kwargs['state'])
- elif event == 'setXAxisAutoScale':
- self.sigSetXAxisAutoScale.emit(kwargs['state'])
- elif event == 'setYAxisAutoScale':
- self.sigSetYAxisAutoScale.emit(kwargs['state'])
- elif event == 'setKeepDataAspectRatio':
+ if event == 'setKeepDataAspectRatio':
self.sigSetKeepDataAspectRatio.emit(kwargs['state'])
elif event == 'setGraphGrid':
self.sigSetGraphGrid.emit(kwargs['which'])
@@ -201,7 +2492,494 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
kwargs['previous'], kwargs['legend'])
elif event == 'interactiveModeChanged':
self.sigInteractiveModeChanged.emit(kwargs['source'])
- Plot.Plot.notify(self, event, **kwargs)
+
+ eventDict = kwargs.copy()
+ eventDict['event'] = event
+ self._callback(eventDict)
+
+ def setCallback(self, callbackFunction=None):
+ """Attach a listener to the backend.
+
+ Limitation: Only one listener at a time.
+
+ :param callbackFunction: function accepting a dictionary as input
+ to handle the graph events
+ If None (default), use a default listener.
+ """
+ # TODO allow multiple listeners, keep a weakref on it
+ # allow register listener by event type
+ if callbackFunction is None:
+ callbackFunction = self.graphCallback
+ self._callback = callbackFunction
+
+ def graphCallback(self, ddict=None):
+ """This callback is going to receive all the events from the plot.
+
+ Those events will consist on a dictionary and among the dictionary
+ keys the key 'event' is mandatory to describe the type of event.
+ This default implementation only handles setting the active curve.
+ """
+
+ if ddict is None:
+ ddict = {}
+ _logger.debug("Received dict keys = %s", str(ddict.keys()))
+ _logger.debug(str(ddict))
+ if ddict['event'] in ["legendClicked", "curveClicked"]:
+ if ddict['button'] == "left":
+ self.setActiveCurve(ddict['label'])
+
+ def saveGraph(self, filename, fileFormat=None, dpi=None, **kw):
+ """Save a snapshot of the plot.
+
+ Supported file formats depends on the backend in use.
+ The following file formats are always supported: "png", "svg".
+ The matplotlib backend supports more formats:
+ "pdf", "ps", "eps", "tiff", "jpeg", "jpg".
+
+ :param filename: Destination
+ :type filename: str, StringIO or BytesIO
+ :param str fileFormat: String specifying the format
+ :return: False if cannot save the plot, True otherwise
+ """
+ if kw:
+ _logger.warning('Extra parameters ignored: %s', str(kw))
+
+ if fileFormat is None:
+ if not hasattr(filename, 'lower'):
+ _logger.warning(
+ 'saveGraph cancelled, cannot define file format.')
+ return False
+ else:
+ fileFormat = (filename.split(".")[-1]).lower()
+
+ supportedFormats = ("png", "svg", "pdf", "ps", "eps",
+ "tif", "tiff", "jpeg", "jpg")
+
+ if fileFormat not in supportedFormats:
+ _logger.warning('Unsupported format %s', fileFormat)
+ return False
+ else:
+ self._backend.saveGraph(filename,
+ fileFormat=fileFormat,
+ dpi=dpi)
+ return True
+
+ def getDataMargins(self):
+ """Get the default data margin ratios, see :meth:`setDataMargins`.
+
+ :return: The margin ratios for each side (xMin, xMax, yMin, yMax).
+ :rtype: A 4-tuple of floats.
+ """
+ return self._defaultDataMargins
+
+ def setDataMargins(self, xMinMargin=0., xMaxMargin=0.,
+ yMinMargin=0., yMaxMargin=0.):
+ """Set the default data margins to use in :meth:`resetZoom`.
+
+ Set the default ratios of margins (as floats) to add around the data
+ inside the plot area for each side.
+ """
+ self._defaultDataMargins = (xMinMargin, xMaxMargin,
+ yMinMargin, yMaxMargin)
+
+ def getAutoReplot(self):
+ """Return True if replot is automatically handled, False otherwise.
+
+ See :meth`setAutoReplot`.
+ """
+ return self._autoreplot
+
+ def setAutoReplot(self, autoreplot=True):
+ """Set automatic replot mode.
+
+ When enabled, the plot is redrawn automatically when changed.
+ When disabled, the plot is not redrawn when its content change.
+ Instead, it :meth:`replot` must be called.
+
+ :param bool autoreplot: True to enable it (default),
+ False to disable it.
+ """
+ self._autoreplot = bool(autoreplot)
+
+ # If the plot is dirty before enabling autoreplot,
+ # then _backend.postRedisplay will never be called from _setDirtyPlot
+ if self._autoreplot and self._getDirtyPlot():
+ self._backend.postRedisplay()
+
+ def replot(self):
+ """Redraw the plot immediately."""
+ for item in self._contentToUpdate:
+ item._update(self._backend)
+ self._contentToUpdate = []
+ self._backend.replot()
+ self._dirty = False # reset dirty flag
+
+ def resetZoom(self, dataMargins=None):
+ """Reset the plot limits to the bounds of the data and redraw the plot.
+
+ It automatically scale limits of axes that are in autoscale mode
+ (see :meth:`getXAxis`, :meth:`getYAxis` and :meth:`Axis.setAutoScale`).
+ It keeps current limits on axes that are not in autoscale mode.
+
+ Extra margins can be added around the data inside the plot area
+ (see :meth:`setDataMargins`).
+ Margins are given as one ratio of the data range per limit of the
+ data (xMin, xMax, yMin and yMax limits).
+ For log scale, extra margins are applied in log10 of the data.
+
+ :param dataMargins: Ratios of margins to add around the data inside
+ the plot area for each side (default: no margins).
+ :type dataMargins: A 4-tuple of float as (xMin, xMax, yMin, yMax).
+ """
+ if dataMargins is None:
+ dataMargins = self._defaultDataMargins
+
+ xLimits = self._xAxis.getLimits()
+ yLimits = self._yAxis.getLimits()
+ y2Limits = self._yRightAxis.getLimits()
+
+ xAuto = self._xAxis.isAutoScale()
+ yAuto = self._yAxis.isAutoScale()
+
+ if not xAuto and not yAuto:
+ _logger.debug("Nothing to autoscale")
+ else: # Some axes to autoscale
+
+ # Get data range
+ ranges = self.getDataRange()
+ xmin, xmax = (1., 100.) if ranges.x is None else ranges.x
+ ymin, ymax = (1., 100.) if ranges.y is None else ranges.y
+ if ranges.yright is None:
+ ymin2, ymax2 = None, None
+ else:
+ ymin2, ymax2 = ranges.yright
+
+ # Add margins around data inside the plot area
+ newLimits = list(_utils.addMarginsToLimits(
+ dataMargins,
+ self._xAxis._isLogarithmic(),
+ self._yAxis._isLogarithmic(),
+ xmin, xmax, ymin, ymax, ymin2, ymax2))
+
+ if self.isKeepDataAspectRatio():
+ # Use limits with margins to keep ratio
+ xmin, xmax, ymin, ymax = newLimits[:4]
+
+ # Compute bbox wth figure aspect ratio
+ plotWidth, plotHeight = self.getPlotBoundsInPixels()[2:]
+ plotRatio = plotHeight / plotWidth
+
+ if plotRatio > 0.:
+ dataRatio = (ymax - ymin) / (xmax - xmin)
+ if dataRatio < plotRatio:
+ # Increase y range
+ ycenter = 0.5 * (ymax + ymin)
+ yrange = (xmax - xmin) * plotRatio
+ newLimits[2] = ycenter - 0.5 * yrange
+ newLimits[3] = ycenter + 0.5 * yrange
+
+ elif dataRatio > plotRatio:
+ # Increase x range
+ xcenter = 0.5 * (xmax + xmin)
+ xrange_ = (ymax - ymin) / plotRatio
+ newLimits[0] = xcenter - 0.5 * xrange_
+ newLimits[1] = xcenter + 0.5 * xrange_
+
+ self.setLimits(*newLimits)
+
+ if not xAuto and yAuto:
+ self.setGraphXLimits(*xLimits)
+ elif xAuto and not yAuto:
+ if y2Limits is not None:
+ self.setGraphYLimits(
+ y2Limits[0], y2Limits[1], axis='right')
+ if yLimits is not None:
+ self.setGraphYLimits(yLimits[0], yLimits[1], axis='left')
+
+ self._setDirtyPlot()
+
+ if (xLimits != self._xAxis.getLimits() or
+ yLimits != self._yAxis.getLimits() or
+ y2Limits != self._yRightAxis.getLimits()):
+ self._notifyLimitsChanged()
+
+ # Coord conversion
+
+ def dataToPixel(self, x=None, y=None, axis="left", check=True):
+ """Convert a position in data coordinates to a position in pixels.
+
+ :param float x: The X coordinate in data space. If None (default)
+ the middle position of the displayed data is used.
+ :param float y: The Y coordinate in data space. If None (default)
+ the middle position of the displayed data is used.
+ :param str axis: The Y axis to use for the conversion
+ ('left' or 'right').
+ :param bool check: True to return None if outside displayed area,
+ False to convert to pixels anyway
+ :returns: The corresponding position in pixels or
+ None if the data position is not in the displayed area and
+ check is True.
+ :rtype: A tuple of 2 floats: (xPixel, yPixel) or None.
+ """
+ assert axis in ("left", "right")
+
+ xmin, xmax = self._xAxis.getLimits()
+ yAxis = self.getYAxis(axis=axis)
+ ymin, ymax = yAxis.getLimits()
+
+ if x is None:
+ x = 0.5 * (xmax + xmin)
+ if y is None:
+ y = 0.5 * (ymax + ymin)
+
+ if check:
+ if x > xmax or x < xmin:
+ return None
+
+ if y > ymax or y < ymin:
+ return None
+
+ return self._backend.dataToPixel(x, y, axis=axis)
+
+ def pixelToData(self, x, y, axis="left", check=False):
+ """Convert a position in pixels to a position in data coordinates.
+
+ :param float x: The X coordinate in pixels. If None (default)
+ the center of the widget is used.
+ :param float y: The Y coordinate in pixels. If None (default)
+ the center of the widget is used.
+ :param str axis: The Y axis to use for the conversion
+ ('left' or 'right').
+ :param bool check: Toggle checking if pixel is in plot area.
+ If False, this method never returns None.
+ :returns: The corresponding position in data space or
+ None if the pixel position is not in the plot area.
+ :rtype: A tuple of 2 floats: (xData, yData) or None.
+ """
+ assert axis in ("left", "right")
+ return self._backend.pixelToData(x, y, axis=axis, check=check)
+
+ def getPlotBoundsInPixels(self):
+ """Plot area bounds in widget coordinates in pixels.
+
+ :return: bounds as a 4-tuple of int: (left, top, width, height)
+ """
+ return self._backend.getPlotBoundsInPixels()
+
+ # Interaction support
+
+ def setGraphCursorShape(self, cursor=None):
+ """Set the cursor shape.
+
+ :param str cursor: Name of the cursor shape
+ """
+ self._backend.setGraphCursorShape(cursor)
+
+ def _pickMarker(self, x, y, test=None):
+ """Pick a marker at the given position.
+
+ To use for interaction implementation.
+
+ :param float x: X position in pixels.
+ :param float y: Y position in pixels.
+ :param test: A callable to call for each picked marker to filter
+ picked markers. If None (default), do not filter markers.
+ """
+ if test is None:
+ def test(mark):
+ return True
+
+ markers = self._backend.pickItems(x, y)
+ legends = [m['legend'] for m in markers if m['kind'] == 'marker']
+
+ for legend in reversed(legends):
+ marker = self._getMarker(legend)
+ if marker is not None and test(marker):
+ return marker
+ return None
+
+ def _getAllMarkers(self, just_legend=False):
+ """Returns all markers' legend or objects
+
+ :param bool just_legend: True to get the legend of the markers,
+ False (the default) to get marker objects.
+ :return: list of legend of list of marker objects
+ :rtype: list of str or list of marker objects
+ """
+ return self._getItems(
+ kind='marker', just_legend=just_legend, withhidden=True)
+
+ def _getMarker(self, legend=None):
+ """Get the object describing a specific marker.
+
+ It returns None in case no matching marker is found
+
+ :param str legend: The legend of the marker to retrieve
+ :rtype: None of marker object
+ """
+ return self._getItem(kind='marker', legend=legend)
+
+ def _pickImageOrCurve(self, x, y, test=None):
+ """Pick an image or a curve at the given position.
+
+ To use for interaction implementation.
+
+ :param float x: X position in pixelsparam float y: Y position in pixels
+ :param test: A callable to call for each picked item to filter
+ picked items. If None (default), do not filter items.
+ """
+ if test is None:
+ def test(i):
+ return True
+
+ allItems = self._backend.pickItems(x, y)
+ allItems = [item for item in allItems
+ if item['kind'] in ['curve', 'image']]
+
+ for item in reversed(allItems):
+ kind, legend = item['kind'], item['legend']
+ if kind == 'curve':
+ curve = self.getCurve(legend)
+ if curve is not None and test(curve):
+ return kind, curve, item['indices']
+
+ elif kind == 'image':
+ image = self.getImage(legend)
+ if image is not None and test(image):
+ return kind, image, None
+
+ else:
+ _logger.warning('Unsupported kind: %s', kind)
+
+ return None
+
+ # User event handling #
+
+ def _isPositionInPlotArea(self, x, y):
+ """Project position in pixel to the closest point in the plot area
+
+ :param float x: X coordinate in widget coordinate (in pixel)
+ :param float y: Y coordinate in widget coordinate (in pixel)
+ :return: (x, y) in widget coord (in pixel) in the plot area
+ """
+ left, top, width, height = self.getPlotBoundsInPixels()
+ xPlot = numpy.clip(x, left, left + width)
+ yPlot = numpy.clip(y, top, top + height)
+ return xPlot, yPlot
+
+ def onMousePress(self, xPixel, yPixel, btn):
+ """Handle mouse press event.
+
+ :param float xPixel: X mouse position in pixels
+ :param float yPixel: Y mouse position in pixels
+ :param str btn: Mouse button in 'left', 'middle', 'right'
+ """
+ if self._isPositionInPlotArea(xPixel, yPixel) == (xPixel, yPixel):
+ self._pressedButtons.append(btn)
+ self._eventHandler.handleEvent('press', xPixel, yPixel, btn)
+
+ def onMouseMove(self, xPixel, yPixel):
+ """Handle mouse move event.
+
+ :param float xPixel: X mouse position in pixels
+ :param float yPixel: Y mouse position in pixels
+ """
+ inXPixel, inYPixel = self._isPositionInPlotArea(xPixel, yPixel)
+ isCursorInPlot = inXPixel == xPixel and inYPixel == yPixel
+
+ if self._cursorInPlot != isCursorInPlot:
+ self._cursorInPlot = isCursorInPlot
+ self._eventHandler.handleEvent(
+ 'enter' if self._cursorInPlot else 'leave')
+
+ if isCursorInPlot:
+ # Signal mouse move event
+ dataPos = self.pixelToData(inXPixel, inYPixel)
+ assert dataPos is not None
+
+ btn = self._pressedButtons[-1] if self._pressedButtons else None
+ event = PlotEvents.prepareMouseSignal(
+ 'mouseMoved', btn, dataPos[0], dataPos[1], xPixel, yPixel)
+ self.notify(**event)
+
+ # Either button was pressed in the plot or cursor is in the plot
+ if isCursorInPlot or self._pressedButtons:
+ self._eventHandler.handleEvent('move', inXPixel, inYPixel)
+
+ def onMouseRelease(self, xPixel, yPixel, btn):
+ """Handle mouse release event.
+
+ :param float xPixel: X mouse position in pixels
+ :param float yPixel: Y mouse position in pixels
+ :param str btn: Mouse button in 'left', 'middle', 'right'
+ """
+ try:
+ self._pressedButtons.remove(btn)
+ except ValueError:
+ pass
+ else:
+ xPixel, yPixel = self._isPositionInPlotArea(xPixel, yPixel)
+ self._eventHandler.handleEvent('release', xPixel, yPixel, btn)
+
+ def onMouseWheel(self, xPixel, yPixel, angleInDegrees):
+ """Handle mouse wheel event.
+
+ :param float xPixel: X mouse position in pixels
+ :param float yPixel: Y mouse position in pixels
+ :param float angleInDegrees: Angle corresponding to wheel motion.
+ Positive for movement away from the user,
+ negative for movement toward the user.
+ """
+ if self._isPositionInPlotArea(xPixel, yPixel) == (xPixel, yPixel):
+ self._eventHandler.handleEvent(
+ 'wheel', xPixel, yPixel, angleInDegrees)
+
+ def onMouseLeaveWidget(self):
+ """Handle mouse leave widget event."""
+ if self._cursorInPlot:
+ self._cursorInPlot = False
+ self._eventHandler.handleEvent('leave')
+
+ # Interaction modes #
+
+ def getInteractiveMode(self):
+ """Returns the current interactive mode as a dict.
+
+ The returned dict contains at least the key 'mode'.
+ Mode can be: 'draw', 'pan', 'select', 'zoom'.
+ It can also contains extra keys (e.g., 'color') specific to a mode
+ as provided to :meth:`setInteractiveMode`.
+ """
+ return self._eventHandler.getInteractiveMode()
+
+ def setInteractiveMode(self, mode, color='black',
+ shape='polygon', label=None,
+ zoomOnWheel=True, source=None, width=None):
+ """Switch the interactive mode.
+
+ :param str mode: The name of the interactive mode.
+ In 'draw', 'pan', 'select', 'zoom'.
+ :param color: Only for 'draw' and 'zoom' modes.
+ Color to use for drawing selection area. Default black.
+ :type color: Color description: The name as a str or
+ a tuple of 4 floats.
+ :param str shape: Only for 'draw' mode. The kind of shape to draw.
+ In 'polygon', 'rectangle', 'line', 'vline', 'hline',
+ 'freeline'.
+ Default is 'polygon'.
+ :param str label: Only for 'draw' mode, sent in drawing events.
+ :param bool zoomOnWheel: Toggle zoom on wheel support
+ :param source: A user-defined object (typically the caller object)
+ that will be send in the interactiveModeChanged event,
+ to identify which object required a mode change.
+ Default: None
+ :param float width: Width of the pencil. Only for draw pencil mode.
+ """
+ self._eventHandler.setInteractiveMode(mode, color, shape, label, width)
+ self._eventHandler.zoomOnWheel = zoomOnWheel
+
+ self.notify(
+ 'interactiveModeChanged', source=source)
# Panning with arrow keys
@@ -265,3 +3043,149 @@ class PlotWidget(qt.QMainWindow, Plot.Plot):
# Only call base class implementation when key is not handled.
# See QWidget.keyPressEvent for details.
super(PlotWidget, self).keyPressEvent(event)
+
+ # Deprecated #
+
+ def isDrawModeEnabled(self):
+ """Deprecated, use :meth:`getInteractiveMode` instead.
+
+ Return True if the current interactive state is drawing."""
+ _logger.warning(
+ 'isDrawModeEnabled deprecated, use getInteractiveMode instead')
+ return self.getInteractiveMode()['mode'] == 'draw'
+
+ def setDrawModeEnabled(self, flag=True, shape='polygon', label=None,
+ color=None, **kwargs):
+ """Deprecated, use :meth:`setInteractiveMode` instead.
+
+ Set the drawing mode if flag is True and its parameters.
+
+ If flag is False, only item selection is enabled.
+
+ Warning: Zoom and drawing are not compatible and cannot be enabled
+ simultaneously.
+
+ :param bool flag: True to enable drawing and disable zoom and select.
+ :param str shape: Type of item to be drawn in:
+ hline, vline, rectangle, polygon (default)
+ :param str label: Associated text for identifying draw signals
+ :param color: The color to use to draw the selection area
+ :type color: string ("#RRGGBB") or 4 column unsigned byte array or
+ one of the predefined color names defined in Colors.py
+ """
+ _logger.warning(
+ 'setDrawModeEnabled deprecated, use setInteractiveMode instead')
+
+ if kwargs:
+ _logger.warning('setDrawModeEnabled ignores additional parameters')
+
+ if color is None:
+ color = 'black'
+
+ if flag:
+ self.setInteractiveMode('draw', shape=shape,
+ label=label, color=color)
+ elif self.getInteractiveMode()['mode'] == 'draw':
+ self.setInteractiveMode('select')
+
+ def getDrawMode(self):
+ """Deprecated, use :meth:`getInteractiveMode` instead.
+
+ Return the draw mode parameters as a dict of None.
+
+ It returns None if the interactive mode is not a drawing mode,
+ otherwise, it returns a dict containing the drawing mode parameters
+ as provided to :meth:`setDrawModeEnabled`.
+ """
+ _logger.warning(
+ 'getDrawMode deprecated, use getInteractiveMode instead')
+ mode = self.getInteractiveMode()
+ return mode if mode['mode'] == 'draw' else None
+
+ def isZoomModeEnabled(self):
+ """Deprecated, use :meth:`getInteractiveMode` instead.
+
+ Return True if the current interactive state is zooming."""
+ _logger.warning(
+ 'isZoomModeEnabled deprecated, use getInteractiveMode instead')
+ return self.getInteractiveMode()['mode'] == 'zoom'
+
+ def setZoomModeEnabled(self, flag=True, color=None):
+ """Deprecated, use :meth:`setInteractiveMode` instead.
+
+ Set the zoom mode if flag is True, else item selection is enabled.
+
+ Warning: Zoom and drawing are not compatible and cannot be enabled
+ simultaneously
+
+ :param bool flag: If True, enable zoom and select mode.
+ :param color: The color to use to draw the selection area.
+ (Default: 'black')
+ :param color: The color to use to draw the selection area
+ :type color: string ("#RRGGBB") or 4 column unsigned byte array or
+ one of the predefined color names defined in Colors.py
+ """
+ _logger.warning(
+ 'setZoomModeEnabled deprecated, use setInteractiveMode instead')
+ if color is None:
+ color = 'black'
+
+ if flag:
+ self.setInteractiveMode('zoom', color=color)
+ elif self.getInteractiveMode()['mode'] == 'zoom':
+ self.setInteractiveMode('select')
+
+ def insertMarker(self, *args, **kwargs):
+ """Deprecated, use :meth:`addMarker` instead."""
+ _logger.warning(
+ 'insertMarker deprecated, use addMarker instead.')
+ return self.addMarker(*args, **kwargs)
+
+ def insertXMarker(self, *args, **kwargs):
+ """Deprecated, use :meth:`addXMarker` instead."""
+ _logger.warning(
+ 'insertXMarker deprecated, use addXMarker instead.')
+ return self.addXMarker(*args, **kwargs)
+
+ def insertYMarker(self, *args, **kwargs):
+ """Deprecated, use :meth:`addYMarker` instead."""
+ _logger.warning(
+ 'insertYMarker deprecated, use addYMarker instead.')
+ return self.addYMarker(*args, **kwargs)
+
+ def isActiveCurveHandlingEnabled(self):
+ """Deprecated, use :meth:`isActiveCurveHandling` instead."""
+ _logger.warning(
+ 'isActiveCurveHandlingEnabled deprecated, '
+ 'use isActiveCurveHandling instead.')
+ return self.isActiveCurveHandling()
+
+ def enableActiveCurveHandling(self, *args, **kwargs):
+ """Deprecated, use :meth:`setActiveCurveHandling` instead."""
+ _logger.warning(
+ 'enableActiveCurveHandling deprecated, '
+ 'use setActiveCurveHandling instead.')
+ return self.setActiveCurveHandling(*args, **kwargs)
+
+ def invertYAxis(self, *args, **kwargs):
+ """Deprecated, use :meth:`Axis.setInverted` instead."""
+ _logger.warning('invertYAxis deprecated, '
+ 'use getYAxis().setInverted instead.')
+ return self.getYAxis().setInverted(*args, **kwargs)
+
+ def showGrid(self, flag=True):
+ """Deprecated, use :meth:`setGraphGrid` instead."""
+ _logger.warning("showGrid deprecated, use setGraphGrid instead")
+ if flag in (0, False):
+ flag = None
+ elif flag in (1, True):
+ flag = 'major'
+ else:
+ flag = 'both'
+ return self.setGraphGrid(flag)
+
+ def keepDataAspectRatio(self, *args, **kwargs):
+ """Deprecated, use :meth:`setKeepDataAspectRatio`."""
+ _logger.warning('keepDataAspectRatio deprecated,'
+ 'use setKeepDataAspectRatio instead')
+ return self.setKeepDataAspectRatio(*args, **kwargs)
diff --git a/silx/gui/plot/PlotWindow.py b/silx/gui/plot/PlotWindow.py
index ae25cfd..a23db04 100644
--- a/silx/gui/plot/PlotWindow.py
+++ b/silx/gui/plot/PlotWindow.py
@@ -25,26 +25,30 @@
"""A :class:`.PlotWidget` with additional toolbars.
The :class:`PlotWindow` is a subclass of :class:`.PlotWidget`.
-It provides the plot API fully defined in :class:`.Plot`.
"""
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "27/04/2017"
+__date__ = "17/08/2017"
import collections
import logging
-from silx.utils.decorators import deprecated
+from silx.utils.deprecation import deprecated
from . import PlotWidget
-from . import PlotActions
+from . import actions
+from . import items
+from .actions import medfilt as actions_medfilt
+from .actions import fit as actions_fit
+from .actions import histogram as actions_histogram
from . import PlotToolButtons
from .PlotTools import PositionInfo
from .Profile import ProfileToolBar
from .LegendSelector import LegendsDockWidget
from .CurvesROIWidget import CurvesROIDockWidget
from .MaskToolsWidget import MaskToolsDockWidget
+from .ColorBar import ColorBarWidget
try:
from ..console import IPythonDockWidget
except ImportError:
@@ -65,7 +69,7 @@ class PlotWindow(PlotWidget):
:param parent: The parent of this widget or None.
:param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ See :class:`.PlotWidget` for the list of supported backend.
:type backend: str or :class:`BackendBase.BackendBase`
:param bool resetzoom: Toggle visibility of reset zoom action.
:param bool autoScale: Toggle visibility of axes autoscale actions.
@@ -113,46 +117,54 @@ class PlotWindow(PlotWidget):
self.group = qt.QActionGroup(self)
self.group.setExclusive(False)
- self.resetZoomAction = self.group.addAction(PlotActions.ResetZoomAction(self))
+ self.zoomModeAction = self.group.addAction(
+ actions.mode.ZoomModeAction(self))
+ self.panModeAction = self.group.addAction(
+ actions.mode.PanModeAction(self))
+
+ self.resetZoomAction = self.group.addAction(
+ actions.control.ResetZoomAction(self))
self.resetZoomAction.setVisible(resetzoom)
self.addAction(self.resetZoomAction)
- self.zoomInAction = PlotActions.ZoomInAction(self)
+ self.zoomInAction = actions.control.ZoomInAction(self)
self.addAction(self.zoomInAction)
- self.zoomOutAction = PlotActions.ZoomOutAction(self)
+ self.zoomOutAction = actions.control.ZoomOutAction(self)
self.addAction(self.zoomOutAction)
self.xAxisAutoScaleAction = self.group.addAction(
- PlotActions.XAxisAutoScaleAction(self))
+ actions.control.XAxisAutoScaleAction(self))
self.xAxisAutoScaleAction.setVisible(autoScale)
self.addAction(self.xAxisAutoScaleAction)
self.yAxisAutoScaleAction = self.group.addAction(
- PlotActions.YAxisAutoScaleAction(self))
+ actions.control.YAxisAutoScaleAction(self))
self.yAxisAutoScaleAction.setVisible(autoScale)
self.addAction(self.yAxisAutoScaleAction)
self.xAxisLogarithmicAction = self.group.addAction(
- PlotActions.XAxisLogarithmicAction(self))
+ actions.control.XAxisLogarithmicAction(self))
self.xAxisLogarithmicAction.setVisible(logScale)
self.addAction(self.xAxisLogarithmicAction)
self.yAxisLogarithmicAction = self.group.addAction(
- PlotActions.YAxisLogarithmicAction(self))
+ actions.control.YAxisLogarithmicAction(self))
self.yAxisLogarithmicAction.setVisible(logScale)
self.addAction(self.yAxisLogarithmicAction)
self.gridAction = self.group.addAction(
- PlotActions.GridAction(self, gridMode='both'))
+ actions.control.GridAction(self, gridMode='both'))
self.gridAction.setVisible(grid)
self.addAction(self.gridAction)
- self.curveStyleAction = self.group.addAction(PlotActions.CurveStyleAction(self))
+ self.curveStyleAction = self.group.addAction(
+ actions.control.CurveStyleAction(self))
self.curveStyleAction.setVisible(curveStyle)
self.addAction(self.curveStyleAction)
- self.colormapAction = self.group.addAction(PlotActions.ColormapAction(self))
+ self.colormapAction = self.group.addAction(
+ actions.control.ColormapAction(self))
self.colormapAction.setVisible(colormap)
self.addAction(self.colormapAction)
@@ -171,34 +183,34 @@ class PlotWindow(PlotWidget):
self.getMaskAction().setVisible(mask)
self._intensityHistoAction = self.group.addAction(
- PlotActions.PixelIntensitiesHistoAction(self))
+ actions_histogram.PixelIntensitiesHistoAction(self))
self._intensityHistoAction.setVisible(False)
self._medianFilter2DAction = self.group.addAction(
- PlotActions.MedianFilter2DAction(self))
+ actions_medfilt.MedianFilter2DAction(self))
self._medianFilter2DAction.setVisible(False)
self._medianFilter1DAction = self.group.addAction(
- PlotActions.MedianFilter1DAction(self))
+ actions_medfilt.MedianFilter1DAction(self))
self._medianFilter1DAction.setVisible(False)
self._separator = qt.QAction('separator', self)
self._separator.setSeparator(True)
self.group.addAction(self._separator)
- self.copyAction = self.group.addAction(PlotActions.CopyAction(self))
+ self.copyAction = self.group.addAction(actions.io.CopyAction(self))
self.copyAction.setVisible(copy)
self.addAction(self.copyAction)
- self.saveAction = self.group.addAction(PlotActions.SaveAction(self))
+ self.saveAction = self.group.addAction(actions.io.SaveAction(self))
self.saveAction.setVisible(save)
self.addAction(self.saveAction)
- self.printAction = self.group.addAction(PlotActions.PrintAction(self))
+ self.printAction = self.group.addAction(actions.io.PrintAction(self))
self.printAction.setVisible(print_)
self.addAction(self.printAction)
- self.fitAction = self.group.addAction(PlotActions.FitAction(self))
+ self.fitAction = self.group.addAction(actions_fit.FitAction(self))
self.fitAction.setVisible(fit)
self.addAction(self.fitAction)
@@ -207,6 +219,28 @@ class PlotWindow(PlotWidget):
self._panWithArrowKeysAction = None
self._crosshairAction = None
+ # Create color bar, hidden by default for backward compatibility
+ self._colorbar = ColorBarWidget(parent=self, plot=self)
+ self._colorbar.setVisible(False)
+
+ # Make colorbar background white
+ self._colorbar.setAutoFillBackground(True)
+ palette = self._colorbar.palette()
+ palette.setColor(qt.QPalette.Background, qt.Qt.white)
+ palette.setColor(qt.QPalette.Window, qt.Qt.white)
+ self._colorbar.setPalette(palette)
+
+ gridLayout = qt.QGridLayout()
+ gridLayout.setSpacing(0)
+ gridLayout.setContentsMargins(0, 0, 0, 0)
+ gridLayout.addWidget(self.getWidgetHandle(), 0, 0)
+ gridLayout.addWidget(self._colorbar, 0, 1)
+ gridLayout.setRowStretch(0, 1)
+ gridLayout.setColumnStretch(0, 1)
+ centralWidget = qt.QWidget()
+ centralWidget.setLayout(gridLayout)
+ self.setCentralWidget(centralWidget)
+
if control or position:
hbox = qt.QHBoxLayout()
hbox.setContentsMargins(0, 0, 0, 0)
@@ -239,16 +273,7 @@ class PlotWindow(PlotWidget):
bottomBar = qt.QWidget()
bottomBar.setLayout(hbox)
- layout = qt.QVBoxLayout()
- layout.setSpacing(0)
- layout.setContentsMargins(0, 0, 0, 0)
- layout.addWidget(self.getWidgetHandle())
- layout.addWidget(bottomBar)
- layout.setStretch(0, 1)
-
- centralWidget = qt.QWidget()
- centralWidget.setLayout(layout)
- self.setCentralWidget(centralWidget)
+ gridLayout.addWidget(bottomBar, 1, 0, 1, -1)
# Creating the toolbar also create actions for toolbuttons
self._toolbar = self._createToolBar(title='Plot', parent=None)
@@ -322,6 +347,8 @@ class PlotWindow(PlotWidget):
self.yAxisInvertedAction = toolbar.addWidget(obj)
else:
raise RuntimeError()
+ if obj is self.panModeAction:
+ toolbar.addSeparator()
return toolbar
def toolBar(self):
@@ -378,6 +405,13 @@ class PlotWindow(PlotWidget):
self.tabifyDockWidget(self._dockWidgets[0],
dock_widget)
+ def getColorBarWidget(self):
+ """Returns the embedded :class:`ColorBarWidget` widget.
+
+ :rtype: ColorBarWidget
+ """
+ return self._colorbar
+
# getters for dock widgets
@property
@deprecated(replacement="getLegendsDockWidget()", since_version="0.4.0")
@@ -464,10 +498,10 @@ class PlotWindow(PlotWidget):
def getCrosshairAction(self):
"""Action toggling crosshair cursor mode.
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
if self._crosshairAction is None:
- self._crosshairAction = PlotActions.CrosshairAction(self, color='red')
+ self._crosshairAction = actions.control.CrosshairAction(self, color='red')
return self._crosshairAction
@property
@@ -491,10 +525,10 @@ class PlotWindow(PlotWidget):
def getPanWithArrowKeysAction(self):
"""Action toggling pan with arrow keys.
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
if self._panWithArrowKeysAction is None:
- self._panWithArrowKeysAction = PlotActions.PanWithArrowKeysAction(self)
+ self._panWithArrowKeysAction = actions.control.PanWithArrowKeysAction(self)
return self._panWithArrowKeysAction
@property
@@ -512,63 +546,63 @@ class PlotWindow(PlotWidget):
def getResetZoomAction(self):
"""Action resetting the zoom
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.resetZoomAction
def getZoomInAction(self):
"""Action to zoom in
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.zoomInAction
def getZoomOutAction(self):
"""Action to zoom out
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.zoomOutAction
def getXAxisAutoScaleAction(self):
"""Action to toggle the X axis autoscale on zoom reset
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.xAxisAutoScaleAction
def getYAxisAutoScaleAction(self):
"""Action to toggle the Y axis autoscale on zoom reset
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.yAxisAutoScaleAction
def getXAxisLogarithmicAction(self):
"""Action to toggle logarithmic X axis
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.xAxisLogarithmicAction
def getYAxisLogarithmicAction(self):
"""Action to toggle logarithmic Y axis
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.yAxisLogarithmicAction
def getGridAction(self):
"""Action to toggle the grid visibility in the plot
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.gridAction
def getCurveStyleAction(self):
"""Action to change curve line and markers styles
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.curveStyleAction
@@ -576,7 +610,7 @@ class PlotWindow(PlotWidget):
"""Action open a colormap dialog to change active image
and default colormap.
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.colormapAction
@@ -592,7 +626,7 @@ class PlotWindow(PlotWidget):
Use this to change the visibility of keepDataAspectRatioButton in the
toolbar (See :meth:`QToolBar.addWidget` documentation).
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.keepDataAspectRatioButton
@@ -608,56 +642,56 @@ class PlotWindow(PlotWidget):
Use this to change the visibility yAxisInvertedButton in the toolbar.
(See :meth:`QToolBar.addWidget` documentation).
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.yAxisInvertedAction
def getIntensityHistogramAction(self):
"""Action toggling the histogram intensity Plot widget
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self._intensityHistoAction
def getCopyAction(self):
"""Action to copy plot snapshot to clipboard
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.copyAction
def getSaveAction(self):
"""Action to save plot
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.saveAction
def getPrintAction(self):
"""Action to print plot
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.printAction
def getFitAction(self):
"""Action to fit selected curve
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self.fitAction
def getMedianFilter1DAction(self):
"""Action toggling the 1D median filter
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self._medianFilter1DAction
def getMedianFilter2DAction(self):
"""Action toggling the 2D median filter
- :rtype: PlotActions.PlotAction
+ :rtype: actions.PlotAction
"""
return self._medianFilter2DAction
@@ -669,7 +703,7 @@ class Plot1D(PlotWindow):
:param parent: The parent of this widget
:param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ See :class:`.PlotWidget` for the list of supported backend.
:type backend: str or :class:`BackendBase.BackendBase`
"""
@@ -684,8 +718,8 @@ class Plot1D(PlotWindow):
roi=True, mask=False, fit=True)
if parent is None:
self.setWindowTitle('Plot1D')
- self.setGraphXLabel('X')
- self.setGraphYLabel('Y')
+ self.getXAxis().setLabel('X')
+ self.getYAxis().setLabel('Y')
class Plot2D(PlotWindow):
@@ -695,7 +729,7 @@ class Plot2D(PlotWindow):
:param parent: The parent of this widget
:param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ See :class:`.PlotWidget` for the list of supported backend.
:type backend: str or :class:`BackendBase.BackendBase`
"""
@@ -716,26 +750,44 @@ class Plot2D(PlotWindow):
roi=False, mask=True)
if parent is None:
self.setWindowTitle('Plot2D')
- self.setGraphXLabel('Columns')
- self.setGraphYLabel('Rows')
+ self.getXAxis().setLabel('Columns')
+ self.getYAxis().setLabel('Rows')
self.profile = ProfileToolBar(plot=self)
-
self.addToolBar(self.profile)
+ self.getColorBarWidget().setVisible(True)
+
+ # Put colorbar action after colormap action
+ actions = self.toolBar().actions()
+ for index, action in enumerate(actions):
+ if action is self.getColormapAction():
+ break
+ self.toolBar().insertAction(
+ actions[index + 1],
+ self.getColorBarWidget().getToggleViewAction())
+
def _getImageValue(self, x, y):
- """Get value of top most image at position (x, y)
+ """Get status bar value of top most image at position (x, y)
:param float x: X position in plot coordinates
:param float y: Y position in plot coordinates
:return: The value at that point or '-'
"""
value = '-'
- valueZ = - float('inf')
+ valueZ = -float('inf')
+ mask = 0
+ maskZ = -float('inf')
for image in self.getAllImages():
data = image.getData(copy=False)
- if image.getZValue() >= valueZ: # This image is over the previous one
+ isMask = isinstance(image, items.MaskImageData)
+ if isMask:
+ zIndex = maskZ
+ else:
+ zIndex = valueZ
+ if image.getZValue() >= zIndex:
+ # This image is over the previous one
ox, oy = image.getOrigin()
sx, sy = image.getScale()
row, col = (y - oy) / sy, (x - ox) / sx
@@ -743,8 +795,15 @@ class Plot2D(PlotWindow):
# Test positive before cast otherwise issue with int(-0.5) = 0
row, col = int(row), int(col)
if (row < data.shape[0] and col < data.shape[1]):
- value = data[row, col]
- valueZ = image.getZValue()
+ v, z = data[row, col], image.getZValue()
+ if not isMask:
+ value = v
+ valueZ = z
+ else:
+ mask = v
+ maskZ = z
+ if maskZ > valueZ and mask > 0:
+ return value, "Masked"
return value
def getProfileToolbar(self):
diff --git a/silx/gui/plot/PrintPreviewToolButton.py b/silx/gui/plot/PrintPreviewToolButton.py
new file mode 100644
index 0000000..c5479b8
--- /dev/null
+++ b/silx/gui/plot/PrintPreviewToolButton.py
@@ -0,0 +1,350 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""
+This modules provides tool buttons to send the content of a plot to a
+print preview page.
+The plot content can then be moved on the page and resized prior to printing.
+
+Classes
+-------
+
+- :class:`PrintPreviewToolButton`
+- :class:`SingletonPrintPreviewToolButton`
+
+Examples
+--------
+
+Simple example
+++++++++++++++
+
+.. code-block:: python
+
+ from silx.gui import qt
+ from silx.gui.plot import PlotWidget
+ from silx.gui.plot.PrintPreviewToolButton import PrintPreviewToolButton
+ import numpy
+
+ app = qt.QApplication([])
+
+ pw = PlotWidget()
+ toolbar = qt.QToolBar(pw)
+ toolbutton = PrintPreviewToolButton(parent=toolbar, plot=pw)
+ pw.addToolBar(toolbar)
+ toolbar.addWidget(toolbutton)
+ pw.show()
+
+ x = numpy.arange(1000)
+ y = x / numpy.sin(x)
+ pw.addCurve(x, y)
+
+ app.exec_()
+
+Singleton example
++++++++++++++++++
+
+This example illustrates how to print the content of several different
+plots on the same page. The plots all instantiate a
+:class:`SingletonPrintPreviewToolButton`, which relies on a singleton widget
+(:class:`silx.gui.widgets.PrintPreview.SingletonPrintPreviewDialog`).
+
+.. image:: img/printPreviewMultiPlot.png
+
+.. code-block:: python
+
+ from silx.gui import qt
+ from silx.gui.plot import PlotWidget
+ from silx.gui.plot.PrintPreviewToolButton import SingletonPrintPreviewToolButton
+ import numpy
+
+ app = qt.QApplication([])
+
+ plot_widgets = []
+
+ for i in range(3):
+ pw = PlotWidget()
+ toolbar = qt.QToolBar(pw)
+ toolbutton = SingletonPrintPreviewToolButton(parent=toolbar,
+ plot=pw)
+ pw.addToolBar(toolbar)
+ toolbar.addWidget(toolbutton)
+ pw.show()
+ plot_widgets.append(pw)
+
+ x = numpy.arange(1000)
+
+ plot_widgets[0].addCurve(x, numpy.sin(x * 2 * numpy.pi / 1000))
+ plot_widgets[1].addCurve(x, numpy.cos(x * 2 * numpy.pi / 1000))
+ plot_widgets[2].addCurve(x, numpy.tan(x * 2 * numpy.pi / 1000))
+
+ app.exec_()
+
+"""
+from __future__ import absolute_import
+
+import logging
+from io import StringIO
+
+from .. import qt
+from .. import icons
+from . import PlotWidget
+from ..widgets.PrintPreview import PrintPreviewDialog, SingletonPrintPreviewDialog
+from ..widgets.PrintGeometryDialog import PrintGeometryDialog
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "18/07/2017"
+
+_logger = logging.getLogger(__name__)
+# _logger.setLevel(logging.DEBUG)
+
+
+class PrintPreviewToolButton(qt.QToolButton):
+ """QToolButton to open a :class:`PrintPreviewDialog` (if not already open)
+ and add the current plot to its page to be printed.
+
+ :param parent: See :class:`QAction`
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ """
+ def __init__(self, parent=None, plot=None):
+ super(PrintPreviewToolButton, self).__init__(parent)
+
+ if not isinstance(plot, PlotWidget):
+ raise TypeError("plot parameter must be a PlotWidget")
+ self.plot = plot
+
+ self.setIcon(icons.getQIcon('document-print'))
+
+ printGeomAction = qt.QAction("Print geometry", self)
+ printGeomAction.setToolTip("Define a print geometry prior to sending "
+ "the plot to the print preview dialog")
+ printGeomAction.setIcon(icons.getQIcon('shape-rectangle')) # fixme: icon not displayed in menu
+ printGeomAction.triggered.connect(self._setPrintConfiguration)
+
+ printPreviewAction = qt.QAction("Print preview", self)
+ printPreviewAction.setToolTip("Send plot to the print preview dialog")
+ printPreviewAction.setIcon(icons.getQIcon('document-print')) # fixme: icon not displayed
+ printPreviewAction.triggered.connect(self._plotToPrintPreview)
+
+ menu = qt.QMenu(self)
+ menu.addAction(printGeomAction)
+ menu.addAction(printPreviewAction)
+ self.setMenu(menu)
+ self.setPopupMode(qt.QToolButton.InstantPopup)
+
+ self._printPreviewDialog = None
+ self._printConfigurationDialog = None
+
+ self._printGeometry = {"xOffset": 0.1,
+ "yOffset": 0.1,
+ "width": 0.9,
+ "height": 0.9,
+ "units": "page",
+ "keepAspectRatio": True}
+
+ @property
+ def printPreviewDialog(self):
+ """Lazy loaded :class:`PrintPreviewDialog`"""
+ # if changes are made here, don't forget making them in
+ # SingletonPrintPreviewToolButton.printPreviewDialog as well
+ if self._printPreviewDialog is None:
+ self._printPreviewDialog = PrintPreviewDialog(self.parent())
+ return self._printPreviewDialog
+
+ def _plotToPrintPreview(self):
+ """Grab the plot widget and send it to the print preview dialog.
+ Make sure the print preview dialog is shown and raised."""
+ self.printPreviewDialog.ensurePrinterIsSet()
+
+ if qt.HAS_SVG:
+ svgRenderer, viewBox = self._getSvgRendererAndViewbox()
+ self.printPreviewDialog.addSvgItem(svgRenderer,
+ viewBox=viewBox)
+ else:
+ _logger.warning("Missing QtSvg library, using a raster image")
+ if qt.BINDING in ["PyQt4", "PySide"]:
+ pixmap = qt.QPixmap.grabWidget(self.plot.centralWidget())
+ else:
+ # PyQt5 and hopefully PyQt6+
+ pixmap = self.plot.centralWidget().grab()
+ self.printPreviewDialog.addPixmap(pixmap)
+ self.printPreviewDialog.show()
+ self.printPreviewDialog.raise_()
+
+ def _getSvgRendererAndViewbox(self):
+ """Return a SVG renderer displaying the plot and its viewbox
+ (interactively specified by the user the first time this is called).
+
+ The size of the renderer is adjusted to the printer configuration
+ and to the geometry configuration (width, height, ratio) specified
+ by the user."""
+ imgData = StringIO()
+ assert self.plot.saveGraph(imgData, fileFormat="svg"), \
+ "Unable to save graph"
+ imgData.flush()
+ imgData.seek(0)
+ svgData = imgData.read()
+
+ svgRenderer = qt.QSvgRenderer()
+
+ viewbox = self._getViewBox()
+
+ svgRenderer.setViewBox(viewbox)
+
+ xml_stream = qt.QXmlStreamReader(svgData.encode(errors="replace"))
+
+ # This is for PyMca compatibility, to share a print preview with PyMca plots
+ svgRenderer._viewBox = viewbox
+ svgRenderer._svgRawData = svgData.encode(errors="replace")
+ svgRenderer._svgRendererData = xml_stream
+
+ if not svgRenderer.load(xml_stream):
+ raise RuntimeError("Cannot interpret svg data")
+
+ return svgRenderer, viewbox
+
+ def _getViewBox(self):
+ """
+ """
+ printer = self.printPreviewDialog.printer
+ dpix = printer.logicalDpiX()
+ dpiy = printer.logicalDpiY()
+ availableWidth = printer.width()
+ availableHeight = printer.height()
+
+ config = self._printGeometry
+ width = config['width']
+ height = config['height']
+ xOffset = config['xOffset']
+ yOffset = config['yOffset']
+ units = config['units']
+ keepAspectRatio = config['keepAspectRatio']
+ aspectRatio = self._getPlotAspectRatio()
+
+ # convert the offsets to dots
+ if units.lower() in ['inch', 'inches']:
+ xOffset = xOffset * dpix
+ yOffset = yOffset * dpiy
+ if width is not None:
+ width = width * dpix
+ if height is not None:
+ height = height * dpiy
+ elif units.lower() in ['cm', 'centimeters']:
+ xOffset = (xOffset / 2.54) * dpix
+ yOffset = (yOffset / 2.54) * dpiy
+ if width is not None:
+ width = (width / 2.54) * dpix
+ if height is not None:
+ height = (height / 2.54) * dpiy
+ else:
+ # page units
+ xOffset = availableWidth * xOffset
+ yOffset = availableHeight * yOffset
+ if width is not None:
+ width = availableWidth * width
+ if height is not None:
+ height = availableHeight * height
+
+ availableWidth -= xOffset
+ availableHeight -= yOffset
+
+ if width is not None:
+ if (availableWidth + 0.1) < width:
+ txt = "Available width %f is less than requested width %f" % \
+ (availableWidth, width)
+ raise ValueError(txt)
+ if height is not None:
+ if (availableHeight + 0.1) < height:
+ txt = "Available height %f is less than requested height %f" % \
+ (availableHeight, height)
+ raise ValueError(txt)
+
+ if keepAspectRatio:
+ bodyWidth = width or availableWidth
+ bodyHeight = bodyWidth * aspectRatio
+
+ if bodyHeight > availableHeight:
+ bodyHeight = availableHeight
+ bodyWidth = bodyHeight / aspectRatio
+
+ else:
+ bodyWidth = width or availableWidth
+ bodyHeight = height or availableHeight
+
+ return qt.QRectF(xOffset,
+ yOffset,
+ bodyWidth,
+ bodyHeight)
+
+ def _setPrintConfiguration(self):
+ """Open a dialog to prompt the user to adjust print
+ geometry parameters."""
+ self.printPreviewDialog.ensurePrinterIsSet()
+ if self._printConfigurationDialog is None:
+ self._printConfigurationDialog = PrintGeometryDialog(self.parent())
+
+ self._printConfigurationDialog.setPrintGeometry(self._printGeometry)
+ if self._printConfigurationDialog.exec_():
+ self._printGeometry = self._printConfigurationDialog.getPrintGeometry()
+
+ def _getPlotAspectRatio(self):
+ widget = self.plot.centralWidget()
+ graphWidth = float(widget.width())
+ graphHeight = float(widget.height())
+ return graphHeight / graphWidth
+
+
+class SingletonPrintPreviewToolButton(PrintPreviewToolButton):
+ """This class is similar to its parent class :class:`PrintPreviewToolButton`
+ but it uses a singleton print preview widget.
+
+ This allows for several plots to send their content to the
+ same print page, and for users to arrange them."""
+ def __init__(self, parent=None, plot=None):
+ PrintPreviewToolButton.__init__(self, parent, plot)
+
+ @property
+ def printPreviewDialog(self):
+ if self._printPreviewDialog is None:
+ self._printPreviewDialog = SingletonPrintPreviewDialog(self.parent())
+ return self._printPreviewDialog
+
+
+if __name__ == '__main__':
+ import numpy
+ app = qt.QApplication([])
+
+ pw = PlotWidget()
+ toolbar = qt.QToolBar(pw)
+ toolbutton = PrintPreviewToolButton(parent=toolbar,
+ plot=pw)
+ pw.addToolBar(toolbar)
+ toolbar.addWidget(toolbutton)
+ pw.show()
+
+ x = numpy.arange(1000)
+ y = x / numpy.sin(x)
+ pw.addCurve(x, y)
+
+ app.exec_()
diff --git a/silx/gui/plot/Profile.py b/silx/gui/plot/Profile.py
index a11b3f0..ff85695 100644
--- a/silx/gui/plot/Profile.py
+++ b/silx/gui/plot/Profile.py
@@ -28,7 +28,7 @@ and stacks of images"""
__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel", "H. Payno"]
__license__ = "MIT"
-__date__ = "24/04/2017"
+__date__ = "17/08/2017"
import numpy
@@ -39,11 +39,11 @@ from .. import icons
from .. import qt
from . import items
from .Colors import cursorColorForColormap
-from .PlotActions import PlotAction
+from . import actions
from .PlotToolButtons import ProfileToolButton
from .ProfileMainWindow import ProfileMainWindow
-from silx.utils.decorators import deprecated
+from silx.utils.deprecation import deprecated
def _alignedFullProfile(data, origin, scale, position, roiWidth, axis):
@@ -372,13 +372,8 @@ class ProfileToolBar(qt.QToolBar):
self._profileMainWindow = ProfileMainWindow(self)
# Actions
- self.browseAction = qt.QAction(
- icons.getQIcon('normal'),
- 'Browsing Mode', None)
- self.browseAction.setToolTip(
- 'Enables zooming interaction mode')
- self.browseAction.setCheckable(True)
- self.browseAction.triggered[bool].connect(self._browseActionTriggered)
+ self._browseAction = actions.mode.ZoomModeAction(self.plot, parent=self)
+ self._browseAction.setVisible(False)
self.hLineAction = qt.QAction(
icons.getQIcon('shape-horizontal'),
@@ -414,15 +409,13 @@ class ProfileToolBar(qt.QToolBar):
# ActionGroup
self.actionGroup = qt.QActionGroup(self)
- self.actionGroup.addAction(self.browseAction)
+ self.actionGroup.addAction(self._browseAction)
self.actionGroup.addAction(self.hLineAction)
self.actionGroup.addAction(self.vLineAction)
self.actionGroup.addAction(self.lineAction)
- self.browseAction.setChecked(True)
-
# Add actions to ToolBar
- self.addAction(self.browseAction)
+ self.addAction(self._browseAction)
self.addAction(self.hLineAction)
self.addAction(self.vLineAction)
self.addAction(self.lineAction)
@@ -450,6 +443,11 @@ class ProfileToolBar(qt.QToolBar):
self.getProfileMainWindow().sigClose.connect(self.clearProfile)
@property
+ @deprecated(since_version="0.6.0")
+ def browseAction(self):
+ return self._browseAction
+
+ @property
@deprecated(replacement="getProfilePlot", since_version="0.5.0")
def profileWindow(self):
return self.getProfilePlot()
@@ -473,10 +471,15 @@ class ProfileToolBar(qt.QToolBar):
def _activeImageChanged(self, previous, legend):
"""Handle active image change: toggle enabled toolbar, update curve"""
- self.setEnabled(legend is not None)
- if legend is not None:
- # Update default profile color
+ if legend is None:
+ self.setEnabled(False)
+ else:
activeImage = self.plot.getActiveImage()
+
+ # Disable for empty image
+ self.setEnabled(activeImage.getData(copy=False).size > 0)
+
+ # Update default profile color
if isinstance(activeImage, items.ColormapMixIn):
self._defaultOverlayColor = cursorColorForColormap(
activeImage.getColormap()['name'])
@@ -495,7 +498,15 @@ class ProfileToolBar(qt.QToolBar):
If changed from elsewhere, disable drawing tool
"""
if source is not self:
- self.browseAction.setChecked(True)
+ self.clearProfile()
+
+ # Uncheck all drawing profile modes
+ self.hLineAction.setChecked(False)
+ self.vLineAction.setChecked(False)
+ self.lineAction.setChecked(False)
+
+ if self.getProfileMainWindow() is not None:
+ self.getProfileMainWindow().hide()
def _hLineActionToggled(self, checked):
"""Handle horizontal line profile action toggle"""
@@ -524,14 +535,6 @@ class ProfileToolBar(qt.QToolBar):
else:
self.plot.sigPlotSignal.disconnect(self._plotWindowSlot)
- def _browseActionTriggered(self, checked):
- """Handle browse action mode triggered by user."""
- if checked:
- self.clearProfile()
- self.plot.setInteractiveMode('zoom', source=self)
- if self.getProfileMainWindow() is not None:
- self.getProfileMainWindow().hide()
-
def _plotWindowSlot(self, event):
"""Listen to Plot to handle drawing events to refresh ROI and profile.
"""
@@ -585,8 +588,8 @@ class ProfileToolBar(qt.QToolBar):
self.plot.remove(self._POLYGON_LEGEND, kind='item')
self.getProfilePlot().clear()
self.getProfilePlot().setGraphTitle('')
- self.getProfilePlot().setGraphXLabel('X')
- self.getProfilePlot().setGraphYLabel('Y')
+ self.getProfilePlot().getXAxis().setLabel('X')
+ self.getProfilePlot().getYAxis().setLabel('Y')
self._createProfile(currentData=image.getData(copy=False),
origin=image.getOrigin(),
@@ -678,17 +681,21 @@ class ProfileToolBar(qt.QToolBar):
class Profile3DToolBar(ProfileToolBar):
- def __init__(self, parent=None, plot=None, title='Profile Selection'):
+ def __init__(self, parent=None, stackview=None,
+ title='Profile Selection'):
"""QToolBar providing profile tools for an image or a stack of images.
:param parent: the parent QWidget
- :param plot: :class:`PlotWindow` instance on which to operate.
+ :param stackview: :class:`StackView` instance on which to operate.
:param str title: See :class:`QToolBar`.
:param parent: See :class:`QToolBar`.
"""
# TODO: add param profileWindow (specify the plot used for profiles)
- super(Profile3DToolBar, self).__init__(parent=parent, plot=plot,
+ super(Profile3DToolBar, self).__init__(parent=parent,
+ plot=stackview.getPlot(),
title=title)
+ self.stackView = stackview
+ """:class:`StackView` instance"""
self.profile3dAction = ProfileToolButton(
parent=self, plot=self.plot)
@@ -721,15 +728,15 @@ class Profile3DToolBar(ProfileToolBar):
if self._profileType == "1D":
super(Profile3DToolBar, self).updateProfile()
elif self._profileType == "2D":
- stackData = self.plot.getCurrentView(copy=False,
- returnNumpyArray=True)
+ stackData = self.stackView.getCurrentView(copy=False,
+ returnNumpyArray=True)
if stackData is None:
return
self.plot.remove(self._POLYGON_LEGEND, kind='item')
self.getProfilePlot().clear()
self.getProfilePlot().setGraphTitle('')
- self.getProfilePlot().setGraphXLabel('X')
- self.getProfilePlot().setGraphYLabel('Y')
+ self.getProfilePlot().getXAxis().setLabel('X')
+ self.getProfilePlot().getYAxis().setLabel('Y')
self._createProfile(currentData=stackData[0],
origin=stackData[1]['origin'],
diff --git a/silx/gui/plot/ScatterMaskToolsWidget.py b/silx/gui/plot/ScatterMaskToolsWidget.py
index 793719d..a9c1073 100644
--- a/silx/gui/plot/ScatterMaskToolsWidget.py
+++ b/silx/gui/plot/ScatterMaskToolsWidget.py
@@ -181,18 +181,14 @@ class ScatterMaskToolsWidget(BaseMaskToolsWidget):
:class:`PlotWidget`."""
def __init__(self, parent=None, plot=None):
+ super(ScatterMaskToolsWidget, self).__init__(parent, plot,
+ mask=ScatterMask())
self._z = 2 # Mask layer in plot
self._data_scatter = None
"""plot Scatter item for data"""
self._mask_scatter = None
"""plot Scatter item for representing the mask"""
- self._mask = ScatterMask()
-
- super(ScatterMaskToolsWidget, self).__init__(parent, plot)
-
- self._initWidgets()
-
def setSelectionMask(self, mask, copy=True):
"""Set the mask to a new array.
@@ -524,6 +520,5 @@ class ScatterMaskToolsDockWidget(BaseMaskToolsDockWidget):
:paran str name: The title of this widget
"""
def __init__(self, parent=None, plot=None, name='Mask'):
- super(ScatterMaskToolsDockWidget, self).__init__(parent, name)
- self.setWidget(ScatterMaskToolsWidget(plot=plot))
- self.widget().sigMaskChanged.connect(self._emitSigMaskChanged)
+ widget = ScatterMaskToolsWidget(plot=plot)
+ super(ScatterMaskToolsDockWidget, self).__init__(parent, name, widget)
diff --git a/silx/gui/plot/StackView.py b/silx/gui/plot/StackView.py
index 9bb0cf0..938447b 100644
--- a/silx/gui/plot/StackView.py
+++ b/silx/gui/plot/StackView.py
@@ -69,18 +69,14 @@ Example::
__authors__ = ["P. Knobel", "H. Payno"]
__license__ = "MIT"
-__date__ = "20/01/2017"
+__date__ = "11/09/2017"
import numpy
-try:
- import h5py
-except ImportError:
- h5py = None
-
from silx.gui import qt
from .. import icons
-from . import items, PlotWindow, PlotActions
+from . import items, PlotWindow, actions
+from .Colormap import Colormap
from .Colors import cursorColorForColormap
from .PlotTools import LimitsToolBar
from .Profile import Profile3DToolBar
@@ -88,6 +84,16 @@ from ..widgets.FrameBrowser import HorizontalSliderWithBrowser
from silx.utils.array_like import DatasetView, ListOfImages
from silx.math import calibration
+from silx.utils.deprecation import deprecated_warning
+
+try:
+ import h5py
+except ImportError:
+ def is_dataset(obj):
+ return False
+ h5py = None
+else:
+ from silx.io.utils import is_dataset
class StackView(qt.QMainWindow):
@@ -100,7 +106,7 @@ class StackView(qt.QMainWindow):
:param QWidget parent: the Qt parent, or None
:param backend: The backend to use for the plot (default: matplotlib).
- See :class:`.Plot` for the list of supported backend.
+ See :class:`.PlotWidget` for the list of supported backend.
:type backend: str or :class:`BackendBase.BackendBase`
:param bool resetzoom: Toggle visibility of reset zoom action.
:param bool autoScale: Toggle visibility of axes autoscale actions.
@@ -181,6 +187,10 @@ class StackView(qt.QMainWindow):
self._first_stack_dimension = 0
"""Used for dimension labels and combobox"""
+ self._titleCallback = self._defaultTitleCallback
+ """Function returning the plot title based on the frame index.
+ It can be set to a custom function using :meth:`setTitleCallback`"""
+
central_widget = qt.QWidget(self)
self._plot = PlotWindow(parent=central_widget, backend=backend,
@@ -195,11 +205,13 @@ class StackView(qt.QMainWindow):
self.sigActiveImageChanged = self._plot.sigActiveImageChanged
self.sigPlotSignal = self._plot.sigPlotSignal
+ self._addColorBarAction()
+
self._plot.profile = Profile3DToolBar(parent=self._plot,
- plot=self)
+ stackview=self)
self._plot.addToolBar(self._plot.profile)
- self._plot.setGraphXLabel('Columns')
- self._plot.setGraphYLabel('Rows')
+ self._plot.getXAxis().setLabel('Columns')
+ self._plot.getYAxis().setLabel('Rows')
self._plot.sigPlotSignal.connect(self._plotCallback)
self.__planeSelection = PlanesWidget(self._plot)
@@ -227,14 +239,15 @@ class StackView(qt.QMainWindow):
self.__planeSelection.sigPlaneSelectionChanged.connect(
self._plot.profile.clearProfile)
- def setOptionVisible(self, isVisible):
- """
- Set the visibility of the browsing options.
-
- :param bool isVisible: True to have the options visible, else False
- """
- self._browser.setVisible(isVisible)
- self.__planeSelection.setVisible(isVisible)
+ def _addColorBarAction(self):
+ self._plot.getColorBarWidget().setVisible(True)
+ actions = self._plot.toolBar().actions()
+ for index, action in enumerate(actions):
+ if action is self._plot.getColormapAction():
+ break
+ self._plot.toolBar().insertAction(
+ actions[index + 1],
+ self._plot.getColorBarWidget().getToggleViewAction())
def _plotCallback(self, eventDict):
"""Callback for plot events.
@@ -242,7 +255,7 @@ class StackView(qt.QMainWindow):
Emit :attr:`valueChanged` signal, with (x, y, value) tuple of the
cursor location in the plot."""
if eventDict['event'] == 'mouseMoved':
- activeImage = self.getActiveImage()
+ activeImage = self._plot.getActiveImage()
if activeImage is not None:
data = activeImage.getData()
height, width = data.shape
@@ -305,8 +318,7 @@ class StackView(qt.QMainWindow):
if isinstance(self._stack, numpy.ndarray):
self.__transposed_view = self._stack
- elif h5py is not None and isinstance(self._stack, h5py.Dataset) or \
- isinstance(self._stack, DatasetView):
+ elif is_dataset(self._stack) or isinstance(self._stack, DatasetView):
self.__transposed_view = DatasetView(self._stack)
elif isinstance(self._stack, ListOfImages):
@@ -321,13 +333,6 @@ class StackView(qt.QMainWindow):
self._browser.setRange(0, self.__transposed_view.shape[0] - 1)
self._browser.setValue(0)
- def setFrameNumber(self, number):
- """Set the frame selection to a specific value\
-
- :param int number: Number of the frame
- """
- self._browser.setValue(number)
-
def __updateFrameNumber(self, index):
"""Update the current image.
@@ -339,7 +344,7 @@ class StackView(qt.QMainWindow):
scale=self._getImageScale(),
legend=self.__imageLegend,
resetzoom=False, replace=False)
- self._plot.setGraphTitle("Image z=%g" % self._getImageZ(index))
+ self._updateTitle()
def _set3DScaleAndOrigin(self, calibrations):
"""Set scale and origin for all 3 axes, to be used when plotting
@@ -396,7 +401,14 @@ class StackView(qt.QMainWindow):
_xcalib, _ycalib, zcalib = self._getXYZCalibs()
return zcalib(index)
- # public API
+ def _updateTitle(self):
+ frame_idx = self._browser.value()
+ self._plot.setGraphTitle(self._titleCallback(frame_idx))
+
+ def _defaultTitleCallback(self, index):
+ return "Image z=%g" % self._getImageZ(index)
+
+ # public API, stack specific methods
def setStack(self, stack, perspective=0, reset=True, calibrations=None):
"""Set the 3D stack.
@@ -426,7 +438,7 @@ class StackView(qt.QMainWindow):
# stack as list of 2D arrays: must be converted into an array_like
if not isinstance(stack, numpy.ndarray):
- if h5py is None or not isinstance(stack, h5py.Dataset):
+ if not is_dataset(stack):
try:
assert hasattr(stack, "__len__")
for img in stack:
@@ -492,7 +504,7 @@ class StackView(qt.QMainWindow):
:return: 3D stack and parameters.
:rtype: (numpy.ndarray, dict)
"""
- image = self.getActiveImage()
+ image = self._plot.getActiveImage()
if image is None:
return None
@@ -543,7 +555,7 @@ class StackView(qt.QMainWindow):
:return: 3D stack and parameters.
:rtype: (numpy.ndarray, dict)
"""
- image = self.getActiveImage()
+ image = self._plot.getActiveImage()
if image is None:
return None
@@ -567,18 +579,57 @@ class StackView(qt.QMainWindow):
return numpy.array(self.__transposed_view, copy=copy), params
return self.__transposed_view, params
- def getActiveImage(self, just_legend=False):
- """Returns the currently active image object.
+ def setFrameNumber(self, number):
+ """Set the frame selection to a specific value
- It returns None in case of not having an active image.
+ :param int number: Number of the frame
+ """
+ self._browser.setValue(number)
- :param bool just_legend: True to get the legend of the image,
- False (the default) to get the image data and info.
- Note: :class:`StackView` uses the same legend for all frames.
- :return: legend or image object
- :rtype: str or list or None
+ def setFirstStackDimension(self, first_stack_dimension):
+ """When viewing the last 3 dimensions of an n-D array (n>3), you can
+ use this method to change the text in the combobox.
+
+ For instance, for a 7-D array, first stack dim is 4, so the default
+ "Dim1-Dim2" text should be replaced with "Dim5-Dim6" (dimensions
+ numbers are 0-based).
+
+ :param int first_stack_dim: First stack dimension (n-3) when viewing the
+ last 3 dimensions of an n-D array.
"""
- return self._plot.getActiveImage(just_legend=just_legend)
+ old_state = self.__planeSelection.blockSignals(True)
+ self.__planeSelection.setFirstStackDimension(first_stack_dimension)
+ self.__planeSelection.blockSignals(old_state)
+ self._first_stack_dimension = first_stack_dimension
+ self._browser_label.setText("Image index (Dim%d):" % first_stack_dimension)
+
+ def setTitleCallback(self, callback):
+ """Set a user defined function to generate the plot title based on the
+ image/frame index.
+
+ The callback function must accept an integer as a its first positional
+ parameter and must not require any other mandatory parameter.
+ It must return a string.
+
+ To switch back the default behavior, you can pass ``None``::
+
+ mystackview.setTitleCallback(None)
+
+ To have no title, pass a function that returns an empty string::
+
+ mystackview.setTitleCallback(lambda idx: "")
+
+ :param callback: Callback function generating the stack title based
+ on the frame number.
+ """
+
+ if callback is None:
+ self._titleCallback = self._defaultTitleCallback
+ elif callable(callback):
+ self._titleCallback = callback
+ else:
+ raise TypeError("Provided callback is not callable")
+ self._updateTitle()
def clear(self):
"""Clear the widget:
@@ -592,22 +643,6 @@ class StackView(qt.QMainWindow):
self._browser.setEnabled(False)
self._plot.clear()
- def resetZoom(self):
- """Reset the plot limits to the bounds of the data and redraw the plot.
- """
- self._plot.resetZoom()
-
- def getGraphTitle(self):
- """Return the plot main title as a str."""
- return self._plot.getGraphTitle()
-
- def setGraphTitle(self, title=""):
- """Set the plot main title.
-
- :param str title: Main title of the plot (default: '')
- """
- return self._plot.setGraphTitle(title)
-
def setLabels(self, labels=None):
"""Set the labels to be displayed on the plot axes.
@@ -635,55 +670,13 @@ class StackView(qt.QMainWindow):
self.__dimensionsLabels = new_labels
self.__updatePlotLabels()
- def getGraphXLabel(self):
- """Return the current horizontal axis label as a str."""
- return self._plot.getGraphXLabel()
-
- def setGraphXLabel(self, label=None):
- """Set the plot horizontal axis label.
-
- :param str label: The horizontal axis label
- """
- if label is None:
- label = self.__dimensionsLabels[1 if self._perspective == 2 else 2]
- self._plot.setGraphXLabel(label)
-
- def getGraphYLabel(self, axis='left'):
- """Return the current vertical axis label as a str.
-
- :param str axis: The Y axis for which to get the label (left or right)
- """
- return self._plot.getGraphYLabel(axis)
-
- def setGraphYLabel(self, label=None, axis='left'):
- """Set the vertical axis label on the plot.
-
- :param str label: The Y axis label
- :param str axis: The Y axis for which to set the label (left or right)
- """
- if label is None:
- label = self.__dimensionsLabels[1 if self._perspective == 0 else 0]
- self._plot.setGraphYLabel(label, axis)
-
- def setYAxisInverted(self, flag=True):
- """Set the Y axis orientation.
+ def getLabels(self):
+ """Return dimension labels displayed on the plot axes
- :param bool flag: True for Y axis going from top to bottom,
- False for Y axis going from bottom to top
- """
- self._plot.setYAxisInverted(flag)
-
- def isYAxisInverted(self):
- """Return True if Y axis goes from top to bottom, False otherwise."""
- return self._backend.isYAxisInverted()
-
- def getSupportedColormaps(self):
- """Get the supported colormap names as a tuple of str.
-
- The list should at least contain and start by:
- ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
+ :return: List of three strings corresponding to the 3 dimensions
+ of the stack: (name_dim0, name_dim1, name_dim2)
"""
- return self._plot.getSupportedColormaps()
+ return self.__dimensionsLabels
def getColormap(self):
"""Get the current colormap description.
@@ -720,12 +713,12 @@ class StackView(qt.QMainWindow):
:param colormap: Name of the colormap in
'gray', 'reversed gray', 'temperature', 'red', 'green', 'blue'.
- Or the description of the colormap as a dict.
+ Or a :class`.Colormap` object.
:type colormap: dict or str.
:param str normalization: Colormap mapping: 'linear' or 'log'.
:param bool autoscale: Whether to use autoscale or [vmin, vmax] range.
- Default value of autoscale is True if data is a numpy array,
- False if data is a h5py dataset.
+ Default value of autoscale is False. This option is not compatible
+ with h5py datasets.
:param float vmin: The minimum value of the range to use if
'autoscale' is False.
:param float vmax: The maximum value of the range to use if
@@ -733,84 +726,85 @@ class StackView(qt.QMainWindow):
:param numpy.ndarray colors: Only used if name is None.
Custom colormap colors as Nx3 or Nx4 RGB or RGBA arrays
"""
- cmapDict = self.getColormap()
-
- if isinstance(colormap, dict):
+ # if is a colormap object or a dictionary
+ if isinstance(colormap, Colormap) or isinstance(colormap, dict):
# Support colormap parameter as a dict
- errmsg = "If colormap is provided as a dict, all other parameters"
+ errmsg = "If colormap is provided as a Colormap object, all other parameters"
errmsg += " must not be specified when calling setColormap"
assert normalization is None, errmsg
assert autoscale is None, errmsg
assert vmin is None, errmsg
assert vmax is None, errmsg
assert colors is None, errmsg
- cmapDict.update(colormap)
+ if isinstance(colormap, dict):
+ reason = 'colormap parameter should now be an object'
+ replacement = 'Colormap()'
+ since_version = '0.6'
+ deprecated_warning(type_='function',
+ name='setColormap',
+ reason=reason,
+ replacement=replacement,
+ since_version=since_version)
+ _colormap = Colormap._fromDict(colormap)
+ else:
+ _colormap = colormap
else:
- if colormap is not None:
- cmapDict['name'] = colormap
- if normalization is not None:
- cmapDict['normalization'] = normalization
- if colors is not None:
- cmapDict['colors'] = colors
-
- # Default meaning of autoscale is to reset min and max
- # each time a new image is added to the plot.
- # We want to use min and max of global volume,
- # and not change them when browsing slides
- cmapDict['autoscale'] = False
-
+ norm = normalization if normalization is not None else 'linear'
+ name = colormap if colormap is not None else 'gray'
+ _colormap = Colormap(name=name,
+ normalization=norm,
+ vmin=vmin,
+ vmax=vmax,
+ colors=colors)
+
+ # Patch: since we don't apply this colormap to a single 2D data but
+ # a 2D stack we have to deal manually with vmin, vmax
if autoscale is None:
# set default
autoscale = False
- # TODO: assess cost of computing min/max for large 3D array
- # if isinstance(self._stack, numpy.ndarray):
- # autoscale = True
- # else: # h5py.Dataset
- # autoscale = False
- elif autoscale and isinstance(self._stack, h5py.Dataset):
+ elif autoscale and is_dataset(self._stack):
# h5py dataset has no min()/max() methods
raise RuntimeError(
"Cannot auto-scale colormap for a h5py dataset")
else:
autoscale = autoscale
self.__autoscaleCmap = autoscale
+
if autoscale and (self._stack is not None):
- cmapDict['vmin'] = self._stack.min()
- cmapDict['vmax'] = self._stack.max()
+ _vmin, _vmax = _colormap.getColormapRange(data=self._stack)
+ _colormap.setVRange(vmin=_vmin, vmax=_vmax)
else:
- if vmin is not None:
- cmapDict['vmin'] = vmin
- if vmax is not None:
- cmapDict['vmax'] = vmax
+ if vmin is None and self._stack is not None:
+ _colormap.setVMin(self._stack.min())
+ else:
+ _colormap.setVMin(vmin)
+ if vmax is None and self._stack is not None:
+ _colormap.setVMax(self._stack.max())
+ else:
+ _colormap.setVMax(vmax)
- cursorColor = cursorColorForColormap(cmapDict['name'])
+ cursorColor = cursorColorForColormap(_colormap.getName())
self._plot.setInteractiveMode('zoom', color=cursorColor)
- self._plot.setDefaultColormap(cmapDict)
+ self._plot.setDefaultColormap(_colormap)
# Update active image colormap
activeImage = self._plot.getActiveImage()
if isinstance(activeImage, items.ColormapMixIn):
activeImage.setColormap(self.getColormap())
- def isKeepDataAspectRatio(self):
- """Returns whether the plot is keeping data aspect ratio or not."""
- return self._plot.isKeepDataAspectRatio()
+ def getPlot(self):
+ """Return the :class:`PlotWidget`.
- def setKeepDataAspectRatio(self, flag=True):
- """Set whether the plot keeps data aspect ratio or not.
+ This gives access to advanced plot configuration options.
+ Be warned that modifying the plot can cause issues, and some changes
+ you make to the plot could be overwritten by the :class:`StackView`
+ widget's internal methods and callbacks.
- :param bool flag: True to respect data aspect ratio
+ :return: instance of :class:`PlotWidget` used in widget
"""
- self._plot.setKeepDataAspectRatio(flag)
-
- def getProfileToolbar(self):
- """Profile tools attached to this plot
-
- See :class:`silx.gui.plot.Profile.Profile3DToolBar`
- """
- return self._plot.profile
+ return self._plot
def getProfileWindow1D(self):
"""Plot window used to display 1D profile curve.
@@ -826,7 +820,158 @@ class StackView(qt.QMainWindow):
"""
return self._plot.profile.getProfileWindow2D()
+ def setOptionVisible(self, isVisible):
+ """
+ Set the visibility of the browsing options.
+
+ :param bool isVisible: True to have the options visible, else False
+ """
+ self._browser.setVisible(isVisible)
+ self.__planeSelection.setVisible(isVisible)
+
+ # proxies to PlotWidget or PlotWindow methods
+ def getProfileToolbar(self):
+ """Profile tools attached to this plot
+
+ See :class:`silx.gui.plot.Profile.Profile3DToolBar`
+ """
+ return self._plot.profile
+
+ def getGraphTitle(self):
+ """Return the plot main title as a str.
+ """
+ return self._plot.getGraphTitle()
+
+ def setGraphTitle(self, title=""):
+ """Set the plot main title.
+
+ :param str title: Main title of the plot (default: '')
+ """
+ return self._plot.setGraphTitle(title)
+
+ def getGraphXLabel(self):
+ """Return the current horizontal axis label as a str.
+ """
+ return self._plot.getXAxis().getLabel()
+
+ def setGraphXLabel(self, label=None):
+ """Set the plot horizontal axis label.
+
+ :param str label: The horizontal axis label
+ """
+ if label is None:
+ label = self.__dimensionsLabels[1 if self._perspective == 2 else 2]
+ self._plot.getXAxis().setLabel(label)
+
+ def getGraphYLabel(self, axis='left'):
+ """Return the current vertical axis label as a str.
+
+ :param str axis: The Y axis for which to get the label (left or right)
+ """
+ return self._plot.getYAxis().getLabel(axis)
+
+ def setGraphYLabel(self, label=None, axis='left'):
+ """Set the vertical axis label on the plot.
+
+ :param str label: The Y axis label
+ :param str axis: The Y axis for which to set the label (left or right)
+ """
+ if label is None:
+ label = self.__dimensionsLabels[1 if self._perspective == 0 else 0]
+ self._plot.getYAxis(axis=axis).setLabel(label)
+
+ def resetZoom(self):
+ """Reset the plot limits to the bounds of the data and redraw the plot.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().resetZoom()
+ """
+ self._plot.resetZoom()
+
+ def setYAxisInverted(self, flag=True):
+ """Set the Y axis orientation.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().setYAxisInverted(flag)
+
+ :param bool flag: True for Y axis going from top to bottom,
+ False for Y axis going from bottom to top
+ """
+ self._plot.setYAxisInverted(flag)
+
+ def isYAxisInverted(self):
+ """Return True if Y axis goes from top to bottom, False otherwise.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().isYAxisInverted()"""
+ return self._plot.isYAxisInverted()
+
+ def getSupportedColormaps(self):
+ """Get the supported colormap names as a tuple of str.
+
+ The list should at least contain and start by:
+ ('gray', 'reversed gray', 'temperature', 'red', 'green', 'blue')
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().getSupportedColormaps()
+ """
+ return self._plot.getSupportedColormaps()
+
+ def isKeepDataAspectRatio(self):
+ """Returns whether the plot is keeping data aspect ratio or not.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().isKeepDataAspectRatio()"""
+ return self._plot.isKeepDataAspectRatio()
+
+ def setKeepDataAspectRatio(self, flag=True):
+ """Set whether the plot keeps data aspect ratio or not.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().setKeepDataAspectRatio(flag)
+
+ :param bool flag: True to respect data aspect ratio
+ """
+ self._plot.setKeepDataAspectRatio(flag)
+
# kind of private methods, but needed by Profile
+ def getActiveImage(self, just_legend=False):
+ """Returns the currently active image object.
+
+ It returns None in case of not having an active image.
+
+ This method is a simple proxy to the legacy :class:`PlotWidget` method
+ of the same name. Using the object oriented approach is now
+ preferred::
+
+ stackview.getPlot().getActiveImage()
+
+ :param bool just_legend: True to get the legend of the image,
+ False (the default) to get the image data and info.
+ Note: :class:`StackView` uses the same legend for all frames.
+ :return: legend or image object
+ :rtype: str or list or None
+ """
+ return self._plot.getActiveImage(just_legend=just_legend)
+
def remove(self, legend=None,
kind=('curve', 'image', 'item', 'marker')):
"""See :meth:`Plot.Plot.remove`"""
@@ -844,23 +989,6 @@ class StackView(qt.QMainWindow):
"""
self._plot.addItem(*args, **kwargs)
- def setFirstStackDimension(self, first_stack_dimension):
- """When viewing the last 3 dimensions of an n-D array (n>3), you can
- use this method to change the text in the combobox.
-
- For instance, for a 7-D array, first stack dim is 4, so the default
- "Dim1-Dim2" text should be replaced with "Dim5-Dim6" (dimensions
- numbers are 0-based).
-
- :param int first_stack_dim: First stack dimension (n-3) when viewing the
- last 3 dimensions of an n-D array.
- """
- old_state = self.__planeSelection.blockSignals(True)
- self.__planeSelection.setFirstStackDimension(first_stack_dimension)
- self.__planeSelection.blockSignals(old_state)
- self._first_stack_dimension = first_stack_dimension
- self._browser_label.setText("Image index (Dim%d):" % first_stack_dimension)
-
class PlanesWidget(qt.QWidget):
"""Widget for the plane/perspective selection
@@ -974,11 +1102,12 @@ class StackViewMainWindow(StackView):
menu.addSeparator()
menu.addAction(self._plot.resetZoomAction)
menu.addAction(self._plot.colormapAction)
- menu.addAction(PlotActions.KeepAspectRatioAction(self._plot, self))
- menu.addAction(PlotActions.YAxisInvertedAction(self._plot, self))
+ menu.addAction(self._plot.getColorBarWidget().getToggleViewAction())
+
+ menu.addAction(actions.control.KeepAspectRatioAction(self._plot, self))
+ menu.addAction(actions.control.YAxisInvertedAction(self._plot, self))
menu = self.menuBar().addMenu('Profile')
- menu.addAction(self._plot.profile.browseAction)
menu.addAction(self._plot.profile.hLineAction)
menu.addAction(self._plot.profile.vLineAction)
menu.addAction(self._plot.profile.lineAction)
diff --git a/silx/gui/plot/_BaseMaskToolsWidget.py b/silx/gui/plot/_BaseMaskToolsWidget.py
index 91bbe1c..35a48ae 100644
--- a/silx/gui/plot/_BaseMaskToolsWidget.py
+++ b/silx/gui/plot/_BaseMaskToolsWidget.py
@@ -27,17 +27,19 @@
"""
from __future__ import division
-
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "20/04/2017"
+__date__ = "02/10/2017"
import os
import numpy
from silx.gui import qt, icons
+from silx.gui.widgets.FloatEdit import FloatEdit
+from silx.gui.plot.Colormap import Colormap
from silx.gui.plot.Colors import rgba
+from .actions.mode import PanModeAction
class BaseMask(qt.QObject):
@@ -353,24 +355,38 @@ class BaseMaskToolsWidget(qt.QWidget):
sigMaskChanged = qt.Signal()
_maxLevelNumber = 255
- def __init__(self, parent=None, plot=None):
+ def __init__(self, parent=None, plot=None, mask=None):
+ """
+
+ :param parent: Parent QWidget
+ :param plot: Plot widget on which to operate
+ :param mask: Instance of subclass of :class:`BaseMask`
+ (e.g. :class:`ImageMask`)
+ """
+ super(BaseMaskToolsWidget, self).__init__(parent)
# register if the user as force a color for the corresponding mask level
self._defaultColors = numpy.ones((self._maxLevelNumber + 1), dtype=numpy.bool)
# overlays colors set by the user
self._overlayColors = numpy.zeros((self._maxLevelNumber + 1, 3), dtype=numpy.float32)
+ # as parent have to be the first argument of the widget to fit
+ # QtDesigner need but here plot can't be None by default.
+ assert plot is not None
self._plot = plot
self._maskName = '__MASK_TOOLS_%d' % id(self) # Legend of the mask
- self._colormap = {
- 'name': None,
- 'normalization': 'linear',
- 'autoscale': False,
- 'vmin': 0, 'vmax': self._maxLevelNumber,
- 'colors': None}
+ self._colormap = Colormap(name="",
+ normalization='linear',
+ vmin=0,
+ vmax=self._maxLevelNumber,
+ colors=None)
self._defaultOverlayColor = rgba('gray') # Color of the mask
self._setMaskColors(1, 0.5)
+ if not isinstance(mask, BaseMask):
+ raise TypeError("mask is not an instance of BaseMask")
+ self._mask = mask
+
self._mask.sigChanged.connect(self._updatePlotMask)
self._mask.sigChanged.connect(self._emitSigMaskChanged)
@@ -378,12 +394,12 @@ class BaseMaskToolsWidget(qt.QWidget):
self._lastPencilPos = None
self._multipleMasks = 'exclusive'
- super(BaseMaskToolsWidget, self).__init__(parent)
-
self._maskFileDir = qt.QDir.home().absolutePath()
self.plot.sigInteractiveModeChanged.connect(
self._interactiveModeChanged)
+ self._initWidgets()
+
def _emitSigMaskChanged(self):
"""Notify mask changes"""
self.sigMaskChanged.emit()
@@ -570,17 +586,10 @@ class BaseMaskToolsWidget(qt.QWidget):
"""Init drawing tools widgets"""
layout = qt.QVBoxLayout()
- # Draw tools
- self.browseAction = qt.QAction(
- icons.getQIcon('normal'), 'Browse', None)
- self.browseAction.setShortcut(qt.QKeySequence(qt.Qt.Key_B))
- self.browseAction.setToolTip(
- 'Disables drawing tools, enables zooming interaction mode'
- ' <b>B</b>')
- self.browseAction.setCheckable(True)
- self.browseAction.triggered.connect(self._activeBrowseMode)
+ self.browseAction = PanModeAction(self.plot, self.plot)
self.addAction(self.browseAction)
+ # Draw tools
self.rectAction = qt.QAction(
icons.getQIcon('shape-rectangle'), 'Rectangle selection', None)
self.rectAction.setToolTip(
@@ -608,23 +617,22 @@ class BaseMaskToolsWidget(qt.QWidget):
'Pencil tool: (Un)Mask using a pencil <b>P</b>')
self.pencilAction.setCheckable(True)
self.pencilAction.triggered.connect(self._activePencilMode)
- self.addAction(self.polygonAction)
+ self.addAction(self.pencilAction)
self.drawActionGroup = qt.QActionGroup(self)
self.drawActionGroup.setExclusive(True)
- self.drawActionGroup.addAction(self.browseAction)
self.drawActionGroup.addAction(self.rectAction)
self.drawActionGroup.addAction(self.polygonAction)
self.drawActionGroup.addAction(self.pencilAction)
- self.browseAction.setChecked(True)
-
- self.drawButtons = {}
- for action in self.drawActionGroup.actions():
+ actions = (self.browseAction, self.rectAction,
+ self.polygonAction, self.pencilAction)
+ drawButtons = []
+ for action in actions:
btn = qt.QToolButton()
btn.setDefaultAction(action)
- self.drawButtons[action.text()] = btn
- container = self._hboxWidget(*self.drawButtons.values())
+ drawButtons.append(btn)
+ container = self._hboxWidget(*drawButtons)
layout.addWidget(container)
# Mask/Unmask radio buttons
@@ -644,10 +652,7 @@ class BaseMaskToolsWidget(qt.QWidget):
self.maskStateWidget = self._hboxWidget(maskRadioBtn, unmaskRadioBtn)
layout.addWidget(self.maskStateWidget)
- # Connect mask state widget visibility with browse action
- self.maskStateWidget.setHidden(self.browseAction.isChecked())
- self.browseAction.toggled[bool].connect(
- self.maskStateWidget.setHidden)
+ self.maskStateWidget.setHidden(True)
# Pencil settings
self.pencilSetting = self._createPencilSettings(None)
@@ -752,15 +757,11 @@ class BaseMaskToolsWidget(qt.QWidget):
form = qt.QFormLayout()
- self.minLineEdit = qt.QLineEdit()
- self.minLineEdit.setText('0')
- self.minLineEdit.setValidator(qt.QDoubleValidator())
+ self.minLineEdit = FloatEdit(self, value=0)
self.minLineEdit.setEnabled(False)
form.addRow('Min:', self.minLineEdit)
- self.maxLineEdit = qt.QLineEdit()
- self.maxLineEdit.setText('0')
- self.maxLineEdit.setValidator(qt.QDoubleValidator())
+ self.maxLineEdit = FloatEdit(self, value=0)
self.maxLineEdit.setEnabled(False)
form.addRow('Max:', self.maxLineEdit)
@@ -790,8 +791,9 @@ class BaseMaskToolsWidget(qt.QWidget):
"""Reset drawing action when disabling widget"""
if (event.type() == qt.QEvent.EnabledChange and
not self.isEnabled() and
- not self.browseAction.isChecked()):
- self.browseAction.trigger() # Disable drawing tool
+ self.drawActionGroup.checkedAction()):
+ # Disable drawing tool by setting interaction to zoom
+ self.browseAction.trigger()
def save(self, filename, kind):
"""Save current mask in a file
@@ -839,7 +841,7 @@ class BaseMaskToolsWidget(qt.QWidget):
# Set no mask level
colors[0] = (0., 0., 0., 0.)
- self._colormap['colors'] = colors
+ self._colormap.setColormapLUT(colors)
def resetMaskColors(self, level=None):
"""Reset the mask color at the given level to be defaultColors
@@ -928,10 +930,11 @@ class BaseMaskToolsWidget(qt.QWidget):
If changed from elsewhere, disable drawing tool
"""
if source is not self:
- # Do not trigger browseAction to avoid to call
- # self.plot.setInteractiveMode
- self.browseAction.setChecked(True)
+ self.pencilAction.setChecked(False)
+ self.rectAction.setChecked(False)
+ self.polygonAction.setChecked(False)
self._releaseDrawingMode()
+ self._updateDrawingModeWidgets()
def _releaseDrawingMode(self):
"""Release the drawing mode if is was used"""
@@ -940,16 +943,6 @@ class BaseMaskToolsWidget(qt.QWidget):
self.plot.sigPlotSignal.disconnect(self._plotDrawEvent)
self._drawingMode = None
- def _activeBrowseMode(self):
- """Handle browse action mode triggered by user.
-
- Set plot interactive mode only when
- the user is triggering the browse action.
- """
- self._releaseDrawingMode()
- self.plot.setInteractiveMode('zoom', source=self)
- self._updateDrawingModeWidgets()
-
def _activeRectMode(self):
"""Handle rect action mode triggering"""
self._releaseDrawingMode()
@@ -981,6 +974,7 @@ class BaseMaskToolsWidget(qt.QWidget):
self._updateDrawingModeWidgets()
def _updateDrawingModeWidgets(self):
+ self.maskStateWidget.setVisible(self._drawingMode is not None)
self.pencilSetting.setVisible(self._drawingMode == 'pencil')
# Handle plot drawing events
@@ -1032,20 +1026,20 @@ class BaseMaskToolsWidget(qt.QWidget):
if self.belowThresholdAction.isChecked():
if self.minLineEdit.text():
self._mask.updateBelowThreshold(self.levelSpinBox.value(),
- float(self.minLineEdit.text()))
+ self.minLineEdit.value())
self._mask.commit()
elif self.betweenThresholdAction.isChecked():
if self.minLineEdit.text() and self.maxLineEdit.text():
- min_ = float(self.minLineEdit.text())
- max_ = float(self.maxLineEdit.text())
+ min_ = self.minLineEdit.value()
+ max_ = self.maxLineEdit.value()
self._mask.updateBetweenThresholds(self.levelSpinBox.value(),
min_, max_)
self._mask.commit()
elif self.aboveThresholdAction.isChecked():
if self.maxLineEdit.text():
- max_ = float(self.maxLineEdit.text())
+ max_ = float(self.maxLineEdit.value())
self._mask.updateAboveThreshold(self.levelSpinBox.value(),
max_)
self._mask.commit()
@@ -1059,7 +1053,7 @@ class BaseMaskToolsWidget(qt.QWidget):
class BaseMaskToolsDockWidget(qt.QDockWidget):
"""Base class for :class:`MaskToolsWidget` and
- :class:`ScatterMaskToolsWidget`
+ :class:`ScatterMaskToolsWidget`.
For integration in a :class:`PlotWindow`.
@@ -1069,10 +1063,15 @@ class BaseMaskToolsDockWidget(qt.QDockWidget):
sigMaskChanged = qt.Signal()
- def __init__(self, parent=None, name='Mask'):
+ def __init__(self, parent=None, name='Mask', widget=None):
super(BaseMaskToolsDockWidget, self).__init__(parent)
self.setWindowTitle(name)
+ if not isinstance(widget, BaseMaskToolsWidget):
+ raise TypeError("BaseMaskToolsDockWidget requires a MaskToolsWidget")
+ self.setWidget(widget)
+ self.widget().sigMaskChanged.connect(self._emitSigMaskChanged)
+
self.layout().setContentsMargins(0, 0, 0, 0)
self.dockLocationChanged.connect(self._dockLocationChanged)
self.topLevelChanged.connect(self._topLevelChanged)
@@ -1107,6 +1106,11 @@ class BaseMaskToolsDockWidget(qt.QDockWidget):
"""
return self.widget().setSelectionMask(mask, copy=copy)
+ def resetSelectionMask(self):
+ """Reset the mask to an array of zeros with the shape of the
+ current data."""
+ self.widget().resetSelectionMask()
+
def toggleViewAction(self):
"""Returns a checkable action that shows or closes this widget.
diff --git a/silx/gui/plot/__init__.py b/silx/gui/plot/__init__.py
index 06a24a7..b03392d 100644
--- a/silx/gui/plot/__init__.py
+++ b/silx/gui/plot/__init__.py
@@ -43,7 +43,7 @@ List of Qt widgets:
By default, those widget are using matplotlib_.
They can optionally use a faster OpenGL-based rendering (beta feature),
which is enabled by setting the ``backend`` argument to ``'gl'``
-when creating the widgets (See :class:`.Plot`).
+when creating the widgets (See :class:`.PlotWidget`).
.. note::
@@ -56,12 +56,9 @@ when creating the widgets (See :class:`.Plot`).
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "22/02/2016"
+__date__ = "03/05/2017"
-# First of all init matplotlib and set its backend
-from .backends import _matplotlib # noqa
-
from .PlotWidget import PlotWidget # noqa
from .PlotWindow import PlotWindow, Plot1D, Plot2D # noqa
from .ImageView import ImageView # noqa
diff --git a/silx/gui/plot/_utils/__init__.py b/silx/gui/plot/_utils/__init__.py
index 355bc02..3c2dfa4 100644
--- a/silx/gui/plot/_utils/__init__.py
+++ b/silx/gui/plot/_utils/__init__.py
@@ -35,17 +35,6 @@ from .panzoom import FLOAT32_SAFE_MIN, FLOAT32_MINPOS, FLOAT32_SAFE_MAX
from .panzoom import applyZoomToPlot, applyPan
-def clipColormapLogRange(colormap):
- """Clip colormap vmin and vmax to 1, 10 if normalization is 'log' and vmin
- or vmax <1
-
- :param dict colormap: the colormap for which we want to clip vmin and vmax
- """
- if colormap['normalization'] is 'log':
- if colormap['vmin'] < 1. or colormap['vmax'] < 1.:
- colormap['vmin'], colormap['vmax'] = 1., 10.
-
-
def addMarginsToLimits(margins, isXLog, isYLog,
xMin, xMax, yMin, yMax, y2Min=None, y2Max=None):
"""Returns updated limits by extending them with margins.
diff --git a/silx/gui/plot/_utils/panzoom.py b/silx/gui/plot/_utils/panzoom.py
index bec31df..3946a04 100644
--- a/silx/gui/plot/_utils/panzoom.py
+++ b/silx/gui/plot/_utils/panzoom.py
@@ -24,13 +24,12 @@
# ###########################################################################*/
"""Functions to apply pan and zoom on a Plot"""
-__authors__ = ["T. Vincent"]
+__authors__ = ["T. Vincent", "V. Valls"]
__license__ = "MIT"
-__date__ = "21/03/2017"
+__date__ = "08/08/2017"
import math
-
import numpy
@@ -93,8 +92,8 @@ def applyZoomToPlot(plot, scaleF, center=None):
:param center: (x, y) coords in pixel coordinates of the zoom center.
:type center: 2-tuple of float
"""
- xMin, xMax = plot.getGraphXLimits()
- yMin, yMax = plot.getGraphYLimits()
+ xMin, xMax = plot.getXAxis().getLimits()
+ yMin, yMax = plot.getYAxis().getLimits()
if center is None:
left, top, width, height = plot.getPlotBoundsInPixels()
@@ -106,17 +105,17 @@ def applyZoomToPlot(plot, scaleF, center=None):
assert dataCenterPos is not None
xMin, xMax = scale1DRange(xMin, xMax, dataCenterPos[0], scaleF,
- plot.isXAxisLogarithmic())
+ plot.getXAxis()._isLogarithmic())
yMin, yMax = scale1DRange(yMin, yMax, dataCenterPos[1], scaleF,
- plot.isYAxisLogarithmic())
+ plot.getYAxis()._isLogarithmic())
dataPos = plot.pixelToData(cx, cy, axis="right")
assert dataPos is not None
y2Center = dataPos[1]
- y2Min, y2Max = plot.getGraphYLimits(axis="right")
+ y2Min, y2Max = plot.getYAxis(axis="right").getLimits()
y2Min, y2Max = scale1DRange(y2Min, y2Max, y2Center, scaleF,
- plot.isYAxisLogarithmic())
+ plot.getYAxis()._isLogarithmic())
plot.setLimits(xMin, xMax, yMin, yMax, y2Min, y2Max)
@@ -154,3 +153,140 @@ def applyPan(min_, max_, panFactor, isLog10):
if newMin > - float('inf') and newMax < float('inf'):
min_, max_ = newMin, newMax
return min_, max_
+
+
+class _Unset(object):
+ """To be able to have distinction between None and unset"""
+ pass
+
+
+class ViewConstraints(object):
+ """
+ Store constraints applied on the view box and compute the resulting view box.
+ """
+
+ def __init__(self):
+ self._min = [None, None]
+ self._max = [None, None]
+ self._minRange = [None, None]
+ self._maxRange = [None, None]
+
+ def update(self, xMin=_Unset, xMax=_Unset,
+ yMin=_Unset, yMax=_Unset,
+ minXRange=_Unset, maxXRange=_Unset,
+ minYRange=_Unset, maxYRange=_Unset):
+ """
+ Update the constraints managed by the object
+
+ The constraints are the same as the ones provided by PyQtGraph.
+
+ :param float xMin: Minimum allowed x-axis value.
+ (default do not change the stat, None remove the constraint)
+ :param float xMax: Maximum allowed x-axis value.
+ (default do not change the stat, None remove the constraint)
+ :param float yMin: Minimum allowed y-axis value.
+ (default do not change the stat, None remove the constraint)
+ :param float yMax: Maximum allowed y-axis value.
+ (default do not change the stat, None remove the constraint)
+ :param float minXRange: Minimum allowed left-to-right span across the
+ view (default do not change the stat, None remove the constraint)
+ :param float maxXRange: Maximum allowed left-to-right span across the
+ view (default do not change the stat, None remove the constraint)
+ :param float minYRange: Minimum allowed top-to-bottom span across the
+ view (default do not change the stat, None remove the constraint)
+ :param float maxYRange: Maximum allowed top-to-bottom span across the
+ view (default do not change the stat, None remove the constraint)
+ :return: True if the constraints was changed
+ """
+ updated = False
+
+ minRange = [minXRange, minYRange]
+ maxRange = [maxXRange, maxYRange]
+ minPos = [xMin, yMin]
+ maxPos = [xMax, yMax]
+
+ for axis in range(2):
+
+ value = minPos[axis]
+ if value is not _Unset and value != self._min[axis]:
+ self._min[axis] = value
+ updated = True
+
+ value = maxPos[axis]
+ if value is not _Unset and value != self._max[axis]:
+ self._max[axis] = value
+ updated = True
+
+ value = minRange[axis]
+ if value is not _Unset and value != self._minRange[axis]:
+ self._minRange[axis] = value
+ updated = True
+
+ value = maxRange[axis]
+ if value is not _Unset and value != self._maxRange[axis]:
+ self._maxRange[axis] = value
+ updated = True
+
+ # Sanity checks
+
+ for axis in range(2):
+ if self._maxRange[axis] is not None and self._min[axis] is not None and self._max[axis] is not None:
+ # max range cannot be larger than bounds
+ diff = self._max[axis] - self._min[axis]
+ self._maxRange[axis] = min(self._maxRange[axis], diff)
+ updated = True
+
+ return updated
+
+ def normalize(self, xMin, xMax, yMin, yMax, allow_scaling=True):
+ """Normalize a view range defined by x and y corners using predefined
+ containts.
+
+ :param float xMin: Min position of the x-axis
+ :param float xMax: Max position of the x-axis
+ :param float yMin: Min position of the y-axis
+ :param float yMax: Max position of the y-axis
+ :param bool allow_scaling: Allow or not to apply scaling for the
+ normalization. Used according to the interaction mode.
+ :return: A normalized tuple of (xMin, xMax, yMin, yMax)
+ """
+ viewRange = [[xMin, xMax], [yMin, yMax]]
+
+ for axis in range(2):
+ # clamp xRange and yRange
+ if allow_scaling:
+ diff = viewRange[axis][1] - viewRange[axis][0]
+ delta = None
+ if self._maxRange[axis] is not None and diff > self._maxRange[axis]:
+ delta = self._maxRange[axis] - diff
+ elif self._minRange[axis] is not None and diff < self._minRange[axis]:
+ delta = self._minRange[axis] - diff
+ if delta is not None:
+ viewRange[axis][0] -= delta * 0.5
+ viewRange[axis][1] += delta * 0.5
+
+ # clamp min and max positions
+ outMin = self._min[axis] is not None and viewRange[axis][0] < self._min[axis]
+ outMax = self._max[axis] is not None and viewRange[axis][1] > self._max[axis]
+
+ if outMin and outMax:
+ if allow_scaling:
+ # we can clamp both sides
+ viewRange[axis][0] = self._min[axis]
+ viewRange[axis][1] = self._max[axis]
+ else:
+ # center the result
+ delta = viewRange[axis][1] - viewRange[axis][0]
+ mid = self._min[axis] + self._max[axis] - self._min[axis]
+ viewRange[axis][0] = mid - delta
+ viewRange[axis][1] = mid + delta
+ elif outMin:
+ delta = self._min[axis] - viewRange[axis][0]
+ viewRange[axis][0] += delta
+ viewRange[axis][1] += delta
+ elif outMax:
+ delta = self._max[axis] - viewRange[axis][1]
+ viewRange[axis][0] += delta
+ viewRange[axis][1] += delta
+
+ return viewRange[0][0], viewRange[0][1], viewRange[1][0], viewRange[1][1]
diff --git a/silx/gui/plot/actions/PlotAction.py b/silx/gui/plot/actions/PlotAction.py
new file mode 100644
index 0000000..6eb9ba3
--- /dev/null
+++ b/silx/gui/plot/actions/PlotAction.py
@@ -0,0 +1,79 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+The class :class:`.PlotAction` help the creation of a qt.QAction associated
+with a :class:`.PlotWidget`.
+"""
+
+from __future__ import division
+
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "20/04/2017"
+
+
+from collections import OrderedDict
+import weakref
+from silx.gui import icons
+from silx.gui import qt
+
+
+class PlotAction(qt.QAction):
+ """Base class for QAction that operates on a PlotWidget.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate.
+ :param icon: QIcon or str name of icon to use
+ :param str text: The name of this action to be used for menu label
+ :param str tooltip: The text of the tooltip
+ :param triggered: The callback to connect to the action's triggered
+ signal or None for no callback.
+ :param bool checkable: True for checkable action, False otherwise (default)
+ :param parent: See :class:`QAction`.
+ """
+
+ def __init__(self, plot, icon, text, tooltip=None,
+ triggered=None, checkable=False, parent=None):
+ assert plot is not None
+ self._plotRef = weakref.ref(plot)
+
+ if not isinstance(icon, qt.QIcon):
+ # Try with icon as a string and load corresponding icon
+ icon = icons.getQIcon(icon)
+
+ super(PlotAction, self).__init__(icon, text, parent)
+
+ if tooltip is not None:
+ self.setToolTip(tooltip)
+
+ self.setCheckable(checkable)
+
+ if triggered is not None:
+ self.triggered[bool].connect(triggered)
+
+ @property
+ def plot(self):
+ """The :class:`.PlotWidget` this action group is controlling."""
+ return self._plotRef()
diff --git a/silx/gui/plot/actions/__init__.py b/silx/gui/plot/actions/__init__.py
new file mode 100644
index 0000000..73829cd
--- /dev/null
+++ b/silx/gui/plot/actions/__init__.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This package provides a set of QActions to use with :class:`PlotWidget`
+
+It also contains the :class:'.PlotAction' (Base class for QAction that operates
+on a PlotWidget)
+"""
+
+__authors__ = ["H. Payno"]
+__license__ = "MIT"
+__date__ = "16/08/2017"
+
+from .PlotAction import PlotAction
+from . import control
+from . import mode
+from . import io
diff --git a/silx/gui/plot/actions/control.py b/silx/gui/plot/actions/control.py
new file mode 100644
index 0000000..23e710e
--- /dev/null
+++ b/silx/gui/plot/actions/control.py
@@ -0,0 +1,549 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.control` provides a set of QAction relative to control
+of a :class:`.PlotWidget`.
+
+The following QAction are available:
+
+- :class:`ColormapAction`
+- :class:`CrosshairAction`
+- :class:`CurveStyleAction`
+- :class:`GridAction`
+- :class:`KeepAspectRatioAction`
+- :class:`PanWithArrowKeysAction`
+- :class:`ResetZoomAction`
+- :class:`XAxisLogarithmicAction`
+- :class:`XAxisAutoScaleAction`
+- :class:`YAxisInvertedAction`
+- :class:`YAxisLogarithmicAction`
+- :class:`YAxisAutoScaleAction`
+- :class:`ZoomBackAction`
+- :class:`ZoomInAction`
+- :class:`ZoomOutAction`
+- :class:'ShowAxisAction'
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "27/06/2017"
+
+from . import PlotAction
+import logging
+import numpy
+from silx.gui.plot import items
+from silx.gui.plot.ColormapDialog import ColormapDialog
+from silx.gui.plot._utils import applyZoomToPlot as _applyZoomToPlot
+from silx.gui import qt
+from silx.gui import icons
+
+_logger = logging.getLogger(__name__)
+
+
+class ResetZoomAction(PlotAction):
+ """QAction controlling reset zoom on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(ResetZoomAction, self).__init__(
+ plot, icon='zoom-original', text='Reset Zoom',
+ tooltip='Auto-scale the graph',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+ self._autoscaleChanged(True)
+ plot.getXAxis().sigAutoScaleChanged.connect(self._autoscaleChanged)
+ plot.getYAxis().sigAutoScaleChanged.connect(self._autoscaleChanged)
+
+ def _autoscaleChanged(self, enabled):
+ xAxis = self.plot.getXAxis()
+ yAxis = self.plot.getYAxis()
+ self.setEnabled(xAxis.isAutoScale() or yAxis.isAutoScale())
+
+ if xAxis.isAutoScale() and yAxis.isAutoScale():
+ tooltip = 'Auto-scale the graph'
+ elif xAxis.isAutoScale(): # And not Y axis
+ tooltip = 'Auto-scale the x-axis of the graph only'
+ elif yAxis.isAutoScale(): # And not X axis
+ tooltip = 'Auto-scale the y-axis of the graph only'
+ else: # no axis in autoscale
+ tooltip = 'Auto-scale the graph'
+ self.setToolTip(tooltip)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.resetZoom()
+
+
+class ZoomBackAction(PlotAction):
+ """QAction performing a zoom-back in :class:`.PlotWidget` limits history.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(ZoomBackAction, self).__init__(
+ plot, icon='zoom-back', text='Zoom Back',
+ tooltip='Zoom back the plot',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.getLimitsHistory().pop()
+
+
+class ZoomInAction(PlotAction):
+ """QAction performing a zoom-in on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(ZoomInAction, self).__init__(
+ plot, icon='zoom-in', text='Zoom In',
+ tooltip='Zoom in the plot',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+ self.setShortcut(qt.QKeySequence.ZoomIn)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ def _actionTriggered(self, checked=False):
+ _applyZoomToPlot(self.plot, 1.1)
+
+
+class ZoomOutAction(PlotAction):
+ """QAction performing a zoom-out on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(ZoomOutAction, self).__init__(
+ plot, icon='zoom-out', text='Zoom Out',
+ tooltip='Zoom out the plot',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+ self.setShortcut(qt.QKeySequence.ZoomOut)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ def _actionTriggered(self, checked=False):
+ _applyZoomToPlot(self.plot, 1. / 1.1)
+
+
+class XAxisAutoScaleAction(PlotAction):
+ """QAction controlling X axis autoscale on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(XAxisAutoScaleAction, self).__init__(
+ plot, icon='plot-xauto', text='X Autoscale',
+ tooltip='Enable x-axis auto-scale when checked.\n'
+ 'If unchecked, x-axis does not change when reseting zoom.',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.setChecked(plot.getXAxis().isAutoScale())
+ plot.getXAxis().sigAutoScaleChanged.connect(self.setChecked)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.getXAxis().setAutoScale(checked)
+ if checked:
+ self.plot.resetZoom()
+
+
+class YAxisAutoScaleAction(PlotAction):
+ """QAction controlling Y axis autoscale on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(YAxisAutoScaleAction, self).__init__(
+ plot, icon='plot-yauto', text='Y Autoscale',
+ tooltip='Enable y-axis auto-scale when checked.\n'
+ 'If unchecked, y-axis does not change when reseting zoom.',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.setChecked(plot.getYAxis().isAutoScale())
+ plot.getYAxis().sigAutoScaleChanged.connect(self.setChecked)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.getYAxis().setAutoScale(checked)
+ if checked:
+ self.plot.resetZoom()
+
+
+class XAxisLogarithmicAction(PlotAction):
+ """QAction controlling X axis log scale on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(XAxisLogarithmicAction, self).__init__(
+ plot, icon='plot-xlog', text='X Log. scale',
+ tooltip='Logarithmic x-axis when checked',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.axis = plot.getXAxis()
+ self.setChecked(self.axis.getScale() == self.axis.LOGARITHMIC)
+ self.axis.sigScaleChanged.connect(self._setCheckedIfLogScale)
+
+ def _setCheckedIfLogScale(self, scale):
+ self.setChecked(scale == self.axis.LOGARITHMIC)
+
+ def _actionTriggered(self, checked=False):
+ scale = self.axis.LOGARITHMIC if checked else self.axis.LINEAR
+ self.axis.setScale(scale)
+
+
+class YAxisLogarithmicAction(PlotAction):
+ """QAction controlling Y axis log scale on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(YAxisLogarithmicAction, self).__init__(
+ plot, icon='plot-ylog', text='Y Log. scale',
+ tooltip='Logarithmic y-axis when checked',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.axis = plot.getYAxis()
+ self.setChecked(self.axis.getScale() == self.axis.LOGARITHMIC)
+ self.axis.sigScaleChanged.connect(self._setCheckedIfLogScale)
+
+ def _setCheckedIfLogScale(self, scale):
+ self.setChecked(scale == self.axis.LOGARITHMIC)
+
+ def _actionTriggered(self, checked=False):
+ scale = self.axis.LOGARITHMIC if checked else self.axis.LINEAR
+ self.axis.setScale(scale)
+
+
+class GridAction(PlotAction):
+ """QAction controlling grid mode on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param str gridMode: The grid mode to use in 'both', 'major'.
+ See :meth:`.PlotWidget.setGraphGrid`
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, gridMode='both', parent=None):
+ assert gridMode in ('both', 'major')
+ self._gridMode = gridMode
+
+ super(GridAction, self).__init__(
+ plot, icon='plot-grid', text='Grid',
+ tooltip='Toggle grid (on/off)',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.setChecked(plot.getGraphGrid() is not None)
+ plot.sigSetGraphGrid.connect(self._gridChanged)
+
+ def _gridChanged(self, which):
+ """Slot listening for PlotWidget grid mode change."""
+ self.setChecked(which != 'None')
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setGraphGrid(self._gridMode if checked else None)
+
+
+class CurveStyleAction(PlotAction):
+ """QAction controlling curve style on a :class:`.PlotWidget`.
+
+ It changes the default line and markers style which updates all
+ curves on the plot.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(CurveStyleAction, self).__init__(
+ plot, icon='plot-toggle-points', text='Curve style',
+ tooltip='Change curve line and markers style',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+
+ def _actionTriggered(self, checked=False):
+ currentState = (self.plot.isDefaultPlotLines(),
+ self.plot.isDefaultPlotPoints())
+
+ # line only, line and symbol, symbol only
+ states = (True, False), (True, True), (False, True)
+ newState = states[(states.index(currentState) + 1) % 3]
+
+ self.plot.setDefaultPlotLines(newState[0])
+ self.plot.setDefaultPlotPoints(newState[1])
+
+
+class ColormapAction(PlotAction):
+ """QAction opening a ColormapDialog to update the colormap.
+
+ Both the active image colormap and the default colormap are updated.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+ def __init__(self, plot, parent=None):
+ self._dialog = None # To store an instance of ColormapDialog
+ super(ColormapAction, self).__init__(
+ plot, icon='colormap', text='Colormap',
+ tooltip="Change colormap",
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+
+ def _actionTriggered(self, checked=False):
+ """Create a cmap dialog and update active image and default cmap."""
+ # Create the dialog if not already existing
+ if self._dialog is None:
+ self._dialog = ColormapDialog()
+
+ image = self.plot.getActiveImage()
+ if not isinstance(image, items.ColormapMixIn):
+ # No active image or active image is RGBA,
+ # set dialog from default info
+ colormap = self.plot.getDefaultColormap()
+
+ self._dialog.setHistogram() # Reset histogram and range if any
+
+ else:
+ # Set dialog from active image
+ colormap = image.getColormap()
+
+ data = image.getData(copy=False)
+
+ goodData = data[numpy.isfinite(data)]
+ if goodData.size > 0:
+ dataMin = goodData.min()
+ dataMax = goodData.max()
+ else:
+ qt.QMessageBox.warning(
+ None, "No Data",
+ "Image data does not contain any real value")
+ dataMin, dataMax = 1., 10.
+
+ self._dialog.setHistogram() # Reset histogram if any
+ self._dialog.setDataRange(dataMin, dataMax)
+ # The histogram should be done in a worker thread
+ # hist, bin_edges = numpy.histogram(goodData, bins=256)
+ # self._dialog.setHistogram(hist, bin_edges)
+
+ self._dialog.setColormap(name=colormap.getName(),
+ normalization=colormap.getNormalization(),
+ autoscale=colormap.isAutoscale(),
+ vmin=colormap.getVMin(),
+ vmax=colormap.getVMax(),
+ colors=colormap.getColormapLUT())
+
+ # Run the dialog listening to colormap change
+ self._dialog.sigColormapChanged.connect(self._colormapChanged)
+ result = self._dialog.exec_()
+ self._dialog.sigColormapChanged.disconnect(self._colormapChanged)
+
+ if not result: # Restore the previous colormap
+ self._colormapChanged(colormap)
+
+ def _colormapChanged(self, colormap):
+ # Update default colormap
+ self.plot.setDefaultColormap(colormap)
+
+ # Update active image colormap
+ activeImage = self.plot.getActiveImage()
+ if isinstance(activeImage, items.ColormapMixIn):
+ activeImage.setColormap(colormap)
+
+
+class KeepAspectRatioAction(PlotAction):
+ """QAction controlling aspect ratio on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ # Uses two images for checked/unchecked states
+ self._states = {
+ False: (icons.getQIcon('shape-circle-solid'),
+ "Keep data aspect ratio"),
+ True: (icons.getQIcon('shape-ellipse-solid'),
+ "Do no keep data aspect ratio")
+ }
+
+ icon, tooltip = self._states[plot.isKeepDataAspectRatio()]
+ super(KeepAspectRatioAction, self).__init__(
+ plot,
+ icon=icon,
+ text='Toggle keep aspect ratio',
+ tooltip=tooltip,
+ triggered=self._actionTriggered,
+ checkable=False,
+ parent=parent)
+ plot.sigSetKeepDataAspectRatio.connect(
+ self._keepDataAspectRatioChanged)
+
+ def _keepDataAspectRatioChanged(self, aspectRatio):
+ """Handle Plot set keep aspect ratio signal"""
+ icon, tooltip = self._states[aspectRatio]
+ self.setIcon(icon)
+ self.setToolTip(tooltip)
+
+ def _actionTriggered(self, checked=False):
+ # This will trigger _keepDataAspectRatioChanged
+ self.plot.setKeepDataAspectRatio(not self.plot.isKeepDataAspectRatio())
+
+
+class YAxisInvertedAction(PlotAction):
+ """QAction controlling Y orientation on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ # Uses two images for checked/unchecked states
+ self._states = {
+ False: (icons.getQIcon('plot-ydown'),
+ "Orient Y axis downward"),
+ True: (icons.getQIcon('plot-yup'),
+ "Orient Y axis upward"),
+ }
+
+ icon, tooltip = self._states[plot.getYAxis().isInverted()]
+ super(YAxisInvertedAction, self).__init__(
+ plot,
+ icon=icon,
+ text='Invert Y Axis',
+ tooltip=tooltip,
+ triggered=self._actionTriggered,
+ checkable=False,
+ parent=parent)
+ plot.getYAxis().sigInvertedChanged.connect(self._yAxisInvertedChanged)
+
+ def _yAxisInvertedChanged(self, inverted):
+ """Handle Plot set y axis inverted signal"""
+ icon, tooltip = self._states[inverted]
+ self.setIcon(icon)
+ self.setToolTip(tooltip)
+
+ def _actionTriggered(self, checked=False):
+ # This will trigger _yAxisInvertedChanged
+ yAxis = self.plot.getYAxis()
+ yAxis.setInverted(not yAxis.isInverted())
+
+
+class CrosshairAction(PlotAction):
+ """QAction toggling crosshair cursor on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param str color: Color to use to draw the crosshair
+ :param int linewidth: Width of the crosshair cursor
+ :param str linestyle: Style of line. See :meth:`.Plot.setGraphCursor`
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, color='black', linewidth=1, linestyle='-',
+ parent=None):
+ self.color = color
+ """Color used to draw the crosshair (str)."""
+
+ self.linewidth = linewidth
+ """Width of the crosshair cursor (int)."""
+
+ self.linestyle = linestyle
+ """Style of line of the cursor (str)."""
+
+ super(CrosshairAction, self).__init__(
+ plot, icon='crosshair', text='Crosshair Cursor',
+ tooltip='Enable crosshair cursor when checked',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.setChecked(plot.getGraphCursor() is not None)
+ plot.sigSetGraphCursor.connect(self.setChecked)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setGraphCursor(checked,
+ color=self.color,
+ linestyle=self.linestyle,
+ linewidth=self.linewidth)
+
+
+class PanWithArrowKeysAction(PlotAction):
+ """QAction toggling pan with arrow keys on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+
+ super(PanWithArrowKeysAction, self).__init__(
+ plot, icon='arrow-keys', text='Pan with arrow keys',
+ tooltip='Enable pan with arrow keys when checked',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ self.setChecked(plot.isPanWithArrowKeys())
+ plot.sigSetPanWithArrowKeys.connect(self.setChecked)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setPanWithArrowKeys(checked)
+
+
+class ShowAxisAction(PlotAction):
+ """QAction controlling axis visibility on a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ tooltip = 'Show plot axis when checked, otherwise hide them'
+ PlotAction.__init__(self,
+ plot,
+ icon='axis',
+ text='show axis',
+ tooltip=tooltip,
+ triggered=self._actionTriggered,
+ checkable=True,
+ parent=parent)
+ self.setChecked(self.plot._backend.isAxesDisplayed())
+ plot._sigAxesVisibilityChanged.connect(self.setChecked)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setAxesDisplayed(checked)
diff --git a/silx/gui/plot/actions/fit.py b/silx/gui/plot/actions/fit.py
new file mode 100644
index 0000000..d7256ab
--- /dev/null
+++ b/silx/gui/plot/actions/fit.py
@@ -0,0 +1,189 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.fit` module provides actions relative to fit.
+
+The following QAction are available:
+
+- :class:`.FitAction`
+
+.. autoclass:`.FitAction`
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "28/06/2017"
+
+from . import PlotAction
+import logging
+from silx.gui import qt
+from silx.gui.plot.ItemsSelectionDialog import ItemsSelectionDialog
+from silx.gui.plot.items import Curve, Histogram
+
+_logger = logging.getLogger(__name__)
+
+
+def _getUniqueCurve(plt):
+ """Get a single curve from the plot.
+ Get the active curve if any, else if a single curve is plotted
+ get it, else return None.
+
+ :param plt: :class:`.PlotWidget` instance on which to operate
+
+ :return: return value of plt.getActiveCurve(), or plt.getAllCurves()[0],
+ or None
+ """
+ curve = plt.getActiveCurve()
+ if curve is not None:
+ return curve
+
+ curves = plt.getAllCurves()
+ if len(curves) == 0:
+ return None
+
+ if len(curves) == 1 and len(plt._getItems(kind='histogram')) == 0:
+ return curves[0]
+
+ return None
+
+
+def _getUniqueHistogram(plt):
+ """Return the histogram if there is a single histogram and no curve in
+ the plot. In all other cases, return None.
+
+ :param plt: :class:`.PlotWidget` instance on which to operate
+ :return: histogram or None
+ """
+ histograms = plt._getItems(kind='histogram')
+ if len(histograms) != 1:
+ return None
+ if plt.getAllCurves(just_legend=True):
+ return None
+ return histograms[0]
+
+
+class FitAction(PlotAction):
+ """QAction to open a :class:`FitWidget` and set its data to the
+ active curve if any, or to the first curve.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+ def __init__(self, plot, parent=None):
+ super(FitAction, self).__init__(
+ plot, icon='math-fit', text='Fit curve',
+ tooltip='Open a fit dialog',
+ triggered=self._getFitWindow,
+ checkable=False, parent=parent)
+ self.fit_window = None
+
+ def _getFitWindow(self):
+ self.xlabel = self.plot.getXAxis().getLabel()
+ self.ylabel = self.plot.getYAxis().getLabel()
+ self.xmin, self.xmax = self.plot.getXAxis().getLimits()
+
+ histo = _getUniqueHistogram(self.plot)
+ curve = _getUniqueCurve(self.plot)
+
+ if histo is None and curve is None:
+ # ambiguous case, we need to ask which plot item to fit
+ isd = ItemsSelectionDialog(plot=self.plot)
+ isd.setWindowTitle("Select item to be fitted")
+ isd.setItemsSelectionMode(qt.QTableWidget.SingleSelection)
+ isd.setAvailableKinds(["curve", "histogram"])
+ isd.selectAllKinds()
+
+ result = isd.exec_()
+ if result and len(isd.getSelectedItems()) == 1:
+ item = isd.getSelectedItems()[0]
+ else:
+ return
+ elif histo is not None:
+ # presence of a unique histo and no curve
+ item = histo
+ elif curve is not None:
+ # presence of a unique or active curve
+ item = curve
+
+ self.legend = item.getLegend()
+
+ if isinstance(item, Histogram):
+ bin_edges = item.getBinEdgesData(copy=False)
+ # take the middle coordinate between adjacent bin edges
+ self.x = (bin_edges[1:] + bin_edges[:-1]) / 2
+ self.y = item.getValueData(copy=False)
+ # else take the active curve, or else the unique curve
+ elif isinstance(item, Curve):
+ self.x = item.getXData(copy=False)
+ self.y = item.getYData(copy=False)
+
+ # open a window with a FitWidget
+ if self.fit_window is None:
+ self.fit_window = qt.QMainWindow()
+ # import done here rather than at module level to avoid circular import
+ # FitWidget -> BackgroundWidget -> PlotWindow -> actions -> fit -> FitWidget
+ from ...fit.FitWidget import FitWidget
+ self.fit_widget = FitWidget(parent=self.fit_window)
+ self.fit_window.setCentralWidget(
+ self.fit_widget)
+ self.fit_widget.guibuttons.DismissButton.clicked.connect(
+ self.fit_window.close)
+ self.fit_widget.sigFitWidgetSignal.connect(
+ self.handle_signal)
+ self.fit_window.show()
+ else:
+ if self.fit_window.isHidden():
+ self.fit_window.show()
+ self.fit_widget.show()
+ self.fit_window.raise_()
+
+ self.fit_widget.setData(self.x, self.y,
+ xmin=self.xmin, xmax=self.xmax)
+ self.fit_window.setWindowTitle(
+ "Fitting " + self.legend +
+ " on x range %f-%f" % (self.xmin, self.xmax))
+
+ def handle_signal(self, ddict):
+ x_fit = self.x[self.xmin <= self.x]
+ x_fit = x_fit[x_fit <= self.xmax]
+ fit_legend = "Fit <%s>" % self.legend
+ fit_curve = self.plot.getCurve(fit_legend)
+
+ if ddict["event"] == "FitFinished":
+ y_fit = self.fit_widget.fitmanager.gendata()
+ if fit_curve is None:
+ self.plot.addCurve(x_fit, y_fit,
+ fit_legend,
+ xlabel=self.xlabel, ylabel=self.ylabel,
+ resetzoom=False)
+ else:
+ fit_curve.setData(x_fit, y_fit)
+ fit_curve.setVisible(True)
+
+ if ddict["event"] in ["FitStarted", "FitFailed"]:
+ if fit_curve is not None:
+ fit_curve.setVisible(False)
diff --git a/silx/gui/plot/actions/histogram.py b/silx/gui/plot/actions/histogram.py
new file mode 100644
index 0000000..a4a91e9
--- /dev/null
+++ b/silx/gui/plot/actions/histogram.py
@@ -0,0 +1,170 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.histogram` provides actions relative to histograms
+for :class:`.PlotWidget`.
+
+The following QAction are available:
+
+- :class:`PixelIntensitiesHistoAction`
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__date__ = "27/06/2017"
+__license__ = "MIT"
+
+from . import PlotAction
+from silx.math.histogram import Histogramnd
+import numpy
+import logging
+from silx.gui import qt
+
+_logger = logging.getLogger(__name__)
+
+
+class PixelIntensitiesHistoAction(PlotAction):
+ """QAction to plot the pixels intensities diagram
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ PlotAction.__init__(self,
+ plot,
+ icon='pixel-intensities',
+ text='pixels intensity',
+ tooltip='Compute image intensity distribution',
+ triggered=self._triggered,
+ parent=parent,
+ checkable=True)
+ self._plotHistogram = None
+ self._connectedToActiveImage = False
+ self._histo = None
+
+ def _triggered(self, checked):
+ """Update the plot of the histogram visibility status
+
+ :param bool checked: status of the action button
+ """
+ if checked:
+ if not self._connectedToActiveImage:
+ self.plot.sigActiveImageChanged.connect(
+ self._activeImageChanged)
+ self._connectedToActiveImage = True
+ self.computeIntensityDistribution()
+
+ self.getHistogramPlotWidget().show()
+
+ else:
+ if self._connectedToActiveImage:
+ self.plot.sigActiveImageChanged.disconnect(
+ self._activeImageChanged)
+ self._connectedToActiveImage = False
+
+ self.getHistogramPlotWidget().hide()
+
+ def _activeImageChanged(self, previous, legend):
+ """Handle active image change: toggle enabled toolbar, update curve"""
+ if self.isChecked():
+ self.computeIntensityDistribution()
+
+ def computeIntensityDistribution(self):
+ """Get the active image and compute the image intensity distribution
+ """
+ activeImage = self.plot.getActiveImage()
+
+ if activeImage is not None:
+ image = activeImage.getData(copy=False)
+ if image.ndim == 3: # RGB(A) images
+ _logger.info('Converting current image from RGB(A) to grayscale\
+ in order to compute the intensity distribution')
+ image = (image[:, :, 0] * 0.299 +
+ image[:, :, 1] * 0.587 +
+ image[:, :, 2] * 0.114)
+
+ xmin = numpy.nanmin(image)
+ xmax = numpy.nanmax(image)
+ nbins = min(1024, int(numpy.sqrt(image.size)))
+ data_range = xmin, xmax
+
+ # bad hack: get 256 bins in the case we have a B&W
+ if numpy.issubdtype(image.dtype, numpy.integer):
+ if nbins > xmax - xmin:
+ nbins = xmax - xmin
+
+ nbins = max(2, nbins)
+
+ data = image.ravel().astype(numpy.float32)
+ histogram = Histogramnd(data, n_bins=nbins, histo_range=data_range)
+ assert len(histogram.edges) == 1
+ self._histo = histogram.histo
+ edges = histogram.edges[0]
+ plot = self.getHistogramPlotWidget()
+ plot.addHistogram(histogram=self._histo,
+ edges=edges,
+ legend='pixel intensity',
+ fill=True,
+ color='red')
+ plot.resetZoom()
+
+ def eventFilter(self, qobject, event):
+ """Observe when the close event is emitted then
+ simply uncheck the action button
+
+ :param qobject: the object observe
+ :param event: the event received by qobject
+ """
+ if event.type() == qt.QEvent.Close:
+ if self._plotHistogram is not None:
+ self._plotHistogram.hide()
+ self.setChecked(False)
+
+ return PlotAction.eventFilter(self, qobject, event)
+
+ def getHistogramPlotWidget(self):
+ """Create the plot histogram if needed, otherwise create it
+
+ :return: the PlotWidget showing the histogram of the pixel intensities
+ """
+ from silx.gui.plot.PlotWindow import Plot1D
+ if self._plotHistogram is None:
+ self._plotHistogram = Plot1D(parent=self.plot)
+ self._plotHistogram.setWindowFlags(qt.Qt.Window)
+ self._plotHistogram.setWindowTitle('Image Intensity Histogram')
+ self._plotHistogram.installEventFilter(self)
+ self._plotHistogram.getXAxis().setLabel("Value")
+ self._plotHistogram.getYAxis().setLabel("Count")
+
+ return self._plotHistogram
+
+ def getHistogram(self):
+ """Return the last computed histogram
+
+ :return: the histogram displayed in the HistogramPlotWiget
+ """
+ return self._histo
diff --git a/silx/gui/plot/actions/io.py b/silx/gui/plot/actions/io.py
new file mode 100644
index 0000000..50410e3
--- /dev/null
+++ b/silx/gui/plot/actions/io.py
@@ -0,0 +1,538 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.io` provides a set of QAction relative of inputs
+and outputs for a :class:`.PlotWidget`.
+
+The following QAction are available:
+
+- :class:`CopyAction`
+- :class:`PrintAction`
+- :class:`SaveAction`
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "27/06/2017"
+
+from . import PlotAction
+from silx.io.utils import save1D, savespec
+import logging
+import sys
+from collections import OrderedDict
+import traceback
+import numpy
+from silx.gui import qt
+from silx.third_party.EdfFile import EdfFile
+from silx.third_party.TiffIO import TiffIO
+from silx.gui._utils import convertArrayToQImage
+if sys.version_info[0] == 3:
+ from io import BytesIO
+else:
+ import cStringIO as _StringIO
+ BytesIO = _StringIO.StringIO
+
+_logger = logging.getLogger(__name__)
+
+
+class SaveAction(PlotAction):
+ """QAction for saving Plot content.
+
+ It opens a Save as... dialog.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate.
+ :param parent: See :class:`QAction`.
+ """
+ # TODO find a way to make the filter list selectable and extensible
+
+ SNAPSHOT_FILTER_SVG = 'Plot Snapshot as SVG (*.svg)'
+ SNAPSHOT_FILTER_PNG = 'Plot Snapshot as PNG (*.png)'
+
+ SNAPSHOT_FILTERS = (SNAPSHOT_FILTER_PNG, SNAPSHOT_FILTER_SVG)
+
+ # Dict of curve filters with CSV-like format
+ # Using ordered dict to guarantee filters order
+ # Note: '%.18e' is numpy.savetxt default format
+ CURVE_FILTERS_TXT = OrderedDict((
+ ('Curve as Raw ASCII (*.txt)',
+ {'fmt': '%.18e', 'delimiter': ' ', 'header': False}),
+ ('Curve as ";"-separated CSV (*.csv)',
+ {'fmt': '%.18e', 'delimiter': ';', 'header': True}),
+ ('Curve as ","-separated CSV (*.csv)',
+ {'fmt': '%.18e', 'delimiter': ',', 'header': True}),
+ ('Curve as tab-separated CSV (*.csv)',
+ {'fmt': '%.18e', 'delimiter': '\t', 'header': True}),
+ ('Curve as OMNIC CSV (*.csv)',
+ {'fmt': '%.7E', 'delimiter': ',', 'header': False}),
+ ('Curve as SpecFile (*.dat)',
+ {'fmt': '%.7g', 'delimiter': '', 'header': False})
+ ))
+
+ CURVE_FILTER_NPY = 'Curve as NumPy binary file (*.npy)'
+
+ CURVE_FILTERS = list(CURVE_FILTERS_TXT.keys()) + [CURVE_FILTER_NPY]
+
+ ALL_CURVES_FILTERS = ("All curves as SpecFile (*.dat)", )
+
+ IMAGE_FILTER_EDF = 'Image data as EDF (*.edf)'
+ IMAGE_FILTER_TIFF = 'Image data as TIFF (*.tif)'
+ IMAGE_FILTER_NUMPY = 'Image data as NumPy binary file (*.npy)'
+ IMAGE_FILTER_ASCII = 'Image data as ASCII (*.dat)'
+ IMAGE_FILTER_CSV_COMMA = 'Image data as ,-separated CSV (*.csv)'
+ IMAGE_FILTER_CSV_SEMICOLON = 'Image data as ;-separated CSV (*.csv)'
+ IMAGE_FILTER_CSV_TAB = 'Image data as tab-separated CSV (*.csv)'
+ IMAGE_FILTER_RGB_PNG = 'Image as PNG (*.png)'
+ IMAGE_FILTER_RGB_TIFF = 'Image as TIFF (*.tif)'
+ IMAGE_FILTERS = (IMAGE_FILTER_EDF,
+ IMAGE_FILTER_TIFF,
+ IMAGE_FILTER_NUMPY,
+ IMAGE_FILTER_ASCII,
+ IMAGE_FILTER_CSV_COMMA,
+ IMAGE_FILTER_CSV_SEMICOLON,
+ IMAGE_FILTER_CSV_TAB,
+ IMAGE_FILTER_RGB_PNG,
+ IMAGE_FILTER_RGB_TIFF)
+
+ def __init__(self, plot, parent=None):
+ super(SaveAction, self).__init__(
+ plot, icon='document-save', text='Save as...',
+ tooltip='Save curve/image/plot snapshot dialog',
+ triggered=self._actionTriggered,
+ checkable=False, parent=parent)
+ self.setShortcut(qt.QKeySequence.Save)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ def _errorMessage(self, informativeText=''):
+ """Display an error message."""
+ # TODO issue with QMessageBox size fixed and too small
+ msg = qt.QMessageBox(self.plot)
+ msg.setIcon(qt.QMessageBox.Critical)
+ msg.setInformativeText(informativeText + ' ' + str(sys.exc_info()[1]))
+ msg.setDetailedText(traceback.format_exc())
+ msg.exec_()
+
+ def _saveSnapshot(self, filename, nameFilter):
+ """Save a snapshot of the :class:`PlotWindow` widget.
+
+ :param str filename: The name of the file to write
+ :param str nameFilter: The selected name filter
+ :return: False if format is not supported or save failed,
+ True otherwise.
+ """
+ if nameFilter == self.SNAPSHOT_FILTER_PNG:
+ fileFormat = 'png'
+ elif nameFilter == self.SNAPSHOT_FILTER_SVG:
+ fileFormat = 'svg'
+ else: # Format not supported
+ _logger.error(
+ 'Saving plot snapshot failed: format not supported')
+ return False
+
+ self.plot.saveGraph(filename, fileFormat=fileFormat)
+ return True
+
+ def _saveCurve(self, filename, nameFilter):
+ """Save a curve from the plot.
+
+ :param str filename: The name of the file to write
+ :param str nameFilter: The selected name filter
+ :return: False if format is not supported or save failed,
+ True otherwise.
+ """
+ if nameFilter not in self.CURVE_FILTERS:
+ return False
+
+ # Check if a curve is to be saved
+ curve = self.plot.getActiveCurve()
+ # before calling _saveCurve, if there is no selected curve, we
+ # make sure there is only one curve on the graph
+ if curve is None:
+ curves = self.plot.getAllCurves()
+ if not curves:
+ self._errorMessage("No curve to be saved")
+ return False
+ curve = curves[0]
+
+ if nameFilter in self.CURVE_FILTERS_TXT:
+ filter_ = self.CURVE_FILTERS_TXT[nameFilter]
+ fmt = filter_['fmt']
+ csvdelim = filter_['delimiter']
+ autoheader = filter_['header']
+ else:
+ # .npy
+ fmt, csvdelim, autoheader = ("", "", False)
+
+ # If curve has no associated label, get the default from the plot
+ xlabel = curve.getXLabel()
+ if xlabel is None:
+ xlabel = self.plot.getXAxis().getLabel()
+ ylabel = curve.getYLabel()
+ if ylabel is None:
+ ylabel = self.plot.getYAxis().getLabel()
+
+ try:
+ save1D(filename,
+ curve.getXData(copy=False),
+ curve.getYData(copy=False),
+ xlabel, [ylabel],
+ fmt=fmt, csvdelim=csvdelim,
+ autoheader=autoheader)
+ except IOError:
+ self._errorMessage('Save failed\n')
+ return False
+
+ return True
+
+ def _saveCurves(self, filename, nameFilter):
+ """Save all curves from the plot.
+
+ :param str filename: The name of the file to write
+ :param str nameFilter: The selected name filter
+ :return: False if format is not supported or save failed,
+ True otherwise.
+ """
+ if nameFilter not in self.ALL_CURVES_FILTERS:
+ return False
+
+ curves = self.plot.getAllCurves()
+ if not curves:
+ self._errorMessage("No curves to be saved")
+ return False
+
+ curve = curves[0]
+ scanno = 1
+ try:
+ specfile = savespec(filename,
+ curve.getXData(copy=False),
+ curve.getYData(copy=False),
+ curve.getXLabel(),
+ curve.getYLabel(),
+ fmt="%.7g", scan_number=1, mode="w",
+ write_file_header=True,
+ close_file=False)
+ except IOError:
+ self._errorMessage('Save failed\n')
+ return False
+
+ for curve in curves[1:]:
+ try:
+ scanno += 1
+ specfile = savespec(specfile,
+ curve.getXData(copy=False),
+ curve.getYData(copy=False),
+ curve.getXLabel(),
+ curve.getYLabel(),
+ fmt="%.7g", scan_number=scanno, mode="w",
+ write_file_header=False,
+ close_file=False)
+ except IOError:
+ self._errorMessage('Save failed\n')
+ return False
+ specfile.close()
+
+ return True
+
+ def _saveImage(self, filename, nameFilter):
+ """Save an image from the plot.
+
+ :param str filename: The name of the file to write
+ :param str nameFilter: The selected name filter
+ :return: False if format is not supported or save failed,
+ True otherwise.
+ """
+ if nameFilter not in self.IMAGE_FILTERS:
+ return False
+
+ image = self.plot.getActiveImage()
+ if image is None:
+ qt.QMessageBox.warning(
+ self.plot, "No Data", "No image to be saved")
+ return False
+
+ data = image.getData(copy=False)
+
+ # TODO Use silx.io for writing files
+ if nameFilter == self.IMAGE_FILTER_EDF:
+ edfFile = EdfFile(filename, access="w+")
+ edfFile.WriteImage({}, data, Append=0)
+ return True
+
+ elif nameFilter == self.IMAGE_FILTER_TIFF:
+ tiffFile = TiffIO(filename, mode='w')
+ tiffFile.writeImage(data, software='silx')
+ return True
+
+ elif nameFilter == self.IMAGE_FILTER_NUMPY:
+ try:
+ numpy.save(filename, data)
+ except IOError:
+ self._errorMessage('Save failed\n')
+ return False
+ return True
+
+ elif nameFilter in (self.IMAGE_FILTER_ASCII,
+ self.IMAGE_FILTER_CSV_COMMA,
+ self.IMAGE_FILTER_CSV_SEMICOLON,
+ self.IMAGE_FILTER_CSV_TAB):
+ csvdelim, filetype = {
+ self.IMAGE_FILTER_ASCII: (' ', 'txt'),
+ self.IMAGE_FILTER_CSV_COMMA: (',', 'csv'),
+ self.IMAGE_FILTER_CSV_SEMICOLON: (';', 'csv'),
+ self.IMAGE_FILTER_CSV_TAB: ('\t', 'csv'),
+ }[nameFilter]
+
+ height, width = data.shape
+ rows, cols = numpy.mgrid[0:height, 0:width]
+ try:
+ save1D(filename, rows.ravel(), (cols.ravel(), data.ravel()),
+ filetype=filetype,
+ xlabel='row',
+ ylabels=['column', 'value'],
+ csvdelim=csvdelim,
+ autoheader=True)
+
+ except IOError:
+ self._errorMessage('Save failed\n')
+ return False
+ return True
+
+ elif nameFilter in (self.IMAGE_FILTER_RGB_PNG,
+ self.IMAGE_FILTER_RGB_TIFF):
+ # Get displayed image
+ rgbaImage = image.getRgbaImageData(copy=False)
+ # Convert RGB QImage
+ qimage = convertArrayToQImage(rgbaImage[:, :, :3])
+
+ if nameFilter == self.IMAGE_FILTER_RGB_PNG:
+ fileFormat = 'PNG'
+ else:
+ fileFormat = 'TIFF'
+
+ if qimage.save(filename, fileFormat):
+ return True
+ else:
+ _logger.error('Failed to save image as %s', filename)
+ qt.QMessageBox.critical(
+ self.parent(),
+ 'Save image as',
+ 'Failed to save image')
+
+ return False
+
+ def _actionTriggered(self, checked=False):
+ """Handle save action."""
+ # Set-up filters
+ filters = []
+
+ # Add image filters if there is an active image
+ if self.plot.getActiveImage() is not None:
+ filters.extend(self.IMAGE_FILTERS)
+
+ # Add curve filters if there is a curve to save
+ if (self.plot.getActiveCurve() is not None or
+ len(self.plot.getAllCurves()) == 1):
+ filters.extend(self.CURVE_FILTERS)
+ if len(self.plot.getAllCurves()) > 1:
+ filters.extend(self.ALL_CURVES_FILTERS)
+
+ filters.extend(self.SNAPSHOT_FILTERS)
+
+ # Create and run File dialog
+ dialog = qt.QFileDialog(self.plot)
+ dialog.setWindowTitle("Output File Selection")
+ dialog.setModal(1)
+ dialog.setNameFilters(filters)
+
+ dialog.setFileMode(dialog.AnyFile)
+ dialog.setAcceptMode(dialog.AcceptSave)
+
+ if not dialog.exec_():
+ return False
+
+ nameFilter = dialog.selectedNameFilter()
+ filename = dialog.selectedFiles()[0]
+ dialog.close()
+
+ # Forces the filename extension to match the chosen filter
+ extension = nameFilter.split()[-1][2:-1]
+ if (len(filename) <= len(extension) or
+ filename[-len(extension):].lower() != extension.lower()):
+ filename += extension
+
+ # Handle save
+ if nameFilter in self.SNAPSHOT_FILTERS:
+ return self._saveSnapshot(filename, nameFilter)
+ elif nameFilter in self.CURVE_FILTERS:
+ return self._saveCurve(filename, nameFilter)
+ elif nameFilter in self.ALL_CURVES_FILTERS:
+ return self._saveCurves(filename, nameFilter)
+ elif nameFilter in self.IMAGE_FILTERS:
+ return self._saveImage(filename, nameFilter)
+ else:
+ _logger.warning('Unsupported file filter: %s', nameFilter)
+ return False
+
+
+def _plotAsPNG(plot):
+ """Save a :class:`Plot` as PNG and return the payload.
+
+ :param plot: The :class:`Plot` to save
+ """
+ pngFile = BytesIO()
+ plot.saveGraph(pngFile, fileFormat='png')
+ pngFile.flush()
+ pngFile.seek(0)
+ data = pngFile.read()
+ pngFile.close()
+ return data
+
+
+class PrintAction(PlotAction):
+ """QAction for printing the plot.
+
+ It opens a Print dialog.
+
+ Current implementation print a bitmap of the plot area and not vector
+ graphics, so printing quality is not great.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate.
+ :param parent: See :class:`QAction`.
+ """
+
+ # Share QPrinter instance to propose latest used as default
+ _printer = None
+
+ def __init__(self, plot, parent=None):
+ super(PrintAction, self).__init__(
+ plot, icon='document-print', text='Print...',
+ tooltip='Open print dialog',
+ triggered=self.printPlot,
+ checkable=False, parent=parent)
+ self.setShortcut(qt.QKeySequence.Print)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ @property
+ def printer(self):
+ """The QPrinter instance used by the actions.
+
+ This is shared accross all instances of PrintAct
+ """
+ if self._printer is None:
+ PrintAction._printer = qt.QPrinter()
+ return self._printer
+
+ def printPlotAsWidget(self):
+ """Open the print dialog and print the plot.
+
+ Use :meth:`QWidget.render` to print the plot
+
+ :return: True if successful
+ """
+ dialog = qt.QPrintDialog(self.printer, self.plot)
+ dialog.setWindowTitle('Print Plot')
+ if not dialog.exec_():
+ return False
+
+ # Print a snapshot of the plot widget at the top of the page
+ widget = self.plot.centralWidget()
+
+ painter = qt.QPainter()
+ if not painter.begin(self.printer):
+ return False
+
+ pageRect = self.printer.pageRect()
+ xScale = pageRect.width() / widget.width()
+ yScale = pageRect.height() / widget.height()
+ scale = min(xScale, yScale)
+
+ painter.translate(pageRect.width() / 2., 0.)
+ painter.scale(scale, scale)
+ painter.translate(-widget.width() / 2., 0.)
+ widget.render(painter)
+ painter.end()
+
+ return True
+
+ def printPlot(self):
+ """Open the print dialog and print the plot.
+
+ Use :meth:`Plot.saveGraph` to print the plot.
+
+ :return: True if successful
+ """
+ # Init printer and start printer dialog
+ dialog = qt.QPrintDialog(self.printer, self.plot)
+ dialog.setWindowTitle('Print Plot')
+ if not dialog.exec_():
+ return False
+
+ # Save Plot as PNG and make a pixmap from it with default dpi
+ pngData = _plotAsPNG(self.plot)
+
+ pixmap = qt.QPixmap()
+ pixmap.loadFromData(pngData, 'png')
+
+ xScale = self.printer.pageRect().width() / pixmap.width()
+ yScale = self.printer.pageRect().height() / pixmap.height()
+ scale = min(xScale, yScale)
+
+ # Draw pixmap with painter
+ painter = qt.QPainter()
+ if not painter.begin(self.printer):
+ return False
+
+ painter.drawPixmap(0, 0,
+ pixmap.width() * scale,
+ pixmap.height() * scale,
+ pixmap)
+ painter.end()
+
+ return True
+
+
+class CopyAction(PlotAction):
+ """QAction to copy :class:`.PlotWidget` content to clipboard.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(CopyAction, self).__init__(
+ plot, icon='edit-copy', text='Copy plot',
+ tooltip='Copy a snapshot of the plot into the clipboard',
+ triggered=self.copyPlot,
+ checkable=False, parent=parent)
+ self.setShortcut(qt.QKeySequence.Copy)
+ self.setShortcutContext(qt.Qt.WidgetShortcut)
+
+ def copyPlot(self):
+ """Copy plot content to the clipboard as a bitmap."""
+ # Save Plot as PNG and make a QImage from it with default dpi
+ pngData = _plotAsPNG(self.plot)
+ image = qt.QImage.fromData(pngData, 'png')
+ qt.QApplication.clipboard().setImage(image)
diff --git a/silx/gui/plot/actions/medfilt.py b/silx/gui/plot/actions/medfilt.py
new file mode 100644
index 0000000..3305d1b
--- /dev/null
+++ b/silx/gui/plot/actions/medfilt.py
@@ -0,0 +1,145 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.medfilt` provides a set of QAction to apply filter
+on data contained in a :class:`.PlotWidget`.
+
+The following QAction are available:
+
+- :class:`MedianFilterAction`
+- :class:`MedianFilter1DAction`
+- :class:`MedianFilter2DAction`
+
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent", "P. Knobel"]
+__license__ = "MIT"
+
+__date__ = "24/05/2017"
+
+from . import PlotAction
+from silx.gui.widgets.MedianFilterDialog import MedianFilterDialog
+from silx.math.medianfilter import medfilt2d
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class MedianFilterAction(PlotAction):
+ """QAction to plot the pixels intensities diagram
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ PlotAction.__init__(self,
+ plot,
+ icon='median-filter',
+ text='median filter',
+ tooltip='Apply a median filter on the image',
+ triggered=self._triggered,
+ parent=parent)
+ self._originalImage = None
+ self._legend = None
+ self._filteredImage = None
+ self._popup = MedianFilterDialog(parent=None)
+ self._popup.sigFilterOptChanged.connect(self._updateFilter)
+ self.plot.sigActiveImageChanged.connect(self._updateActiveImage)
+ self._updateActiveImage()
+
+ def _triggered(self, checked):
+ """Update the plot of the histogram visibility status
+
+ :param bool checked: status of the action button
+ """
+ self._popup.show()
+
+ def _updateActiveImage(self):
+ """Set _activeImageLegend and _originalImage from the active image"""
+ self._activeImageLegend = self.plot.getActiveImage(just_legend=True)
+ if self._activeImageLegend is None:
+ self._originalImage = None
+ self._legend = None
+ else:
+ self._originalImage = self.plot.getImage(self._activeImageLegend).getData(copy=False)
+ self._legend = self.plot.getImage(self._activeImageLegend).getLegend()
+
+ def _updateFilter(self, kernelWidth, conditional=False):
+ if self._originalImage is None:
+ return
+
+ self.plot.sigActiveImageChanged.disconnect(self._updateActiveImage)
+ filteredImage = self._computeFilteredImage(kernelWidth, conditional)
+ self.plot.addImage(data=filteredImage,
+ legend=self._legend,
+ replace=True)
+ self.plot.sigActiveImageChanged.connect(self._updateActiveImage)
+
+ def _computeFilteredImage(self, kernelWidth, conditional):
+ raise NotImplemented('MedianFilterAction is a an abstract class')
+
+ def getFilteredImage(self):
+ """
+ :return: the image with the median filter apply on"""
+ return self._filteredImage
+
+
+class MedianFilter1DAction(MedianFilterAction):
+ """Define the MedianFilterAction for 1D
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+ def __init__(self, plot, parent=None):
+ MedianFilterAction.__init__(self,
+ plot,
+ parent=parent)
+
+ def _computeFilteredImage(self, kernelWidth, conditional):
+ assert(self.plot is not None)
+ return medfilt2d(self._originalImage,
+ (kernelWidth, 1),
+ conditional)
+
+
+class MedianFilter2DAction(MedianFilterAction):
+ """Define the MedianFilterAction for 2D
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+ def __init__(self, plot, parent=None):
+ MedianFilterAction.__init__(self,
+ plot,
+ parent=parent)
+
+ def _computeFilteredImage(self, kernelWidth, conditional):
+ assert(self.plot is not None)
+ return medfilt2d(self._originalImage,
+ (kernelWidth, kernelWidth),
+ conditional)
diff --git a/silx/gui/plot/actions/mode.py b/silx/gui/plot/actions/mode.py
new file mode 100644
index 0000000..026a94d
--- /dev/null
+++ b/silx/gui/plot/actions/mode.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""
+:mod:`silx.gui.plot.actions.mode` provides a set of QAction relative to mouse
+mode of a :class:`.PlotWidget`.
+
+The following QAction are available:
+
+- :class:`ZoomModeAction`
+- :class:`PanModeAction`
+"""
+
+from __future__ import division
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "16/08/2017"
+
+from . import PlotAction
+import logging
+
+_logger = logging.getLogger(__name__)
+
+
+class ZoomModeAction(PlotAction):
+ """QAction controlling the zoom mode of a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(ZoomModeAction, self).__init__(
+ plot, icon='zoom', text='Zoom mode',
+ tooltip='Zoom in or out',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ # Listen to mode change
+ self.plot.sigInteractiveModeChanged.connect(self._modeChanged)
+ # Init the state
+ self._modeChanged(None)
+
+ def _modeChanged(self, source):
+ modeDict = self.plot.getInteractiveMode()
+ old = self.blockSignals(True)
+ self.setChecked(modeDict["mode"] == "zoom")
+ self.blockSignals(old)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setInteractiveMode('zoom', source=self)
+
+
+class PanModeAction(PlotAction):
+ """QAction controlling the pan mode of a :class:`.PlotWidget`.
+
+ :param plot: :class:`.PlotWidget` instance on which to operate
+ :param parent: See :class:`QAction`
+ """
+
+ def __init__(self, plot, parent=None):
+ super(PanModeAction, self).__init__(
+ plot, icon='pan', text='Pan mode',
+ tooltip='Pan the view',
+ triggered=self._actionTriggered,
+ checkable=True, parent=parent)
+ # Listen to mode change
+ self.plot.sigInteractiveModeChanged.connect(self._modeChanged)
+ # Init the state
+ self._modeChanged(None)
+
+ def _modeChanged(self, source):
+ modeDict = self.plot.getInteractiveMode()
+ old = self.blockSignals(True)
+ self.setChecked(modeDict["mode"] == "pan")
+ self.blockSignals(old)
+
+ def _actionTriggered(self, checked=False):
+ self.plot.setInteractiveMode('pan', source=self)
diff --git a/silx/gui/plot/backends/BackendBase.py b/silx/gui/plot/backends/BackendBase.py
index 74f96af..12561b2 100644
--- a/silx/gui/plot/backends/BackendBase.py
+++ b/silx/gui/plot/backends/BackendBase.py
@@ -31,10 +31,11 @@ This API is a simplified version of PyMca PlotBackend API.
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "18/02/2016"
+__date__ = "16/08/2017"
import weakref
+from ... import qt
# Names for setCursor
@@ -58,9 +59,12 @@ class BackendBase(object):
self.__yLimits = {'left': (1., 100.), 'right': (1., 100.)}
self.__yAxisInverted = False
self.__keepDataAspectRatio = False
+ self._axesDisplayed = True
# Store a weakref to get access to the plot state.
self._setPlot(plot)
+ self.__zoomBackAction = None
+
@property
def _plot(self):
"""The plot this backend is attached to."""
@@ -79,6 +83,18 @@ class BackendBase(object):
"""
self._plotRef = weakref.ref(plot)
+ # Default Qt context menu
+
+ def contextMenuEvent(self, event):
+ """Override QWidget.contextMenuEvent to implement the context menu"""
+ if self.__zoomBackAction is None:
+ from ..actions.control import ZoomBackAction # Avoid cyclic import
+ self.__zoomBackAction = ZoomBackAction(plot=self._plot,
+ parent=self._plot)
+ menu = qt.QMenu(self)
+ menu.addAction(self.__zoomBackAction)
+ menu.exec_(event.globalPos())
+
# Add methods
def addCurve(self, x, y, legend,
@@ -147,9 +163,9 @@ class BackendBase(object):
:param int z: Layer on which to draw the image
:param bool selectable: indicate if the image can be selected
:param bool draggable: indicate if the image can be moved
- :param colormap: Dictionary describing the colormap to use.
+ :param colormap: :class:`.Colormap` describing the colormap to use.
Ignored if data is RGB(A).
- :type colormap: dict or None
+ :type colormap: :class:`.Colormap`
:param float alpha: Opacity of the image, as a float in range [0, 1].
:returns: The handle used by the backend to univocally access the image
"""
@@ -307,6 +323,8 @@ class BackendBase(object):
def saveGraph(self, fileName, fileFormat, dpi):
"""Save the graph to a file (or a StringIO)
+ At least "png", "svg" are supported.
+
:param fileName: Destination
:type fileName: String or StringIO or BytesIO
:param str fileFormat: String specifying the format
@@ -472,3 +490,18 @@ class BackendBase(object):
:return: bounds as a 4-tuple of int: (left, top, width, height)
"""
raise NotImplementedError()
+
+ def setAxesDisplayed(self, displayed):
+ """Display or not the axes.
+
+ :param bool displayed: If `True` axes are displayed. If `False` axes
+ are not anymore visible and the margin used for them is removed.
+ """
+ self._axesDisplayed = displayed
+
+ def isAxesDisplayed(self):
+ """private because in some case it is possible that one of the two axes
+ are displayed and not the other.
+ This only check status set to axes from the public API
+ """
+ return self._axesDisplayed \ No newline at end of file
diff --git a/silx/gui/plot/backends/BackendMatplotlib.py b/silx/gui/plot/backends/BackendMatplotlib.py
index f9e60d5..59e753e 100644
--- a/silx/gui/plot/backends/BackendMatplotlib.py
+++ b/silx/gui/plot/backends/BackendMatplotlib.py
@@ -28,7 +28,7 @@ from __future__ import division
__authors__ = ["V.A. Sole", "T. Vincent, H. Payno"]
__license__ = "MIT"
-__date__ = "18/01/2017"
+__date__ = "16/08/2017"
import logging
@@ -41,7 +41,9 @@ _logger = logging.getLogger(__name__)
from ... import qt
-from ._matplotlib import FigureCanvasQTAgg
+# First of all init matplotlib and set its backend
+from ..matplotlib import Colormap as MPLColormap
+from ..matplotlib import FigureCanvasQTAgg
import matplotlib
from matplotlib.container import Container
from matplotlib.figure import Figure
@@ -51,9 +53,8 @@ from matplotlib.backend_bases import MouseEvent
from matplotlib.lines import Line2D
from matplotlib.collections import PathCollection, LineCollection
-from .ModestImage import ModestImage
+from ..matplotlib.ModestImage import ModestImage
from . import BackendBase
-from .. import Colors
from .._utils import FLOAT32_MINPOS
@@ -75,6 +76,7 @@ class BackendMatplotlib(BackendBase.BackendBase):
# This attribute is used to ensure consistent values returned
# when getting the limits at the expense of a replot
self._dirtyLimits = True
+ self._axesDisplayed = True
self.fig = Figure()
self.fig.set_facecolor("w")
@@ -83,6 +85,16 @@ class BackendMatplotlib(BackendBase.BackendBase):
self.ax2 = self.ax.twinx()
self.ax2.set_label("right")
+ # disable the use of offsets
+ try:
+ self.ax.get_yaxis().get_major_formatter().set_useOffset(False)
+ self.ax.get_xaxis().get_major_formatter().set_useOffset(False)
+ self.ax2.get_yaxis().get_major_formatter().set_useOffset(False)
+ self.ax2.get_xaxis().get_major_formatter().set_useOffset(False)
+ except:
+ _logger.warning('Cannot disabled axes offsets in %s ' \
+ % matplotlib.__version__)
+
# critical for picking!!!!
self.ax2.set_zorder(0)
self.ax2.set_autoscaley_on(True)
@@ -102,10 +114,6 @@ class BackendMatplotlib(BackendBase.BackendBase):
self._graphCursor = tuple()
self.matplotlibVersion = matplotlib.__version__
- self.setGraphXLimits(0., 100.)
- self.setGraphYLimits(0., 100., axis='right')
- self.setGraphYLimits(0., 100., axis='left')
-
self._enableAxis('right', False)
# Add methods
@@ -142,7 +150,7 @@ class BackendMatplotlib(BackendBase.BackendBase):
errorbarColor = color
# On Debian 7 at least, Nx1 array yerr does not seems supported
- if (yerror is not None and yerror.ndim == 2 and
+ if (isinstance(yerror, numpy.ndarray) and yerror.ndim == 2 and
yerror.shape[1] == 1 and len(x) != 1):
yerror = numpy.ravel(yerror)
@@ -226,17 +234,17 @@ class BackendMatplotlib(BackendBase.BackendBase):
# Add support for transparent colormap for uint8 data with
# colormap with 256 colors, linear norm, [0, 255] range
if matplotlib.__version__ < '1.2.0':
- if (len(data.shape) == 2 and colormap['name'] is None and
- 'colors' in colormap):
- colors = numpy.array(colormap['colors'], copy=False)
+ if (len(data.shape) == 2 and colormap.getName() is None and
+ colormap.getColormapLUT() is not None):
+ colors = colormap.getColormapLUT()
if (colors.shape[-1] == 4 and
not numpy.all(numpy.equal(colors[3], 255))):
# This is a transparent colormap
if (colors.shape == (256, 4) and
- colormap['normalization'] == 'linear' and
- not colormap['autoscale'] and
- colormap['vmin'] == 0 and
- colormap['vmax'] == 255 and
+ colormap.getNormalization() == 'linear' and
+ not colormap.isAutoscale() and
+ colormap.getVMin() == 0 and
+ colormap.getVMax() == 255 and
data.dtype == numpy.uint8):
# Supported case, convert data to RGBA
data = colors[data.reshape(-1)].reshape(
@@ -264,7 +272,7 @@ class BackendMatplotlib(BackendBase.BackendBase):
else:
# Convert colormap argument to matplotlib colormap
- scalarMappable = Colors.getMPLScalarMappable(colormap, data)
+ scalarMappable = MPLColormap.getScalarMappable(colormap, data)
# try as data
image = imageClass(self.ax,
@@ -440,7 +448,10 @@ class BackendMatplotlib(BackendBase.BackendBase):
item._infoText.remove()
item._infoText = None
self._overlays.discard(item)
- item.remove()
+ try:
+ item.remove()
+ except ValueError:
+ pass # Already removed e.g., in set[X|Y]AxisLogarithmic
# Interaction methods
@@ -591,10 +602,16 @@ class BackendMatplotlib(BackendBase.BackendBase):
# Graph axes
def setXAxisLogarithmic(self, flag):
+ if matplotlib.__version__ >= "2.0.0":
+ self.ax.cla()
+ self.ax2.cla()
self.ax2.set_xscale('log' if flag else 'linear')
self.ax.set_xscale('log' if flag else 'linear')
def setYAxisLogarithmic(self, flag):
+ if matplotlib.__version__ >= "2.0.0":
+ self.ax.cla()
+ self.ax2.cla()
self.ax2.set_yscale('log' if flag else 'linear')
self.ax.set_yscale('log' if flag else 'linear')
@@ -649,6 +666,29 @@ class BackendMatplotlib(BackendBase.BackendBase):
return (bbox.bounds[0] * dpi, bbox.bounds[1] * dpi,
bbox.bounds[2] * dpi, bbox.bounds[3] * dpi)
+ def setAxesDisplayed(self, displayed):
+ """Display or not the axes.
+
+ :param bool displayed: If `True` axes are displayed. If `False` axes
+ are not anymore visible and the margin used for them is removed.
+ """
+ BackendBase.BackendBase.setAxesDisplayed(self, displayed)
+ if displayed:
+ # show axes and viewbox rect
+ self.ax.set_axis_on()
+ self.ax2.set_axis_on()
+ # set the default margins
+ self.ax.set_position([.15, .15, .75, .75])
+ self.ax2.set_position([.15, .15, .75, .75])
+ else:
+ # hide axes and viewbox rect
+ self.ax.set_axis_off()
+ self.ax2.set_axis_off()
+ # remove external margins
+ self.ax.set_position([0, 0, 1, 1])
+ self.ax2.set_position([0, 0, 1, 1])
+ self._plot._setDirtyPlot()
+
class BackendMatplotlibQt(FigureCanvasQTAgg, BackendMatplotlib):
"""QWidget matplotlib backend using a QtAgg canvas.
@@ -682,6 +722,11 @@ class BackendMatplotlibQt(FigureCanvasQTAgg, BackendMatplotlib):
self.mpl_connect('motion_notify_event', self._onMouseMove)
self.mpl_connect('scroll_event', self._onMouseWheel)
+ def contextMenuEvent(self, event):
+ """Override QWidget.contextMenuEvent to implement the context menu"""
+ # Makes sure it is overridden (issue with PySide)
+ BackendBase.BackendBase.contextMenuEvent(self, event)
+
def postRedisplay(self):
self._sigPostRedisplay.emit()
@@ -738,18 +783,12 @@ class BackendMatplotlibQt(FigureCanvasQTAgg, BackendMatplotlib):
self._picked.append({'kind': 'image', 'legend': label[9:]})
else: # it's a curve, item have no picker for now
- if isinstance(event.artist, PathCollection):
- data = event.artist.get_offsets()[event.ind, :]
- xdata, ydata = data[:, 0], data[:, 1]
- elif isinstance(event.artist, Line2D):
- xdata = event.artist.get_xdata()[event.ind]
- ydata = event.artist.get_ydata()[event.ind]
- else:
+ if not isinstance(event.artist, (PathCollection, Line2D)):
_logger.info('Unsupported artist, ignored')
return
self._picked.append({'kind': 'curve', 'legend': label,
- 'xdata': xdata, 'ydata': ydata})
+ 'indices': event.ind})
def pickItems(self, x, y):
self._picked = []
@@ -776,9 +815,22 @@ class BackendMatplotlibQt(FigureCanvasQTAgg, BackendMatplotlib):
def draw(self):
"""Override canvas draw method to support faster draw of overlays."""
if self._plot._getDirtyPlot(): # Need a full redraw
+ # Store previous limits
+ xLimits = self.ax.get_xbound()
+ yLimits = self.ax.get_ybound()
+ yRightLimits = self.ax2.get_ybound()
+
FigureCanvasQTAgg.draw(self)
self._background = None # Any saved background is dirty
+ # Check if limits changed due to a resize of the widget
+ if xLimits != self.ax.get_xbound():
+ self._plot.getXAxis()._emitLimitsChanged()
+ if yLimits != self.ax.get_ybound():
+ self._plot.getYAxis(axis='left')._emitLimitsChanged()
+ if yRightLimits != self.ax2.get_ybound():
+ self._plot.getYAxis(axis='left')._emitLimitsChanged()
+
if (self._overlays or self._graphCursor or
self._plot._getDirtyPlot() == 'overlay'):
# There are overlays or crosshair, or they is just no more overlays
diff --git a/silx/gui/plot/backends/BackendOpenGL.py b/silx/gui/plot/backends/BackendOpenGL.py
index bc10eca..c70b03a 100644
--- a/silx/gui/plot/backends/BackendOpenGL.py
+++ b/silx/gui/plot/backends/BackendOpenGL.py
@@ -28,7 +28,7 @@ from __future__ import division
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "21/03/2017"
+__date__ = "16/08/2017"
from collections import OrderedDict, namedtuple
from ctypes import c_void_p
@@ -39,6 +39,7 @@ import numpy
from .._utils import FLOAT32_MINPOS
from . import BackendBase
from .. import Colors
+from ..Colormap import Colormap
from ... import qt
from ..._glutils import gl
@@ -299,6 +300,7 @@ _texFragShd = """
void main(void) {
gl_FragColor = texture2D(tex, coords);
+ gl_FragColor.a = 1.0;
}
"""
@@ -313,7 +315,7 @@ def _getContext():
return _current_context
-class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
+class BackendOpenGL(BackendBase.BackendBase, glu.OpenGLWidget):
"""OpenGL-based Plot backend.
WARNINGS:
@@ -328,8 +330,13 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
_sigPostRedisplay = qt.Signal()
"""Signal handling automatic asynchronous replot"""
- def __init__(self, plot, parent=None):
- qt.QGLWidget.__init__(self, parent)
+ def __init__(self, plot, parent=None, f=qt.Qt.WindowFlags()):
+ glu.OpenGLWidget.__init__(self, parent,
+ alphaBufferSize=8,
+ depthBufferSize=0,
+ stencilBufferSize=0,
+ version=(2, 1),
+ f=f)
BackendBase.BackendBase.__init__(self, plot, parent)
self.matScreenProj = mat4Identity()
@@ -342,8 +349,6 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
self._keepDataAspectRatio = False
- self._devicePixelRatio = 1.0
-
self._crosshairCursor = None
self._mousePosInPixels = None
@@ -361,11 +366,6 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
super(BackendOpenGL, self).postRedisplay,
qt.Qt.QueuedConnection)
- # TODO is this needed? move it Plot?
- self.setGraphXLimits(0., 100.)
- self.setGraphYLimits(0., 100., axis='right')
- self.setGraphYLimits(0., 100., axis='left')
-
self.setAutoFillBackground(False)
self.setMouseTracking(True)
@@ -373,19 +373,24 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
_MOUSE_BTNS = {1: 'left', 2: 'right', 4: 'middle'}
+ def contextMenuEvent(self, event):
+ """Override QWidget.contextMenuEvent to implement the context menu"""
+ # Makes sure it is overridden (issue with PySide)
+ BackendBase.BackendBase.contextMenuEvent(self, event)
+
def sizeHint(self):
return qt.QSize(8 * 80, 6 * 80) # Mimic MatplotlibBackend
def mousePressEvent(self, event):
- xPixel = event.x() * self._devicePixelRatio
- yPixel = event.y() * self._devicePixelRatio
+ xPixel = event.x() * self.getDevicePixelRatio()
+ yPixel = event.y() * self.getDevicePixelRatio()
btn = self._MOUSE_BTNS[event.button()]
self._plot.onMousePress(xPixel, yPixel, btn)
event.accept()
def mouseMoveEvent(self, event):
- xPixel = event.x() * self._devicePixelRatio
- yPixel = event.y() * self._devicePixelRatio
+ xPixel = event.x() * self.getDevicePixelRatio()
+ yPixel = event.y() * self.getDevicePixelRatio()
# Handle crosshair
inXPixel, inYPixel = self._mouseInPlotArea(xPixel, yPixel)
@@ -402,16 +407,16 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
event.accept()
def mouseReleaseEvent(self, event):
- xPixel = event.x() * self._devicePixelRatio
- yPixel = event.y() * self._devicePixelRatio
+ xPixel = event.x() * self.getDevicePixelRatio()
+ yPixel = event.y() * self.getDevicePixelRatio()
btn = self._MOUSE_BTNS[event.button()]
self._plot.onMouseRelease(xPixel, yPixel, btn)
event.accept()
def wheelEvent(self, event):
- xPixel = event.x() * self._devicePixelRatio
- yPixel = event.y() * self._devicePixelRatio
+ xPixel = event.x() * self.getDevicePixelRatio()
+ yPixel = event.y() * self.getDevicePixelRatio()
if hasattr(event, 'angleDelta'): # Qt 5
delta = event.angleDelta().y()
@@ -424,11 +429,11 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
def leaveEvent(self, _):
self._plot.onMouseLeaveWidget()
- # QGLWidget API
+ # OpenGLWidget API
@staticmethod
def _setBlendFuncGL():
- # glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
+ # gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA)
gl.glBlendFuncSeparate(gl.GL_SRC_ALPHA,
gl.GL_ONE_MINUS_SRC_ALPHA,
gl.GL_ONE,
@@ -526,13 +531,6 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
glu.setGLContextGetter(_getContext)
- if hasattr(self, 'windowHandle'): # Qt 5
- devicePixelRatio = self.windowHandle().devicePixelRatio()
- if devicePixelRatio != self._devicePixelRatio:
- self._devicePixelRatio = devicePixelRatio
- self.resizeGL(int(self.width() * devicePixelRatio),
- int(self.height() * devicePixelRatio))
-
# Release OpenGL resources
for item in self._glGarbageCollector:
item.discard()
@@ -916,16 +914,32 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
def resizeGL(self, width, height):
if width == 0 or height == 0: # Do not resize
return
- self._plotFrame.size = width, height
+
+ self._plotFrame.size = (
+ int(self.getDevicePixelRatio() * width),
+ int(self.getDevicePixelRatio() * height))
self.matScreenProj = mat4Ortho(0, self._plotFrame.size[0],
self._plotFrame.size[1], 0,
1, -1)
+ # Store current ranges
+ previousXRange = self.getGraphXLimits()
+ previousYRange = self.getGraphYLimits(axis='left')
+ previousYRightRange = self.getGraphYLimits(axis='right')
+
(xMin, xMax), (yMin, yMax), (y2Min, y2Max) = \
self._plotFrame.dataRanges
self.setLimits(xMin, xMax, yMin, yMax, y2Min, y2Max)
+ # If plot range has changed, then emit signal
+ if previousXRange != self.getGraphXLimits():
+ self._plot.getXAxis()._emitLimitsChanged()
+ if previousYRange != self.getGraphYLimits(axis='left'):
+ self._plot.getYAxis(axis='left')._emitLimitsChanged()
+ if previousYRightRange != self.getGraphYLimits(axis='right'):
+ self._plot.getYAxis(axis='right')._emitLimitsChanged()
+
# Add methods
def addCurve(self, x, y, legend,
@@ -1017,23 +1031,18 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
'addImage: Convert %s data to float32', str(data.dtype))
data = numpy.array(data, dtype=numpy.float32, order='C')
- colormapIsLog = colormap['normalization'].startswith('log')
+ colormapIsLog = colormap.getNormalization() == 'log'
- if colormap['autoscale']:
- cmapRange = None
- else:
- cmapRange = colormap['vmin'], colormap['vmax']
- assert cmapRange[0] <= cmapRange[1]
+ cmapRange = colormap.getColormapRange(data=data)
# Retrieve colormap LUT from name and color array
- colormapLut = Colors.applyColormapToData(
- numpy.arange(256, dtype=numpy.uint8),
- name=colormap['name'],
- normalization='linear',
- autoscale=False,
- vmin=0,
- vmax=255,
- colors=colormap.get('colors'))
+ colormapDisp = Colormap(name=colormap.getName(),
+ normalization=Colormap.LINEAR,
+ vmin=0,
+ vmax=255,
+ colors=colormap.getColormapLUT())
+ colormapLut = colormapDisp.applyToData(
+ numpy.arange(256, dtype=numpy.uint8))
image = GLPlotColormap(data,
origin,
@@ -1301,8 +1310,7 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
if pickedIndices:
picked.append(dict(kind='curve',
legend=item.info['legend'],
- xdata=item.xData[pickedIndices],
- ydata=item.yData[pickedIndices]))
+ indices=pickedIndices))
return picked
@@ -1330,20 +1338,38 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
if fileFormat not in ['png', 'ppm', 'svg', 'tiff']:
raise NotImplementedError('Unsupported format: %s' % fileFormat)
- self.makeCurrent()
-
- data = numpy.empty(
- (self._plotFrame.size[1], self._plotFrame.size[0], 3),
- dtype=numpy.uint8, order='C')
+ if not self.isValid():
+ _logger.error('OpenGL 2.1 not available, cannot save OpenGL image')
+ width, height = self._plotFrame.size
+ data = numpy.zeros((height, width, 3), dtype=numpy.uint8)
+ else:
+ self.makeCurrent()
+
+ data = numpy.empty(
+ (self._plotFrame.size[1], self._plotFrame.size[0], 3),
+ dtype=numpy.uint8, order='C')
+
+ context = self.context()
+ framebufferTexture = self._plotFBOs.get(context)
+ if framebufferTexture is None:
+ # Fallback, supports direct rendering mode: _paintDirectGL
+ # might have issues as it can read on-screen framebuffer
+ fboName = self.defaultFramebufferObject()
+ width, height = self._plotFrame.size
+ else:
+ fboName = framebufferTexture.name
+ height, width = framebufferTexture.shape
- gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0)
- gl.glPixelStorei(gl.GL_PACK_ALIGNMENT, 1)
- gl.glReadPixels(0, 0, self._plotFrame.size[0], self._plotFrame.size[1],
- gl.GL_RGB, gl.GL_UNSIGNED_BYTE, data)
+ previousFramebuffer = gl.glGetInteger(gl.GL_FRAMEBUFFER_BINDING)
+ gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, fboName)
+ gl.glPixelStorei(gl.GL_PACK_ALIGNMENT, 1)
+ gl.glReadPixels(0, 0, width, height,
+ gl.GL_RGB, gl.GL_UNSIGNED_BYTE, data)
+ gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, previousFramebuffer)
- # glReadPixels gives bottom to top,
- # while images are stored as top to bottom
- data = numpy.flipud(data)
+ # glReadPixels gives bottom to top,
+ # while images are stored as top to bottom
+ data = numpy.flipud(data)
# fileName is either a file-like object or a str
saveImageToFile(data, fileName, fileFormat)
@@ -1629,3 +1655,7 @@ class BackendOpenGL(BackendBase.BackendBase, qt.QGLWidget):
def getPlotBoundsInPixels(self):
return self._plotFrame.plotOrigin + self._plotFrame.plotSize
+
+ def setAxesDisplayed(self, displayed):
+ BackendBase.BackendBase.setAxesDisplayed(self, displayed)
+ self._plotFrame.displayed = displayed \ No newline at end of file
diff --git a/silx/gui/plot/backends/glutils/GLPlotCurve.py b/silx/gui/plot/backends/glutils/GLPlotCurve.py
index 4f08054..4433613 100644
--- a/silx/gui/plot/backends/glutils/GLPlotCurve.py
+++ b/silx/gui/plot/backends/glutils/GLPlotCurve.py
@@ -1185,7 +1185,7 @@ class GLPlotCurve2D(object):
self.yVboData.offset += yAttrib.itemsize
if cAttrib is not None and colorData.dtype.kind == 'u':
- cAttrib.normalisation = True # Normalise uint to [0, 1]
+ cAttrib.normalization = True # Normalize uint to [0, 1]
self.colorVboData = cAttrib
self.useColorVboData = cAttrib is not None
self.distVboData = dAttrib
diff --git a/silx/gui/plot/backends/glutils/GLPlotFrame.py b/silx/gui/plot/backends/glutils/GLPlotFrame.py
index 367419c..eb101c4 100644
--- a/silx/gui/plot/backends/glutils/GLPlotFrame.py
+++ b/silx/gui/plot/backends/glutils/GLPlotFrame.py
@@ -317,6 +317,9 @@ class GLPlotFrame(object):
_Margins = namedtuple('Margins', ('left', 'right', 'top', 'bottom'))
+ # Margins used when plot frame is not displayed
+ _NoDisplayMargins = _Margins(0, 0, 0, 0)
+
def __init__(self, margins):
"""
:param margins: The margins around plot area for axis and labels.
@@ -332,6 +335,7 @@ class GLPlotFrame(object):
self._grid = False
self._size = 0., 0.
self._title = ''
+ self._displayed = True
@property
def isDirty(self):
@@ -344,9 +348,24 @@ class GLPlotFrame(object):
GRID_ALL_TICKS = (GRID_MAIN_TICKS + GRID_SUB_TICKS)
@property
+ def displayed(self):
+ """Whether axes and their labels are displayed or not (bool)"""
+ return self._displayed
+
+ @displayed.setter
+ def displayed(self, displayed):
+ displayed = bool(displayed)
+ if displayed != self._displayed:
+ self._displayed = displayed
+ self._dirty()
+
+ @property
def margins(self):
"""Margins in pixels around the plot."""
- return self._margins
+ if not self.displayed:
+ return self._NoDisplayMargins
+ else:
+ return self._margins
@property
def grid(self):
@@ -465,6 +484,9 @@ class GLPlotFrame(object):
_SHADERS['vertex'], _SHADERS['fragment'], attrib0='position')
def render(self):
+ if not self.displayed:
+ return
+
if self._renderResources is None:
self._buildVerticesAndLabels()
vertices, gridVertices, labels = self._renderResources
diff --git a/silx/gui/plot/backends/glutils/GLPlotImage.py b/silx/gui/plot/backends/glutils/GLPlotImage.py
index 8fff82b..df5b289 100644
--- a/silx/gui/plot/backends/glutils/GLPlotImage.py
+++ b/silx/gui/plot/backends/glutils/GLPlotImage.py
@@ -243,8 +243,7 @@ class GLPlotColormap(_GLPlotData2D):
super(GLPlotColormap, self).__init__(data, origin, scale)
self.colormap = numpy.array(colormap, copy=False)
self.cmapIsLog = cmapIsLog
- self._cmapRange = None # User-provided range info
- self._cmapRangeCache = None # Store extra data for range
+ self._cmapRange = (1., 10.) # Colormap range
self.cmapRange = cmapRange # Update _cmapRange
self._alpha = numpy.clip(alpha, 0., 1.)
@@ -264,54 +263,15 @@ class GLPlotColormap(_GLPlotData2D):
@property
def cmapRange(self):
- if self._cmapRange is None: # Auto-scale mode
- if self._cmapRangeCache is None:
- # Build data , positive ranges
- result = min_max(self.data, min_positive=True)
- min_ = result.minimum
- minPos = result.min_positive
- max_ = result.maximum
- maxPos = max_ if max_ > 0. else 1.
- if minPos is None:
- minPos = maxPos
- self._cmapRangeCache = {'range': (min_, max_),
- 'pos': (minPos, maxPos)}
-
- return self._cmapRangeCache['pos' if self.cmapIsLog else 'range']
-
- else:
- if not self.cmapIsLog:
- return self._cmapRange # Return range as is
- else:
- if self._cmapRangeCache is None:
- # Build a strictly positive range from cmapRange
- min_, max_ = self._cmapRange
- if min_ > 0. and max_ > 0.:
- minPos, maxPos = min_, max_
- else:
- result = min_max(self.data, min_positive=True)
- minPos = result.min_positive
- dataMax = result.maximum
- if max_ > 0.:
- maxPos = max_
- elif dataMax > 0.:
- maxPos = dataMax
- else:
- maxPos = 1. # Arbitrary fallback
- if minPos is None:
- minPos = maxPos
- self._cmapRangeCache = minPos, maxPos
- return self._cmapRangeCache # Strictly positive range
+ if self.cmapIsLog:
+ assert self._cmapRange[0] > 0. and self._cmapRange[1] > 0.
+ return self._cmapRange
@cmapRange.setter
def cmapRange(self, cmapRange):
- self._cmapRangeCache = None
- if cmapRange is None:
- self._cmapRange = None
- else:
- assert len(cmapRange) == 2
- assert cmapRange[0] <= cmapRange[1]
- self._cmapRange = tuple(cmapRange)
+ assert len(cmapRange) == 2
+ assert cmapRange[0] <= cmapRange[1]
+ self._cmapRange = float(cmapRange[0]), float(cmapRange[1])
@property
def alpha(self):
@@ -322,8 +282,6 @@ class GLPlotColormap(_GLPlotData2D):
oldData = self.data
self.data = data
- self._cmapRangeCache = None
-
if self._texture is not None:
if (self.data.shape != oldData.shape or
self.data.dtype != oldData.dtype):
diff --git a/silx/gui/plot/backends/glutils/GLText.py b/silx/gui/plot/backends/glutils/GLText.py
index 495882c..cef0c5a 100644
--- a/silx/gui/plot/backends/glutils/GLText.py
+++ b/silx/gui/plot/backends/glutils/GLText.py
@@ -88,11 +88,12 @@ class Text2D(object):
attrib0='position')
_textures = {}
-
- _rasterTextCache = {}
- """Internal cache storing already rasterized text"""
+ """Cache already created textures"""
# TODO limit cache size and discard least recent used
+ _sizes = {}
+ """Cache already computed sizes"""
+
def __init__(self, text, x=0, y=0,
color=(0., 0., 0., 1.),
bgColor=None,
@@ -117,31 +118,37 @@ class Text2D(object):
self._rotate = numpy.radians(rotate)
- @classmethod
- def _getTexture(cls, text):
+ def _getTexture(self, text):
key = getGLContext(), text
- if key not in cls._textures:
+
+ if key not in self._textures:
image, offset = font.rasterText(text,
font.getDefaultFontFamily())
- cls._textures[key] = (Texture(gl.GL_RED,
- data=image,
- minFilter=gl.GL_NEAREST,
- magFilter=gl.GL_NEAREST,
- wrap=(gl.GL_CLAMP_TO_EDGE,
- gl.GL_CLAMP_TO_EDGE)),
- offset)
+ if text not in self._sizes:
+ self._sizes[text] = image.shape[1], image.shape[0]
- return cls._textures[key]
+ self._textures[key] = (
+ Texture(gl.GL_RED,
+ data=image,
+ minFilter=gl.GL_NEAREST,
+ magFilter=gl.GL_NEAREST,
+ wrap=(gl.GL_CLAMP_TO_EDGE,
+ gl.GL_CLAMP_TO_EDGE)),
+ offset)
+
+ return self._textures[key]
@property
def text(self):
return self._text
@property
- def size(self): # TODO very poor implementation
- image, offset = font.rasterText(self.text,
- font.getDefaultFontFamily())
- return image.shape[1], image.shape[0]
+ def size(self):
+ if self.text not in self._sizes:
+ image, offset = font.rasterText(self.text,
+ font.getDefaultFontFamily())
+ self._sizes[self.text] = image.shape[1], image.shape[0]
+ return self._sizes[self.text]
def getVertices(self, offset, shape):
height, width = shape
diff --git a/silx/gui/plot/backends/glutils/PlotImageFile.py b/silx/gui/plot/backends/glutils/PlotImageFile.py
index e4ebe24..f028ee8 100644
--- a/silx/gui/plot/backends/glutils/PlotImageFile.py
+++ b/silx/gui/plot/backends/glutils/PlotImageFile.py
@@ -96,7 +96,11 @@ def saveImageToFile(data, fileNameOrObj, fileFormat):
if sys.version < "3.0":
fileObj = open(fileNameOrObj, "wb")
else:
- fileObj = open(fileNameOrObj, "w", newline='')
+ if fileFormat in ('png', 'ppm', 'tiff'):
+ # Open in binary mode
+ fileObj = open(fileNameOrObj, 'wb')
+ else:
+ fileObj = open(fileNameOrObj, 'w', newline='')
else: # Use as a file-like object
fileObj = fileNameOrObj
@@ -127,9 +131,9 @@ def saveImageToFile(data, fileNameOrObj, fileFormat):
elif fileFormat == 'ppm':
height, width = data.shape[:2]
- fileObj.write('P6\n')
- fileObj.write('%d %d\n' % (width, height))
- fileObj.write('255\n')
+ fileObj.write(b'P6\n')
+ fileObj.write(b'%d %d\n' % (width, height))
+ fileObj.write(b'255\n')
fileObj.write(data.tostring())
elif fileFormat == 'png':
@@ -143,7 +147,7 @@ def saveImageToFile(data, fileNameOrObj, fileFormat):
from silx.third_party.TiffIO import TiffIO
tif = TiffIO(fileNameOrObj, mode='wb+')
- tif.writeImage(data, info={'Title': 'PyMCA GL Snapshot'})
+ tif.writeImage(data, info={'Title': 'OpenGL Plot Snapshot'})
if fileObj != fileNameOrObj:
fileObj.close()
diff --git a/silx/gui/plot/items/__init__.py b/silx/gui/plot/items/__init__.py
index b16fe40..bf39c87 100644
--- a/silx/gui/plot/items/__init__.py
+++ b/silx/gui/plot/items/__init__.py
@@ -22,22 +22,23 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This package provides classes that describes :class:`.Plot` content.
+"""This package provides classes that describes :class:`.PlotWidget` content.
-Instances of those classes are returned by :class:`.Plot` methods that give
-access to its content such as :meth:`.Plot.getCurve`, :meth:`.Plot.getImage`.
+Instances of those classes are returned by :class:`.PlotWidget` methods that give
+access to its content such as :meth:`.PlotWidget.getCurve`, :meth:`.PlotWidget.getImage`.
"""
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "06/03/2017"
+__date__ = "22/06/2017"
from .core import (Item, LabelsMixIn, DraggableMixIn, ColormapMixIn, # noqa
SymbolMixIn, ColorMixIn, YAxisMixIn, FillMixIn, # noqa
- AlphaMixIn, LineMixIn) # noqa
+ AlphaMixIn, LineMixIn, ItemChangedType) # noqa
from .curve import Curve # noqa
from .histogram import Histogram # noqa
-from .image import ImageBase, ImageData, ImageRgba # noqa
+from .image import ImageBase, ImageData, ImageRgba, MaskImageData # noqa
from .shape import Shape # noqa
from .scatter import Scatter # noqa
from .marker import Marker, XMarker, YMarker # noqa
+from .axis import Axis, XAxis, YAxis, YRightAxis
diff --git a/silx/gui/plot/items/axis.py b/silx/gui/plot/items/axis.py
new file mode 100644
index 0000000..56fd762
--- /dev/null
+++ b/silx/gui/plot/items/axis.py
@@ -0,0 +1,477 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides the class for axes of the :class:`PlotWidget`.
+"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "30/08/2017"
+
+import logging
+from ... import qt
+
+_logger = logging.getLogger(__name__)
+
+
+class Axis(qt.QObject):
+ """This class describes and controls a plot axis.
+
+ Note: This is an abstract class.
+ """
+ # States are half-stored on the backend of the plot, and half-stored on this
+ # object.
+ # TODO It would be good to store all the states of an axis in this object.
+ # i.e. vmin and vmax
+
+ LINEAR = "linear"
+ """Constant defining a linear scale"""
+
+ LOGARITHMIC = "log"
+ """Constant defining a logarithmic scale"""
+
+ _SCALES = set([LINEAR, LOGARITHMIC])
+
+ sigInvertedChanged = qt.Signal(bool)
+ """Signal emitted when axis orientation has changed"""
+
+ sigScaleChanged = qt.Signal(str)
+ """Signal emitted when axis scale has changed"""
+
+ _sigLogarithmicChanged = qt.Signal(bool)
+ """Signal emitted when axis scale has changed to or from logarithmic"""
+
+ sigAutoScaleChanged = qt.Signal(bool)
+ """Signal emitted when axis autoscale has changed"""
+
+ sigLimitsChanged = qt.Signal(float, float)
+ """Signal emitted when axis autoscale has changed"""
+
+ def __init__(self, plot):
+ """Constructor
+
+ :param silx.gui.plot.PlotWidget.PlotWidget plot: Parent plot of this
+ axis
+ """
+ qt.QObject.__init__(self, parent=plot)
+ self._scale = self.LINEAR
+ self._isAutoScale = True
+ # Store default labels provided to setGraph[X|Y]Label
+ self._defaultLabel = ''
+ # Store currently displayed labels
+ # Current label can differ from input one with active curve handling
+ self._currentLabel = ''
+ self._plot = plot
+
+ def getLimits(self):
+ """Get the limits of this axis.
+
+ :return: Minimum and maximum values of this axis as tuple
+ """
+ return self._internalGetLimits()
+
+ def setLimits(self, vmin, vmax):
+ """Set this axis limits.
+
+ :param float vmin: minimum axis value
+ :param float vmax: maximum axis value
+ """
+ vmin, vmax = self._checkLimits(vmin, vmax)
+ if self.getLimits() == (vmin, vmax):
+ return
+
+ self._internalSetLimits(vmin, vmax)
+ self._plot._setDirtyPlot()
+
+ self._emitLimitsChanged()
+
+ def _emitLimitsChanged(self):
+ """Emit axis sigLimitsChanged and PlotWidget limitsChanged event"""
+ vmin, vmax = self.getLimits()
+ self.sigLimitsChanged.emit(vmin, vmax)
+ self._plot._notifyLimitsChanged(emitSignal=False)
+
+ def _checkLimits(self, vmin, vmax):
+ """Makes sure axis range is not empty
+
+ :param float vmin: Min axis value
+ :param float vmax: Max axis value
+ :return: (min, max) making sure min < max
+ :rtype: 2-tuple of float
+ """
+ if vmax < vmin:
+ _logger.debug('%s axis: max < min, inverting limits.', self._defaultLabel)
+ vmin, vmax = vmax, vmin
+ elif vmax == vmin:
+ _logger.debug('%s axis: max == min, expanding limits.', self._defaultLabel)
+ if vmin == 0.:
+ vmin, vmax = -0.1, 0.1
+ elif vmin < 0:
+ vmin, vmax = vmin * 1.1, vmin * 0.9
+ else: # xmin > 0
+ vmin, vmax = vmin * 0.9, vmin * 1.1
+
+ return vmin, vmax
+
+ def isInverted(self):
+ """Return True if the axis is inverted (top to bottom for the y-axis),
+ False otherwise. It is always False for the X axis.
+
+ :rtype: bool
+ """
+ return False
+
+ def setInverted(self, isInverted):
+ """Set the axis orientation.
+
+ This is only available for the Y axis.
+
+ :param bool flag: True for Y axis going from top to bottom,
+ False for Y axis going from bottom to top
+ """
+ if isInverted == self.isInverted():
+ return
+ raise NotImplementedError()
+
+ def getLabel(self):
+ """Return the current displayed label of this axis.
+
+ :param str axis: The Y axis for which to get the label (left or right)
+ :rtype: str
+ """
+ return self._currentLabel
+
+ def setLabel(self, label):
+ """Set the label displayed on the plot for this axis.
+
+ The provided label can be temporarily replaced by the label of the
+ active curve if any.
+
+ :param str label: The axis label
+ """
+ self._defaultLabel = label
+ self._setCurrentLabel(label)
+ self._plot._setDirtyPlot()
+
+ def _setCurrentLabel(self, label):
+ """Define the label currently displayed.
+
+ If the label is None or empty the default label is used.
+
+ :param str label: Currently displayed label
+ """
+ if label is None or label == '':
+ label = self._defaultLabel
+ if label is None:
+ label = ''
+ self._currentLabel = label
+ self._internalSetCurrentLabel(label)
+
+ def getScale(self):
+ """Return the name of the scale used by this axis.
+
+ :rtype: str
+ """
+ return self._scale
+
+ def setScale(self, scale):
+ """Set the scale to be used by this axis.
+
+ :param str scale: Name of the scale ("log", or "linear")
+ """
+ assert(scale in self._SCALES)
+ if self._scale == scale:
+ return
+
+ # For the backward compatibility signal
+ emitLog = self._scale == self.LOGARITHMIC or scale == self.LOGARITHMIC
+
+ if scale == self.LOGARITHMIC:
+ self._internalSetLogarithmic(True)
+ elif scale == self.LINEAR:
+ self._internalSetLogarithmic(False)
+ else:
+ raise ValueError("Scale %s unsupported" % scale)
+
+ self._scale = scale
+
+ # TODO hackish way of forcing update of curves and images
+ for item in self._plot._getItems(withhidden=True):
+ item._updated()
+ self._plot._invalidateDataRange()
+ self._plot.resetZoom()
+
+ self.sigScaleChanged.emit(self._scale)
+ if emitLog:
+ self._sigLogarithmicChanged.emit(self._scale == self.LOGARITHMIC)
+
+ def _isLogarithmic(self):
+ """Return True if this axis scale is logarithmic, False if linear.
+
+ :rtype: bool
+ """
+ return self._scale == self.LOGARITHMIC
+
+ def _setLogarithmic(self, flag):
+ """Set the scale of this axes (either linear or logarithmic).
+
+ :param bool flag: True to use a logarithmic scale, False for linear.
+ """
+ flag = bool(flag)
+ self.setScale(self.LOGARITHMIC if flag else self.LINEAR)
+
+ def isAutoScale(self):
+ """Return True if axis is automatically adjusting its limits.
+
+ :rtype: bool
+ """
+ return self._isAutoScale
+
+ def setAutoScale(self, flag=True):
+ """Set the axis limits adjusting behavior of :meth:`resetZoom`.
+
+ :param bool flag: True to resize limits automatically,
+ False to disable it.
+ """
+ self._isAutoScale = bool(flag)
+ self.sigAutoScaleChanged.emit(self._isAutoScale)
+
+ def _setLimitsConstraints(self, minPos=None, maxPos=None):
+ raise NotImplementedError()
+
+ def setLimitsConstraints(self, minPos=None, maxPos=None):
+ """
+ Set a constaints on the position of the axes.
+
+ :param float minPos: Minimum allowed axis value.
+ :param float maxPos: Maximum allowed axis value.
+ :return: True if the constaints was updated
+ :rtype: bool
+ """
+ updated = self._setLimitsConstraints(minPos, maxPos)
+ if updated:
+ plot = self._plot
+ xMin, xMax = plot.getXAxis().getLimits()
+ yMin, yMax = plot.getYAxis().getLimits()
+ y2Min, y2Max = plot.getYAxis('right').getLimits()
+ plot.setLimits(xMin, xMax, yMin, yMax, y2Min, y2Max)
+ return updated
+
+ def _setRangeConstraints(self, minRange=None, maxRange=None):
+ raise NotImplementedError()
+
+ def setRangeConstraints(self, minRange=None, maxRange=None):
+ """
+ Set a constaints on the position of the axes.
+
+ :param float minRange: Minimum allowed left-to-right span across the
+ view
+ :param float maxRange: Maximum allowed left-to-right span across the
+ view
+ :return: True if the constaints was updated
+ :rtype: bool
+ """
+ updated = self._setRangeConstraints(minRange, maxRange)
+ if updated:
+ plot = self._plot
+ xMin, xMax = plot.getXAxis().getLimits()
+ yMin, yMax = plot.getYAxis().getLimits()
+ y2Min, y2Max = plot.getYAxis('right').getLimits()
+ plot.setLimits(xMin, xMax, yMin, yMax, y2Min, y2Max)
+ return updated
+
+
+class XAxis(Axis):
+ """Axis class defining primitives for the X axis"""
+
+ # TODO With some changes on the backend, it will be able to remove all this
+ # specialised implementations (prefixel by '_internal')
+
+ def _internalSetCurrentLabel(self, label):
+ self._plot._backend.setGraphXLabel(label)
+
+ def _internalGetLimits(self):
+ return self._plot._backend.getGraphXLimits()
+
+ def _internalSetLimits(self, xmin, xmax):
+ self._plot._backend.setGraphXLimits(xmin, xmax)
+
+ def _internalSetLogarithmic(self, flag):
+ self._plot._backend.setXAxisLogarithmic(flag)
+
+ def _setLimitsConstraints(self, minPos=None, maxPos=None):
+ constrains = self._plot._getViewConstraints()
+ updated = constrains.update(xMin=minPos, xMax=maxPos)
+ return updated
+
+ def _setRangeConstraints(self, minRange=None, maxRange=None):
+ constrains = self._plot._getViewConstraints()
+ updated = constrains.update(minXRange=minRange, maxXRange=maxRange)
+ return updated
+
+
+class YAxis(Axis):
+ """Axis class defining primitives for the Y axis"""
+
+ # TODO With some changes on the backend, it will be able to remove all this
+ # specialised implementations (prefixel by '_internal')
+
+ def _internalSetCurrentLabel(self, label):
+ self._plot._backend.setGraphYLabel(label, axis='left')
+
+ def _internalGetLimits(self):
+ return self._plot._backend.getGraphYLimits(axis='left')
+
+ def _internalSetLimits(self, ymin, ymax):
+ self._plot._backend.setGraphYLimits(ymin, ymax, axis='left')
+
+ def _internalSetLogarithmic(self, flag):
+ self._plot._backend.setYAxisLogarithmic(flag)
+
+ def setInverted(self, flag=True):
+ """Set the axis orientation.
+
+ This is only available for the Y axis.
+
+ :param bool flag: True for Y axis going from top to bottom,
+ False for Y axis going from bottom to top
+ """
+ flag = bool(flag)
+ self._plot._backend.setYAxisInverted(flag)
+ self._plot._setDirtyPlot()
+ self.sigInvertedChanged.emit(flag)
+
+ def isInverted(self):
+ """Return True if the axis is inverted (top to bottom for the y-axis),
+ False otherwise. It is always False for the X axis.
+
+ :rtype: bool
+ """
+ return self._plot._backend.isYAxisInverted()
+
+ def _setLimitsConstraints(self, minPos=None, maxPos=None):
+ constrains = self._plot._getViewConstraints()
+ updated = constrains.update(yMin=minPos, yMax=maxPos)
+ return updated
+
+ def _setRangeConstraints(self, minRange=None, maxRange=None):
+ constrains = self._plot._getViewConstraints()
+ updated = constrains.update(minYRange=minRange, maxYRange=maxRange)
+ return updated
+
+
+class YRightAxis(Axis):
+ """Proxy axis for the secondary Y axes. It manages it own label and limit
+ but share the some state like scale and direction with the main axis."""
+
+ # TODO With some changes on the backend, it will be able to remove all this
+ # specialised implementations (prefixel by '_internal')
+
+ def __init__(self, plot, mainAxis):
+ """Constructor
+
+ :param silx.gui.plot.PlotWidget.PlotWidget plot: Parent plot of this
+ axis
+ :param Axis mainAxis: Axis which sharing state with this axis
+ """
+ Axis.__init__(self, plot)
+ self.__mainAxis = mainAxis
+
+ @property
+ def sigInvertedChanged(self):
+ """Signal emitted when axis orientation has changed"""
+ return self.__mainAxis.sigInvertedChanged
+
+ @property
+ def sigScaleChanged(self):
+ """Signal emitted when axis scale has changed"""
+ return self.__mainAxis.sigScaleChanged
+
+ @property
+ def _sigLogarithmicChanged(self):
+ """Signal emitted when axis scale has changed to or from logarithmic"""
+ return self.__mainAxis._sigLogarithmicChanged
+
+ @property
+ def sigAutoScaleChanged(self):
+ """Signal emitted when axis autoscale has changed"""
+ return self.__mainAxis.sigAutoScaleChanged
+
+ def _internalSetCurrentLabel(self, label):
+ self._plot._backend.setGraphYLabel(label, axis='right')
+
+ def _internalGetLimits(self):
+ return self._plot._backend.getGraphYLimits(axis='right')
+
+ def _internalSetLimits(self, ymin, ymax):
+ self._plot._backend.setGraphYLimits(ymin, ymax, axis='right')
+
+ def setInverted(self, flag=True):
+ """Set the Y axis orientation.
+
+ :param bool flag: True for Y axis going from top to bottom,
+ False for Y axis going from bottom to top
+ """
+ return self.__mainAxis.setInverted(flag)
+
+ def isInverted(self):
+ """Return True if Y axis goes from top to bottom, False otherwise."""
+ return self.__mainAxis.isInverted()
+
+ def getScale(self):
+ """Return the name of the scale used by this axis.
+
+ :rtype: str
+ """
+ return self.__mainAxis.getScale()
+
+ def setScale(self, scale):
+ """Set the scale to be used by this axis.
+
+ :param str scale: Name of the scale ("log", or "linear")
+ """
+ self.__mainAxis.setScale(scale)
+
+ def _isLogarithmic(self):
+ """Return True if Y axis scale is logarithmic, False if linear."""
+ return self.__mainAxis._isLogarithmic()
+
+ def _setLogarithmic(self, flag):
+ """Set the Y axes scale (either linear or logarithmic).
+
+ :param bool flag: True to use a logarithmic scale, False for linear.
+ """
+ return self.__mainAxis._setLogarithmic(flag)
+
+ def isAutoScale(self):
+ """Return True if Y axes are automatically adjusting its limits."""
+ return self.__mainAxis.isAutoScale()
+
+ def setAutoScale(self, flag=True):
+ """Set the Y axis limits adjusting behavior of :meth:`PlotWidget.resetZoom`.
+
+ :param bool flag: True to resize limits automatically,
+ False to disable it.
+ """
+ return self.__mainAxis.setAutoScale(flag)
diff --git a/silx/gui/plot/items/core.py b/silx/gui/plot/items/core.py
index 72bfd9a..0f4ffb9 100644
--- a/silx/gui/plot/items/core.py
+++ b/silx/gui/plot/items/core.py
@@ -27,22 +27,96 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "27/06/2017"
+import collections
from copy import deepcopy
import logging
import weakref
import numpy
-from silx.third_party import six
+from silx.third_party import six, enum
+from ... import qt
from .. import Colors
-
+from ..Colormap import Colormap
_logger = logging.getLogger(__name__)
-class Item(object):
+@enum.unique
+class ItemChangedType(enum.Enum):
+ """Type of modification provided by :attr:`Item.sigItemChanged` signal."""
+ # Private setters and setInfo are not emitting sigItemChanged signal.
+ # Signals to consider:
+ # COLORMAP_SET emitted when setColormap is called but not forward colormap object signal
+ # CURRENT_COLOR_CHANGED emitted current color changed because highlight changed,
+ # highlighted color changed or color changed depending on hightlight state.
+
+ VISIBLE = 'visibleChanged'
+ """Item's visibility changed flag."""
+
+ ZVALUE = 'zValueChanged'
+ """Item's Z value changed flag."""
+
+ COLORMAP = 'colormapChanged' # Emitted when set + forward events from the colormap object
+ """Item's colormap changed flag.
+
+ This is emitted both when setting a new colormap and
+ when the current colormap object is updated.
+ """
+
+ SYMBOL = 'symbolChanged'
+ """Item's symbol changed flag."""
+
+ SYMBOL_SIZE = 'symbolSizeChanged'
+ """Item's symbol size changed flag."""
+
+ LINE_WIDTH = 'lineWidthChanged'
+ """Item's line width changed flag."""
+
+ LINE_STYLE = 'lineStyleChanged'
+ """Item's line style changed flag."""
+
+ COLOR = 'colorChanged'
+ """Item's color changed flag."""
+
+ YAXIS = 'yAxisChanged'
+ """Item's Y axis binding changed flag."""
+
+ FILL = 'fillChanged'
+ """Item's fill changed flag."""
+
+ ALPHA = 'alphaChanged'
+ """Item's transparency alpha changed flag."""
+
+ DATA = 'dataChanged'
+ """Item's data changed flag"""
+
+ HIGHLIGHTED = 'highlightedChanged'
+ """Item's highlight state changed flag."""
+
+ HIGHLIGHTED_COLOR = 'highlightedColorChanged'
+ """Item's highlighted color changed flag."""
+
+ SCALE = 'scaleChanged'
+ """Item's scale changed flag."""
+
+ TEXT = 'textChanged'
+ """Item's text changed flag."""
+
+ POSITION = 'positionChanged'
+ """Item's position changed flag.
+
+ This is emitted when a marker position changed and
+ when an image origin changed.
+ """
+
+ OVERLAY = 'overlayChanged'
+ """Item's overlay state changed flag."""
+
+
+class Item(qt.QObject):
"""Description of an item of the plot"""
_DEFAULT_Z_LAYER = 0
@@ -54,7 +128,15 @@ class Item(object):
_DEFAULT_SELECTABLE = False
"""Default selectable state of items"""
+ sigItemChanged = qt.Signal(object)
+ """Signal emitted when the item has changed.
+
+ It provides a flag describing which property of the item has changed.
+ See :class:`ItemChangedType` for flags description.
+ """
+
def __init__(self):
+ super(Item, self).__init__()
self._dirty = True
self._plotRef = None
self._visible = True
@@ -114,7 +196,8 @@ class Item(object):
if visible != self._visible:
self._visible = visible
# When visibility has changed, always mark as dirty
- self._updated(checkVisibility=False)
+ self._updated(ItemChangedType.VISIBLE,
+ checkVisibility=False)
def isOverlay(self):
"""Return true if item is drawn as an overlay.
@@ -158,7 +241,7 @@ class Item(object):
z = int(z) if z is not None else self._DEFAULT_Z_LAYER
if z != self._z:
self._z = z
- self._updated()
+ self._updated(ItemChangedType.ZVALUE)
def getInfo(self, copy=True):
"""Returns the info associated to this item
@@ -172,11 +255,12 @@ class Item(object):
info = deepcopy(info)
self._info = info
- def _updated(self, checkVisibility=True):
+ def _updated(self, event=None, checkVisibility=True):
"""Mark the item as dirty (i.e., needing update).
This also triggers Plot.replot.
+ :param event: The event to send to :attr:`sigItemChanged` signal.
:param bool checkVisibility: True to only mark as dirty if visible,
False to always mark as dirty.
"""
@@ -187,6 +271,8 @@ class Item(object):
plot = self.getPlot()
if plot is not None:
plot._itemRequiresUpdate(self)
+ if event is not None:
+ self.sigItemChanged.emit(event)
def _update(self, backend):
"""Called by Plot to update the backend for this item.
@@ -292,25 +378,32 @@ class DraggableMixIn(object):
class ColormapMixIn(object):
"""Mix-in class for items with colormap"""
- _DEFAULT_COLORMAP = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
- """Default colormap of the item"""
-
def __init__(self):
- self._colormap = self._DEFAULT_COLORMAP
+ self._colormap = Colormap()
+ self._colormap.sigChanged.connect(self._colormapChanged)
def getColormap(self):
"""Return the used colormap"""
- return self._colormap.copy()
+ return self._colormap
def setColormap(self, colormap):
"""Set the colormap of this image
- :param dict colormap: colormap description
+ :param Colormap colormap: colormap description
"""
- self._colormap = colormap.copy()
- # TODO colormap comparison + colormap object and events on modification
- self._updated()
+ if isinstance(colormap, dict):
+ colormap = Colormap._fromDict(colormap)
+
+ if self._colormap is not None:
+ self._colormap.sigChanged.disconnect(self._colormapChanged)
+ self._colormap = colormap
+ if self._colormap is not None:
+ self._colormap.sigChanged.connect(self._colormapChanged)
+ self._colormapChanged()
+
+ def _colormapChanged(self):
+ """Handle updates of the colormap"""
+ self._updated(ItemChangedType.COLORMAP)
class SymbolMixIn(object):
@@ -355,7 +448,7 @@ class SymbolMixIn(object):
symbol = self._DEFAULT_SYMBOL
if symbol != self._symbol:
self._symbol = symbol
- self._updated()
+ self._updated(ItemChangedType.SYMBOL)
def getSymbolSize(self):
"""Return the point marker size in points.
@@ -375,7 +468,7 @@ class SymbolMixIn(object):
size = self._DEFAULT_SYMBOL_SIZE
if size != self._symbol_size:
self._symbol_size = size
- self._updated()
+ self._updated(ItemChangedType.SYMBOL_SIZE)
class LineMixIn(object):
@@ -405,7 +498,7 @@ class LineMixIn(object):
width = float(width)
if width != self._linewidth:
self._linewidth = width
- self._updated()
+ self._updated(ItemChangedType.LINE_WIDTH)
def getLineStyle(self):
"""Return the type of the line
@@ -435,7 +528,7 @@ class LineMixIn(object):
style = self._DEFAULT_LINESTYLE
if style != self._linestyle:
self._linestyle = style
- self._updated()
+ self._updated(ItemChangedType.LINE_STYLE)
class ColorMixIn(object):
@@ -473,8 +566,9 @@ class ColorMixIn(object):
else: # Array of colors
assert color.ndim == 2
- self._color = color
- self._updated()
+ if self._color != color:
+ self._color = color
+ self._updated(ItemChangedType.COLOR)
class YAxisMixIn(object):
@@ -504,7 +598,7 @@ class YAxisMixIn(object):
assert yaxis in ('left', 'right')
if yaxis != self._yaxis:
self._yaxis = yaxis
- self._updated()
+ self._updated(ItemChangedType.YAXIS)
class FillMixIn(object):
@@ -528,7 +622,7 @@ class FillMixIn(object):
fill = bool(fill)
if fill != self._fill:
self._fill = fill
- self._updated()
+ self._updated(ItemChangedType.FILL)
class AlphaMixIn(object):
@@ -561,7 +655,7 @@ class AlphaMixIn(object):
alpha = max(0., min(alpha, 1.)) # Clip alpha to [0., 1.] range
if alpha != self._alpha:
self._alpha = alpha
- self._updated()
+ self._updated(ItemChangedType.ALPHA)
class Points(Item, SymbolMixIn, AlphaMixIn):
@@ -690,8 +784,8 @@ class Points(Item, SymbolMixIn, AlphaMixIn):
plot = self.getPlot()
if plot is not None:
- xPositive = plot.isXAxisLogarithmic()
- yPositive = plot.isYAxisLogarithmic()
+ xPositive = plot.getXAxis()._isLogarithmic()
+ yPositive = plot.getYAxis()._isLogarithmic()
else:
xPositive = False
yPositive = False
@@ -724,8 +818,8 @@ class Points(Item, SymbolMixIn, AlphaMixIn):
Return None if caching is not applicable."""
plot = self.getPlot()
if plot is not None:
- xPositive = plot.isXAxisLogarithmic()
- yPositive = plot.isYAxisLogarithmic()
+ xPositive = plot.getXAxis()._isLogarithmic()
+ yPositive = plot.getYAxis()._isLogarithmic()
if xPositive or yPositive:
# At least one axis has log scale, filter data
if (xPositive, yPositive) not in self._filteredCache:
@@ -779,24 +873,24 @@ class Points(Item, SymbolMixIn, AlphaMixIn):
:param copy: True (Default) to get a copy,
False to use internal representation (do not modify!)
- :rtype: numpy.ndarray or None
+ :rtype: numpy.ndarray, float or None
"""
- if self._xerror is None:
- return None
- else:
+ if isinstance(self._xerror, numpy.ndarray):
return numpy.array(self._xerror, copy=copy)
+ else:
+ return self._xerror # float or None
def getYErrorData(self, copy=True):
"""Returns the y error of the points
:param copy: True (Default) to get a copy,
False to use internal representation (do not modify!)
- :rtype: numpy.ndarray or None
+ :rtype: numpy.ndarray, float or None
"""
- if self._yerror is None:
- return None
- else:
+ if isinstance(self._yerror, numpy.ndarray):
return numpy.array(self._yerror, copy=copy)
+ else:
+ return self._yerror # float or None
def setData(self, x, y, xerror=None, yerror=None, copy=True):
"""Set the data of the curve.
@@ -820,9 +914,15 @@ class Points(Item, SymbolMixIn, AlphaMixIn):
assert x.ndim == y.ndim == 1
if xerror is not None:
- xerror = numpy.array(xerror, copy=copy)
+ if isinstance(xerror, collections.Iterable):
+ xerror = numpy.array(xerror, copy=copy)
+ else:
+ xerror = float(xerror)
if yerror is not None:
- yerror = numpy.array(yerror, copy=copy)
+ if isinstance(yerror, collections.Iterable):
+ yerror = numpy.array(yerror, copy=copy)
+ else:
+ yerror = float(yerror)
# TODO checks on xerror, yerror
self._x, self._y = x, y
self._xerror, self._yerror = xerror, yerror
@@ -831,9 +931,9 @@ class Points(Item, SymbolMixIn, AlphaMixIn):
self._filteredCache = {} # Reset cached filtered data
self._clippedCache = {} # Reset cached clipped bool array
- self._updated()
# TODO hackish data range implementation
if self.isVisible():
plot = self.getPlot()
if plot is not None:
plot._invalidateDataRange()
+ self._updated(ItemChangedType.DATA)
diff --git a/silx/gui/plot/items/curve.py b/silx/gui/plot/items/curve.py
index d25ae00..ce7f03e 100644
--- a/silx/gui/plot/items/curve.py
+++ b/silx/gui/plot/items/curve.py
@@ -32,11 +32,9 @@ __date__ = "06/03/2017"
import logging
-import numpy
-
from .. import Colors
-from .core import (Points, LabelsMixIn, SymbolMixIn,
- ColorMixIn, YAxisMixIn, FillMixIn, LineMixIn)
+from .core import (Points, LabelsMixIn, ColorMixIn, YAxisMixIn,
+ FillMixIn, LineMixIn, ItemChangedType)
_logger = logging.getLogger(__name__)
@@ -132,15 +130,15 @@ class Curve(Points, ColorMixIn, YAxisMixIn, FillMixIn, LabelsMixIn, LineMixIn):
:param bool visible: True to display it, False otherwise
"""
- visibleChanged = self.isVisible() != bool(visible)
- super(Curve, self).setVisible(visible)
-
+ visible = bool(visible)
# TODO hackish data range implementation
- if visibleChanged:
+ if self.isVisible() != visible:
plot = self.getPlot()
if plot is not None:
plot._invalidateDataRange()
+ super(Curve, self).setVisible(visible)
+
def isHighlighted(self):
"""Returns True if curve is highlighted.
@@ -157,7 +155,7 @@ class Curve(Points, ColorMixIn, YAxisMixIn, FillMixIn, LabelsMixIn, LineMixIn):
if highlighted != self._highlighted:
self._highlighted = highlighted
# TODO inefficient: better to use backend's setCurveColor
- self._updated()
+ self._updated(ItemChangedType.HIGHLIGHTED)
def getHighlightedColor(self):
"""Returns the RGBA highlight color of the item
@@ -176,7 +174,7 @@ class Curve(Points, ColorMixIn, YAxisMixIn, FillMixIn, LabelsMixIn, LineMixIn):
color = Colors.rgba(color)
if color != self._highlightColor:
self._highlightColor = color
- self._updated()
+ self._updated(ItemChangedType.HIGHLIGHTED_COLOR)
def getCurrentColor(self):
"""Returns the current color of the curve.
diff --git a/silx/gui/plot/items/histogram.py b/silx/gui/plot/items/histogram.py
index c3821bc..ad89677 100644
--- a/silx/gui/plot/items/histogram.py
+++ b/silx/gui/plot/items/histogram.py
@@ -27,7 +27,7 @@
__authors__ = ["H. Payno", "T. Vincent"]
__license__ = "MIT"
-__date__ = "02/05/2017"
+__date__ = "27/06/2017"
import logging
@@ -35,7 +35,7 @@ import logging
import numpy
from .core import (Item, AlphaMixIn, ColorMixIn, FillMixIn,
- LineMixIn, YAxisMixIn)
+ LineMixIn, YAxisMixIn, ItemChangedType)
_logger = logging.getLogger(__name__)
@@ -139,8 +139,8 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
# Filter-out values <= 0
plot = self.getPlot()
if plot is not None:
- xPositive = plot.isXAxisLogarithmic()
- yPositive = plot.isYAxisLogarithmic()
+ xPositive = plot.getXAxis()._isLogarithmic()
+ yPositive = plot.getYAxis()._isLogarithmic()
else:
xPositive = False
yPositive = False
@@ -174,8 +174,8 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
plot = self.getPlot()
if plot is not None:
- xPositive = plot.isXAxisLogarithmic()
- yPositive = plot.isYAxisLogarithmic()
+ xPositive = plot.getXAxis()._isLogarithmic()
+ yPositive = plot.getYAxis()._isLogarithmic()
else:
xPositive = False
yPositive = False
@@ -185,14 +185,19 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
if xPositive:
# Replace edges <= 0 by NaN and corresponding values by NaN
- clipped = (edges <= 0)
+ clipped_edges = (edges <= 0)
edges = numpy.array(edges, copy=True, dtype=numpy.float)
- edges[clipped] = numpy.nan
- values[numpy.logical_or(clipped[:-1], clipped[1:])] = numpy.nan
+ edges[clipped_edges] = numpy.nan
+ clipped_values = numpy.logical_or(clipped_edges[:-1],
+ clipped_edges[1:])
+ else:
+ clipped_values = numpy.zeros_like(values, dtype=numpy.bool)
if yPositive:
# Replace values <= 0 by NaN, do not modify edges
- values[values <= 0] = numpy.nan
+ clipped_values = numpy.logical_or(clipped_values, values <= 0)
+
+ values[clipped_values] = numpy.nan
if xPositive or yPositive:
return (numpy.nanmin(edges),
@@ -211,14 +216,13 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
:param bool visible: True to display it, False otherwise
"""
- visibleChanged = self.isVisible() != bool(visible)
- super(Histogram, self).setVisible(visible)
-
+ visible = bool(visible)
# TODO hackish data range implementation
- if visibleChanged:
+ if self.isVisible() != visible:
plot = self.getPlot()
if plot is not None:
plot._invalidateDataRange()
+ super(Histogram, self).setVisible(visible)
def getValueData(self, copy=True):
"""The values of the histogram
@@ -248,7 +252,7 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
:returns: (N histogram value, N+1 bin edges)
:rtype: 2-tuple of numpy.nadarray
"""
- return (self.getValueData(copy), self.getBinEdgesData(copy))
+ return self.getValueData(copy), self.getBinEdgesData(copy)
def setData(self, histogram, edges, align='center', copy=True):
"""Set the histogram values and bin edges.
@@ -286,3 +290,5 @@ class Histogram(Item, AlphaMixIn, ColorMixIn, FillMixIn,
self._histogram = histogram
self._edges = edges
+
+ self._updated(ItemChangedType.DATA)
diff --git a/silx/gui/plot/items/image.py b/silx/gui/plot/items/image.py
index 7e1dd8b..acf7bf6 100644
--- a/silx/gui/plot/items/image.py
+++ b/silx/gui/plot/items/image.py
@@ -28,7 +28,7 @@ of the :class:`Plot`.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "06/03/2017"
+__date__ = "27/06/2017"
from collections import Sequence
@@ -36,7 +36,8 @@ import logging
import numpy
-from .core import Item, LabelsMixIn, DraggableMixIn, ColormapMixIn, AlphaMixIn
+from .core import (Item, LabelsMixIn, DraggableMixIn, ColormapMixIn,
+ AlphaMixIn, ItemChangedType)
from ..Colors import applyColormapToData
@@ -130,14 +131,23 @@ class ImageBase(Item, LabelsMixIn, DraggableMixIn, AlphaMixIn):
:param bool visible: True to display it, False otherwise
"""
- visibleChanged = self.isVisible() != bool(visible)
- super(ImageBase, self).setVisible(visible)
-
+ visible = bool(visible)
# TODO hackish data range implementation
- if visibleChanged:
+ if self.isVisible() != visible:
plot = self.getPlot()
if plot is not None:
plot._invalidateDataRange()
+ super(ImageBase, self).setVisible(visible)
+
+ def _isPlotLinear(self, plot):
+ """Return True if plot only uses linear scale for both of x and y
+ axes."""
+ linear = plot.getXAxis().LINEAR
+ if plot.getXAxis().getScale() != linear:
+ return False
+ if plot.getYAxis().getScale() != linear:
+ return False
+ return True
def _getBounds(self):
if self.getData(copy=False).size == 0: # Empty data
@@ -156,8 +166,7 @@ class ImageBase(Item, LabelsMixIn, DraggableMixIn, AlphaMixIn):
ymin, ymax = ymax, ymin
plot = self.getPlot()
- if (plot is not None and
- plot.isXAxisLogarithmic() or plot.isYAxisLogarithmic()):
+ if plot is not None and not self._isPlotLinear(plot):
return None
else:
return xmin, xmax, ymin, ymax
@@ -197,7 +206,6 @@ class ImageBase(Item, LabelsMixIn, DraggableMixIn, AlphaMixIn):
origin = float(origin), float(origin)
if origin != self._origin:
self._origin = origin
- self._updated()
# TODO hackish data range implementation
if self.isVisible():
@@ -205,6 +213,8 @@ class ImageBase(Item, LabelsMixIn, DraggableMixIn, AlphaMixIn):
if plot is not None:
plot._invalidateDataRange()
+ self._updated(ItemChangedType.POSITION)
+
def getScale(self):
"""Returns the scale of the image in data coordinates.
@@ -222,9 +232,17 @@ class ImageBase(Item, LabelsMixIn, DraggableMixIn, AlphaMixIn):
scale = float(scale[0]), float(scale[1])
else: # single value scale
scale = float(scale), float(scale)
+
if scale != self._scale:
self._scale = scale
- self._updated()
+
+ # TODO hackish data range implementation
+ if self.isVisible():
+ plot = self.getPlot()
+ if plot is not None:
+ plot._invalidateDataRange()
+
+ self._updated(ItemChangedType.SCALE)
class ImageData(ImageBase, ColormapMixIn):
@@ -240,8 +258,9 @@ class ImageData(ImageBase, ColormapMixIn):
"""Update backend renderer"""
plot = self.getPlot()
assert plot is not None
- if plot.isXAxisLogarithmic() or plot.isYAxisLogarithmic():
- return None # Do not render with log scales
+ if not self._isPlotLinear(plot):
+ # Do not render with non linear scales
+ return None
if self.getAlternativeImageData(copy=False) is not None:
dataToUse = self.getAlternativeImageData(copy=False)
@@ -283,8 +302,7 @@ class ImageData(ImageBase, ColormapMixIn):
else:
# Apply colormap, in this case an new array is always returned
colormap = self.getColormap()
- image = applyColormapToData(self.getData(copy=False),
- **colormap)
+ image = colormap.applyToData(self.getData(copy=False))
return image
def getAlternativeImageData(self, copy=True):
@@ -312,6 +330,14 @@ class ImageData(ImageBase, ColormapMixIn):
"""
data = numpy.array(data, copy=copy)
assert data.ndim == 2
+ if data.dtype.kind == 'b':
+ _logger.warning(
+ 'Converting boolean image to int8 to plot it.')
+ data = numpy.array(data, copy=False, dtype=numpy.int8)
+ elif numpy.issubdtype(data.dtype, numpy.complex):
+ _logger.warning(
+ 'Converting complex image to absolute value to plot it.')
+ data = numpy.absolute(data)
self._data = data
if alternative is not None:
@@ -320,7 +346,6 @@ class ImageData(ImageBase, ColormapMixIn):
assert alternative.shape[2] in (3, 4)
assert alternative.shape[:2] == data.shape[:2]
self._alternativeImage = alternative
- self._updated()
# TODO hackish data range implementation
if self.isVisible():
@@ -328,6 +353,8 @@ class ImageData(ImageBase, ColormapMixIn):
if plot is not None:
plot._invalidateDataRange()
+ self._updated(ItemChangedType.DATA)
+
class ImageRgba(ImageBase):
"""Description of an RGB(A) image"""
@@ -339,8 +366,9 @@ class ImageRgba(ImageBase):
"""Update backend renderer"""
plot = self.getPlot()
assert plot is not None
- if plot.isXAxisLogarithmic() or plot.isYAxisLogarithmic():
- return None # Do not render with log scales
+ if not self._isPlotLinear(plot):
+ # Do not render with non linear scales
+ return None
data = self.getData(copy=False)
@@ -376,10 +404,19 @@ class ImageRgba(ImageBase):
assert data.shape[-1] in (3, 4)
self._data = data
- self._updated()
-
# TODO hackish data range implementation
if self.isVisible():
plot = self.getPlot()
if plot is not None:
plot._invalidateDataRange()
+
+ self._updated(ItemChangedType.DATA)
+
+
+class MaskImageData(ImageData):
+ """Description of an image used as a mask.
+
+ This class is used to flag mask items. This information is used to improve
+ internal silx widgets.
+ """
+ pass
diff --git a/silx/gui/plot/items/marker.py b/silx/gui/plot/items/marker.py
index c05558b..5f930b7 100644
--- a/silx/gui/plot/items/marker.py
+++ b/silx/gui/plot/items/marker.py
@@ -32,7 +32,8 @@ __date__ = "06/03/2017"
import logging
-from .core import Item, DraggableMixIn, ColorMixIn, SymbolMixIn
+from .core import (Item, DraggableMixIn, ColorMixIn, SymbolMixIn,
+ ItemChangedType)
_logger = logging.getLogger(__name__)
@@ -95,7 +96,7 @@ class _BaseMarker(Item, DraggableMixIn, ColorMixIn):
text = str(text)
if text != self._text:
self._text = text
- self._updated()
+ self._updated(ItemChangedType.TEXT)
def getXPosition(self):
"""Returns the X position of the marker line in data coordinates
@@ -130,7 +131,7 @@ class _BaseMarker(Item, DraggableMixIn, ColorMixIn):
x, y = float(x), float(y)
if x != self._x or y != self._y:
self._x, self._y = x, y
- self._updated()
+ self._updated(ItemChangedType.POSITION)
def getConstraint(self):
"""Returns the dragging constraint of this item"""
@@ -216,7 +217,7 @@ class XMarker(_BaseMarker):
x = float(x)
if x != self._x:
self._x = x
- self._updated()
+ self._updated(ItemChangedType.POSITION)
class YMarker(_BaseMarker):
@@ -238,4 +239,4 @@ class YMarker(_BaseMarker):
y = float(y)
if y != self._y:
self._y = y
- self._updated()
+ self._updated(ItemChangedType.POSITION)
diff --git a/silx/gui/plot/items/scatter.py b/silx/gui/plot/items/scatter.py
index 3897dc1..98ed473 100644
--- a/silx/gui/plot/items/scatter.py
+++ b/silx/gui/plot/items/scatter.py
@@ -35,7 +35,7 @@ import logging
import numpy
from .core import Points, ColormapMixIn
-from silx.gui.plot.Colors import applyColormapToData # TODO: cherry-pick commit or wait for PR merge
+
_logger = logging.getLogger(__name__)
@@ -60,13 +60,7 @@ class Scatter(Points, ColormapMixIn):
return None # No data to display, do not add renderer to backend
cmap = self.getColormap()
- rgbacolors = applyColormapToData(self._value,
- cmap["name"],
- cmap["normalization"],
- cmap["autoscale"],
- cmap["vmin"],
- cmap["vmax"],
- cmap.get("colors"))
+ rgbacolors = cmap.applyToData(self._value)
return backend.addCurve(xFiltered, yFiltered, self.getLegend(),
color=rgbacolors,
diff --git a/silx/gui/plot/items/shape.py b/silx/gui/plot/items/shape.py
index b663989..65b26a1 100644
--- a/silx/gui/plot/items/shape.py
+++ b/silx/gui/plot/items/shape.py
@@ -27,14 +27,14 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "06/03/2017"
+__date__ = "17/05/2017"
import logging
import numpy
-from .core import Item, ColorMixIn, FillMixIn
+from .core import (Item, ColorMixIn, FillMixIn, ItemChangedType)
_logger = logging.getLogger(__name__)
@@ -46,7 +46,7 @@ class Shape(Item, ColorMixIn, FillMixIn):
"""Description of a shape item
:param str type_: The type of shape in:
- 'hline', 'polygon', 'rectangle', 'vline', 'polyline'
+ 'hline', 'polygon', 'rectangle', 'vline', 'polylines'
"""
def __init__(self, type_):
@@ -54,7 +54,7 @@ class Shape(Item, ColorMixIn, FillMixIn):
ColorMixIn.__init__(self)
FillMixIn.__init__(self)
self._overlay = False
- assert type_ in ('hline', 'polygon', 'rectangle', 'vline', 'polyline')
+ assert type_ in ('hline', 'polygon', 'rectangle', 'vline', 'polylines')
self._type = type_
self._points = ()
@@ -88,12 +88,12 @@ class Shape(Item, ColorMixIn, FillMixIn):
overlay = bool(overlay)
if overlay != self._overlay:
self._overlay = overlay
- self._updated()
+ self._updated(ItemChangedType.OVERLAY)
def getType(self):
"""Returns the type of shape to draw.
- One of: 'hline', 'polygon', 'rectangle', 'vline', 'polyline'
+ One of: 'hline', 'polygon', 'rectangle', 'vline', 'polylines'
:rtype: str
"""
@@ -118,4 +118,4 @@ class Shape(Item, ColorMixIn, FillMixIn):
:return:
"""
self._points = numpy.array(points, copy=copy)
- self._updated()
+ self._updated(ItemChangedType.DATA)
diff --git a/silx/gui/plot/matplotlib/Colormap.py b/silx/gui/plot/matplotlib/Colormap.py
new file mode 100644
index 0000000..a86d76e
--- /dev/null
+++ b/silx/gui/plot/matplotlib/Colormap.py
@@ -0,0 +1,282 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+"""Matplotlib's new colormaps"""
+
+import numpy
+import logging
+from matplotlib.colors import ListedColormap
+import matplotlib.colors
+import matplotlib.cm
+import silx.resources
+
+_logger = logging.getLogger(__name__)
+
+_AVAILABLE_AS_RESOURCE = ('magma', 'inferno', 'plasma', 'viridis')
+"""List available colormap name as resources"""
+
+_AVAILABLE_AS_BUILTINS = ('gray', 'reversed gray',
+ 'temperature', 'red', 'green', 'blue')
+"""List of colormaps available through built-in declarations"""
+
+_CMAPS = {}
+"""Cache colormaps"""
+
+
+@property
+def magma():
+ return getColormap('magma')
+
+
+@property
+def inferno():
+ return getColormap('inferno')
+
+
+@property
+def plasma():
+ return getColormap('plasma')
+
+
+@property
+def viridis():
+ return getColormap('viridis')
+
+
+def getColormap(name):
+ """Returns matplotlib colormap corresponding to given name
+
+ :param str name: The name of the colormap
+ :return: The corresponding colormap
+ :rtype: matplolib.colors.Colormap
+ """
+ if not _CMAPS: # Lazy initialization of own colormaps
+ cdict = {'red': ((0.0, 0.0, 0.0),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0)),
+ 'blue': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0))}
+ _CMAPS['red'] = matplotlib.colors.LinearSegmentedColormap(
+ 'red', cdict, 256)
+
+ cdict = {'red': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0)),
+ 'green': ((0.0, 0.0, 0.0),
+ (1.0, 1.0, 1.0)),
+ 'blue': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0))}
+ _CMAPS['green'] = matplotlib.colors.LinearSegmentedColormap(
+ 'green', cdict, 256)
+
+ cdict = {'red': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0)),
+ 'green': ((0.0, 0.0, 0.0),
+ (1.0, 0.0, 0.0)),
+ 'blue': ((0.0, 0.0, 0.0),
+ (1.0, 1.0, 1.0))}
+ _CMAPS['blue'] = matplotlib.colors.LinearSegmentedColormap(
+ 'blue', cdict, 256)
+
+ # Temperature as defined in spslut
+ cdict = {'red': ((0.0, 0.0, 0.0),
+ (0.5, 0.0, 0.0),
+ (0.75, 1.0, 1.0),
+ (1.0, 1.0, 1.0)),
+ 'green': ((0.0, 0.0, 0.0),
+ (0.25, 1.0, 1.0),
+ (0.75, 1.0, 1.0),
+ (1.0, 0.0, 0.0)),
+ 'blue': ((0.0, 1.0, 1.0),
+ (0.25, 1.0, 1.0),
+ (0.5, 0.0, 0.0),
+ (1.0, 0.0, 0.0))}
+ # but limited to 256 colors for a faster display (of the colorbar)
+ _CMAPS['temperature'] = \
+ matplotlib.colors.LinearSegmentedColormap(
+ 'temperature', cdict, 256)
+
+ # reversed gray
+ cdict = {'red': ((0.0, 1.0, 1.0),
+ (1.0, 0.0, 0.0)),
+ 'green': ((0.0, 1.0, 1.0),
+ (1.0, 0.0, 0.0)),
+ 'blue': ((0.0, 1.0, 1.0),
+ (1.0, 0.0, 0.0))}
+
+ _CMAPS['reversed gray'] = \
+ matplotlib.colors.LinearSegmentedColormap(
+ 'yerg', cdict, 256)
+
+ if name in _CMAPS:
+ return _CMAPS[name]
+ elif name in _AVAILABLE_AS_RESOURCE:
+ filename = silx.resources.resource_filename("gui/colormaps/%s.npy" % name)
+ data = numpy.load(filename)
+ lut = ListedColormap(data, name=name)
+ _CMAPS[name] = lut
+ return lut
+ else:
+ # matplotlib built-in
+ return matplotlib.cm.get_cmap(name)
+
+
+def getScalarMappable(colormap, data=None):
+ """Returns matplotlib ScalarMappable corresponding to colormap
+
+ :param :class:`.Colormap` colormap: The colormap to convert
+ :param numpy.ndarray data:
+ The data on which the colormap is applied.
+ If provided, it is used to compute autoscale.
+ :return: matplotlib object corresponding to colormap
+ :rtype: matplotlib.cm.ScalarMappable
+ """
+ assert colormap is not None
+
+ if colormap.getName() is not None:
+ cmap = getColormap(colormap.getName())
+
+ else: # No name, use custom colors
+ if colormap.getColormapLUT() is None:
+ raise ValueError(
+ 'addImage: colormap no name nor list of colors.')
+ colors = colormap.getColormapLUT()
+ assert len(colors.shape) == 2
+ assert colors.shape[-1] in (3, 4)
+ if colors.dtype == numpy.uint8:
+ # Convert to float in [0., 1.]
+ colors = colors.astype(numpy.float32) / 255.
+ cmap = matplotlib.colors.ListedColormap(colors)
+
+ if colormap.getNormalization().startswith('log'):
+ vmin, vmax = None, None
+ if not colormap.isAutoscale():
+ if colormap.getVMin() > 0.:
+ vmin = colormap.getVMin()
+ if colormap.getVMax() > 0.:
+ vmax = colormap.getVMax()
+
+ if vmin is None or vmax is None:
+ _logger.warning('Log colormap with negative bounds, ' +
+ 'changing bounds to positive ones.')
+ elif vmin > vmax:
+ _logger.warning('Colormap bounds are inverted.')
+ vmin, vmax = vmax, vmin
+
+ # Set unset/negative bounds to positive bounds
+ if vmin is None or vmax is None:
+ # Convert to numpy array
+ data = numpy.array(data if data is not None else [], copy=False)
+
+ if data.size > 0:
+ finiteData = data[numpy.isfinite(data)]
+ posData = finiteData[finiteData > 0]
+ if vmax is None:
+ # 1. as an ultimate fallback
+ vmax = posData.max() if posData.size > 0 else 1.
+ if vmin is None:
+ vmin = posData.min() if posData.size > 0 else vmax
+ if vmin > vmax:
+ vmin = vmax
+ else:
+ vmin, vmax = 1., 1.
+
+ norm = matplotlib.colors.LogNorm(vmin, vmax)
+
+ else: # Linear normalization
+ if colormap.isAutoscale():
+ # Convert to numpy array
+ data = numpy.array(data if data is not None else [], copy=False)
+
+ if data.size == 0:
+ vmin, vmax = 1., 1.
+ else:
+ finiteData = data[numpy.isfinite(data)]
+ if finiteData.size > 0:
+ vmin = finiteData.min()
+ vmax = finiteData.max()
+ else:
+ vmin, vmax = 1., 1.
+
+ else:
+ vmin = colormap.getVMin()
+ vmax = colormap.getVMax()
+ if vmin > vmax:
+ _logger.warning('Colormap bounds are inverted.')
+ vmin, vmax = vmax, vmin
+
+ norm = matplotlib.colors.Normalize(vmin, vmax)
+
+ return matplotlib.cm.ScalarMappable(norm=norm, cmap=cmap)
+
+
+def applyColormapToData(data,
+ colormap):
+ """Apply a colormap to the data and returns the RGBA image
+
+ This supports data of any dimensions (not only of dimension 2).
+ The returned array will have one more dimension (with 4 entries)
+ than the input data to store the RGBA channels
+ corresponding to each bin in the array.
+
+ :param numpy.ndarray data: The data to convert.
+ :param :class:`.Colormap`: The colormap to apply
+ """
+ # Debian 7 specific support
+ # No transparent colormap with matplotlib < 1.2.0
+ # Add support for transparent colormap for uint8 data with
+ # colormap with 256 colors, linear norm, [0, 255] range
+ if matplotlib.__version__ < '1.2.0':
+ if (colormap.getName() is None and
+ colormap.getColormapLUT() is not None):
+ colors = colormap.getColormapLUT()
+ if (colors.shape[-1] == 4 and
+ not numpy.all(numpy.equal(colors[3], 255))):
+ # This is a transparent colormap
+ if (colors.shape == (256, 4) and
+ colormap.getNormalization() == 'linear' and
+ not colormap.isAutoscale() and
+ colormap.getVMin() == 0 and
+ colormap.getVMax() == 255 and
+ data.dtype == numpy.uint8):
+ # Supported case, convert data to RGBA
+ return colors[data.reshape(-1)].reshape(
+ data.shape + (4,))
+ else:
+ _logger.warning(
+ 'matplotlib %s does not support transparent '
+ 'colormap.', matplotlib.__version__)
+
+ scalarMappable = getScalarMappable(colormap, data)
+ rgbaImage = scalarMappable.to_rgba(data, bytes=True)
+
+ return rgbaImage
+
+
+def getSupportedColormaps():
+ """Get the supported colormap names as a tuple of str.
+ """
+ colormaps = set(matplotlib.cm.datad.keys())
+ colormaps.update(_AVAILABLE_AS_BUILTINS)
+ colormaps.update(_AVAILABLE_AS_RESOURCE)
+ return tuple(sorted(colormaps))
diff --git a/silx/gui/plot/backends/ModestImage.py b/silx/gui/plot/matplotlib/ModestImage.py
index 93fba5a..e4a72d5 100644
--- a/silx/gui/plot/backends/ModestImage.py
+++ b/silx/gui/plot/matplotlib/ModestImage.py
@@ -26,7 +26,7 @@
__authors__ = ["V.A. Sole", "T. Vincent"]
__license__ = "MIT"
-__date__ = "16/02/2016"
+__date__ = "03/05/2017"
import numpy
diff --git a/silx/gui/plot/backends/_matplotlib.py b/silx/gui/plot/matplotlib/__init__.py
index 26732a0..be9cb9a 100644
--- a/silx/gui/plot/backends/_matplotlib.py
+++ b/silx/gui/plot/matplotlib/__init__.py
@@ -32,7 +32,7 @@ to the used backend.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "26/10/2016"
+__date__ = "04/05/2017"
import sys
@@ -53,12 +53,18 @@ import matplotlib
if qt.BINDING == 'PySide':
matplotlib.rcParams['backend'] = 'Qt4Agg'
matplotlib.rcParams['backend.qt4'] = 'PySide'
- from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg # noqa
+ import matplotlib.backends.backend_qt4agg as backend
elif qt.BINDING == 'PyQt4':
matplotlib.rcParams['backend'] = 'Qt4Agg'
- from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg # noqa
+ import matplotlib.backends.backend_qt4agg as backend
elif qt.BINDING == 'PyQt5':
matplotlib.rcParams['backend'] = 'Qt5Agg'
- from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg # noqa
+ import matplotlib.backends.backend_qt5agg as backend
+
+else:
+ backend = None
+
+if backend is not None:
+ FigureCanvasQTAgg = backend.FigureCanvasQTAgg # noqa
diff --git a/silx/gui/plot/setup.py b/silx/gui/plot/setup.py
index 6408113..205c5fa 100644
--- a/silx/gui/plot/setup.py
+++ b/silx/gui/plot/setup.py
@@ -24,7 +24,7 @@
# ###########################################################################*/
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "16/02/2016"
+__date__ = "29/06/2017"
from numpy.distutils.misc_util import Configuration
@@ -33,10 +33,13 @@ from numpy.distutils.misc_util import Configuration
def configuration(parent_package='', top_path=None):
config = Configuration('plot', parent_package, top_path)
config.add_subpackage('_utils')
+ config.add_subpackage('utils')
+ config.add_subpackage('matplotlib')
config.add_subpackage('backends')
config.add_subpackage('backends.glutils')
config.add_subpackage('items')
config.add_subpackage('test')
+ config.add_subpackage('actions')
return config
diff --git a/silx/gui/plot/test/__init__.py b/silx/gui/plot/test/__init__.py
index b4378c7..2c2943e 100644
--- a/silx/gui/plot/test/__init__.py
+++ b/silx/gui/plot/test/__init__.py
@@ -24,48 +24,58 @@
# ###########################################################################*/
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "18/02/2016"
+__date__ = "04/08/2017"
import unittest
-from .._utils.test import suite as testUtilsSuite
-from .testColorBar import suite as testColorBarSuite
-from .testColormapDialog import suite as testColormapDialogSuite
-from .testColors import suite as testColorsSuite
-from .testCurvesROIWidget import suite as testCurvesROIWidgetSuite
-from .testAlphaSlider import suite as testAlphaSliderSuite
-from .testInteraction import suite as testInteractionSuite
-from .testLegendSelector import suite as testLegendSelectorSuite
-from .testMaskToolsWidget import suite as testMaskToolsWidgetSuite
-from .testScatterMaskToolsWidget import suite as testScatterMaskToolsWidgetSuite
-from .testPlotInteraction import suite as testPlotInteractionSuite
-from .testPlotTools import suite as testPlotToolsSuite
-from .testPlotWidget import suite as testPlotWidgetSuite
-from .testPlotWindow import suite as testPlotWindowSuite
-from .testPlot import suite as testPlotSuite
-from .testProfile import suite as testProfileSuite
-from .testStackView import suite as testStackViewSuite
+from .._utils import test
+from . import testColorBar
+from . import testColormap
+from . import testColormapDialog
+from . import testColors
+from . import testCurvesROIWidget
+from . import testAlphaSlider
+from . import testInteraction
+from . import testLegendSelector
+from . import testMaskToolsWidget
+from . import testScatterMaskToolsWidget
+from . import testPlotInteraction
+from . import testPlotTools
+from . import testPlotWidgetNoBackend
+from . import testPlotWidget
+from . import testPlotWindow
+from . import testProfile
+from . import testStackView
+from . import testItem
+from . import testUtilsAxis
+from . import testLimitConstraints
+from . import testComplexImageView
def suite():
test_suite = unittest.TestSuite()
test_suite.addTests(
- [testUtilsSuite(),
- testColorBarSuite(),
- testColorsSuite(),
- testColormapDialogSuite(),
- testCurvesROIWidgetSuite(),
- testAlphaSliderSuite(),
- testInteractionSuite(),
- testLegendSelectorSuite(),
- testMaskToolsWidgetSuite(),
- testScatterMaskToolsWidgetSuite(),
- testPlotInteractionSuite(),
- testPlotSuite(),
- testPlotToolsSuite(),
- testPlotWidgetSuite(),
- testPlotWindowSuite(),
- testProfileSuite(),
- testStackViewSuite()])
+ [test.suite(),
+ testColorBar.suite(),
+ testColors.suite(),
+ testColormapDialog.suite(),
+ testCurvesROIWidget.suite(),
+ testAlphaSlider.suite(),
+ testInteraction.suite(),
+ testLegendSelector.suite(),
+ testMaskToolsWidget.suite(),
+ testScatterMaskToolsWidget.suite(),
+ testPlotInteraction.suite(),
+ testPlotWidgetNoBackend.suite(),
+ testPlotTools.suite(),
+ testPlotWidget.suite(),
+ testPlotWindow.suite(),
+ testProfile.suite(),
+ testStackView.suite(),
+ testColormap.suite(),
+ testItem.suite(),
+ testUtilsAxis.suite(),
+ testLimitConstraints.suite(),
+ testComplexImageView.suite()])
return test_suite
diff --git a/silx/gui/plot/test/testColorBar.py b/silx/gui/plot/test/testColorBar.py
index 797ff03..80ae6a8 100644
--- a/silx/gui/plot/test/testColorBar.py
+++ b/silx/gui/plot/test/testColorBar.py
@@ -32,22 +32,37 @@ import unittest
from silx.gui.test.utils import TestCaseQt
from silx.gui.plot.ColorBar import _ColorScale
from silx.gui.plot.ColorBar import ColorBarWidget
+from silx.gui.plot.Colormap import Colormap
from silx.gui.plot import Plot2D
+from silx.gui import qt
import numpy
-class TestColorScale(unittest.TestCase):
+class TestColorScale(TestCaseQt):
"""Test that interaction with the colorScale is correct"""
def setUp(self):
+ super(TestColorScale, self).setUp()
self.colorScaleWidget = _ColorScale(colormap=None, parent=None)
+ self.colorScaleWidget.show()
+ self.qWaitForWindowExposed(self.colorScaleWidget)
def tearDown(self):
- self.colorScaleWidget.deleteLater()
- self.colorScaleWidget = None
+ self.qapp.processEvents()
+ self.colorScaleWidget.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.colorScaleWidget.close()
+ del self.colorScaleWidget
+ super(TestColorScale, self).tearDown()
+
+ def testNoColormap(self):
+ """Test _ColorScale without a colormap"""
+ colormap = self.colorScaleWidget.getColormap()
+ self.assertIsNone(colormap)
def testRelativePositionLinear(self):
- self.colorMapLin1 = { 'name': 'gray', 'normalization': 'linear',
- 'autoscale': False, 'vmin': 0.0, 'vmax': 1.0 }
+ self.colorMapLin1 = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=0.0,
+ vmax=1.0)
self.colorScaleWidget.setColormap(self.colorMapLin1)
self.assertTrue(
@@ -57,8 +72,10 @@ class TestColorScale(unittest.TestCase):
self.assertTrue(
self.colorScaleWidget.getValueFromRelativePosition(1.0) == 1.0)
- self.colorMapLin2 = { 'name': 'viridis', 'normalization': 'linear',
- 'autoscale': False, 'vmin': -10, 'vmax': 0 }
+ self.colorMapLin2 = Colormap(name='viridis',
+ normalization=Colormap.LINEAR,
+ vmin=-10,
+ vmax=0)
self.colorScaleWidget.setColormap(self.colorMapLin2)
self.assertTrue(
@@ -69,8 +86,10 @@ class TestColorScale(unittest.TestCase):
self.colorScaleWidget.getValueFromRelativePosition(1.0) == 0.0)
def testRelativePositionLog(self):
- self.colorMapLog1 = { 'name': 'temperature', 'normalization': 'log',
- 'autoscale': False, 'vmin': 1.0, 'vmax': 100.0 }
+ self.colorMapLog1 = Colormap(name='temperature',
+ normalization=Colormap.LOGARITHM,
+ vmin=1.0,
+ vmax=100.0)
self.colorScaleWidget.setColormap(self.colorMapLog1)
@@ -83,41 +102,38 @@ class TestColorScale(unittest.TestCase):
val = self.colorScaleWidget.getValueFromRelativePosition(0.0)
self.assertTrue(val == 1.0)
- def testNegativeLogMin(self):
- colormap = { 'name': 'gray', 'normalization': 'log',
- 'autoscale': False, 'vmin': -1.0, 'vmax': 1.0 }
-
- with self.assertRaises(ValueError):
- self.colorScaleWidget.setColormap(colormap)
-
- def testNegativeLogMax(self):
- colormap = { 'name': 'gray', 'normalization': 'log',
- 'autoscale': False, 'vmin': 1.0, 'vmax': -1.0 }
- with self.assertRaises(ValueError):
- self.colorScaleWidget.setColormap(colormap)
-
-class TestNoAutoscale(unittest.TestCase):
+class TestNoAutoscale(TestCaseQt):
"""Test that ticks and color displayed are correct in the case of a colormap
with no autoscale
"""
def setUp(self):
+ super(TestNoAutoscale, self).setUp()
self.plot = Plot2D()
- self.colorBar = ColorBarWidget(parent=None, plot=self.plot)
+ self.colorBar = self.plot.getColorBarWidget()
+ self.colorBar.setVisible(True) # Makes sure the colormap is visible
self.tickBar = self.colorBar.getColorScaleBar().getTickBar()
self.colorScale = self.colorBar.getColorScaleBar().getColorScale()
+ self.plot.show()
+ self.qWaitForWindowExposed(self.plot)
+
def tearDown(self):
+ self.qapp.processEvents()
self.tickBar = None
self.colorScale = None
del self.colorBar
+ self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
self.plot.close()
del self.plot
+ super(TestNoAutoscale, self).tearDown()
def testLogNormNoAutoscale(self):
- colormapLog = { 'name': 'gray', 'normalization': 'log',
- 'autoscale': False, 'vmin': 1.0, 'vmax': 100.0 }
+ colormapLog = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=1.0,
+ vmax=100.0)
data = numpy.linspace(10, 1e10, 9).reshape(3, 3)
self.plot.addImage(data=data, colormap=colormapLog, legend='toto')
@@ -139,8 +155,10 @@ class TestNoAutoscale(unittest.TestCase):
self.assertTrue(val == 1.0)
def testLinearNormNoAutoscale(self):
- colormapLog = { 'name': 'gray', 'normalization': 'linear',
- 'autoscale': False, 'vmin': -4, 'vmax': 5 }
+ colormapLog = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=-4,
+ vmax=5)
data = numpy.linspace(1, 9, 9).reshape(3, 3)
self.plot.addImage(data=data, colormap=colormapLog, legend='toto')
@@ -159,20 +177,26 @@ class TestNoAutoscale(unittest.TestCase):
val = self.colorScale.getValueFromRelativePosition(0.0)
self.assertTrue(val == -4.0)
-class TestColorbarWidget(TestCaseQt):
- """Test interaction with the ColorScaleBar"""
+
+class TestColorBarWidget(TestCaseQt):
+ """Test interaction with the ColorBarWidget"""
def setUp(self):
- super(TestColorbarWidget, self).setUp()
+ super(TestColorBarWidget, self).setUp()
self.plot = Plot2D()
- self.colorBar = ColorBarWidget(parent=None, plot=self.plot)
+ self.colorBar = self.plot.getColorBarWidget()
+ self.colorBar.setVisible(True) # Makes sure the colormap is visible
+
+ self.plot.show()
+ self.qWaitForWindowExposed(self.plot)
def tearDown(self):
+ self.qapp.processEvents()
del self.colorBar
+ self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
self.plot.close()
del self.plot
-
- super(TestColorbarWidget, self).tearDown()
+ super(TestColorBarWidget, self).tearDown()
def testEmptyColorBar(self):
colorBar = ColorBarWidget(parent=None)
@@ -185,38 +209,43 @@ class TestColorbarWidget(TestCaseQt):
Note : colorbar is modified by the Plot directly not ColorBarWidget
"""
- colormapLog = { 'name': 'gray', 'normalization': 'log',
- 'autoscale': True, 'vmin': -1.0, 'vmax': 1.0 }
-
- colormapLog2 = { 'name': 'gray', 'normalization': 'log',
- 'autoscale': False, 'vmin': -1.0, 'vmax': 1.0 }
+ colormapLog = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=None,
+ vmax=None)
data = numpy.array([-5, -4, 0, 2, 3, 5, 10, 20, 30])
data = data.reshape(3, 3)
self.plot.addImage(data=data, colormap=colormapLog, legend='toto')
self.plot.setActiveImage('toto')
- # default behavior when autoscale : set to minmal positive value
- data[data<1] = data.max()
- self.assertTrue(self.colorBar._colormap['vmin'] == data.min())
- self.assertTrue(self.colorBar._colormap['vmax'] == data.max())
-
- data = numpy.linspace(-9, -2, 100).reshape(10, 10)
+ # default behavior when with log and negative values: should set vmin
+ # to 1 and vmax to 10
+ self.assertTrue(self.colorBar.getColorScaleBar().minVal == 2)
+ self.assertTrue(self.colorBar.getColorScaleBar().maxVal == 30)
- self.plot.addImage(data=data, colormap=colormapLog2, legend='toto')
+ # if data is positive
+ data[data<1] = data.max()
+ self.plot.addImage(data=data,
+ colormap=colormapLog,
+ legend='toto',
+ replace=True)
self.plot.setActiveImage('toto')
- # if negative values, changing bounds for default : 1, 10
- self.assertTrue(self.colorBar._colormap['vmin'] == 1)
- self.assertTrue(self.colorBar._colormap['vmax'] == 10)
- def testPlotAssocation(self):
- """Make sure the ColorBarWidget is proparly connected with the plot"""
- colormap = { 'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': -1.0, 'vmax': 1.0 }
+ self.assertTrue(self.colorBar.getColorScaleBar().minVal == data.min())
+ self.assertTrue(self.colorBar.getColorScaleBar().maxVal == data.max())
- # make sure that default settings are the same
+ def testPlotAssocation(self):
+ """Make sure the ColorBarWidget is properly connected with the plot"""
+ colormap = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=None)
+
+ # make sure that default settings are the same (but a copy of the
+ self.colorBar.setPlot(self.plot)
self.assertTrue(
- self.colorBar.getColormap() == self.plot.getDefaultColormap())
+ self.colorBar.getColormap() is self.plot.getDefaultColormap())
data = numpy.linspace(0, 10, 100).reshape(10, 10)
self.plot.addImage(data=data, colormap=colormap, legend='toto')
@@ -224,12 +253,94 @@ class TestColorbarWidget(TestCaseQt):
# make sure the modification of the colormap has been done
self.assertFalse(
- self.colorBar.getColormap() == self.plot.getDefaultColormap())
+ self.colorBar.getColormap() is self.plot.getDefaultColormap())
+ self.assertTrue(
+ self.colorBar.getColormap() is colormap)
+
+ # test that colorbar is updated when default plot colormap changes
+ self.plot.clear()
+ plotColormap = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=None,
+ vmax=None)
+ self.plot.setDefaultColormap(plotColormap)
+ self.assertTrue(self.colorBar.getColormap() is plotColormap)
+
+ def testColormapWithoutRange(self):
+ """Test with a colormap with vmin==vmax"""
+ colormap = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=1.0,
+ vmax=1.0)
+ self.colorBar.setColormap(colormap)
+
+
+class TestColorBarUpdate(TestCaseQt):
+ """Test that the ColorBar is correctly updated when the signal 'sigChanged'
+ of the colormap is emitted
+ """
+
+ def setUp(self):
+ super(TestColorBarUpdate, self).setUp()
+ self.plot = Plot2D()
+ self.colorBar = self.plot.getColorBarWidget()
+ self.colorBar.setVisible(True) # Makes sure the colormap is visible
+ self.colorBar.setPlot(self.plot)
+
+ self.plot.show()
+ self.qWaitForWindowExposed(self.plot)
+ self.data = numpy.random.rand(9).reshape(3, 3)
+
+ def tearDown(self):
+ self.qapp.processEvents()
+ del self.colorBar
+ self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.plot.close()
+ del self.plot
+ super(TestColorBarUpdate, self).tearDown()
+
+ def testUpdateColorMap(self):
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=0,
+ vmax=1)
+
+ # check inital state
+ self.plot.addImage(data=self.data, colormap=colormap, legend='toto')
+ self.plot.setActiveImage('toto')
+
+ self.assertTrue(self.colorBar.getColorScaleBar().minVal == 0)
+ self.assertTrue(self.colorBar.getColorScaleBar().maxVal == 1)
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._vmin == 0)
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._vmax == 1)
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._norm == "linear")
+
+ # update colormap
+ colormap.setVMin(0.5)
+ self.assertTrue(self.colorBar.getColorScaleBar().minVal == 0.5)
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._vmin == 0.5)
+
+ colormap.setVMax(0.8)
+ self.assertTrue(self.colorBar.getColorScaleBar().maxVal == 0.8)
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._vmax == 0.8)
+
+ colormap.setNormalization('log')
+ self.assertTrue(
+ self.colorBar.getColorScaleBar().getTickBar()._norm == 'log')
+
+ # TODO : should also check that if the colormap is changing then values (especially in log scale)
+ # should be coherent if in autoscale
def suite():
test_suite = unittest.TestSuite()
- for ui in (TestColorScale, TestNoAutoscale, TestColorbarWidget):
+ for ui in (TestColorScale, TestNoAutoscale, TestColorBarWidget,
+ TestColorBarUpdate):
test_suite.addTest(
unittest.defaultTestLoader.loadTestsFromTestCase(ui))
@@ -237,4 +348,4 @@ def suite():
if __name__ == '__main__':
- unittest.main(defaultTest='suite') \ No newline at end of file
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/testColormap.py b/silx/gui/plot/test/testColormap.py
new file mode 100644
index 0000000..aa285d3
--- /dev/null
+++ b/silx/gui/plot/test/testColormap.py
@@ -0,0 +1,291 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2015-2017 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.
+#
+# ###########################################################################*/
+"""This module provides the Colormap object
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["H.Payno"]
+__license__ = "MIT"
+__date__ = "05/12/2016"
+
+import unittest
+import numpy
+from silx.test.utils import ParametricTestCase
+from silx.gui.plot.Colormap import Colormap
+
+
+class TestDictAPI(unittest.TestCase):
+ """Make sure the old dictionary API is working
+ """
+
+ def setUp(self):
+ self.vmin = -1.0
+ self.vmax = 12
+
+ def testGetItem(self):
+ """test the item getter API ([xxx])"""
+ colormap = Colormap(name='viridis',
+ normalization=Colormap.LINEAR,
+ vmin=self.vmin,
+ vmax=self.vmax)
+ self.assertTrue(colormap['name'] == 'viridis')
+ self.assertTrue(colormap['normalization'] == Colormap.LINEAR)
+ self.assertTrue(colormap['vmin'] == self.vmin)
+ self.assertTrue(colormap['vmax'] == self.vmax)
+ with self.assertRaises(KeyError):
+ colormap['toto']
+
+ def testGetDict(self):
+ """Test the getDict function API"""
+ clmObject = Colormap(name='viridis',
+ normalization=Colormap.LINEAR,
+ vmin=self.vmin,
+ vmax=self.vmax)
+ clmDict = clmObject._toDict()
+ self.assertTrue(clmDict['name'] == 'viridis')
+ self.assertTrue(clmDict['autoscale'] is False)
+ self.assertTrue(clmDict['vmin'] == self.vmin)
+ self.assertTrue(clmDict['vmax'] == self.vmax)
+ self.assertTrue(clmDict['normalization'] == Colormap.LINEAR)
+
+ clmObject.setVRange(None, None)
+ self.assertTrue(clmObject._toDict()['autoscale'] is True)
+
+ def testSetValidDict(self):
+ """Test that if a colormap is created from a dict then it is correctly
+ created and the values are copied (so if some values from the dict
+ is changing, this won't affect the Colormap object"""
+ clm_dict = {
+ 'name': 'temperature',
+ 'vmin': 1.0,
+ 'vmax': 2.0,
+ 'normalization': 'linear',
+ 'colors': None,
+ 'autoscale': False
+ }
+
+ # Test that the colormap is correctly created
+ colormapObject = Colormap._fromDict(clm_dict)
+ self.assertTrue(colormapObject.getName() == clm_dict['name'])
+ self.assertTrue(colormapObject.getColormapLUT() == clm_dict['colors'])
+ self.assertTrue(colormapObject.getVMin() == clm_dict['vmin'])
+ self.assertTrue(colormapObject.getVMax() == clm_dict['vmax'])
+ self.assertTrue(colormapObject.isAutoscale() == clm_dict['autoscale'])
+
+ # Check that the colormap has copied the values
+ clm_dict['vmin'] = None
+ clm_dict['vmax'] = None
+ clm_dict['colors'] = [1.0, 2.0]
+ clm_dict['autoscale'] = True
+ clm_dict['normalization'] = Colormap.LOGARITHM
+ clm_dict['name'] = 'viridis'
+
+ self.assertFalse(colormapObject.getName() == clm_dict['name'])
+ self.assertFalse(colormapObject.getColormapLUT() == clm_dict['colors'])
+ self.assertFalse(colormapObject.getVMin() == clm_dict['vmin'])
+ self.assertFalse(colormapObject.getVMax() == clm_dict['vmax'])
+ self.assertFalse(colormapObject.isAutoscale() == clm_dict['autoscale'])
+
+ def testMissingKeysFromDict(self):
+ """Make sure we can create a Colormap object from a dictionnary even if
+ there is missing keys excepts if those keys are 'colors' or 'name'
+ """
+ colormap = Colormap._fromDict({'name': 'toto'})
+ self.assertTrue(colormap.getVMin() is None)
+ colormap = Colormap._fromDict({'colors': numpy.zeros(10)})
+ self.assertTrue(colormap.getName() is None)
+
+ with self.assertRaises(ValueError):
+ Colormap._fromDict({})
+
+ def testUnknowNorm(self):
+ """Make sure an error is raised if the given normalization is not
+ knowed
+ """
+ clm_dict = {
+ 'name': 'temperature',
+ 'vmin': 1.0,
+ 'vmax': 2.0,
+ 'normalization': 'toto',
+ 'colors': None,
+ 'autoscale': False
+ }
+ with self.assertRaises(ValueError):
+ colormapObject = Colormap._fromDict(clm_dict)
+
+
+class TestObjectAPI(ParametricTestCase):
+ """Test the new Object API of the colormap"""
+ def setUp(self):
+ signalHasBeenEmitting = False
+
+ def testVMinVMax(self):
+ """Test getter and setter associated to vmin and vmax values"""
+ vmin = 1.0
+ vmax = 2.0
+
+ colormapObject = Colormap(name='viridis',
+ vmin=vmin,
+ vmax=vmax,
+ normalization=Colormap.LINEAR)
+
+ with self.assertRaises(ValueError):
+ colormapObject.setVMin(3)
+
+ with self.assertRaises(ValueError):
+ colormapObject.setVMax(-2)
+
+ with self.assertRaises(ValueError):
+ colormapObject.setVRange(3, -2)
+
+ self.assertTrue(colormapObject.getColormapRange() == (1.0, 2.0))
+ self.assertTrue(colormapObject.isAutoscale() is False)
+ colormapObject.setVRange(None, None)
+ self.assertTrue(colormapObject.getVMin() is None)
+ self.assertTrue(colormapObject.getVMax() is None)
+ self.assertTrue(colormapObject.isAutoscale() is True)
+
+ def testCopy(self):
+ """Make sure the copy function is correctly processing
+ """
+ colormapObject = Colormap(name='toto',
+ colors=numpy.array([12, 13, 14]),
+ vmin=None,
+ vmax=None,
+ normalization=Colormap.LOGARITHM)
+
+ colormapObject2 = colormapObject.copy()
+ self.assertTrue(colormapObject == colormapObject2)
+ colormapObject.setColormapLUT(numpy.array([0, 1]))
+ self.assertFalse(colormapObject == colormapObject2)
+
+ colormapObject2 = colormapObject.copy()
+ self.assertTrue(colormapObject == colormapObject2)
+ colormapObject.setNormalization(Colormap.LINEAR)
+ self.assertFalse(colormapObject == colormapObject2)
+
+ def testGetColorMapRange(self):
+ """Make sure the getColormapRange function of colormap is correctly
+ applying
+ """
+ # test linear scale
+ data = numpy.array([-1, 1, 2, 3, float('nan')])
+ cl1 = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=0,
+ vmax=2)
+ cl2 = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=2)
+ cl3 = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=0,
+ vmax=None)
+ cl4 = Colormap(name='gray',
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=None)
+
+ self.assertTrue(cl1.getColormapRange(data) == (0, 2))
+ self.assertTrue(cl2.getColormapRange(data) == (-1, 2))
+ self.assertTrue(cl3.getColormapRange(data) == (0, 3))
+ self.assertTrue(cl4.getColormapRange(data) == (-1, 3))
+
+ # test linear with annoying cases
+ self.assertEqual(cl3.getColormapRange((-1, -2)), (0, 0))
+ self.assertEqual(cl4.getColormapRange(()), (0., 1.))
+ self.assertEqual(cl4.getColormapRange(
+ (float('nan'), float('inf'), 1., -float('inf'), 2)), (1., 2.))
+ self.assertEqual(cl4.getColormapRange(
+ (float('nan'), float('inf'))), (0., 1.))
+
+ # test log scale
+ data = numpy.array([float('nan'), -1, 1, 10, 100, 1000])
+ cl1 = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=1,
+ vmax=100)
+ cl2 = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=None,
+ vmax=100)
+ cl3 = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=1,
+ vmax=None)
+ cl4 = Colormap(name='gray',
+ normalization=Colormap.LOGARITHM,
+ vmin=None,
+ vmax=None)
+
+ self.assertTrue(cl1.getColormapRange(data) == (1, 100))
+ self.assertTrue(cl2.getColormapRange(data) == (1, 100))
+ self.assertTrue(cl3.getColormapRange(data) == (1, 1000))
+ self.assertTrue(cl4.getColormapRange(data) == (1, 1000))
+
+ # test log with annoying cases
+ self.assertEqual(cl3.getColormapRange((0.1, 0.2)), (1, 1))
+ self.assertEqual(cl4.getColormapRange((-2., -1.)), (1., 1.))
+ self.assertEqual(cl4.getColormapRange(()), (1., 10.))
+ self.assertEqual(cl4.getColormapRange(
+ (float('nan'), float('inf'), 1., -float('inf'), 2)), (1., 2.))
+ self.assertEqual(cl4.getColormapRange(
+ (float('nan'), float('inf'))), (1., 10.))
+
+ def testApplyToData(self):
+ """Test applyToData on different datasets"""
+ datasets = [
+ numpy.zeros((0, 0)), # Empty array
+ numpy.array((numpy.nan, numpy.inf)), # All non-finite
+ numpy.array((-numpy.inf, numpy.inf, 1.0, 2.0)), # Some infinite
+ ]
+
+ for normalization in ('linear', 'log'):
+ colormap = Colormap(name='gray',
+ normalization=normalization,
+ vmin=None,
+ vmax=None)
+
+ for data in datasets:
+ with self.subTest(data=data):
+ image = colormap.applyToData(data)
+ self.assertEqual(image.dtype, numpy.uint8)
+ self.assertEqual(image.shape[-1], 4)
+ self.assertEqual(image.shape[:-1], data.shape)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ for ui in (TestDictAPI, TestObjectAPI):
+ test_suite.addTest(
+ unittest.defaultTestLoader.loadTestsFromTestCase(ui))
+
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/testColors.py b/silx/gui/plot/test/testColors.py
index 94c22f3..18f0902 100644
--- a/silx/gui/plot/test/testColors.py
+++ b/silx/gui/plot/test/testColors.py
@@ -35,7 +35,7 @@ import unittest
from silx.test.utils import ParametricTestCase
from silx.gui.plot import Colors
-
+from silx.gui.plot.Colormap import Colormap
class TestRGBA(ParametricTestCase):
"""Basic tests of rgba function"""
@@ -65,8 +65,8 @@ class TestApplyColormapToData(ParametricTestCase):
def testApplyColormapToData(self):
"""Simple test of applyColormapToData function"""
- colormap = dict(name='gray', normalization='linear',
- autoscale=False, vmin=0, vmax=255)
+ colormap = Colormap(name='gray', normalization='linear',
+ vmin=0, vmax=255)
size = 10
expected = numpy.empty((size, 4), dtype='uint8')
@@ -78,7 +78,7 @@ class TestApplyColormapToData(ParametricTestCase):
for dtype in ('uint8', 'int32', 'float32', 'float64'):
with self.subTest(dtype=dtype):
array = numpy.arange(size, dtype=dtype)
- result = Colors.applyColormapToData(array, **colormap)
+ result = colormap.applyToData(data=array)
self.assertTrue(numpy.all(numpy.equal(result, expected)))
diff --git a/silx/gui/plot/test/testComplexImageView.py b/silx/gui/plot/test/testComplexImageView.py
new file mode 100644
index 0000000..f8ec370
--- /dev/null
+++ b/silx/gui/plot/test/testComplexImageView.py
@@ -0,0 +1,95 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""Test suite for :class:`ComplexImageView`"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "14/09/2017"
+
+
+import unittest
+import logging
+import numpy
+
+from silx.test.utils import ParametricTestCase
+from silx.gui.plot import ComplexImageView
+
+from .utils import PlotWidgetTestCase
+
+
+logger = logging.getLogger(__name__)
+
+
+class TestComplexImageView(PlotWidgetTestCase, ParametricTestCase):
+ """Test suite of ComplexImageView widget"""
+
+ def _createPlot(self):
+ return ComplexImageView.ComplexImageView()
+
+ def testPlot2DComplex(self):
+ """Test API of ComplexImageView widget"""
+ data = numpy.array(((0, 1j), (1, 1 + 1j)), dtype=numpy.complex)
+ self.plot.setData(data)
+ self.plot.setKeepDataAspectRatio(True)
+ self.plot.getPlot().resetZoom()
+ self.qWait(100)
+
+ # Test colormap API
+ colormap = self.plot.getColormap().copy()
+ colormap.setName('magma')
+ self.plot.setColormap(colormap)
+ self.qWait(100)
+
+ # Test all modes
+ modes = self.plot.getSupportedVisualizationModes()
+ for mode in modes:
+ with self.subTest(mode=mode):
+ self.plot.setVisualizationMode(mode)
+ self.qWait(100)
+
+ # Test origin and scale API
+ self.plot.setScale((2, 1))
+ self.qWait(100)
+ self.plot.setOrigin((1, 1))
+ self.qWait(100)
+
+ # Test no data
+ self.plot.setData(numpy.zeros((0, 0), dtype=numpy.complex))
+ self.qWait(100)
+
+ # Test float data
+ self.plot.setData(numpy.arange(100, dtype=numpy.float).reshape(10, 10))
+ self.qWait(100)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(
+ TestComplexImageView))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/testCurvesROIWidget.py b/silx/gui/plot/test/testCurvesROIWidget.py
index 3c6f2ba..716960a 100644
--- a/silx/gui/plot/test/testCurvesROIWidget.py
+++ b/silx/gui/plot/test/testCurvesROIWidget.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "15/05/2017"
import logging
@@ -41,7 +41,6 @@ from silx.gui.test.utils import TestCaseQt
from silx.gui.plot import PlotWindow, CurvesROIWidget
-logging.basicConfig()
_logger = logging.getLogger(__name__)
diff --git a/silx/gui/plot/test/testItem.py b/silx/gui/plot/test/testItem.py
new file mode 100644
index 0000000..8c15bb7
--- /dev/null
+++ b/silx/gui/plot/test/testItem.py
@@ -0,0 +1,231 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""Tests for PlotWidget items."""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "01/09/2017"
+
+
+import unittest
+
+import numpy
+
+from silx.gui.test.utils import SignalListener
+from silx.gui.plot.items import ItemChangedType
+from .utils import PlotWidgetTestCase
+
+
+class TestSigItemChangedSignal(PlotWidgetTestCase):
+ """Test item's sigItemChanged signal"""
+
+ def testCurveChanged(self):
+ """Test sigItemChanged for curve"""
+ self.plot.addCurve(numpy.arange(10), numpy.arange(10), legend='test')
+ curve = self.plot.getCurve('test')
+
+ listener = SignalListener()
+ curve.sigItemChanged.connect(listener)
+
+ # Test for signal in Item class
+ curve.setVisible(False)
+ curve.setVisible(True)
+ curve.setZValue(100)
+
+ # Test for signals in Points class
+ curve.setData(numpy.arange(100), numpy.arange(100))
+
+ # SymbolMixIn
+ curve.setSymbol('o')
+ curve.setSymbol('d')
+ curve.setSymbolSize(20)
+
+ # AlphaMixIn
+ curve.setAlpha(0.5)
+
+ # Test for signals in Curve class
+ # ColorMixIn
+ curve.setColor('yellow')
+ # YAxisMixIn
+ curve.setYAxis('right')
+ # FillMixIn
+ curve.setFill(True)
+ # LineMixIn
+ curve.setLineStyle(':')
+ curve.setLineStyle(':') # Not sending event
+ curve.setLineWidth(2)
+
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.VISIBLE,
+ ItemChangedType.VISIBLE,
+ ItemChangedType.ZVALUE,
+ ItemChangedType.DATA,
+ ItemChangedType.SYMBOL,
+ ItemChangedType.SYMBOL,
+ ItemChangedType.SYMBOL_SIZE,
+ ItemChangedType.ALPHA,
+ ItemChangedType.COLOR,
+ ItemChangedType.YAXIS,
+ ItemChangedType.FILL,
+ ItemChangedType.LINE_STYLE,
+ ItemChangedType.LINE_WIDTH])
+
+ def testHistogramChanged(self):
+ """Test sigItemChanged for Histogram"""
+ self.plot.addHistogram(
+ numpy.arange(10), edges=numpy.arange(11), legend='test')
+ histogram = self.plot.getHistogram('test')
+ listener = SignalListener()
+ histogram.sigItemChanged.connect(listener)
+
+ # Test signals in Histogram class
+ histogram.setData(numpy.zeros(10), numpy.arange(11))
+
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.DATA])
+
+ def testImageDataChanged(self):
+ """Test sigItemChanged for ImageData"""
+ self.plot.addImage(numpy.arange(100).reshape(10, 10), legend='test')
+ image = self.plot.getImage('test')
+
+ listener = SignalListener()
+ image.sigItemChanged.connect(listener)
+
+ # ColormapMixIn
+ colormap = self.plot.getDefaultColormap().copy()
+ image.setColormap(colormap)
+ image.getColormap().setName('viridis')
+
+ # Test of signals in ImageBase class
+ image.setOrigin(10)
+ image.setScale(2)
+
+ # Test of signals in ImageData class
+ image.setData(numpy.ones((10, 10)))
+
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.COLORMAP,
+ ItemChangedType.COLORMAP,
+ ItemChangedType.POSITION,
+ ItemChangedType.SCALE,
+ ItemChangedType.DATA])
+
+ def testImageRgbaChanged(self):
+ """Test sigItemChanged for ImageRgba"""
+ self.plot.addImage(numpy.ones((10, 10, 3)), legend='rgb')
+ image = self.plot.getImage('rgb')
+
+ listener = SignalListener()
+ image.sigItemChanged.connect(listener)
+
+ # Test of signals in ImageRgba class
+ image.setData(numpy.zeros((10, 10, 3)))
+
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.DATA])
+
+ def testMarkerChanged(self):
+ """Test sigItemChanged for markers"""
+ self.plot.addMarker(10, 20, legend='test')
+ marker = self.plot._getMarker('test')
+
+ listener = SignalListener()
+ marker.sigItemChanged.connect(listener)
+
+ # Test signals in _BaseMarker
+ marker.setPosition(10, 10)
+ marker.setPosition(10, 10) # Not sending event
+ marker.setText('toto')
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.POSITION,
+ ItemChangedType.TEXT])
+
+ # XMarker
+ self.plot.addXMarker(10, legend='x')
+ marker = self.plot._getMarker('x')
+
+ listener = SignalListener()
+ marker.sigItemChanged.connect(listener)
+ marker.setPosition(20, 20)
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.POSITION])
+
+ # YMarker
+ self.plot.addYMarker(10, legend='x')
+ marker = self.plot._getMarker('x')
+
+ listener = SignalListener()
+ marker.sigItemChanged.connect(listener)
+ marker.setPosition(20, 20)
+ self.assertEqual(listener.arguments(argumentIndex=0),
+ [ItemChangedType.POSITION])
+
+ def testScatterChanged(self):
+ """Test sigItemChanged for scatter"""
+ data = numpy.arange(10)
+ self.plot.addScatter(data, data, data, legend='test')
+ scatter = self.plot.getScatter('test')
+
+ listener = SignalListener()
+ scatter.sigItemChanged.connect(listener)
+
+ # ColormapMixIn
+ scatter.getColormap().setName('viridis')
+ data2 = data + 10
+
+ # Test of signals in Scatter class
+ scatter.setData(data2, data2, data2)
+
+ self.assertEqual(listener.arguments(),
+ [(ItemChangedType.COLORMAP,),
+ (ItemChangedType.DATA,)])
+
+ def testShapeChanged(self):
+ """Test sigItemChanged for shape"""
+ data = numpy.array((1., 10.))
+ self.plot.addItem(data, data, legend='test', shape='rectangle')
+ shape = self.plot._getItem(kind='item', legend='test')
+
+ listener = SignalListener()
+ shape.sigItemChanged.connect(listener)
+
+ shape.setOverlay(True)
+ shape.setPoints(((2., 2.), (3., 3.)))
+
+ self.assertEqual(listener.arguments(),
+ [(ItemChangedType.OVERLAY,),
+ (ItemChangedType.DATA,)])
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestSigItemChangedSignal))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/testLegendSelector.py b/silx/gui/plot/test/testLegendSelector.py
index 371197f..9d4ada7 100644
--- a/silx/gui/plot/test/testLegendSelector.py
+++ b/silx/gui/plot/test/testLegendSelector.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Rueter", "T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "15/05/2017"
import logging
@@ -37,7 +37,6 @@ from silx.gui.test.utils import TestCaseQt
from silx.gui.plot import LegendSelector
-logging.basicConfig()
_logger = logging.getLogger(__name__)
diff --git a/silx/gui/plot/test/testLimitConstraints.py b/silx/gui/plot/test/testLimitConstraints.py
new file mode 100644
index 0000000..94aae76
--- /dev/null
+++ b/silx/gui/plot/test/testLimitConstraints.py
@@ -0,0 +1,125 @@
+# 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.
+#
+# ###########################################################################*/
+"""Test setLimitConstaints on the PlotWidget"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "30/08/2017"
+
+
+import unittest
+from silx.gui.plot import PlotWidget
+
+
+class TestLimitConstaints(unittest.TestCase):
+ """Tests setLimitConstaints class"""
+
+ def setUp(self):
+ self.plot = PlotWidget()
+
+ def tearDown(self):
+ self.plot = None
+
+ def testApi(self):
+ """Test availability of the API"""
+ self.plot.getXAxis().setLimitsConstraints(minPos=1, maxPos=1)
+ self.plot.getXAxis().setRangeConstraints(minRange=1, maxRange=1)
+ self.plot.getYAxis().setLimitsConstraints(minPos=1, maxPos=1)
+ self.plot.getYAxis().setRangeConstraints(minRange=1, maxRange=1)
+
+ def testXMinMax(self):
+ """Test limit constains on x-axis"""
+ self.plot.getXAxis().setLimitsConstraints(minPos=0, maxPos=100)
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ self.assertEqual(self.plot.getXAxis().getLimits(), (0, 100))
+ self.assertEqual(self.plot.getYAxis().getLimits(), (-1, 101))
+
+ def testYMinMax(self):
+ """Test limit constains on y-axis"""
+ self.plot.getYAxis().setLimitsConstraints(minPos=0, maxPos=100)
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ self.assertEqual(self.plot.getXAxis().getLimits(), (-1, 101))
+ self.assertEqual(self.plot.getYAxis().getLimits(), (0, 100))
+
+ def testMinXRange(self):
+ """Test min range constains on x-axis"""
+ self.plot.getXAxis().setRangeConstraints(minRange=100)
+ self.plot.setLimits(xmin=1, xmax=99, ymin=1, ymax=99)
+ limits = self.plot.getXAxis().getLimits()
+ self.assertEqual(limits[1] - limits[0], 100)
+ limits = self.plot.getYAxis().getLimits()
+ self.assertNotEqual(limits[1] - limits[0], 100)
+
+ def testMaxXRange(self):
+ """Test max range constains on x-axis"""
+ self.plot.getXAxis().setRangeConstraints(maxRange=100)
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ limits = self.plot.getXAxis().getLimits()
+ self.assertEqual(limits[1] - limits[0], 100)
+ limits = self.plot.getYAxis().getLimits()
+ self.assertNotEqual(limits[1] - limits[0], 100)
+
+ def testMinYRange(self):
+ """Test min range constains on y-axis"""
+ self.plot.getYAxis().setRangeConstraints(minRange=100)
+ self.plot.setLimits(xmin=1, xmax=99, ymin=1, ymax=99)
+ limits = self.plot.getXAxis().getLimits()
+ self.assertNotEqual(limits[1] - limits[0], 100)
+ limits = self.plot.getYAxis().getLimits()
+ self.assertEqual(limits[1] - limits[0], 100)
+
+ def testMaxYRange(self):
+ """Test max range constains on y-axis"""
+ self.plot.getYAxis().setRangeConstraints(maxRange=100)
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ limits = self.plot.getXAxis().getLimits()
+ self.assertNotEqual(limits[1] - limits[0], 100)
+ limits = self.plot.getYAxis().getLimits()
+ self.assertEqual(limits[1] - limits[0], 100)
+
+ def testChangeOfConstraints(self):
+ """Test changing of the constraints"""
+ self.plot.getXAxis().setRangeConstraints(minRange=10, maxRange=10)
+ # There is no more constraints on the range
+ self.plot.getXAxis().setRangeConstraints(minRange=None, maxRange=None)
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ self.assertEqual(self.plot.getXAxis().getLimits(), (-1, 101))
+
+ def testSettingConstraints(self):
+ """Test setting a constaint (setLimits first then the constaint)"""
+ self.plot.setLimits(xmin=-1, xmax=101, ymin=-1, ymax=101)
+ self.plot.getXAxis().setLimitsConstraints(minPos=0, maxPos=100)
+ self.assertEqual(self.plot.getXAxis().getLimits(), (0, 100))
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestLimitConstaints))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/testMaskToolsWidget.py b/silx/gui/plot/test/testMaskToolsWidget.py
index 0c11928..191bbe0 100644
--- a/silx/gui/plot/test/testMaskToolsWidget.py
+++ b/silx/gui/plot/test/testMaskToolsWidget.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "01/09/2017"
import logging
@@ -37,8 +37,9 @@ import numpy
from silx.gui import qt
from silx.test.utils import temp_dir, ParametricTestCase
-from silx.gui.test.utils import TestCaseQt, getQToolButtonFromAction
+from silx.gui.test.utils import getQToolButtonFromAction
from silx.gui.plot import PlotWindow, MaskToolsWidget
+from .utils import PlotWidgetTestCase
try:
import fabio
@@ -46,33 +47,24 @@ except ImportError:
fabio = None
-logging.basicConfig()
_logger = logging.getLogger(__name__)
-class TestMaskToolsWidget(TestCaseQt, ParametricTestCase):
+class TestMaskToolsWidget(PlotWidgetTestCase, ParametricTestCase):
"""Basic test for MaskToolsWidget"""
+ def _createPlot(self):
+ return PlotWindow()
+
def setUp(self):
super(TestMaskToolsWidget, self).setUp()
- self.plot = PlotWindow()
-
self.widget = MaskToolsWidget.MaskToolsDockWidget(plot=self.plot, name='TEST')
self.plot.addDockWidget(qt.Qt.BottomDockWidgetArea, self.widget)
-
- self.plot.show()
- self.qWaitForWindowExposed(self.plot)
-
self.maskWidget = self.widget.widget()
def tearDown(self):
del self.maskWidget
del self.widget
-
- self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
- self.plot.close()
- del self.plot
-
super(TestMaskToolsWidget, self).tearDown()
def testEmptyPlot(self):
@@ -85,7 +77,7 @@ class TestMaskToolsWidget(TestCaseQt, ParametricTestCase):
def _drag(self):
"""Drag from plot center to offset position"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
xCenter, yCenter = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -99,7 +91,7 @@ class TestMaskToolsWidget(TestCaseQt, ParametricTestCase):
def _drawPolygon(self):
"""Draw a star polygon in the plot"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
x, y = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -107,16 +99,17 @@ class TestMaskToolsWidget(TestCaseQt, ParametricTestCase):
(x - offset, y - offset),
(x + offset, y),
(x - offset, y),
- (x + offset, y - offset)]
+ (x + offset, y - offset),
+ (x, y + offset)] # Close polygon
+ self.mouseMove(plot, pos=(0, 0))
for pos in star:
self.mouseMove(plot, pos=pos)
- btn = qt.Qt.LeftButton if pos != star[-1] else qt.Qt.RightButton
- self.mouseClick(plot, btn, pos=pos)
+ self.mouseClick(plot, qt.Qt.LeftButton, pos=pos)
def _drawPencil(self):
"""Draw a star polygon in the plot"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
x, y = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -126,9 +119,10 @@ class TestMaskToolsWidget(TestCaseQt, ParametricTestCase):
(x - offset, y),
(x + offset, y - offset)]
+ self.mouseMove(plot, pos=(0, 0))
self.mouseMove(plot, pos=star[0])
self.mousePress(plot, qt.Qt.LeftButton, pos=star[0])
- for pos in star:
+ for pos in star[1:]:
self.mouseMove(plot, pos=pos)
self.mouseRelease(
plot, qt.Qt.LeftButton, pos=star[-1])
diff --git a/silx/gui/plot/test/testPlotInteraction.py b/silx/gui/plot/test/testPlotInteraction.py
index 25f57a9..335b1e4 100644
--- a/silx/gui/plot/test/testPlotInteraction.py
+++ b/silx/gui/plot/test/testPlotInteraction.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016=2017 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
@@ -26,12 +26,12 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "13/10/2016"
+__date__ = "01/09/2017"
import unittest
from silx.gui import qt
-from silx.gui.plot.test.testPlotWidget import _PlotWidgetTest
+from .utils import PlotWidgetTestCase
class _SignalDump(object):
@@ -49,7 +49,7 @@ class _SignalDump(object):
return list(self._received)
-class TestSelectPolygon(_PlotWidgetTest):
+class TestSelectPolygon(PlotWidgetTestCase):
"""Test polygon selection interaction"""
def _interactionModeChanged(self, source):
@@ -59,17 +59,16 @@ class TestSelectPolygon(_PlotWidgetTest):
def _draw(self, polygon):
"""Draw a polygon in the plot
- :param polygon: List of points (x, y) of the polygon (not closed)
+ :param polygon: List of points (x, y) of the polygon (closed)
"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
dump = _SignalDump()
self.plot.sigPlotSignal.connect(dump)
for pos in polygon:
self.mouseMove(plot, pos=pos)
- btn = qt.Qt.LeftButton if pos != polygon[-1] else qt.Qt.RightButton
- self.mouseClick(plot, btn, pos=pos)
+ self.mouseClick(plot, qt.Qt.LeftButton, pos=pos)
self.plot.sigPlotSignal.disconnect(dump)
return [args[0] for args in dump.received]
@@ -89,7 +88,7 @@ class TestSelectPolygon(_PlotWidgetTest):
self.plot.sigInteractiveModeChanged.disconnect(
self._interactionModeChanged)
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
xCenter, yCenter = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -98,7 +97,8 @@ class TestSelectPolygon(_PlotWidgetTest):
(xCenter - offset, yCenter - offset),
(xCenter + offset, yCenter),
(xCenter - offset, yCenter),
- (xCenter + offset, yCenter - offset)]
+ (xCenter + offset, yCenter - offset),
+ (xCenter, yCenter + offset)] # Close polygon
# Draw while dumping signals
events = self._draw(star)
@@ -113,7 +113,8 @@ class TestSelectPolygon(_PlotWidgetTest):
largeSquare = [(xCenter - offset, yCenter - offset),
(xCenter + offset, yCenter - offset),
(xCenter + offset, yCenter + offset),
- (xCenter - offset, yCenter + offset)]
+ (xCenter - offset, yCenter + offset),
+ (xCenter - offset, yCenter - offset)] # Close polygon
# Draw while dumping signals
events = self._draw(largeSquare)
@@ -128,7 +129,7 @@ class TestSelectPolygon(_PlotWidgetTest):
thinRectX = [(xCenter, yCenter - offset),
(xCenter, yCenter + offset),
(xCenter + 1, yCenter + offset),
- (xCenter + 1, yCenter - offset)]
+ (xCenter + 1, yCenter - offset)] # Close polygon
# Draw while dumping signals
events = self._draw(thinRectX)
@@ -143,7 +144,7 @@ class TestSelectPolygon(_PlotWidgetTest):
thinRectY = [(xCenter - offset, yCenter),
(xCenter + offset, yCenter),
(xCenter + offset, yCenter + 1),
- (xCenter - offset, yCenter + 1)]
+ (xCenter - offset, yCenter + 1)] # Close polygon
# Draw while dumping signals
events = self._draw(thinRectY)
diff --git a/silx/gui/plot/test/testPlotTools.py b/silx/gui/plot/test/testPlotTools.py
index 1d5e148..a08a18a 100644
--- a/silx/gui/plot/test/testPlotTools.py
+++ b/silx/gui/plot/test/testPlotTools.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "01/09/2017"
import numpy
@@ -37,6 +37,7 @@ from silx.gui.test.utils import (
qWaitForWindowExposedAndActivate, TestCaseQt, getQToolButtonFromAction)
from silx.gui import qt
from silx.gui.plot import Plot2D, PlotWindow, PlotTools
+from .utils import PlotWidgetTestCase
# Makes sure a QApplication exists
@@ -67,23 +68,19 @@ def _tearDownDocTest(docTest):
# """
-class TestPositionInfo(TestCaseQt):
+class TestPositionInfo(PlotWidgetTestCase):
"""Tests for PositionInfo widget."""
+ def _createPlot(self):
+ return PlotWindow()
+
def setUp(self):
super(TestPositionInfo, self).setUp()
- self.plot = PlotWindow()
- self.plot.show()
- self.qWaitForWindowExposed(self.plot)
- self.mouseMove(self.plot, pos=(1, 1))
+ self.mouseMove(self.plot, pos=(0, 0))
self.qapp.processEvents()
self.qWait(100)
def tearDown(self):
- self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
- self.plot.close()
- del self.plot
-
super(TestPositionInfo, self).tearDown()
def _test(self, positionWidget, converterNames, **kwargs):
@@ -104,10 +101,10 @@ class TestPositionInfo(TestCaseQt):
with TestLogging(PlotTools.__name__, **kwargs):
# Move mouse to center
- self.mouseMove(self.plot)
+ center = self.plot.size() / 2
+ self.mouseMove(self.plot, pos=(center.width(), center.height()))
+ # Move out
self.mouseMove(self.plot, pos=(1, 1))
- self.qapp.processEvents()
- self.qWait(100)
def testDefaultConverters(self):
"""Test PositionInfo with default converters"""
diff --git a/silx/gui/plot/test/testPlotWidget.py b/silx/gui/plot/test/testPlotWidget.py
index 2de18a8..deeb198 100644
--- a/silx/gui/plot/test/testPlotWidget.py
+++ b/silx/gui/plot/test/testPlotWidget.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2017 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
@@ -26,18 +26,24 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "01/09/2017"
import unittest
-
+import logging
import numpy
from silx.test.utils import ParametricTestCase
+from silx.gui.test.utils import SignalListener
from silx.gui.test.utils import TestCaseQt
+from silx.test import utils
+from silx.utils import deprecation
from silx.gui import qt
from silx.gui.plot import PlotWidget
+from silx.gui.plot.Colormap import Colormap
+
+from .utils import PlotWidgetTestCase
SIZE = 1024
@@ -47,27 +53,10 @@ DATA_2D = numpy.arange(SIZE ** 2).reshape(SIZE, SIZE)
"""Image data set"""
-class _PlotWidgetTest(TestCaseQt):
- """Base class for tests of PlotWidget, not a TestCase in itself.
-
- plot attribute is the PlotWidget created for the test.
- """
-
- def setUp(self):
- super(_PlotWidgetTest, self).setUp()
- self.plot = PlotWidget()
- self.plot.show()
- self.qWaitForWindowExposed(self.plot)
-
- def tearDown(self):
- self.qapp.processEvents()
- self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
- self.plot.close()
- del self.plot
- super(_PlotWidgetTest, self).tearDown()
+logger = logging.getLogger(__name__)
-class TestPlotWidget(_PlotWidgetTest, ParametricTestCase):
+class TestPlotWidget(PlotWidgetTestCase, ParametricTestCase):
"""Basic tests for PlotWidget"""
def testShow(self):
@@ -79,77 +68,115 @@ class TestPlotWidget(_PlotWidgetTest, ParametricTestCase):
title, xlabel, ylabel = 'the title', 'x label', 'y label'
self.plot.setGraphTitle(title)
- self.plot.setGraphXLabel(xlabel)
- self.plot.setGraphYLabel(ylabel)
+ self.plot.getXAxis().setLabel(xlabel)
+ self.plot.getYAxis().setLabel(ylabel)
self.qapp.processEvents()
self.assertEqual(self.plot.getGraphTitle(), title)
- self.assertEqual(self.plot.getGraphXLabel(), xlabel)
- self.assertEqual(self.plot.getGraphYLabel(), ylabel)
+ self.assertEqual(self.plot.getXAxis().getLabel(), xlabel)
+ self.assertEqual(self.plot.getYAxis().getLabel(), ylabel)
- def testChangeLimitsWithAspectRatio(self):
- def checkLimits(expectedXLim=None, expectedYLim=None,
- expectedRatio=None):
- xlim = self.plot.getGraphXLimits()
- ylim = self.plot.getGraphYLimits()
- ratio = abs(xlim[1] - xlim[0]) / abs(ylim[1] - ylim[0])
+ def _checkLimits(self,
+ expectedXLim=None,
+ expectedYLim=None,
+ expectedRatio=None):
+ """Assert that limits are as expected"""
+ xlim = self.plot.getXAxis().getLimits()
+ ylim = self.plot.getYAxis().getLimits()
+ ratio = abs(xlim[1] - xlim[0]) / abs(ylim[1] - ylim[0])
- if expectedXLim is not None:
- self.assertEqual(expectedXLim, xlim)
+ if expectedXLim is not None:
+ self.assertEqual(expectedXLim, xlim)
- if expectedYLim is not None:
- self.assertEqual(expectedYLim, ylim)
+ if expectedYLim is not None:
+ self.assertEqual(expectedYLim, ylim)
- if expectedRatio is not None:
- self.assertTrue(
- numpy.allclose(expectedRatio, ratio, atol=0.01))
+ if expectedRatio is not None:
+ self.assertTrue(
+ numpy.allclose(expectedRatio, ratio, atol=0.01))
+ def testChangeLimitsWithAspectRatio(self):
self.plot.setKeepDataAspectRatio()
self.qapp.processEvents()
- xlim = self.plot.getGraphXLimits()
- ylim = self.plot.getGraphYLimits()
+ xlim = self.plot.getXAxis().getLimits()
+ ylim = self.plot.getYAxis().getLimits()
defaultRatio = abs(xlim[1] - xlim[0]) / abs(ylim[1] - ylim[0])
- self.plot.setGraphXLimits(1., 10.)
- checkLimits(expectedXLim=(1., 10.), expectedRatio=defaultRatio)
+ self.plot.getXAxis().setLimits(1., 10.)
+ self._checkLimits(expectedXLim=(1., 10.), expectedRatio=defaultRatio)
+ self.qapp.processEvents()
+ self._checkLimits(expectedXLim=(1., 10.), expectedRatio=defaultRatio)
+
+ self.plot.getYAxis().setLimits(1., 10.)
+ self._checkLimits(expectedYLim=(1., 10.), expectedRatio=defaultRatio)
self.qapp.processEvents()
- checkLimits(expectedXLim=(1., 10.), expectedRatio=defaultRatio)
+ self._checkLimits(expectedYLim=(1., 10.), expectedRatio=defaultRatio)
- self.plot.setGraphYLimits(1., 10.)
- checkLimits(expectedYLim=(1., 10.), expectedRatio=defaultRatio)
+ def testResizeWidget(self):
+ """Test resizing the widget and receiving limitsChanged events"""
+ self.plot.resize(200, 200)
self.qapp.processEvents()
- checkLimits(expectedYLim=(1., 10.), expectedRatio=defaultRatio)
+ xlim = self.plot.getXAxis().getLimits()
+ ylim = self.plot.getYAxis().getLimits()
-class TestPlotImage(_PlotWidgetTest, ParametricTestCase):
+ listener = SignalListener()
+ self.plot.getXAxis().sigLimitsChanged.connect(listener.partial('x'))
+ self.plot.getYAxis().sigLimitsChanged.connect(listener.partial('y'))
+
+ # Resize without aspect ratio
+ self.plot.resize(200, 300)
+ self.qapp.processEvents()
+ self._checkLimits(expectedXLim=xlim, expectedYLim=ylim)
+ self.assertEqual(listener.callCount(), 0)
+
+ # Resize with aspect ratio
+ self.plot.setKeepDataAspectRatio(True)
+ listener.clear() # Clean-up received signal
+ self.qapp.processEvents()
+ self.assertEqual(listener.callCount(), 0) # No event when redrawing
+
+ self.plot.resize(200, 200)
+ self.qapp.processEvents()
+
+ self.assertNotEqual(listener.callCount(), 0)
+
+
+class TestPlotImage(PlotWidgetTestCase, ParametricTestCase):
"""Basic tests for addImage"""
def setUp(self):
super(TestPlotImage, self).setUp()
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
def testPlotColormapTemperature(self):
self.plot.setGraphTitle('Temp. Linear')
- colormap = {'name': 'temperature', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='temperature',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1", colormap=colormap)
def testPlotColormapGray(self):
self.plot.setKeepDataAspectRatio(False)
self.plot.setGraphTitle('Gray Linear')
- colormap = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1", colormap=colormap)
def testPlotColormapTemperatureLog(self):
self.plot.setGraphTitle('Temp. Log')
- colormap = {'name': 'temperature', 'normalization': 'log',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='temperature',
+ normalization=Colormap.LOGARITHM,
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1", colormap=colormap)
def testPlotRgbRgba(self):
@@ -180,19 +207,23 @@ class TestPlotImage(_PlotWidgetTest, ParametricTestCase):
self.plot.setKeepDataAspectRatio(False)
self.plot.setGraphTitle('Custom colormap')
- colormap = {'name': None, 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0,
- 'colors': ((0., 0., 0.), (1., 0., 0.),
- (0., 1., 0.), (0., 0., 1.))}
+ colormap = Colormap(name=None,
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=None,
+ colors=((0., 0., 0.), (1., 0., 0.),
+ (0., 1., 0.), (0., 0., 1.)))
self.plot.addImage(DATA_2D, legend="image 1", colormap=colormap,
replace=False, resetzoom=False)
- colormap = {'name': None, 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0,
- 'colors': numpy.array(
- ((0, 0, 0, 0), (0, 0, 0, 128),
- (128, 128, 128, 128), (255, 255, 255, 255)),
- dtype=numpy.uint8)}
+ colormap = Colormap(name=None,
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=None,
+ colors=numpy.array(
+ ((0, 0, 0, 0), (0, 0, 0, 128),
+ (128, 128, 128, 128), (255, 255, 255, 255)),
+ dtype=numpy.uint8))
self.plot.addImage(DATA_2D, legend="image 2", colormap=colormap,
origin=(DATA_2D.shape[0], 0),
replace=False, resetzoom=False)
@@ -228,8 +259,8 @@ class TestPlotImage(_PlotWidgetTest, ParametricTestCase):
ybounds = oy, oy + DATA_2D.shape[0] * sy
# Check limits without aspect ratio
- xmin, xmax = self.plot.getGraphXLimits()
- ymin, ymax = self.plot.getGraphYLimits()
+ xmin, xmax = self.plot.getXAxis().getLimits()
+ ymin, ymax = self.plot.getYAxis().getLimits()
self.assertEqual(xmin, min(xbounds))
self.assertEqual(xmax, max(xbounds))
self.assertEqual(ymin, min(ybounds))
@@ -237,8 +268,8 @@ class TestPlotImage(_PlotWidgetTest, ParametricTestCase):
# Check limits with aspect ratio
self.plot.setKeepDataAspectRatio(True)
- xmin, xmax = self.plot.getGraphXLimits()
- ymin, ymax = self.plot.getGraphYLimits()
+ xmin, xmax = self.plot.getXAxis().getLimits()
+ ymin, ymax = self.plot.getYAxis().getLimits()
self.assertTrue(xmin <= min(xbounds))
self.assertTrue(xmax >= max(xbounds))
self.assertTrue(ymin <= min(ybounds))
@@ -248,8 +279,42 @@ class TestPlotImage(_PlotWidgetTest, ParametricTestCase):
self.plot.clear()
self.plot.resetZoom()
+ def testPlotColormapDictAPI(self):
+ """Test that the addImage API using a colormap dictionary is still
+ working"""
+ self.plot.setGraphTitle('Temp. Log')
+
+ colormap = {
+ 'name': 'temperature',
+ 'normalization': 'log',
+ 'vmin': None,
+ 'vmax': None
+ }
+ self.plot.addImage(DATA_2D, legend="image 1", colormap=colormap)
+
+ def testPlotComplexImage(self):
+ """Test that a complex image is displayed as its absolute value."""
+ data = numpy.linspace(1, 1j, 100).reshape(10, 10)
+ self.plot.addImage(data, legend='complex')
+
+ image = self.plot.getActiveImage()
+ retrievedData = image.getData(copy=False)
+ self.assertTrue(
+ numpy.all(numpy.equal(retrievedData, numpy.absolute(data))))
+
+ def testPlotBooleanImage(self):
+ """Test that a boolean image is displayed and converted to int8."""
+ data = numpy.zeros((10, 10), dtype=numpy.bool)
+ data[::2, ::2] = True
+ self.plot.addImage(data, legend='boolean')
-class TestPlotCurve(_PlotWidgetTest):
+ image = self.plot.getActiveImage()
+ retrievedData = image.getData(copy=False)
+ self.assertTrue(numpy.all(numpy.equal(retrievedData, data)))
+ self.assertIs(retrievedData.dtype.type, numpy.int8)
+
+
+class TestPlotCurve(PlotWidgetTestCase):
"""Basic tests for addCurve."""
# Test data sets
@@ -261,8 +326,8 @@ class TestPlotCurve(_PlotWidgetTest):
def setUp(self):
super(TestPlotCurve, self).setUp()
self.plot.setGraphTitle('Curve')
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
self.plot.setActiveCurveHandling(False)
@@ -307,16 +372,16 @@ class TestPlotCurve(_PlotWidgetTest):
self.plot.resetZoom()
-class TestPlotMarker(_PlotWidgetTest):
+class TestPlotMarker(PlotWidgetTestCase):
"""Basic tests for add*Marker"""
def setUp(self):
super(TestPlotMarker, self).setUp()
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
- self.plot.setXAxisAutoScale(False)
- self.plot.setYAxisAutoScale(False)
+ self.plot.getXAxis().setAutoScale(False)
+ self.plot.getYAxis().setAutoScale(False)
self.plot.setKeepDataAspectRatio(False)
self.plot.setLimits(0., 100., -100., 100.)
@@ -382,7 +447,7 @@ class TestPlotMarker(_PlotWidgetTest):
def testPlotMarkerWithoutLegend(self):
self.plot.setGraphTitle('Markers without legend')
- self.plot.setYAxisInverted(True)
+ self.plot.getYAxis().setInverted(True)
# Markers without legend
self.plot.addMarker(10, 10)
@@ -401,7 +466,7 @@ class TestPlotMarker(_PlotWidgetTest):
# TestPlotItem ################################################################
-class TestPlotItem(_PlotWidgetTest):
+class TestPlotItem(PlotWidgetTestCase):
"""Basic tests for addItem."""
# Polygon coordinates and color
@@ -431,10 +496,10 @@ class TestPlotItem(_PlotWidgetTest):
def setUp(self):
super(TestPlotItem, self).setUp()
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
- self.plot.setXAxisAutoScale(False)
- self.plot.setYAxisAutoScale(False)
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
+ self.plot.getXAxis().setAutoScale(False)
+ self.plot.getYAxis().setAutoScale(False)
self.plot.setKeepDataAspectRatio(False)
self.plot.setLimits(0., 100., -100., 100.)
@@ -475,102 +540,428 @@ class TestPlotItem(_PlotWidgetTest):
self.plot.resetZoom()
-class TestPlotActiveCurveImage(_PlotWidgetTest):
+class TestPlotActiveCurveImage(PlotWidgetTestCase):
"""Basic tests for active image handling"""
def testActiveCurveAndLabels(self):
# Active curve handling off, no label change
self.plot.setActiveCurveHandling(False)
- self.plot.setGraphXLabel('XLabel')
- self.plot.setGraphYLabel('YLabel')
+ self.plot.getXAxis().setLabel('XLabel')
+ self.plot.getYAxis().setLabel('YLabel')
self.plot.addCurve((1, 2), (1, 2))
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
self.plot.addCurve((1, 2), (2, 3), xlabel='x1', ylabel='y1')
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
self.plot.clear()
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
# Active curve handling on, label changes
self.plot.setActiveCurveHandling(True)
- self.plot.setGraphXLabel('XLabel')
- self.plot.setGraphYLabel('YLabel')
+ self.plot.getXAxis().setLabel('XLabel')
+ self.plot.getYAxis().setLabel('YLabel')
# labels changed as active curve
self.plot.addCurve((1, 2), (1, 2), legend='1',
xlabel='x1', ylabel='y1')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
# labels not changed as not active curve
self.plot.addCurve((1, 2), (2, 3), legend='2')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
# labels changed
self.plot.setActiveCurve('2')
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
self.plot.setActiveCurve('1')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
self.plot.clear()
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
def testActiveImageAndLabels(self):
# Active image handling always on, no API for toggling it
- self.plot.setGraphXLabel('XLabel')
- self.plot.setGraphYLabel('YLabel')
+ self.plot.getXAxis().setLabel('XLabel')
+ self.plot.getYAxis().setLabel('YLabel')
# labels changed as active curve
self.plot.addImage(numpy.arange(100).reshape(10, 10), replace=False,
legend='1', xlabel='x1', ylabel='y1')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
# labels not changed as not active curve
self.plot.addImage(numpy.arange(100).reshape(10, 10), replace=False,
legend='2')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
# labels changed
self.plot.setActiveImage('2')
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
self.plot.setActiveImage('1')
- self.assertEqual(self.plot.getGraphXLabel(), 'x1')
- self.assertEqual(self.plot.getGraphYLabel(), 'y1')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'x1')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'y1')
self.plot.clear()
- self.assertEqual(self.plot.getGraphXLabel(), 'XLabel')
- self.assertEqual(self.plot.getGraphYLabel(), 'YLabel')
+ self.assertEqual(self.plot.getXAxis().getLabel(), 'XLabel')
+ self.assertEqual(self.plot.getYAxis().getLabel(), 'YLabel')
##############################################################################
# Log
##############################################################################
-class TestPlotEmptyLog(_PlotWidgetTest):
+class TestPlotEmptyLog(PlotWidgetTestCase):
"""Basic tests for log plot"""
def testEmptyPlotTitleLabelsLog(self):
self.plot.setGraphTitle('Empty Log Log')
- self.plot.setGraphXLabel('X')
- self.plot.setGraphYLabel('Y')
+ self.plot.getXAxis().setLabel('X')
+ self.plot.getYAxis().setLabel('Y')
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
+ self.plot.resetZoom()
+
+
+class TestPlotAxes(TestCaseQt, ParametricTestCase):
+
+ # Test data
+ xData = numpy.arange(1, 10)
+ yData = xData ** 2
+
+ def setUp(self):
+ super(TestPlotAxes, self).setUp()
+ self.plot = PlotWidget()
+ # It is not needed to display the plot
+ # It saves a lot of time
+ # self.plot.show()
+ # self.qWaitForWindowExposed(self.plot)
+
+ def tearDown(self):
+ self.qapp.processEvents()
+ self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.plot.close()
+ del self.plot
+ super(TestPlotAxes, self).tearDown()
+
+ def testDefaultAxes(self):
+ axis = self.plot.getXAxis()
+ self.assertEqual(axis.getScale(), axis.LINEAR)
+ axis = self.plot.getYAxis()
+ self.assertEqual(axis.getScale(), axis.LINEAR)
+ axis = self.plot.getYAxis(axis="right")
+ self.assertEqual(axis.getScale(), axis.LINEAR)
+
+ def testOldPlotAxis_getterSetter(self):
+ """Test silx API prior to silx 0.6"""
+ x = self.plot.getXAxis()
+ y = self.plot.getYAxis()
+ p = self.plot
+
+ tests = [
+ # setters
+ (p.setGraphXLimits, (10, 20), x.getLimits, (10, 20)),
+ (p.setGraphYLimits, (10, 20), y.getLimits, (10, 20)),
+ (p.setGraphXLabel, "foox", x.getLabel, "foox"),
+ (p.setGraphYLabel, "fooy", y.getLabel, "fooy"),
+ (p.setYAxisInverted, True, y.isInverted, True),
+ (p.setXAxisLogarithmic, True, x.getScale, x.LOGARITHMIC),
+ (p.setYAxisLogarithmic, True, y.getScale, y.LOGARITHMIC),
+ (p.setXAxisAutoScale, False, x.isAutoScale, False),
+ (p.setYAxisAutoScale, False, y.isAutoScale, False),
+ # getters
+ (x.setLimits, (11, 20), p.getGraphXLimits, (11, 20)),
+ (y.setLimits, (11, 20), p.getGraphYLimits, (11, 20)),
+ (x.setLabel, "fooxx", p.getGraphXLabel, "fooxx"),
+ (y.setLabel, "fooyy", p.getGraphYLabel, "fooyy"),
+ (y.setInverted, False, p.isYAxisInverted, False),
+ (x.setScale, x.LINEAR, p.isXAxisLogarithmic, False),
+ (y.setScale, y.LINEAR, p.isYAxisLogarithmic, False),
+ (x.setAutoScale, True, p.isXAxisAutoScale, True),
+ (y.setAutoScale, True, p.isYAxisAutoScale, True),
+ ]
+ for testCase in tests:
+ setter, value, getter, expected = testCase
+ with self.subTest():
+ if setter is not None:
+ if not isinstance(value, tuple):
+ value = (value, )
+ setter(*value)
+ if getter is not None:
+ self.assertEqual(getter(), expected)
+
+ @utils.test_logging(deprecation.depreclog.name, warning=2)
+ def testOldPlotAxis_Logarithmic(self):
+ """Test silx API prior to silx 0.6"""
+ x = self.plot.getXAxis()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+
+ listener = SignalListener()
+ self.plot.sigSetXAxisLogarithmic.connect(listener.partial("x"))
+ self.plot.sigSetYAxisLogarithmic.connect(listener.partial("y"))
+
+ self.assertEqual(x.getScale(), x.LINEAR)
+ self.assertEqual(y.getScale(), x.LINEAR)
+ self.assertEqual(yright.getScale(), x.LINEAR)
+
self.plot.setXAxisLogarithmic(True)
+ self.assertEqual(x.getScale(), x.LOGARITHMIC)
+ self.assertEqual(y.getScale(), x.LINEAR)
+ self.assertEqual(yright.getScale(), x.LINEAR)
+ self.assertEqual(self.plot.isXAxisLogarithmic(), True)
+ self.assertEqual(self.plot.isYAxisLogarithmic(), False)
+ self.assertEqual(listener.arguments(callIndex=-1), ("x", True))
+
self.plot.setYAxisLogarithmic(True)
- self.plot.resetZoom()
+ self.assertEqual(x.getScale(), x.LOGARITHMIC)
+ self.assertEqual(y.getScale(), x.LOGARITHMIC)
+ self.assertEqual(yright.getScale(), x.LOGARITHMIC)
+ self.assertEqual(self.plot.isXAxisLogarithmic(), True)
+ self.assertEqual(self.plot.isYAxisLogarithmic(), True)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", True))
+
+ yright.setScale(yright.LINEAR)
+ self.assertEqual(x.getScale(), x.LOGARITHMIC)
+ self.assertEqual(y.getScale(), x.LINEAR)
+ self.assertEqual(yright.getScale(), x.LINEAR)
+ self.assertEqual(self.plot.isXAxisLogarithmic(), True)
+ self.assertEqual(self.plot.isYAxisLogarithmic(), False)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", False))
+
+ @utils.test_logging(deprecation.depreclog.name, warning=2)
+ def testOldPlotAxis_AutoScale(self):
+ """Test silx API prior to silx 0.6"""
+ x = self.plot.getXAxis()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+
+ listener = SignalListener()
+ self.plot.sigSetXAxisAutoScale.connect(listener.partial("x"))
+ self.plot.sigSetYAxisAutoScale.connect(listener.partial("y"))
+
+ self.assertEqual(x.isAutoScale(), True)
+ self.assertEqual(y.isAutoScale(), True)
+ self.assertEqual(yright.isAutoScale(), True)
+
+ self.plot.setXAxisAutoScale(False)
+ self.assertEqual(x.isAutoScale(), False)
+ self.assertEqual(y.isAutoScale(), True)
+ self.assertEqual(yright.isAutoScale(), True)
+ self.assertEqual(self.plot.isXAxisAutoScale(), False)
+ self.assertEqual(self.plot.isYAxisAutoScale(), True)
+ self.assertEqual(listener.arguments(callIndex=-1), ("x", False))
+
+ self.plot.setYAxisAutoScale(False)
+ self.assertEqual(x.isAutoScale(), False)
+ self.assertEqual(y.isAutoScale(), False)
+ self.assertEqual(yright.isAutoScale(), False)
+ self.assertEqual(self.plot.isXAxisAutoScale(), False)
+ self.assertEqual(self.plot.isYAxisAutoScale(), False)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", False))
+
+ yright.setAutoScale(True)
+ self.assertEqual(x.isAutoScale(), False)
+ self.assertEqual(y.isAutoScale(), True)
+ self.assertEqual(yright.isAutoScale(), True)
+ self.assertEqual(self.plot.isXAxisAutoScale(), False)
+ self.assertEqual(self.plot.isYAxisAutoScale(), True)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", True))
+
+ @utils.test_logging(deprecation.depreclog.name, warning=1)
+ def testOldPlotAxis_Inverted(self):
+ """Test silx API prior to silx 0.6"""
+ x = self.plot.getXAxis()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+
+ listener = SignalListener()
+ self.plot.sigSetYAxisInverted.connect(listener.partial("y"))
+
+ self.assertEqual(x.isInverted(), False)
+ self.assertEqual(y.isInverted(), False)
+ self.assertEqual(yright.isInverted(), False)
+
+ self.plot.setYAxisInverted(True)
+ self.assertEqual(x.isInverted(), False)
+ self.assertEqual(y.isInverted(), True)
+ self.assertEqual(yright.isInverted(), True)
+ self.assertEqual(self.plot.isYAxisInverted(), True)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", True))
+
+ yright.setInverted(False)
+ self.assertEqual(x.isInverted(), False)
+ self.assertEqual(y.isInverted(), False)
+ self.assertEqual(yright.isInverted(), False)
+ self.assertEqual(self.plot.isYAxisInverted(), False)
+ self.assertEqual(listener.arguments(callIndex=-1), ("y", False))
+
+ def testLogXWithData(self):
+ self.plot.setGraphTitle('Curve X: Log Y: Linear')
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=True,
+ color='green', linestyle="-", symbol='o')
+ axis = self.plot.getXAxis()
+ axis.setScale(axis.LOGARITHMIC)
+
+ self.assertEqual(axis.getScale(), axis.LOGARITHMIC)
+
+ def testLogYWithData(self):
+ self.plot.setGraphTitle('Curve X: Linear Y: Log')
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=True,
+ color='green', linestyle="-", symbol='o')
+ axis = self.plot.getYAxis()
+ axis.setScale(axis.LOGARITHMIC)
+ self.assertEqual(axis.getScale(), axis.LOGARITHMIC)
+ axis = self.plot.getYAxis(axis="right")
+ self.assertEqual(axis.getScale(), axis.LOGARITHMIC)
-class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
+ def testLogYRightWithData(self):
+ self.plot.setGraphTitle('Curve X: Linear Y: Log')
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=True,
+ color='green', linestyle="-", symbol='o')
+ axis = self.plot.getYAxis(axis="right")
+ axis.setScale(axis.LOGARITHMIC)
+
+ self.assertEqual(axis.getScale(), axis.LOGARITHMIC)
+ axis = self.plot.getYAxis()
+ self.assertEqual(axis.getScale(), axis.LOGARITHMIC)
+
+ def testLimitsChanged_setLimits(self):
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=False,
+ color='green', linestyle="-", symbol='o')
+ listener = SignalListener()
+ self.plot.getXAxis().sigLimitsChanged.connect(listener.partial(axis="x"))
+ self.plot.getYAxis().sigLimitsChanged.connect(listener.partial(axis="y"))
+ self.plot.getYAxis(axis="right").sigLimitsChanged.connect(listener.partial(axis="y2"))
+ self.plot.setLimits(0, 1, 0, 1, 0, 1)
+ # at least one event per axis
+ self.assertEquals(len(set(listener.karguments(argumentName="axis"))), 3)
+
+ def testLimitsChanged_resetZoom(self):
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=False,
+ color='green', linestyle="-", symbol='o')
+ listener = SignalListener()
+ self.plot.getXAxis().sigLimitsChanged.connect(listener.partial(axis="x"))
+ self.plot.getYAxis().sigLimitsChanged.connect(listener.partial(axis="y"))
+ self.plot.getYAxis(axis="right").sigLimitsChanged.connect(listener.partial(axis="y2"))
+ self.plot.resetZoom()
+ # at least one event per axis
+ self.assertEquals(len(set(listener.karguments(argumentName="axis"))), 3)
+
+ def testLimitsChanged_setXLimit(self):
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=False,
+ color='green', linestyle="-", symbol='o')
+ listener = SignalListener()
+ axis = self.plot.getXAxis()
+ axis.sigLimitsChanged.connect(listener)
+ axis.setLimits(20, 30)
+ # at least one event per axis
+ self.assertEquals(listener.arguments(callIndex=-1), (20.0, 30.0))
+ self.assertEquals(axis.getLimits(), (20.0, 30.0))
+
+ def testLimitsChanged_setYLimit(self):
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=False,
+ color='green', linestyle="-", symbol='o')
+ listener = SignalListener()
+ axis = self.plot.getYAxis()
+ axis.sigLimitsChanged.connect(listener)
+ axis.setLimits(20, 30)
+ # at least one event per axis
+ self.assertEquals(listener.arguments(callIndex=-1), (20.0, 30.0))
+ self.assertEquals(axis.getLimits(), (20.0, 30.0))
+
+ def testLimitsChanged_setYRightLimit(self):
+ self.plot.addCurve(self.xData, self.yData,
+ legend="curve",
+ replace=False, resetzoom=False,
+ color='green', linestyle="-", symbol='o')
+ listener = SignalListener()
+ axis = self.plot.getYAxis(axis="right")
+ axis.sigLimitsChanged.connect(listener)
+ axis.setLimits(20, 30)
+ # at least one event per axis
+ self.assertEquals(listener.arguments(callIndex=-1), (20.0, 30.0))
+ self.assertEquals(axis.getLimits(), (20.0, 30.0))
+
+ def testScaleProxy(self):
+ listener = SignalListener()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+ y.sigScaleChanged.connect(listener.partial("left"))
+ yright.sigScaleChanged.connect(listener.partial("right"))
+ yright.setScale(yright.LOGARITHMIC)
+
+ self.assertEquals(y.getScale(), y.LOGARITHMIC)
+ events = listener.arguments()
+ self.assertEquals(len(events), 2)
+ self.assertIn(("left", y.LOGARITHMIC), events)
+ self.assertIn(("right", y.LOGARITHMIC), events)
+
+ def testAutoScaleProxy(self):
+ listener = SignalListener()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+ y.sigAutoScaleChanged.connect(listener.partial("left"))
+ yright.sigAutoScaleChanged.connect(listener.partial("right"))
+ yright.setAutoScale(False)
+
+ self.assertEquals(y.isAutoScale(), False)
+ events = listener.arguments()
+ self.assertEquals(len(events), 2)
+ self.assertIn(("left", False), events)
+ self.assertIn(("right", False), events)
+
+ def testInvertedProxy(self):
+ listener = SignalListener()
+ y = self.plot.getYAxis()
+ yright = self.plot.getYAxis(axis="right")
+ y.sigInvertedChanged.connect(listener.partial("left"))
+ yright.sigInvertedChanged.connect(listener.partial("right"))
+ yright.setInverted(True)
+
+ self.assertEquals(y.isInverted(), True)
+ events = listener.arguments()
+ self.assertEquals(len(events), 2)
+ self.assertIn(("left", True), events)
+ self.assertIn(("right", True), events)
+
+ def testAxesDisplayedFalse(self):
+ """Test coverage on setAxesDisplayed(False)"""
+ self.plot.setAxesDisplayed(False)
+
+ def testAxesDisplayedTrue(self):
+ """Test coverage on setAxesDisplayed(True)"""
+ self.plot.setAxesDisplayed(True)
+
+
+class TestPlotCurveLog(PlotWidgetTestCase, ParametricTestCase):
"""Basic tests for addCurve with log scale axes"""
# Test data
@@ -578,12 +969,12 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
yData = xData ** 2
def _setLabels(self):
- self.plot.setGraphXLabel('X')
- self.plot.setGraphYLabel('X * X')
+ self.plot.getXAxis().setLabel('X')
+ self.plot.getYAxis().setLabel('X * X')
def testPlotCurveLogX(self):
self._setLabels()
- self.plot.setXAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
self.plot.setGraphTitle('Curve X: Log Y: Linear')
self.plot.addCurve(self.xData, self.yData,
@@ -593,7 +984,7 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
def testPlotCurveLogY(self):
self._setLabels()
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.plot.setGraphTitle('Curve X: Linear Y: Log')
@@ -604,8 +995,8 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
def testPlotCurveLogXY(self):
self._setLabels()
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.plot.setGraphTitle('Curve X: Log Y: Log')
@@ -615,8 +1006,8 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
color='green', linestyle="-", symbol='o')
def testPlotCurveErrorLogXY(self):
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
# Every second error leads to negative number
errors = numpy.ones_like(self.xData)
@@ -666,17 +1057,17 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
self.qapp.processEvents()
# no log axis
- xLim = self.plot.getGraphXLimits()
+ xLim = self.plot.getXAxis().getLimits()
self.assertEqual(xLim, (min(xData), max(xData)))
- yLim = self.plot.getGraphYLimits()
+ yLim = self.plot.getYAxis().getLimits()
self.assertEqual(yLim, (min(yData), max(yData)))
# x axis log
- self.plot.setXAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
self.qapp.processEvents()
- xLim = self.plot.getGraphXLimits()
- yLim = self.plot.getGraphYLimits()
+ xLim = self.plot.getXAxis().getLimits()
+ yLim = self.plot.getYAxis().getLimits()
positives = xData > 0
if numpy.any(positives):
self.assertTrue(numpy.allclose(
@@ -688,11 +1079,11 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
self.assertEqual(yLim, (1., 100.))
# x axis and y axis log
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.qapp.processEvents()
- xLim = self.plot.getGraphXLimits()
- yLim = self.plot.getGraphYLimits()
+ xLim = self.plot.getXAxis().getLimits()
+ yLim = self.plot.getYAxis().getLimits()
positives = numpy.logical_and(xData > 0, yData > 0)
if numpy.any(positives):
self.assertTrue(numpy.allclose(
@@ -704,11 +1095,11 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
self.assertEqual(yLim, (1., 100.))
# y axis log
- self.plot.setXAxisLogarithmic(False)
+ self.plot.getXAxis()._setLogarithmic(False)
self.qapp.processEvents()
- xLim = self.plot.getGraphXLimits()
- yLim = self.plot.getGraphYLimits()
+ xLim = self.plot.getXAxis().getLimits()
+ yLim = self.plot.getYAxis().getLimits()
positives = yData > 0
if numpy.any(positives):
self.assertEqual(
@@ -720,12 +1111,12 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
self.assertEqual(yLim, (1., 100.))
# no log axis
- self.plot.setYAxisLogarithmic(False)
+ self.plot.getYAxis()._setLogarithmic(False)
self.qapp.processEvents()
- xLim = self.plot.getGraphXLimits()
+ xLim = self.plot.getXAxis().getLimits()
self.assertEqual(xLim, (min(xData), max(xData)))
- yLim = self.plot.getGraphYLimits()
+ yLim = self.plot.getYAxis().getLimits()
self.assertEqual(yLim, (min(yData), max(yData)))
self.plot.clear()
@@ -733,52 +1124,58 @@ class TestPlotCurveLog(_PlotWidgetTest, ParametricTestCase):
self.qapp.processEvents()
-class TestPlotImageLog(_PlotWidgetTest):
+class TestPlotImageLog(PlotWidgetTestCase):
"""Basic tests for addImage with log scale axes."""
def setUp(self):
super(TestPlotImageLog, self).setUp()
- self.plot.setGraphXLabel('Columns')
- self.plot.setGraphYLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
+ self.plot.getYAxis().setLabel('Rows')
def testPlotColormapGrayLogX(self):
- self.plot.setXAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
self.plot.setGraphTitle('CMap X: Log Y: Linear')
- colormap = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1",
origin=(1., 1.), scale=(1., 1.),
replace=False, resetzoom=False, colormap=colormap)
self.plot.resetZoom()
def testPlotColormapGrayLogY(self):
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.plot.setGraphTitle('CMap X: Linear Y: Log')
- colormap = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1",
origin=(1., 1.), scale=(1., 1.),
replace=False, resetzoom=False, colormap=colormap)
self.plot.resetZoom()
def testPlotColormapGrayLogXY(self):
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.plot.setGraphTitle('CMap X: Log Y: Log')
- colormap = {'name': 'gray', 'normalization': 'linear',
- 'autoscale': True, 'vmin': 0.0, 'vmax': 1.0}
+ colormap = Colormap(name='gray',
+ normalization='linear',
+ vmin=None,
+ vmax=None)
self.plot.addImage(DATA_2D, legend="image 1",
origin=(1., 1.), scale=(1., 1.),
replace=False, resetzoom=False, colormap=colormap)
self.plot.resetZoom()
def testPlotRgbRgbaLogXY(self):
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
self.plot.setGraphTitle('RGB + RGBA X: Log Y: Log')
rgb = numpy.array(
@@ -801,7 +1198,7 @@ class TestPlotImageLog(_PlotWidgetTest):
self.plot.resetZoom()
-class TestPlotMarkerLog(_PlotWidgetTest):
+class TestPlotMarkerLog(PlotWidgetTestCase):
"""Basic tests for markers on log scales"""
# Test marker parameters
@@ -816,14 +1213,14 @@ class TestPlotMarkerLog(_PlotWidgetTest):
def setUp(self):
super(TestPlotMarkerLog, self).setUp()
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
- self.plot.setXAxisAutoScale(False)
- self.plot.setYAxisAutoScale(False)
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
+ self.plot.getXAxis().setAutoScale(False)
+ self.plot.getYAxis().setAutoScale(False)
self.plot.setKeepDataAspectRatio(False)
self.plot.setLimits(1., 100., 1., 1000.)
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
def testPlotMarkerXLog(self):
self.plot.setGraphTitle('Markers X, Log axes')
@@ -862,7 +1259,7 @@ class TestPlotMarkerLog(_PlotWidgetTest):
self.plot.resetZoom()
-class TestPlotItemLog(_PlotWidgetTest):
+class TestPlotItemLog(PlotWidgetTestCase):
"""Basic tests for items with log scale axes"""
# Polygon coordinates and color
@@ -892,14 +1289,14 @@ class TestPlotItemLog(_PlotWidgetTest):
def setUp(self):
super(TestPlotItemLog, self).setUp()
- self.plot.setGraphYLabel('Rows')
- self.plot.setGraphXLabel('Columns')
- self.plot.setXAxisAutoScale(False)
- self.plot.setYAxisAutoScale(False)
+ self.plot.getYAxis().setLabel('Rows')
+ self.plot.getXAxis().setLabel('Columns')
+ self.plot.getXAxis().setAutoScale(False)
+ self.plot.getYAxis().setAutoScale(False)
self.plot.setKeepDataAspectRatio(False)
self.plot.setLimits(1., 100., 1., 100.)
- self.plot.setXAxisLogarithmic(True)
- self.plot.setYAxisLogarithmic(True)
+ self.plot.getXAxis()._setLogarithmic(True)
+ self.plot.getYAxis()._setLogarithmic(True)
def testPlotItemPolygonLogFill(self):
self.plot.setGraphTitle('Item Fill Log')
@@ -940,26 +1337,18 @@ class TestPlotItemLog(_PlotWidgetTest):
def suite():
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotWidget))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotImage))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotCurve))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotMarker))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotItem))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotEmptyLog))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotCurveLog))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotImageLog))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotMarkerLog))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestPlotItemLog))
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestPlotWidget))
+ test_suite.addTest(loadTests(TestPlotImage))
+ test_suite.addTest(loadTests(TestPlotCurve))
+ test_suite.addTest(loadTests(TestPlotMarker))
+ test_suite.addTest(loadTests(TestPlotItem))
+ test_suite.addTest(loadTests(TestPlotAxes))
+ test_suite.addTest(loadTests(TestPlotEmptyLog))
+ test_suite.addTest(loadTests(TestPlotCurveLog))
+ test_suite.addTest(loadTests(TestPlotImageLog))
+ test_suite.addTest(loadTests(TestPlotMarkerLog))
+ test_suite.addTest(loadTests(TestPlotItemLog))
return test_suite
diff --git a/silx/gui/plot/test/testPlot.py b/silx/gui/plot/test/testPlotWidgetNoBackend.py
index 25e7511..3094a20 100644
--- a/silx/gui/plot/test/testPlot.py
+++ b/silx/gui/plot/test/testPlotWidgetNoBackend.py
@@ -22,11 +22,11 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""Basic tests for Plot"""
+"""Basic tests for PlotWidget with 'none' backend"""
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "27/06/2017"
import unittest
@@ -35,7 +35,7 @@ from silx.test.utils import ParametricTestCase
import numpy
-from silx.gui.plot.Plot import Plot
+from silx.gui.plot.PlotWidget import PlotWidget
from silx.gui.plot.items.histogram import _getHistogramCurve, _computeEdges
@@ -45,21 +45,21 @@ class TestPlot(unittest.TestCase):
def testPlotTitleLabels(self):
"""Create a Plot and set the labels"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
title, xlabel, ylabel = 'the title', 'x label', 'y label'
plot.setGraphTitle(title)
- plot.setGraphXLabel(xlabel)
- plot.setGraphYLabel(ylabel)
+ plot.getXAxis().setLabel(xlabel)
+ plot.getYAxis().setLabel(ylabel)
self.assertEqual(plot.getGraphTitle(), title)
- self.assertEqual(plot.getGraphXLabel(), xlabel)
- self.assertEqual(plot.getGraphYLabel(), ylabel)
+ self.assertEqual(plot.getXAxis().getLabel(), xlabel)
+ self.assertEqual(plot.getYAxis().getLabel(), ylabel)
def testAddNoRemove(self):
"""add objects to the Plot"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
plot.addCurve(x=(1, 2, 3), y=(3, 2, 1))
plot.addImage(numpy.arange(100.).reshape(10, -1))
plot.addItem(
@@ -96,7 +96,7 @@ class TestPlotRanges(ParametricTestCase):
def testDataRangeNoPlot(self):
"""empty plot data range"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
for logX, logY in ((False, False),
(True, False),
@@ -104,8 +104,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
self.assertIsNone(dataRange.x)
self.assertIsNone(dataRange.y)
@@ -114,7 +114,7 @@ class TestPlotRanges(ParametricTestCase):
def testDataRangeLeft(self):
"""left axis range"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
xData = numpy.arange(10) - 4.9 # range : -4.9 , 4.1
yData = numpy.arange(10) - 6.9 # range : -6.9 , 2.1
@@ -130,8 +130,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRange, yRange = self._getRanges([xData, yData],
[logX, logY])
@@ -142,7 +142,7 @@ class TestPlotRanges(ParametricTestCase):
def testDataRangeRight(self):
"""right axis range"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
xData = numpy.arange(10) - 4.9 # range : -4.9 , 4.1
yData = numpy.arange(10) - 6.9 # range : -6.9 , 2.1
plot.addCurve(x=xData,
@@ -156,8 +156,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRange, yRange = self._getRanges([xData, yData],
[logX, logY])
@@ -172,7 +172,7 @@ class TestPlotRanges(ParametricTestCase):
scale = (3., 8.)
image = numpy.arange(100.).reshape(20, 5)
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
plot.addImage(image,
origin=origin, scale=scale)
@@ -190,8 +190,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRange, yRange = ranges[logX, logY]
self.assertTrue(numpy.array_equal(dataRange.x, xRange),
@@ -203,7 +203,7 @@ class TestPlotRanges(ParametricTestCase):
def testDataRangeLeftRight(self):
"""right+left axis range"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
xData_l = numpy.arange(10) - 0.9 # range : -0.9 , 8.1
yData_l = numpy.arange(10) - 1.9 # range : -1.9 , 7.1
@@ -225,8 +225,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRangeL, yRangeL = self._getRanges([xData_l, yData_l],
[logX, logY])
@@ -244,7 +244,7 @@ class TestPlotRanges(ParametricTestCase):
# image sets x min and y max
# plot_left sets y min
# plot_right sets x max (and yright)
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
origin = (-10, 5)
scale = (3., 8.)
@@ -276,8 +276,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRangeL, yRangeL = self._getRanges([xData_l, yData_l],
[logX, logY])
@@ -301,7 +301,7 @@ class TestPlotRanges(ParametricTestCase):
scale = (-3., 8.)
image = numpy.arange(100.).reshape(20, 5)
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
plot.addImage(image,
origin=origin, scale=scale)
@@ -320,8 +320,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRange, yRange = ranges[logX, logY]
self.assertTrue(numpy.array_equal(dataRange.x, xRange),
@@ -337,7 +337,7 @@ class TestPlotRanges(ParametricTestCase):
scale = (3., -8.)
image = numpy.arange(100.).reshape(20, 5)
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
plot.addImage(image,
origin=origin, scale=scale)
@@ -356,8 +356,8 @@ class TestPlotRanges(ParametricTestCase):
(False, True),
(False, False)):
with self.subTest(logX=logX, logY=logY):
- plot.setXAxisLogarithmic(logX)
- plot.setYAxisLogarithmic(logY)
+ plot.getXAxis()._setLogarithmic(logX)
+ plot.getYAxis()._setLogarithmic(logY)
dataRange = plot.getDataRange()
xRange, yRange = ranges[logX, logY]
self.assertTrue(numpy.array_equal(dataRange.x, xRange),
@@ -368,7 +368,7 @@ class TestPlotRanges(ParametricTestCase):
def testDataRangeHiddenCurve(self):
"""curves with a hidden curve"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
plot.addCurve((0, 1), (0, 1), legend='shown')
plot.addCurve((0, 1, 2), (5, 5, 5), legend='hidden')
range1 = plot.getDataRange()
@@ -384,9 +384,9 @@ class TestPlotGetCurveImage(unittest.TestCase):
"""Test of plot getCurve and getImage methods"""
def testGetCurve(self):
- """Plot.getCurve and Plot.getActiveCurve tests"""
+ """PlotWidget.getCurve and Plot.getActiveCurve tests"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No curve
curve = plot.getCurve()
@@ -423,9 +423,9 @@ class TestPlotGetCurveImage(unittest.TestCase):
self.assertIsNone(curve)
def testGetCurveOldApi(self):
- """old API Plot.getCurve and Plot.getActiveCurve tests"""
+ """old API PlotWidget.getCurve and Plot.getActiveCurve tests"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No curve
curve = plot.getCurve()
@@ -433,7 +433,7 @@ class TestPlotGetCurveImage(unittest.TestCase):
plot.setActiveCurveHandling(True)
x = numpy.arange(10.).astype(numpy.float32)
- y = x * x;
+ y = x * x
plot.addCurve(x=x, y=y, legend='curve 0', info=["whatever"])
plot.addCurve(x=x, y=2*x, legend='curve 1', info="anything")
plot.setActiveCurve('curve 0')
@@ -449,12 +449,12 @@ class TestPlotGetCurveImage(unittest.TestCase):
self.assertEqual(legend, 'curve 1')
self.assertEqual(info, 'anything')
self.assertTrue(numpy.allclose(xOut, x), 'curve 1 wrong x data')
- self.assertTrue(numpy.allclose(yOut, 2*x), 'curve 1 wrong y data')
+ self.assertTrue(numpy.allclose(yOut, 2 * x), 'curve 1 wrong y data')
def testGetImage(self):
- """Plot.getImage and Plot.getActiveImage tests"""
+ """PlotWidget.getImage and PlotWidget.getActiveImage tests"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No image
image = plot.getImage()
@@ -485,9 +485,9 @@ class TestPlotGetCurveImage(unittest.TestCase):
self.assertEqual(image.getLegend(), 'image 1')
def testGetImageOldApi(self):
- """Plot.getImage and Plot.getActiveImage old API tests"""
+ """PlotWidget.getImage and PlotWidget.getActiveImage old API tests"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No image
image = plot.getImage()
@@ -505,9 +505,9 @@ class TestPlotGetCurveImage(unittest.TestCase):
self.assertTrue(numpy.allclose(data, image), "image 0 data not correct")
def testGetAllImages(self):
- """Plot.getAllImages test"""
+ """PlotWidget.getAllImages test"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No image
images = plot.getAllImages()
@@ -530,7 +530,7 @@ class TestPlotAddScatter(unittest.TestCase):
def testAddGetScatter(self):
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
# No curve
scatter = plot._getItem(kind="scatter")
@@ -565,9 +565,9 @@ class TestPlotAddScatter(unittest.TestCase):
self.assertEqual(scatter1.getLegend(), 'scatter 1')
def testGetAllScatters(self):
- """Plot.getAllImages test"""
+ """PlotWidget.getAllImages test"""
- plot = Plot(backend='none')
+ plot = PlotWidget(backend='none')
scatters = plot._getItems(kind='scatter')
self.assertEqual(len(scatters), 0)
diff --git a/silx/gui/plot/test/testPlotWindow.py b/silx/gui/plot/test/testPlotWindow.py
index 5afd53a..24d840b 100644
--- a/silx/gui/plot/test/testPlotWindow.py
+++ b/silx/gui/plot/test/testPlotWindow.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "27/06/2017"
import doctest
@@ -84,10 +84,10 @@ class TestPlotWindow(TestCaseQt):
self.plot.setLimits(1, 100, 1, 100)
checkList = [ # QAction, Plot state getter
- (self.plot.xAxisAutoScaleAction, self.plot.isXAxisAutoScale),
- (self.plot.yAxisAutoScaleAction, self.plot.isYAxisAutoScale),
- (self.plot.xAxisLogarithmicAction, self.plot.isXAxisLogarithmic),
- (self.plot.yAxisLogarithmicAction, self.plot.isYAxisLogarithmic),
+ (self.plot.xAxisAutoScaleAction, self.plot.getXAxis().isAutoScale),
+ (self.plot.yAxisAutoScaleAction, self.plot.getYAxis().isAutoScale),
+ (self.plot.xAxisLogarithmicAction, self.plot.getXAxis()._isLogarithmic),
+ (self.plot.yAxisLogarithmicAction, self.plot.getYAxis()._isLogarithmic),
(self.plot.gridAction, self.plot.getGraphGrid),
]
@@ -121,9 +121,9 @@ class TestPlotWindow(TestCaseQt):
def testToolYAxisOrigin(self):
self.plot.toolBar()
self.plot.yAxisInvertedButton.setYAxisUpward()
- self.assertFalse(self.plot.isYAxisInverted())
+ self.assertFalse(self.plot.getYAxis().isInverted())
self.plot.yAxisInvertedButton.setYAxisDownward()
- self.assertTrue(self.plot.isYAxisInverted())
+ self.assertTrue(self.plot.getYAxis().isInverted())
def suite():
diff --git a/silx/gui/plot/test/testScatterMaskToolsWidget.py b/silx/gui/plot/test/testScatterMaskToolsWidget.py
index 8b5f2ad..178274a 100644
--- a/silx/gui/plot/test/testScatterMaskToolsWidget.py
+++ b/silx/gui/plot/test/testScatterMaskToolsWidget.py
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "10/07/2017"
+__date__ = "01/09/2017"
import logging
@@ -37,8 +37,9 @@ import numpy
from silx.gui import qt
from silx.test.utils import temp_dir, ParametricTestCase
-from silx.gui.test.utils import TestCaseQt, getQToolButtonFromAction
+from silx.gui.test.utils import getQToolButtonFromAction
from silx.gui.plot import PlotWindow, ScatterMaskToolsWidget
+from .utils import PlotWidgetTestCase
try:
import fabio
@@ -46,34 +47,26 @@ except ImportError:
fabio = None
-logging.basicConfig()
_logger = logging.getLogger(__name__)
-class TestScatterMaskToolsWidget(TestCaseQt, ParametricTestCase):
+class TestScatterMaskToolsWidget(PlotWidgetTestCase, ParametricTestCase):
"""Basic test for MaskToolsWidget"""
+ def _createPlot(self):
+ return PlotWindow()
+
def setUp(self):
super(TestScatterMaskToolsWidget, self).setUp()
- self.plot = PlotWindow()
-
self.widget = ScatterMaskToolsWidget.ScatterMaskToolsDockWidget(
plot=self.plot, name='TEST')
self.plot.addDockWidget(qt.Qt.BottomDockWidgetArea, self.widget)
- self.plot.show()
- self.qWaitForWindowExposed(self.plot)
-
self.maskWidget = self.widget.widget()
def tearDown(self):
del self.maskWidget
del self.widget
-
- self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
- self.plot.close()
- del self.plot
-
super(TestScatterMaskToolsWidget, self).tearDown()
def testEmptyPlot(self):
@@ -86,7 +79,7 @@ class TestScatterMaskToolsWidget(TestCaseQt, ParametricTestCase):
def _drag(self):
"""Drag from plot center to offset position"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
xCenter, yCenter = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -100,7 +93,7 @@ class TestScatterMaskToolsWidget(TestCaseQt, ParametricTestCase):
def _drawPolygon(self):
"""Draw a star polygon in the plot"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
x, y = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -108,16 +101,17 @@ class TestScatterMaskToolsWidget(TestCaseQt, ParametricTestCase):
(x - offset, y - offset),
(x + offset, y),
(x - offset, y),
- (x + offset, y - offset)]
+ (x + offset, y - offset),
+ (x, y + offset)] # Close polygon
+ self.mouseMove(plot, pos=[0, 0])
for pos in star:
self.mouseMove(plot, pos=pos)
- btn = qt.Qt.LeftButton if pos != star[-1] else qt.Qt.RightButton
- self.mouseClick(plot, btn, pos=pos)
+ self.mouseClick(plot, qt.Qt.LeftButton, pos=pos)
def _drawPencil(self):
"""Draw a star polygon in the plot"""
- plot = self.plot.centralWidget()
+ plot = self.plot.getWidgetHandle()
x, y = plot.width() // 2, plot.height() // 2
offset = min(plot.width(), plot.height()) // 10
@@ -127,9 +121,10 @@ class TestScatterMaskToolsWidget(TestCaseQt, ParametricTestCase):
(x - offset, y),
(x + offset, y - offset)]
+ self.mouseMove(plot, pos=[0, 0])
self.mouseMove(plot, pos=star[0])
self.mousePress(plot, qt.Qt.LeftButton, pos=star[0])
- for pos in star:
+ for pos in star[1:]:
self.mouseMove(plot, pos=pos)
self.mouseRelease(
plot, qt.Qt.LeftButton, pos=star[-1])
diff --git a/silx/gui/plot/test/testStackView.py b/silx/gui/plot/test/testStackView.py
index 69584cd..8d2a0ee 100644
--- a/silx/gui/plot/test/testStackView.py
+++ b/silx/gui/plot/test/testStackView.py
@@ -130,7 +130,7 @@ class TestStackView(TestCaseQt):
self.assertEqual(self.stackview._perspective, 2,
"Perspective not set in setStack(..., perspective=2).")
- def testTitle(self):
+ def testDefaultTitle(self):
"""Test that the plot title contains the proper Z information"""
self.stackview.setStack(numpy.arange(24).reshape((4, 3, 2)),
calibrations=[(0, 1), (-10, 10), (3.14, 3.14)])
@@ -156,6 +156,37 @@ class TestStackView(TestCaseQt):
self.assertEqual(self.stackview._plot.getGraphTitle(),
"Image z=6.28")
+ def testCustomTitle(self):
+ """Test setting the plot title with a user defined callback"""
+ self.stackview.setStack(numpy.arange(24).reshape((4, 3, 2)),
+ calibrations=[(0, 1), (-10, 10), (3.14, 3.14)])
+
+ def title_callback(frame_idx):
+ return "Cubed index title %d" % (frame_idx**3)
+
+ self.stackview.setTitleCallback(title_callback)
+ self.assertEqual(self.stackview._plot.getGraphTitle(),
+ "Cubed index title 0")
+ self.stackview.setFrameNumber(2)
+ self.assertEqual(self.stackview._plot.getGraphTitle(),
+ "Cubed index title 8")
+
+ # perspective should not matter, only frame index
+ self.stackview._StackView__planeSelection.setPerspective(1)
+ self.stackview.setFrameNumber(0)
+ self.assertEqual(self.stackview._plot.getGraphTitle(),
+ "Cubed index title 0")
+ self.stackview.setFrameNumber(2)
+ self.assertEqual(self.stackview._plot.getGraphTitle(),
+ "Cubed index title 8")
+
+ with self.assertRaises(TypeError):
+ # setTitleCallback should not accept non-callable objects like strings
+ self.stackview.setTitleCallback(
+ "Là, vous faites sirop de vingt-et-un et vous dites : "
+ "beau sirop, mi-sirop, siroté, gagne-sirop, sirop-grelot,"
+ " passe-montagne, sirop au bon goût.")
+
class TestStackViewMainWindow(TestCaseQt):
"""Base class for tests of StackView."""
diff --git a/silx/gui/plot/test/testUtilsAxis.py b/silx/gui/plot/test/testUtilsAxis.py
new file mode 100644
index 0000000..6702b00
--- /dev/null
+++ b/silx/gui/plot/test/testUtilsAxis.py
@@ -0,0 +1,148 @@
+# 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.
+#
+# ###########################################################################*/
+"""Basic tests for PlotWidget"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "04/08/2017"
+
+
+import unittest
+from silx.gui.plot import PlotWidget
+from silx.gui.plot.utils.axis import SyncAxes
+
+
+class TestAxisSync(unittest.TestCase):
+ """Tests AxisSync class"""
+
+ def setUp(self):
+ self.plot1 = PlotWidget()
+ self.plot2 = PlotWidget()
+ self.plot3 = PlotWidget()
+
+ def tearDown(self):
+ self.plot1 = None
+ self.plot2 = None
+ self.plot3 = None
+
+ def testMoveFirstAxis(self):
+ """Test synchronization after construction"""
+ _sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+
+ self.plot1.getXAxis().setLimits(10, 500)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testMoveSecondAxis(self):
+ """Test synchronization after construction"""
+ _sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+
+ self.plot2.getXAxis().setLimits(10, 500)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testMoveTwoAxes(self):
+ """Test synchronization after construction"""
+ _sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+
+ self.plot1.getXAxis().setLimits(1, 50)
+ self.plot2.getXAxis().setLimits(10, 500)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testDestruction(self):
+ """Test synchronization when sync object is destroyed"""
+ sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ del sync
+
+ self.plot1.getXAxis().setLimits(10, 500)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertNotEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertNotEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testStop(self):
+ """Test synchronization after calling stop"""
+ sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ sync.stop()
+
+ self.plot1.getXAxis().setLimits(10, 500)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertNotEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertNotEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testStopMovingStart(self):
+ """Test synchronization after calling stop, moving an axis, then start again"""
+ sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ sync.stop()
+ self.plot1.getXAxis().setLimits(10, 500)
+ self.plot2.getXAxis().setLimits(1, 50)
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ sync.start()
+
+ # The first axis is the reference
+ self.assertEqual(self.plot1.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot2.getXAxis().getLimits(), (10, 500))
+ self.assertEqual(self.plot3.getXAxis().getLimits(), (10, 500))
+
+ def testDoubleStop(self):
+ """Test double stop"""
+ sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ sync.stop()
+ self.assertRaises(RuntimeError, sync.stop)
+
+ def testDoubleStart(self):
+ """Test double stop"""
+ sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ self.assertRaises(RuntimeError, sync.start)
+
+ def testScale(self):
+ """Test scale change"""
+ _sync = SyncAxes([self.plot1.getXAxis(), self.plot2.getXAxis(), self.plot3.getXAxis()])
+ self.plot1.getXAxis().setScale(self.plot1.getXAxis().LOGARITHMIC)
+ self.assertEqual(self.plot1.getXAxis().getScale(), self.plot1.getXAxis().LOGARITHMIC)
+ self.assertEqual(self.plot2.getXAxis().getScale(), self.plot1.getXAxis().LOGARITHMIC)
+ self.assertEqual(self.plot3.getXAxis().getScale(), self.plot1.getXAxis().LOGARITHMIC)
+
+ def testDirection(self):
+ """Test direction change"""
+ _sync = SyncAxes([self.plot1.getYAxis(), self.plot2.getYAxis(), self.plot3.getYAxis()])
+ self.plot1.getYAxis().setInverted(True)
+ self.assertEqual(self.plot1.getYAxis().isInverted(), True)
+ self.assertEqual(self.plot2.getYAxis().isInverted(), True)
+ self.assertEqual(self.plot3.getYAxis().isInverted(), True)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestAxisSync))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot/test/utils.py b/silx/gui/plot/test/utils.py
new file mode 100644
index 0000000..ef547c6
--- /dev/null
+++ b/silx/gui/plot/test/utils.py
@@ -0,0 +1,194 @@
+# 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.
+#
+# ###########################################################################*/
+"""Basic tests for PlotWidget"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "01/09/2017"
+
+
+import logging
+import contextlib
+
+from silx.gui.test.utils import TestCaseQt
+
+from silx.gui import qt
+from silx.gui.plot import PlotWidget
+from silx.gui.plot.backends.BackendMatplotlib import BackendMatplotlibQt
+
+
+logger = logging.getLogger(__name__)
+
+
+class PlotWidgetTestCase(TestCaseQt):
+ """Base class for tests of PlotWidget, not a TestCase in itself.
+
+ plot attribute is the PlotWidget created for the test.
+ """
+
+ def __init__(self, methodName='runTest'):
+ TestCaseQt.__init__(self, methodName=methodName)
+ self.__mousePos = None
+
+ def _createPlot(self):
+ return PlotWidget()
+
+ def setUp(self):
+ super(PlotWidgetTestCase, self).setUp()
+ self.plot = self._createPlot()
+ self.plot.show()
+ self.plotAlive = True
+ self.qWaitForWindowExposed(self.plot)
+ TestCaseQt.mouseClick(self, self.plot, button=qt.Qt.LeftButton, pos=(0, 0))
+
+ def __onPlotDestroyed(self):
+ self.plotAlive = False
+
+ def _waitForPlotClosed(self):
+ self.plot.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.plot.destroyed.connect(self.__onPlotDestroyed)
+ self.plot.close()
+ del self.plot
+ for _ in range(100):
+ if not self.plotAlive:
+ break
+ self.qWait(10)
+ else:
+ logger.error("Plot is still alive")
+
+ def tearDown(self):
+ self.qapp.processEvents()
+ self._waitForPlotClosed()
+ super(PlotWidgetTestCase, self).tearDown()
+
+ def _logMplEvents(self, event):
+ self.__mplEvents.append(event)
+
+ @contextlib.contextmanager
+ def _waitForMplEvent(self, plot, mplEventType):
+ """Check if an event was received by the MPL backend.
+
+ :param PlotWidget plot: A plot widget or a MPL plot backend
+ :param str mplEventType: MPL event type
+ :raises RuntimeError: When the event did not happen
+ """
+ self.__mplEvents = []
+ if isinstance(plot, BackendMatplotlibQt):
+ backend = plot
+ else:
+ backend = plot._backend
+
+ callbackId = backend.mpl_connect(mplEventType, self._logMplEvents)
+ received = False
+ yield
+ for _ in range(100):
+ if len(self.__mplEvents) > 0:
+ received = True
+ break
+ self.qWait(10)
+ backend.mpl_disconnect(callbackId)
+ del self.__mplEvents
+ if not received:
+ self.logScreenShot()
+ raise RuntimeError("MPL event %s expected but nothing received" % mplEventType)
+
+ def _haveMplEvent(self, widget, pos):
+ """Check if the widget at this position is a matplotlib widget."""
+ if isinstance(pos, qt.QPoint):
+ pass
+ else:
+ pos = qt.QPoint(pos[0], pos[1])
+ pos = widget.mapTo(widget.window(), pos)
+ target = widget.window().childAt(pos)
+
+ # Check if the target is a MPL container
+ backend = target
+ if hasattr(target, "_backend"):
+ backend = target._backend
+ haveEvent = isinstance(backend, BackendMatplotlibQt)
+ return haveEvent
+
+ def _patchPos(self, widget, pos):
+ """Return a real position relative to the widget.
+
+ If pos is None, the returned value is the center of the widget,
+ as the default behaviour of functions like QTest.mouseMove.
+ Else the position is returned as it is.
+ """
+ if pos is None:
+ pos = widget.size() / 2
+ pos = pos.width(), pos.height()
+ return pos
+
+ def _checkMouseMove(self, widget, pos):
+ """Returns true if the position differe from the current position of
+ the cursor"""
+ pos = qt.QPoint(pos[0], pos[1])
+ pos = widget.mapTo(widget.window(), pos)
+ willMove = pos != self.__mousePos
+ self.__mousePos = pos
+ return willMove
+
+ def mouseMove(self, widget, pos=None, delay=-1):
+ """Override TestCaseQt to wait while MPL did not reveive the expected
+ event"""
+ pos = self._patchPos(widget, pos)
+ willMove = self._checkMouseMove(widget, pos)
+ hadMplEvents = self._haveMplEvent(widget, self.__mousePos)
+ willHaveMplEvents = self._haveMplEvent(widget, pos)
+ if (not hadMplEvents and not willHaveMplEvents) or not willMove:
+ return TestCaseQt.mouseMove(self, widget, pos=pos, delay=delay)
+ with self._waitForMplEvent(widget, "motion_notify_event"):
+ TestCaseQt.mouseMove(self, widget, pos=pos, delay=delay)
+
+ def mouseClick(self, widget, button, modifier=None, pos=None, delay=-1):
+ """Override TestCaseQt to wait while MPL did not reveive the expected
+ event"""
+ pos = self._patchPos(widget, pos)
+ self._checkMouseMove(widget, pos)
+ if not self._haveMplEvent(widget, pos):
+ return TestCaseQt.mouseClick(self, widget, button, modifier=modifier, pos=pos, delay=delay)
+ with self._waitForMplEvent(widget, "button_release_event"):
+ TestCaseQt.mouseClick(self, widget, button, modifier=modifier, pos=pos, delay=delay)
+
+ def mousePress(self, widget, button, modifier=None, pos=None, delay=-1):
+ """Override TestCaseQt to wait while MPL did not reveive the expected
+ event"""
+ pos = self._patchPos(widget, pos)
+ self._checkMouseMove(widget, pos)
+ if not self._haveMplEvent(widget, pos):
+ return TestCaseQt.mousePress(self, widget, button, modifier=modifier, pos=pos, delay=delay)
+ with self._waitForMplEvent(widget, "button_press_event"):
+ TestCaseQt.mousePress(self, widget, button, modifier=modifier, pos=pos, delay=delay)
+
+ def mouseRelease(self, widget, button, modifier=None, pos=None, delay=-1):
+ """Override TestCaseQt to wait while MPL did not reveive the expected
+ event"""
+ pos = self._patchPos(widget, pos)
+ self._checkMouseMove(widget, pos)
+ if not self._haveMplEvent(widget, pos):
+ return TestCaseQt.mouseRelease(self, widget, button, modifier=modifier, pos=pos, delay=delay)
+ with self._waitForMplEvent(widget, "button_release_event"):
+ TestCaseQt.mouseRelease(self, widget, button, modifier=modifier, pos=pos, delay=delay)
diff --git a/silx/gui/plot/utils/__init__.py b/silx/gui/plot/utils/__init__.py
new file mode 100644
index 0000000..3187f6b
--- /dev/null
+++ b/silx/gui/plot/utils/__init__.py
@@ -0,0 +1,30 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Utils module for plot.
+"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "29/06/2017"
diff --git a/silx/gui/plot/utils/axis.py b/silx/gui/plot/utils/axis.py
new file mode 100644
index 0000000..f7ec711
--- /dev/null
+++ b/silx/gui/plot/utils/axis.py
@@ -0,0 +1,164 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module contains utils class for axes management.
+"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "04/08/2017"
+
+import functools
+import logging
+from contextlib import contextmanager
+from silx.utils import weakref
+
+_logger = logging.getLogger(__name__)
+
+
+class SyncAxes(object):
+ """Synchronize a set of plot axes together.
+
+ It is created with the expected axes and starts to synchronize them.
+
+ It can be customized to synchronize limits, scale, and direction of axes
+ together. By default everything is synchronized.
+
+ The API :meth:`start` and :meth:`stop` can be used to enable/disable the
+ synchronization while this object is still alive.
+
+ If this object is destroyed the synchronization stop.
+
+ .. versionadded:: 0.6
+ """
+
+ def __init__(self, axes, syncLimits=True, syncScale=True, syncDirection=True):
+ """
+ Constructor
+
+ :param list(Axis) axes: A list of axes to synchronize together
+ :param bool syncLimits: Synchronize axes limits
+ :param bool syncScale: Synchronize axes scale
+ :param bool syncDirection: Synchronize axes direction
+ """
+ object.__init__(self)
+ self.__axes = []
+ self.__locked = False
+ self.__syncLimits = syncLimits
+ self.__syncScale = syncScale
+ self.__syncDirection = syncDirection
+ self.__callbacks = []
+
+ self.__axes.extend(axes)
+ self.start()
+
+ def start(self):
+ """Start synchronizing axes together.
+
+ The first axis is used as the reference for the first synchronization.
+ After that, any changes to any axes will be used to synchronize other
+ axes.
+ """
+ if len(self.__callbacks) != 0:
+ raise RuntimeError("Axes already synchronized")
+
+ # register callback for further sync
+ for axis in self.__axes:
+ if self.__syncLimits:
+ # the weakref is needed to be able ignore self references
+ callback = weakref.WeakMethodProxy(self.__axisLimitsChanged)
+ callback = functools.partial(callback, axis)
+ sig = axis.sigLimitsChanged
+ sig.connect(callback)
+ self.__callbacks.append((sig, callback))
+ if self.__syncScale:
+ # the weakref is needed to be able ignore self references
+ callback = weakref.WeakMethodProxy(self.__axisScaleChanged)
+ callback = functools.partial(callback, axis)
+ sig = axis.sigScaleChanged
+ sig.connect(callback)
+ self.__callbacks.append((sig, callback))
+ if self.__syncDirection:
+ # the weakref is needed to be able ignore self references
+ callback = weakref.WeakMethodProxy(self.__axisInvertedChanged)
+ callback = functools.partial(callback, axis)
+ sig = axis.sigInvertedChanged
+ sig.connect(callback)
+ self.__callbacks.append((sig, callback))
+
+ # sync the current state
+ mainAxis = self.__axes[0]
+ if self.__syncLimits:
+ self.__axisLimitsChanged(mainAxis, *mainAxis.getLimits())
+ if self.__syncScale:
+ self.__axisScaleChanged(mainAxis, mainAxis.getScale())
+ if self.__syncDirection:
+ self.__axisInvertedChanged(mainAxis, mainAxis.isInverted())
+
+ def stop(self):
+ """Stop the synchronization of the axes"""
+ if len(self.__callbacks) == 0:
+ raise RuntimeError("Axes not synchronized")
+ for sig, callback in self.__callbacks:
+ sig.disconnect(callback)
+ self.__callbacks = []
+
+ def __del__(self):
+ """Destructor"""
+ # clean up references
+ if len(self.__callbacks) != 0:
+ self.stop()
+
+ @contextmanager
+ def __inhibitSignals(self):
+ self.__locked = True
+ yield
+ self.__locked = False
+
+ def __otherAxes(self, changedAxis):
+ for axis in self.__axes:
+ if axis is changedAxis:
+ continue
+ yield axis
+
+ def __axisLimitsChanged(self, changedAxis, vmin, vmax):
+ if self.__locked:
+ return
+ with self.__inhibitSignals():
+ for axis in self.__otherAxes(changedAxis):
+ axis.setLimits(vmin, vmax)
+
+ def __axisScaleChanged(self, changedAxis, scale):
+ if self.__locked:
+ return
+ with self.__inhibitSignals():
+ for axis in self.__otherAxes(changedAxis):
+ axis.setScale(scale)
+
+ def __axisInvertedChanged(self, changedAxis, isInverted):
+ if self.__locked:
+ return
+ with self.__inhibitSignals():
+ for axis in self.__otherAxes(changedAxis):
+ axis.setInverted(isInverted)
diff --git a/silx/gui/plot3d/Plot3DWidget.py b/silx/gui/plot3d/Plot3DWidget.py
index 9c9da0c..aae3955 100644
--- a/silx/gui/plot3d/Plot3DWidget.py
+++ b/silx/gui/plot3d/Plot3DWidget.py
@@ -35,10 +35,10 @@ import logging
from silx.gui import qt
from silx.gui.plot.Colors import rgba
-from silx.gui.plot3d import Plot3DActions
+from . import actions
from .._utils import convertArrayToQImage
-from .._glutils import gl
+from .. import _glutils as glu
from .scene import interaction, primitives, transform
from . import scene
@@ -79,31 +79,29 @@ class _OverviewViewport(scene.Viewport):
source.extrinsic.direction, source.extrinsic.up)
-class Plot3DWidget(qt.QGLWidget):
- """QGLWidget with a 3D viewport and an overview."""
+class Plot3DWidget(glu.OpenGLWidget):
+ """OpenGL widget with a 3D viewport and an overview."""
- def __init__(self, parent=None):
- if not qt.QGLFormat.hasOpenGL(): # Check if any OpenGL is available
- raise RuntimeError(
- 'OpenGL is not available on this platform: 3D disabled')
+ sigInteractiveModeChanged = qt.Signal()
+ """Signal emitted when the interactive mode has changed
+ """
- self._devicePixelRatio = 1.0 # Store GL canvas/QWidget ratio
- self._isOpenGL21 = False
+ def __init__(self, parent=None, f=qt.Qt.WindowFlags()):
self._firstRender = True
- format_ = qt.QGLFormat()
- format_.setRgba(True)
- format_.setDepth(False)
- format_.setStencil(False)
- format_.setVersion(2, 1)
- format_.setDoubleBuffer(True)
+ super(Plot3DWidget, self).__init__(
+ parent,
+ alphaBufferSize=8,
+ depthBufferSize=0,
+ stencilBufferSize=0,
+ version=(2, 1),
+ f=f)
- super(Plot3DWidget, self).__init__(format_, parent)
self.setAutoFillBackground(False)
self.setMouseTracking(True)
self.setFocusPolicy(qt.Qt.StrongFocus)
- self._copyAction = Plot3DActions.CopyAction(parent=self, plot3d=self)
+ self._copyAction = actions.io.CopyAction(parent=self, plot3d=self)
self.addAction(self._copyAction)
self._updating = False # True if an update is requested
@@ -112,8 +110,8 @@ class Plot3DWidget(qt.QGLWidget):
self.viewport = scene.Viewport()
self.viewport.background = 0.2, 0.2, 0.2, 1.
- sceneScale = transform.Scale(1., 1., 1.)
- self.viewport.scene.transforms = [sceneScale,
+ self._sceneScale = transform.Scale(1., 1., 1.)
+ self.viewport.scene.transforms = [self._sceneScale,
transform.Translate(0., 0., 0.)]
# Overview area
@@ -122,15 +120,56 @@ class Plot3DWidget(qt.QGLWidget):
self.setBackgroundColor((0.2, 0.2, 0.2, 1.))
# Window describing on screen area to render
- self.window = scene.Window(mode='framebuffer')
- self.window.viewports = [self.viewport, self.overview]
+ self._window = scene.Window(mode='framebuffer')
+ self._window.viewports = [self.viewport, self.overview]
+ self._window.addListener(self._redraw)
+
+ self.eventHandler = None
+ self.setInteractiveMode('rotate')
+
+ def setInteractiveMode(self, mode):
+ """Set the interactive mode.
+
+ :param str mode: The interactive mode: 'rotate', 'pan' or None
+ """
+ if mode == self.getInteractiveMode():
+ return
+
+ if mode is None:
+ self.eventHandler = None
+
+ elif mode == 'rotate':
+ self.eventHandler = interaction.RotateCameraControl(
+ self.viewport,
+ orbitAroundCenter=False,
+ mode='position',
+ scaleTransform=self._sceneScale)
+
+ elif mode == 'pan':
+ self.eventHandler = interaction.PanCameraControl(
+ self.viewport,
+ mode='position',
+ scaleTransform=self._sceneScale,
+ selectCB=None)
+
+ else:
+ raise ValueError('Unsupported interactive mode %s', str(mode))
+
+ self.sigInteractiveModeChanged.emit()
- self.eventHandler = interaction.CameraControl(
- self.viewport, orbitAroundCenter=False,
- mode='position', scaleTransform=sceneScale,
- selectCB=None)
+ def getInteractiveMode(self):
+ """Returns the interactive mode in use.
- self.viewport.addListener(self._redraw)
+ :rtype: str
+ """
+ if self.eventHandler is None:
+ return None
+ if isinstance(self.eventHandler, interaction.RotateCameraControl):
+ return 'rotate'
+ elif isinstance(self.eventHandler, interaction.PanCameraControl):
+ return 'pan'
+ else:
+ return None
def setProjection(self, projection):
"""Change the projection in use.
@@ -176,6 +215,25 @@ class Plot3DWidget(qt.QGLWidget):
"""Returns the RGBA background color (QColor)."""
return qt.QColor.fromRgbF(*self.viewport.background)
+ def isOrientationIndicatorVisible(self):
+ """Returns True if the orientation indicator is displayed.
+
+ :rtype: bool
+ """
+ return self.overview in self._window.viewports
+
+ def setOrientationIndicatorVisible(self, visible):
+ """Set the orientation indicator visibility.
+
+ :param bool visible: True to show
+ """
+ visible = bool(visible)
+ if visible != self.isOrientationIndicatorVisible():
+ if visible:
+ self._window.viewports = [self.viewport, self.overview]
+ else:
+ self._window.viewports = [self.viewport]
+
def centerScene(self):
"""Position the center of the scene at the center of rotation."""
self.viewport.resetCamera()
@@ -192,7 +250,7 @@ class Plot3DWidget(qt.QGLWidget):
def _redraw(self, source=None):
"""Viewport listener to require repaint"""
- if not self._updating and self.viewport.dirty:
+ if not self._updating:
self._updating = True # Mark that an update is requested
self.update() # Queued repaint (i.e., asynchronous)
@@ -200,52 +258,18 @@ class Plot3DWidget(qt.QGLWidget):
return qt.QSize(400, 300)
def initializeGL(self):
- # Check if OpenGL2 is available
- versionflags = self.format().openGLVersionFlags()
- self._isOpenGL21 = bool(versionflags & qt.QGLFormat.OpenGL_Version_2_1)
- if not self._isOpenGL21:
- _logger.error(
- '3D rendering is disabled: OpenGL 2.1 not available')
-
- messageBox = qt.QMessageBox(parent=self)
- messageBox.setIcon(qt.QMessageBox.Critical)
- messageBox.setWindowTitle('Error')
- messageBox.setText('3D rendering is disabled.\n\n'
- 'Reason: OpenGL 2.1 is not available.')
- messageBox.addButton(qt.QMessageBox.Ok)
- messageBox.setWindowModality(qt.Qt.WindowModal)
- messageBox.setAttribute(qt.Qt.WA_DeleteOnClose)
- messageBox.show()
+ pass
def paintGL(self):
# In case paintGL is called by the system and not through _redraw,
# Mark as updating.
self._updating = True
- if hasattr(self, 'windowHandle'): # Qt 5
- devicePixelRatio = self.windowHandle().devicePixelRatio()
- if devicePixelRatio != self._devicePixelRatio:
- # Move window from one screen to another one
- self._devicePixelRatio = devicePixelRatio
- # Resize might not be called, so call it explicitly
- self.resizeGL(int(self.width() * devicePixelRatio),
- int(self.height() * devicePixelRatio))
-
- if not self._isOpenGL21:
- # Cannot render scene, just clear the color buffer.
- ox, oy = self.viewport.origin
- w, h = self.viewport.size
- gl.glViewport(ox, oy, w, h)
+ # Update near and far planes only if viewport needs refresh
+ if self.viewport.dirty:
+ self.viewport.adjustCameraDepthExtent()
- gl.glClearColor(*self.viewport.background)
- gl.glClear(gl.GL_COLOR_BUFFER_BIT)
-
- else:
- # Update near and far planes only if viewport needs refresh
- if self.viewport.dirty:
- self.viewport.adjustCameraDepthExtent()
-
- self.window.render(self.context(), self._devicePixelRatio)
+ self._window.render(self.context(), self.getDevicePixelRatio())
if self._firstRender: # TODO remove this ugly hack
self._firstRender = False
@@ -253,8 +277,10 @@ class Plot3DWidget(qt.QGLWidget):
self._updating = False
def resizeGL(self, width, height):
- self.window.size = width, height
- self.viewport.size = width, height
+ width *= self.getDevicePixelRatio()
+ height *= self.getDevicePixelRatio()
+ self._window.size = width, height
+ self.viewport.size = self._window.size
overviewWidth, overviewHeight = self.overview.size
self.overview.origin = width - overviewWidth, height - overviewHeight
@@ -264,27 +290,27 @@ class Plot3DWidget(qt.QGLWidget):
:returns: OpenGL scene RGB rasterization
:rtype: QImage
"""
- if not self._isOpenGL21:
+ if not self.isValid():
_logger.error('OpenGL 2.1 not available, cannot save OpenGL image')
- height, width = self.window.shape
+ height, width = self._window.shape
image = numpy.zeros((height, width, 3), dtype=numpy.uint8)
else:
self.makeCurrent()
- image = self.window.grab(qt.QGLContext.currentContext())
+ image = self._window.grab(self.context())
return convertArrayToQImage(image)
def wheelEvent(self, event):
- xpixel = event.x() * self._devicePixelRatio
- ypixel = event.y() * self._devicePixelRatio
+ xpixel = event.x() * self.getDevicePixelRatio()
+ ypixel = event.y() * self.getDevicePixelRatio()
if hasattr(event, 'delta'): # Qt4
angle = event.delta() / 8.
else: # Qt5
angle = event.angleDelta().y() / 8.
event.accept()
- if angle != 0:
+ if self.eventHandler is not None and angle != 0 and self.isValid():
self.makeCurrent()
self.eventHandler.handleEvent('wheel', xpixel, ypixel, angle)
@@ -315,27 +341,30 @@ class Plot3DWidget(qt.QGLWidget):
_MOUSE_BTNS = {1: 'left', 2: 'right', 4: 'middle'}
def mousePressEvent(self, event):
- xpixel = event.x() * self._devicePixelRatio
- ypixel = event.y() * self._devicePixelRatio
+ xpixel = event.x() * self.getDevicePixelRatio()
+ ypixel = event.y() * self.getDevicePixelRatio()
btn = self._MOUSE_BTNS[event.button()]
event.accept()
- self.makeCurrent()
- self.eventHandler.handleEvent('press', xpixel, ypixel, btn)
+ if self.eventHandler is not None and self.isValid():
+ self.makeCurrent()
+ self.eventHandler.handleEvent('press', xpixel, ypixel, btn)
def mouseMoveEvent(self, event):
- xpixel = event.x() * self._devicePixelRatio
- ypixel = event.y() * self._devicePixelRatio
+ xpixel = event.x() * self.getDevicePixelRatio()
+ ypixel = event.y() * self.getDevicePixelRatio()
event.accept()
- self.makeCurrent()
- self.eventHandler.handleEvent('move', xpixel, ypixel)
+ if self.eventHandler is not None and self.isValid():
+ self.makeCurrent()
+ self.eventHandler.handleEvent('move', xpixel, ypixel)
def mouseReleaseEvent(self, event):
- xpixel = event.x() * self._devicePixelRatio
- ypixel = event.y() * self._devicePixelRatio
+ xpixel = event.x() * self.getDevicePixelRatio()
+ ypixel = event.y() * self.getDevicePixelRatio()
btn = self._MOUSE_BTNS[event.button()]
event.accept()
- self.makeCurrent()
- self.eventHandler.handleEvent('release', xpixel, ypixel, btn)
+ if self.eventHandler is not None and self.isValid():
+ self.makeCurrent()
+ self.eventHandler.handleEvent('release', xpixel, ypixel, btn)
diff --git a/silx/gui/plot3d/Plot3DWindow.py b/silx/gui/plot3d/Plot3DWindow.py
index 4658d38..1bc2738 100644
--- a/silx/gui/plot3d/Plot3DWindow.py
+++ b/silx/gui/plot3d/Plot3DWindow.py
@@ -34,13 +34,13 @@ __date__ = "26/01/2017"
from silx.gui import qt
-from .Plot3DToolBar import Plot3DToolBar
from .Plot3DWidget import Plot3DWidget
-from .ViewpointToolBar import ViewpointToolBar
+from .tools import OutputToolBar, InteractiveModeToolBar
+from .tools import ViewpointToolButton
class Plot3DWindow(qt.QMainWindow):
- """QGLWidget with a 3D viewport and an overview."""
+ """OpenGL widget with a 3D viewport and an overview."""
def __init__(self, parent=None):
super(Plot3DWindow, self).__init__(parent)
@@ -50,9 +50,17 @@ class Plot3DWindow(qt.QMainWindow):
self._plot3D = Plot3DWidget()
self.setCentralWidget(self._plot3D)
- self.addToolBar(
- ViewpointToolBar(parent=self, plot3D=self._plot3D))
- toolbar = Plot3DToolBar(parent=self)
+
+ toolbar = InteractiveModeToolBar(parent=self)
+ toolbar.setPlot3DWidget(self._plot3D)
+ self.addToolBar(toolbar)
+ self.addActions(toolbar.actions())
+
+ toolbar = qt.QToolBar(self)
+ toolbar.addWidget(ViewpointToolButton(plot3D=self._plot3D))
+ self.addToolBar(toolbar)
+
+ toolbar = OutputToolBar(parent=self)
toolbar.setPlot3DWidget(self._plot3D)
self.addToolBar(toolbar)
self.addActions(toolbar.actions())
diff --git a/silx/gui/plot3d/SFViewParamTree.py b/silx/gui/plot3d/SFViewParamTree.py
index 38d4e37..8b144df 100644
--- a/silx/gui/plot3d/SFViewParamTree.py
+++ b/silx/gui/plot3d/SFViewParamTree.py
@@ -30,15 +30,18 @@ from __future__ import absolute_import
__authors__ = ["D. N."]
__license__ = "MIT"
-__date__ = "10/01/2017"
+__date__ = "02/10/2017"
import logging
import sys
+import weakref
import numpy
from silx.gui import qt
from silx.gui.icons import getQIcon
+from silx.gui.plot.Colormap import Colormap
+from silx.gui.widgets.FloatEdit import FloatEdit
from .ScalarFieldView import Isosurface
@@ -111,14 +114,20 @@ class SubjectItem(qt.QStandardItem):
value = setValue
super(SubjectItem, self).setData(value, role)
- subject = property(lambda self: self.__subject)
+ @property
+ def subject(self):
+ """The subject this item is observing"""
+ return None if self.__subject is None else self.__subject()
@subject.setter
def subject(self, subject):
if self.__subject is not None:
raise ValueError('Subject already set '
' (subject change not supported).')
- self.__subject = subject
+ if subject is None:
+ self.__subject = None
+ else:
+ self.__subject = weakref.ref(subject)
if subject is not None:
self._init()
self._connectSignals()
@@ -343,6 +352,44 @@ class HighlightColorItem(ColorItem):
return self.subject.getHighlightColor()
+class BoundingBoxItem(SubjectItem):
+ """Bounding box, axes labels and grid visibility item.
+
+ Item is checkable.
+ """
+ itemName = 'Bounding Box'
+
+ def _init(self):
+ visible = self.subject.isBoundingBoxVisible()
+ self.setCheckable(True)
+ self.setCheckState(qt.Qt.Checked if visible else qt.Qt.Unchecked)
+
+ def leftClicked(self):
+ checked = (self.checkState() == qt.Qt.Checked)
+ if checked != self.subject.isBoundingBoxVisible():
+ self.subject.setBoundingBoxVisible(checked)
+
+
+class OrientationIndicatorItem(SubjectItem):
+ """Orientation indicator visibility item.
+
+ Item is checkable.
+ """
+ itemName = 'Axes indicator'
+
+ def _init(self):
+ plot3d = self.subject.getPlot3DWidget()
+ visible = plot3d.isOrientationIndicatorVisible()
+ self.setCheckable(True)
+ self.setCheckState(qt.Qt.Checked if visible else qt.Qt.Unchecked)
+
+ def leftClicked(self):
+ plot3d = self.subject.getPlot3DWidget()
+ checked = (self.checkState() == qt.Qt.Checked)
+ if checked != plot3d.isOrientationIndicatorVisible():
+ plot3d.setOrientationIndicatorVisible(checked)
+
+
class ViewSettingsItem(qt.QStandardItem):
"""Viewport settings"""
@@ -352,7 +399,9 @@ class ViewSettingsItem(qt.QStandardItem):
self.setEditable(False)
- classes = BackgroundColorItem, ForegroundColorItem, HighlightColorItem
+ classes = (BackgroundColorItem, ForegroundColorItem,
+ HighlightColorItem,
+ BoundingBoxItem, OrientationIndicatorItem)
for cls in classes:
titleItem = qt.QStandardItem(cls.itemName)
titleItem.setEditable(False)
@@ -534,8 +583,8 @@ class _IsoLevelSlider(qt.QSlider):
"""Set slider from iso-surface level"""
dataRange = self.subject.parent().getDataRange()
- if dataRange is not None and None not in dataRange:
- width = dataRange[1] - dataRange[0]
+ if dataRange is not None:
+ width = dataRange[-1] - dataRange[0]
if width > 0:
sliderWidth = self.maximum() - self.minimum()
sliderPosition = sliderWidth * (level - dataRange[0]) / width
@@ -548,10 +597,12 @@ class _IsoLevelSlider(qt.QSlider):
def __sliderReleased(self):
value = self.value()
dataRange = self.subject.parent().getDataRange()
- width = dataRange[1] - dataRange[0]
- sliderWidth = self.maximum() - self.minimum()
- level = dataRange[0] + width * value / sliderWidth
- self.subject.setLevel(level)
+ if dataRange is not None:
+ min_, _, max_ = dataRange
+ width = max_ - min_
+ sliderWidth = self.maximum() - self.minimum()
+ level = min_ + width * value / sliderWidth
+ self.subject.setLevel(level)
class IsoSurfaceLevelSlider(IsoSurfaceLevelItem):
@@ -771,7 +822,8 @@ class IsoSurfaceAddRemoveWidget(qt.QWidget):
if dataRange is None:
dataRange = [0, 1]
- sfview.addIsosurface(numpy.mean(dataRange), '#0000FF')
+ sfview.addIsosurface(
+ numpy.mean((dataRange[0], dataRange[-1])), '#0000FF')
def __removeClicked(self):
self.sigViewTask.emit('remove_iso')
@@ -867,30 +919,24 @@ class PlaneMinRangeItem(ColormapBase):
self._setVMin(value)
def _setVMin(self, value):
- cutPlane = self.subject.getCutPlanes()[0]
- colormap = cutPlane.getColormap()
+ colormap = self.subject.getCutPlanes()[0].getColormap()
vMin = value
vMax = colormap.getVMax()
if vMax is not None and value > vMax:
vMin = vMax
vMax = value
- cutPlane.setColormap(name=colormap.getName(),
- norm=colormap.getNorm(),
- vmin=vMin,
- vmax=vMax)
+ colormap.setVRange(vMin, vMax)
def getEditor(self, parent, option, index):
- editor = qt.QLineEdit(parent)
- editor.setValidator(qt.QDoubleValidator())
- return editor
+ return FloatEdit(parent)
def setEditorData(self, editor):
- editor.setText(str(self._pullData()))
+ editor.setValue(self._pullData())
return True
def _setModelData(self, editor):
- value = float(editor.text())
+ value = editor.value()
self._setVMin(value)
return True
@@ -910,29 +956,23 @@ class PlaneMaxRangeItem(ColormapBase):
return self.subject.getCutPlanes()[0].getColormap().getVMax()
def _setVMax(self, value):
- cutPlane = self.subject.getCutPlanes()[0]
- colormap = cutPlane.getColormap()
+ colormap = self.subject.getCutPlanes()[0].getColormap()
vMin = colormap.getVMin()
vMax = value
if vMin is not None and value < vMin:
vMax = vMin
vMin = value
- cutPlane.setColormap(name=colormap.getName(),
- norm=colormap.getNorm(),
- vmin=vMin,
- vmax=vMax)
+ colormap.setVRange(vMin, vMax)
def getEditor(self, parent, option, index):
- editor = qt.QLineEdit(parent)
- editor.setValidator(qt.QDoubleValidator())
- return editor
+ return FloatEdit(parent)
def setEditorData(self, editor):
editor.setText(str(self._pullData()))
return True
def _setModelData(self, editor):
- value = float(editor.text())
+ value = editor.value()
self._setVMax(value)
return True
@@ -1028,7 +1068,8 @@ class PlaneColormapItem(ColormapBase):
listValues = ['gray', 'reversed gray',
'temperature', 'red',
- 'green', 'blue']
+ 'green', 'blue',
+ 'viridis', 'magma', 'inferno', 'plasma']
def getEditor(self, parent, option, index):
editor = qt.QComboBox(parent)
@@ -1038,17 +1079,18 @@ class PlaneColormapItem(ColormapBase):
return editor
def __editorChanged(self, index):
- colorMapName = self.listValues[index]
- colorMap = self.subject.getCutPlanes()[0].getColormap()
- self.subject.getCutPlanes()[0].setColormap(name=colorMapName,
- norm=colorMap.getNorm(),
- vmin=colorMap.getVMin(),
- vmax=colorMap.getVMax())
+ colormapName = self.listValues[index]
+ colormap = self.subject.getCutPlanes()[0].getColormap()
+ colormap.setName(colormapName)
def setEditorData(self, editor):
colormapName = self.subject.getCutPlanes()[0].getColormap().getName()
- index = self.listValues.index(colormapName)
- editor.setCurrentIndex(index)
+ try:
+ index = self.listValues.index(colormapName)
+ except ValueError:
+ _logger.error('Unsupported colormap: %s', colormapName)
+ else:
+ editor.setCurrentIndex(index)
return True
def _setModelData(self, editor):
@@ -1078,22 +1120,18 @@ class PlaneAutoScaleItem(ColormapBase):
def _setAutoScale(self, auto):
view3d = self.subject
- cutPlane = view3d.getCutPlanes()[0]
- colormap = cutPlane.getColormap()
+ colormap = view3d.getCutPlanes()[0].getColormap()
if auto != colormap.isAutoscale():
if auto:
vMin = vMax = None
else:
dataRange = view3d.getDataRange()
- if dataRange is None or None in dataRange:
+ if dataRange is None:
vMin = vMax = None
else:
- vMin, vMax = dataRange
- cutPlane.setColormap(colormap.getName(),
- colormap.getNorm(),
- vMin,
- vMax)
+ vMin, vMax = dataRange[0], dataRange[-1]
+ colormap.setVRange(vMin, vMax)
def _pullData(self):
auto = self.subject.getCutPlanes()[0].getColormap().isAutoscale()
@@ -1111,7 +1149,7 @@ class NormalizationNode(ColormapBase):
Item is a QComboBox.
"""
editable = True
- listValues = ['linear', 'log']
+ listValues = list(Colormap.NORMALIZATIONS)
def getEditor(self, parent, option, index):
editor = qt.QComboBox(parent)
@@ -1129,7 +1167,7 @@ class NormalizationNode(ColormapBase):
vmax=colorMap.getVMax())
def setEditorData(self, editor):
- normalization = self.subject.getCutPlanes()[0].getColormap().getNorm()
+ normalization = self.subject.getCutPlanes()[0].getColormap().getNormalization()
index = self.listValues.index(normalization)
editor.setCurrentIndex(index)
return True
@@ -1139,7 +1177,7 @@ class NormalizationNode(ColormapBase):
return True
def _pullData(self):
- return self.subject.getCutPlanes()[0].getColormap().getNorm()
+ return self.subject.getCutPlanes()[0].getColormap().getNormalization()
class PlaneGroup(SubjectItem):
diff --git a/silx/gui/plot3d/ScalarFieldView.py b/silx/gui/plot3d/ScalarFieldView.py
index 2eb54a3..6a4d9d4 100644
--- a/silx/gui/plot3d/ScalarFieldView.py
+++ b/silx/gui/plot3d/ScalarFieldView.py
@@ -41,15 +41,17 @@ from collections import deque
import numpy
-from silx.gui import qt
+from silx.gui import qt, icons
from silx.gui.plot.Colors import rgba
+from silx.gui.plot.Colormap import Colormap
from silx.math.marchingcubes import MarchingCubes
+from silx.math.combo import min_max
-from .scene import axes, cutplane, function, interaction, primitives, transform
+from .scene import axes, cutplane, interaction, primitives, transform
from . import scene
from .Plot3DWindow import Plot3DWindow
-
+from .tools import InteractiveModeToolBar
_logger = logging.getLogger(__name__)
@@ -245,7 +247,7 @@ class Isosurface(qt.QObject):
self._level = level
self.sigLevelChanged.emit(level)
- if numpy.isnan(self._level):
+ if not numpy.isfinite(self._level):
return
st = time.time()
@@ -265,48 +267,6 @@ class Isosurface(qt.QObject):
self._group.children = [mesh]
-class Colormap(object):
- """Description of a colormap
-
- :param str name: Name of the colormap
- :param str norm: Normalization: 'linear' (default) or 'log'
- :param float vmin:
- Lower bound of the colormap or None for autoscale (default)
- :param float vmax:
- Upper bounds of the colormap or None for autoscale (default)
- """
-
- def __init__(self, name, norm='linear', vmin=None, vmax=None):
- assert name in function.Colormap.COLORMAPS
- self._name = str(name)
-
- assert norm in ('linear', 'log')
- self._norm = str(norm)
-
- self._vmin = float(vmin) if vmin is not None else None
- self._vmax = float(vmax) if vmax is not None else None
-
- def isAutoscale(self):
- """True if both min and max are in autoscale mode"""
- return self._vmin is None or self._vmax is None
-
- def getName(self):
- """Return the name of the colormap (str)"""
- return self._name
-
- def getNorm(self):
- """Return the normalization of the colormap (str)"""
- return self._norm
-
- def getVMin(self):
- """Return the lower bound of the colormap or None"""
- return self._vmin
-
- def getVMax(self):
- """Return the upper bounds of the colormap or None"""
- return self._vmax
-
-
class SelectedRegion(object):
"""Selection of a 3D region aligned with the axis.
@@ -391,7 +351,7 @@ class CutPlane(qt.QObject):
sigPlaneChanged = qt.Signal()
"""Signal emitted when the cut plane has moved"""
- sigColormapChanged = qt.Signal(object)
+ sigColormapChanged = qt.Signal(Colormap)
"""Signal emitted when the colormap has changed
This signal provides the new colormap.
@@ -406,11 +366,7 @@ class CutPlane(qt.QObject):
def __init__(self, sfView):
super(CutPlane, self).__init__(parent=sfView)
- self._colormap = Colormap(
- name='gray', norm='linear', vmin=None, vmax=None)
-
self._dataRange = None
- self._positiveMin = None
self._plane = cutplane.CutPlane(normal=(0, 1, 0))
self._plane.alpha = 1.
@@ -418,6 +374,11 @@ class CutPlane(qt.QObject):
self._plane.addListener(self._planeChanged)
self._plane.plane.addListener(self._planePositionChanged)
+ self._colormap = Colormap(
+ name='gray', normalization='linear', vmin=None, vmax=None)
+ self.getColormap().sigChanged.connect(self._colormapChanged)
+ self._updateSceneColormap()
+
sfView.sigDataChanged.connect(self._sfViewDataChanged)
def _get3DPrimitive(self):
@@ -427,13 +388,15 @@ class CutPlane(qt.QObject):
def _sfViewDataChanged(self):
"""Handle data change in the ScalarFieldView this plane belongs to"""
self._plane.setData(self.sender().getData(), copy=False)
+
+ # Store data range info as 3-tuple of values
self._dataRange = self.sender().getDataRange()
- self._positiveMin = None
+
self.sigDataChanged.emit()
# Update colormap range when autoscale
if self.getColormap().isAutoscale():
- self._updateColormapRange()
+ self._updateSceneColormap()
def _planeChanged(self, source, *args, **kwargs):
"""Handle events from the plane primitive"""
@@ -565,7 +528,7 @@ class CutPlane(qt.QObject):
# self._plane.alpha = alpha
def getColormap(self):
- """Returns the colormap set by :meth:`getColormap`.
+ """Returns the colormap set by :meth:`setColormap`.
:return: The colormap
:rtype: Colormap
@@ -574,25 +537,38 @@ class CutPlane(qt.QObject):
def setColormap(self,
name='gray',
- norm='linear',
+ norm=None,
vmin=None,
vmax=None):
"""Set the colormap to use.
- :param str name: Name of the colormap in
+ By either providing a :class:`Colormap` object or
+ its name, normalization and range.
+
+ :param name: Name of the colormap in
'gray', 'reversed gray', 'temperature', 'red', 'green', 'blue'.
+ Or Colormap object.
+ :type name: str or Colormap
:param str norm: Colormap mapping: 'linear' or 'log'.
:param float vmin: The minimum value of the range or None for autoscale
:param float vmax: The maximum value of the range or None for autoscale
"""
_logger.debug('setColormap %s %s (%s, %s)',
- name, norm, str(vmin), str(vmax))
+ name, str(norm), str(vmin), str(vmax))
- self._colormap = Colormap(
- name=name, norm=norm, vmin=vmin, vmax=vmax)
+ self._colormap.sigChanged.disconnect(self._colormapChanged)
- self._updateColormapRange()
- self.sigColormapChanged.emit(self.getColormap())
+ if isinstance(name, Colormap): # Use it as it is
+ assert (norm, vmin, vmax) == (None, None, None)
+ self._colormap = name
+ else:
+ if norm is None:
+ norm = 'linear'
+ self._colormap = Colormap(
+ name=name, normalization=norm, vmin=vmin, vmax=vmax)
+
+ self._colormap.sigChanged.connect(self._colormapChanged)
+ self._colormapChanged()
def getColormapEffectiveRange(self):
"""Returns the currently used range of the colormap.
@@ -604,35 +580,29 @@ class CutPlane(qt.QObject):
"""
return self._plane.colormap.range_
- def _updateColormapRange(self):
- """Update the colormap range"""
+ def _updateSceneColormap(self):
+ """Synchronizes scene's colormap with Colormap object"""
colormap = self.getColormap()
-
- self._plane.colormap.name = colormap.getName()
- if colormap.isAutoscale():
- range_ = self._dataRange
- if range_ is None: # No data, use a default range
- range_ = 1., 10.
- else:
- range_ = colormap.getVMin(), colormap.getVMax()
-
- if colormap.getNorm() == 'linear':
- self._plane.colormap.norm = 'linear'
- self._plane.colormap.range_ = range_
-
- else: # Log
- # Make sure range is strictly positive
- if range_[0] <= 0.:
- data = self._plane.getData(copy=False)
- if data is not None:
- if self._positiveMin is None:
- # TODO compute this with the range as a combo operation
- self._positiveMin = numpy.min(data[data > 0.])
- range_ = (self._positiveMin,
- max(range_[1], self._positiveMin))
-
- self._plane.colormap.range_ = range_
- self._plane.colormap.norm = colormap.getNorm()
+ sceneCMap = self._plane.colormap
+
+ indices = numpy.linspace(0., 1., 256)
+ colormapDisp = Colormap(name=colormap.getName(),
+ normalization=Colormap.LINEAR,
+ vmin=None,
+ vmax=None,
+ colors=colormap.getColormapLUT())
+ colors = colormapDisp.applyToData(indices)
+ sceneCMap.colormap = colors
+
+ sceneCMap.norm = colormap.getNormalization()
+ range_ = colormap.getColormapRange(data=self._dataRange)
+ sceneCMap.range_ = range_
+
+ def _colormapChanged(self):
+ """Handle update of Colormap object"""
+ self._updateSceneColormap()
+ # Forward colormap changed event
+ self.sigColormapChanged.emit(self.getColormap())
class _CutPlaneImage(object):
@@ -766,7 +736,7 @@ class ScalarFieldView(Plot3DWindow):
def __init__(self, parent=None):
super(ScalarFieldView, self).__init__(parent)
self._colormap = Colormap(
- name='gray', norm='linear', vmin=None, vmax=None)
+ name='gray', normalization='linear', vmin=None, vmax=None)
self._selectedRange = None
# Store iso-surfaces
@@ -815,7 +785,7 @@ class ScalarFieldView(Plot3DWindow):
self._bbox.children = [self._group]
self.getPlot3DWidget().viewport.scene.children.append(self._bbox)
- self._initInteractionToolBar()
+ self._initPanPlaneAction()
self._updateColors()
@@ -958,81 +928,71 @@ class ScalarFieldView(Plot3DWindow):
raise ValueError('Unknown entry tag {0}.'
''.format(itemId))
- def _initInteractionToolBar(self):
- self._interactionToolbar = qt.QToolBar()
- self._interactionToolbar.setEnabled(False)
-
- group = qt.QActionGroup(self._interactionToolbar)
- group.setExclusive(True)
-
- self._cameraAction = qt.QAction(None)
- self._cameraAction.setText('camera')
- self._cameraAction.setCheckable(True)
- self._cameraAction.setToolTip('Control camera')
- self._cameraAction.setChecked(True)
- group.addAction(self._cameraAction)
-
- self._planeAction = qt.QAction(None)
- self._planeAction.setText('plane')
- self._planeAction.setCheckable(True)
- self._planeAction.setToolTip('Control cutting plane')
- group.addAction(self._planeAction)
- group.triggered.connect(self._interactionChanged)
-
- self._interactionToolbar.addActions(group.actions())
- self.addToolBar(self._interactionToolbar)
+ def _initPanPlaneAction(self):
+ """Creates and init the pan plane action"""
+ self._panPlaneAction = qt.QAction(self)
+ self._panPlaneAction.setIcon(icons.getQIcon('3d-plane-pan'))
+ self._panPlaneAction.setText('plane')
+ self._panPlaneAction.setCheckable(True)
+ self._panPlaneAction.setToolTip('pan the cutting plane')
+ self._panPlaneAction.setEnabled(False)
+
+ self._panPlaneAction.triggered[bool].connect(self._planeActionTriggered)
+ self.getPlot3DWidget().sigInteractiveModeChanged.connect(
+ self._interactiveModeChanged)
+
+ toolbar = self.findChild(InteractiveModeToolBar)
+ if toolbar is not None:
+ toolbar.addAction(self._panPlaneAction)
+
+ def _planeActionTriggered(self, checked=False):
+ self._panPlaneAction.setChecked(True)
+ self.setInteractiveMode('plane')
+
+ def _interactiveModeChanged(self):
+ self._panPlaneAction.setChecked(self.getInteractiveMode() == 'plane')
+ self._updateColors()
def _planeVisibilityChanged(self, visible):
"""Handle visibility events from the plane"""
- if visible != self._interactionToolbar.isEnabled():
+ if visible != self._panPlaneAction.isEnabled():
+ self._panPlaneAction.setEnabled(visible)
if visible:
- self._interactionToolbar.setEnabled(True)
self.setInteractiveMode('plane')
- else:
- self._interactionToolbar.setEnabled(False)
- self.setInteractiveMode('camera')
-
- def _interactionChanged(self, action):
- self.setInteractiveMode(action.text())
+ elif self._panPlaneAction.isChecked():
+ self.setInteractiveMode('rotate')
def setInteractiveMode(self, mode):
"""Choose the current interaction.
- :param str mode: Either plane or camera
+ :param str mode: Either rotate, pan or plane
"""
if mode == self.getInteractiveMode():
return
sceneScale = self.getPlot3DWidget().viewport.scene.transforms[0]
if mode == 'plane':
+ self.getPlot3DWidget().setInteractiveMode(None)
+
self.getPlot3DWidget().eventHandler = \
- interaction.PanPlaneRotateCameraControl(
+ interaction.PanPlaneZoomOnWheelControl(
self.getPlot3DWidget().viewport,
self._cutPlane._get3DPrimitive(),
mode='position',
scaleTransform=sceneScale)
- self._planeAction.setChecked(True)
- elif mode == 'camera':
- self.getPlot3DWidget().eventHandler = interaction.CameraControl(
- self.getPlot3DWidget().viewport, orbitAroundCenter=False,
- mode='position', scaleTransform=sceneScale,
- selectCB=None)
- self._cameraAction.setChecked(True)
else:
- raise ValueError('Unsupported interactive mode %s', str(mode))
+ self.getPlot3DWidget().setInteractiveMode(mode)
self._updateColors()
def getInteractiveMode(self):
"""Returns the current interaction mode, see :meth:`setInteractiveMode`
"""
- if isinstance(self.getPlot3DWidget().eventHandler,
- interaction.PanPlaneRotateCameraControl):
+ if (isinstance(self.getPlot3DWidget().eventHandler,
+ interaction.PanPlaneZoomOnWheelControl) or
+ self.getPlot3DWidget().eventHandler is None):
return 'plane'
- elif isinstance(self.getPlot3DWidget().eventHandler,
- interaction.CameraControl):
- return 'camera'
else:
- raise RuntimeError('Unknown interactive mode')
+ return self.getPlot3DWidget().getInteractiveMode()
# Handle scalar field
@@ -1063,7 +1023,18 @@ class ScalarFieldView(Plot3DWindow):
previousSelectedRegion = self.getSelectedRegion()
self._data = data
- self._dataRange = self._data.min(), self._data.max()
+
+ # Store data range info
+ dataRange = min_max(self._data, min_positive=True, finite=True)
+ if dataRange.minimum is None: # Only non-finite data
+ dataRange = None
+
+ if dataRange is not None:
+ min_positive = dataRange.min_positive
+ if min_positive is None:
+ min_positive = float('nan')
+ dataRange = dataRange.minimum, min_positive, dataRange.maximum
+ self._dataRange = dataRange
if previousSelectedRegion is not None:
# Update selected region to ensure it is clipped to array range
@@ -1094,7 +1065,12 @@ class ScalarFieldView(Plot3DWindow):
return numpy.array(self._data, copy=copy)
def getDataRange(self):
- """Return the range of the data as a 2-tuple (min, max)"""
+ """Return the range of the data as a 3-tuple of values.
+
+ positive min is NaN if no data is positive.
+
+ :return: (min, positive min, max) or None.
+ """
return self._dataRange
# Transformations
@@ -1135,6 +1111,20 @@ class ScalarFieldView(Plot3DWindow):
# Axes labels
+ def isBoundingBoxVisible(self):
+ """Returns axes labels, grid and bounding box visibility.
+
+ :rtype: bool
+ """
+ return self._bbox.boxVisible
+
+ def setBoundingBoxVisible(self, visible):
+ """Set axes labels, grid and bounding box visibility.
+
+ :param bool visible: True to show axes, False to hide
+ """
+ self._bbox.boxVisible = bool(visible)
+
def setAxesLabels(self, xlabel=None, ylabel=None, zlabel=None):
"""Set the text labels of the axes.
diff --git a/silx/gui/plot3d/__init__.py b/silx/gui/plot3d/__init__.py
index ad45424..af74613 100644
--- a/silx/gui/plot3d/__init__.py
+++ b/silx/gui/plot3d/__init__.py
@@ -25,7 +25,7 @@
"""
This package provides widgets displaying 3D content based on OpenGL.
-It depends on PyOpenGL and QtOpenGL.
+It depends on PyOpenGL and PyQtx.QtOpenGL or PyQt>=5.4.
"""
from __future__ import absolute_import
@@ -34,11 +34,6 @@ __license__ = "MIT"
__date__ = "18/01/2017"
-from .. import qt as _qt
-
-if not _qt.HAS_OPENGL:
- raise ImportError('Qt.QtOpenGL is not available')
-
try:
import OpenGL as _OpenGL
except ImportError:
diff --git a/silx/gui/plot3d/actions/Plot3DAction.py b/silx/gui/plot3d/actions/Plot3DAction.py
new file mode 100644
index 0000000..a1faaea
--- /dev/null
+++ b/silx/gui/plot3d/actions/Plot3DAction.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Base class for QAction attached to a Plot3DWidget."""
+
+from __future__ import absolute_import, division
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "06/09/2017"
+
+
+import logging
+import weakref
+
+from silx.gui import qt
+
+
+_logger = logging.getLogger(__name__)
+
+
+class Plot3DAction(qt.QAction):
+ """QAction associated to a Plot3DWidget
+
+ :param parent: See :class:`QAction`
+ :param Plot3DWidget plot3d: Plot3DWidget the action is associated with
+ """
+
+ def __init__(self, parent, plot3d=None):
+ super(Plot3DAction, self).__init__(parent)
+ self._plot3d = None
+ self.setPlot3DWidget(plot3d)
+
+ def setPlot3DWidget(self, widget):
+ """Set the Plot3DWidget this action is associated with
+
+ :param Plot3DWidget widget: The Plot3DWidget to use
+ """
+ self._plot3d = None if widget is None else weakref.ref(widget)
+
+ def getPlot3DWidget(self):
+ """Return the Plot3DWidget associated to this action.
+
+ If no widget is associated, it returns None.
+
+ :rtype: qt.QWidget
+ """
+ return None if self._plot3d is None else self._plot3d()
diff --git a/silx/gui/plot3d/actions/__init__.py b/silx/gui/plot3d/actions/__init__.py
new file mode 100644
index 0000000..ebc57d2
--- /dev/null
+++ b/silx/gui/plot3d/actions/__init__.py
@@ -0,0 +1,33 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides QAction that can be attached to a plot3DWidget."""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "06/09/2017"
+
+from .Plot3DAction import Plot3DAction
+from . import io
+from . import mode
diff --git a/silx/gui/plot3d/Plot3DActions.py b/silx/gui/plot3d/actions/io.py
index 2ae2750..18f91b4 100644
--- a/silx/gui/plot3d/Plot3DActions.py
+++ b/silx/gui/plot3d/actions/io.py
@@ -22,60 +22,34 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This module provides QAction that can be attached to a plot3DWidget."""
+"""This module provides Plot3DAction related to input/output.
+
+It provides QAction to copy, save (snapshot and video), print a Plot3DWidget.
+"""
from __future__ import absolute_import, division
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "26/01/2017"
+__date__ = "06/09/2017"
import logging
import os
-import weakref
import numpy
from silx.gui import qt
-from silx.gui.plot.PlotActions import PrintAction as _PrintAction
+from silx.gui.plot.actions.io import PrintAction as _PrintAction
from silx.gui.icons import getQIcon
-from .utils import mng
-from .._utils import convertQImageToArray
+from .Plot3DAction import Plot3DAction
+from ..utils import mng
+from ..._utils import convertQImageToArray
_logger = logging.getLogger(__name__)
-class Plot3DAction(qt.QAction):
- """QAction associated to a Plot3DWidget
-
- :param parent: See :class:`QAction`
- :param Plot3DWidget plot3d: Plot3DWidget the action is associated with
- """
-
- def __init__(self, parent, plot3d=None):
- super(Plot3DAction, self).__init__(parent)
- self._plot3d = None
- self.setPlot3DWidget(plot3d)
-
- def setPlot3DWidget(self, widget):
- """Set the Plot3DWidget this action is associated with
-
- :param Plot3DWidget widget: The Plot3DWidget to use
- """
- self._plot3d = None if widget is None else weakref.ref(widget)
-
- def getPlot3DWidget(self):
- """Return the Plot3DWidget associated to this action.
-
- If no widget is associated, it returns None.
-
- :rtype: qt.QWidget
- """
- return None if self._plot3d is None else self._plot3d()
-
-
class CopyAction(Plot3DAction):
"""QAction to provide copy of a Plot3DWidget
diff --git a/silx/gui/plot3d/actions/mode.py b/silx/gui/plot3d/actions/mode.py
new file mode 100644
index 0000000..a06b9a8
--- /dev/null
+++ b/silx/gui/plot3d/actions/mode.py
@@ -0,0 +1,126 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides Plot3DAction related to interaction modes.
+
+It provides QAction to rotate or pan a Plot3DWidget.
+"""
+
+from __future__ import absolute_import, division
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "06/09/2017"
+
+
+import logging
+
+from silx.gui.icons import getQIcon
+from .Plot3DAction import Plot3DAction
+
+
+_logger = logging.getLogger(__name__)
+
+
+class InteractiveModeAction(Plot3DAction):
+ """Base class for QAction changing interactive mode of a Plot3DWidget
+
+ :param parent: See :class:`QAction`
+ :param str interaction: The interactive mode this action controls
+ :param Plot3DWidget plot3d: Plot3DWidget the action is associated with
+ """
+
+ def __init__(self, parent, interaction, plot3d=None):
+ self._interaction = interaction
+
+ super(InteractiveModeAction, self).__init__(parent, plot3d)
+ self.setCheckable(True)
+ self.triggered[bool].connect(self._triggered)
+
+ def _triggered(self, checked=False):
+ plot3d = self.getPlot3DWidget()
+ if plot3d is None:
+ _logger.error(
+ 'Cannot set %s interaction, no associated Plot3DWidget' %
+ self._interaction)
+ else:
+ plot3d.setInteractiveMode(self._interaction)
+ self.setChecked(True)
+
+ def setPlot3DWidget(self, widget):
+ # Disconnect from previous Plot3DWidget
+ plot3d = self.getPlot3DWidget()
+ if plot3d is not None:
+ plot3d.sigInteractiveModeChanged.disconnect(
+ self._interactiveModeChanged)
+
+ super(InteractiveModeAction, self).setPlot3DWidget(widget)
+
+ # Connect to new Plot3DWidget
+ if widget is None:
+ self.setChecked(False)
+ else:
+ self.setChecked(widget.getInteractiveMode() == self._interaction)
+ widget.sigInteractiveModeChanged.connect(
+ self._interactiveModeChanged)
+
+ # Reuse docstring from super class
+ setPlot3DWidget.__doc__ = Plot3DAction.setPlot3DWidget.__doc__
+
+ def _interactiveModeChanged(self):
+ plot3d = self.getPlot3DWidget()
+ if plot3d is None:
+ _logger.error('Received a signal while there is no widget')
+ else:
+ self.setChecked(plot3d.getInteractiveMode() == self._interaction)
+
+
+class RotateArcballAction(InteractiveModeAction):
+ """QAction to set arcball rotation interaction on a Plot3DWidget
+
+ :param parent: See :class:`QAction`
+ :param Plot3DWidget plot3d: Plot3DWidget the action is associated with
+ """
+
+ def __init__(self, parent, plot3d=None):
+ super(RotateArcballAction, self).__init__(parent, 'rotate', plot3d)
+
+ self.setIcon(getQIcon('rotate-3d'))
+ self.setText('Rotate')
+ self.setToolTip('Rotate the view')
+
+
+class PanAction(InteractiveModeAction):
+ """QAction to set pan interaction on a Plot3DWidget
+
+ :param parent: See :class:`QAction`
+ :param Plot3DWidget plot3d: Plot3DWidget the action is associated with
+ """
+
+ def __init__(self, parent, plot3d=None):
+ super(PanAction, self).__init__(parent, 'pan', plot3d)
+
+ self.setIcon(getQIcon('pan'))
+ self.setText('Pan')
+ self.setToolTip('Pan the view')
diff --git a/silx/gui/plot3d/scene/axes.py b/silx/gui/plot3d/scene/axes.py
index 528e4f7..520ef3e 100644
--- a/silx/gui/plot3d/scene/axes.py
+++ b/silx/gui/plot3d/scene/axes.py
@@ -52,6 +52,8 @@ class LabelledAxes(primitives.GroupBBox):
self._font = text.Font()
+ self._boxVisibility = True
+
# TODO offset labels from anchor in pixels
self._xlabel = text.Text2D(font=self._font)
@@ -145,6 +147,21 @@ class LabelledAxes(primitives.GroupBBox):
def zlabel(self, text):
self._zlabel.text = text
+ @property
+ def boxVisible(self):
+ """Returns bounding box, axes labels and grid visibility."""
+ return self._boxVisibility
+
+ @boxVisible.setter
+ def boxVisible(self, visible):
+ self._boxVisibility = bool(visible)
+ for child in self._children:
+ if child == self._tickLines:
+ if self._ticksForBounds is not None:
+ child.visible = self._boxVisibility
+ elif child != self._group:
+ child.visible = self._boxVisibility
+
def _updateTicks(self):
"""Check if ticks need update and update them if needed."""
bounds = self._group.bounds(transformed=False, dataBounds=True)
@@ -187,7 +204,7 @@ class LabelledAxes(primitives.GroupBBox):
zcoords[:, 3, 1] += ticklength[1] # Z ticks on YZ plane
self._tickLines.setPositions(coords.reshape(-1, 3))
- self._tickLines.visible = True
+ self._tickLines.visible = self._boxVisibility
# Update labels
color = self.tickColor
diff --git a/silx/gui/plot3d/scene/function.py b/silx/gui/plot3d/scene/function.py
index 80ac820..73cdb72 100644
--- a/silx/gui/plot3d/scene/function.py
+++ b/silx/gui/plot3d/scene/function.py
@@ -35,6 +35,7 @@ import contextlib
import logging
import numpy
+from ... import _glutils
from ..._glutils import gl
from . import event
@@ -296,18 +297,10 @@ class DirectionalLight(event.Notifier, ProgramFunction):
class Colormap(event.Notifier, ProgramFunction):
# TODO use colors for out-of-bound values, for <=0 with log, for nan
- # TODO texture-based colormap
decl = """
- #define CMAP_GRAY 0
- #define CMAP_R_GRAY 1
- #define CMAP_RED 2
- #define CMAP_GREEN 3
- #define CMAP_BLUE 4
- #define CMAP_TEMP 5
-
uniform struct {
- int id;
+ sampler2D texture;
bool isLog;
float min;
float oneOverRange;
@@ -328,60 +321,24 @@ class Colormap(event.Notifier, ProgramFunction):
value = clamp(cmap.oneOverRange * (value - cmap.min), 0.0, 1.0);
}
- if (cmap.id == CMAP_GRAY) {
- return vec4(value, value, value, 1.0);
- }
- else if (cmap.id == CMAP_R_GRAY) {
- float invValue = 1.0 - value;
- return vec4(invValue, invValue, invValue, 1.0);
- }
- else if (cmap.id == CMAP_RED) {
- return vec4(value, 0.0, 0.0, 1.0);
- }
- else if (cmap.id == CMAP_GREEN) {
- return vec4(0.0, value, 0.0, 1.0);
- }
- else if (cmap.id == CMAP_BLUE) {
- return vec4(0.0, 0.0, value, 1.0);
- }
- else if (cmap.id == CMAP_TEMP) {
- //red: 0.5->0.75: 0->1
- //green: 0.->0.25: 0->1; 0.75->1.: 1->0
- //blue: 0.25->0.5: 1->0
- return vec4(
- clamp(4.0 * value - 2.0, 0.0, 1.0),
- 1.0 - clamp(4.0 * abs(value - 0.5) - 1.0, 0.0, 1.0),
- 1.0 - clamp(4.0 * value - 1.0, 0.0, 1.0),
- 1.0);
- }
- else {
- /* Unknown colormap */
- return vec4(0.0, 0.0, 0.0, 1.0);
- }
+ vec4 color = texture2D(cmap.texture, vec2(value, 0.5));
+ return color;
}
"""
call = "colormap"
- _COLORMAPS = {
- 'gray': 0,
- 'reversed gray': 1,
- 'red': 2,
- 'green': 3,
- 'blue': 4,
- 'temperature': 5
- }
-
- COLORMAPS = tuple(_COLORMAPS.keys())
- """Tuple of supported colormap names."""
-
NORMS = 'linear', 'log'
"""Tuple of supported normalizations."""
- def __init__(self, name='gray', norm='linear', range_=(1., 10.)):
+ _COLORMAP_TEXTURE_UNIT = 1
+ """Texture unit to use for storing the colormap"""
+
+ def __init__(self, colormap=None, norm='linear', range_=(1., 10.)):
"""Shader function to apply a colormap to a value.
- :param str name: Name of the colormap.
+ :param colormap: RGB(A) color look-up table (default: gray)
+ :param colormap: numpy.ndarray of numpy.uint8 of dimension Nx3 or Nx4
:param str norm: Normalization to apply: 'linear' (default) or 'log'.
:param range_: Range of value to map to the colormap.
:type range_: 2-tuple of float (begin, end).
@@ -389,24 +346,35 @@ class Colormap(event.Notifier, ProgramFunction):
super(Colormap, self).__init__()
# Init privates to default
- self._name, self._norm, self._range = 'gray', 'linear', (1., 10.)
+ self._colormap, self._norm, self._range = None, 'linear', (1., 10.)
+
+ self._texture = None
+ self._update_texture = True
+
+ if colormap is None:
+ # default colormap
+ colormap = numpy.empty((256, 3), dtype=numpy.uint8)
+ colormap[:] = numpy.arange(256,
+ dtype=numpy.uint8)[:, numpy.newaxis]
# Set to param values through properties to go through asserts
- self.name = name
+ self.colormap = colormap
self.norm = norm
self.range_ = range_
@property
- def name(self):
- """Name of the colormap in use."""
- return self._name
-
- @name.setter
- def name(self, name):
- if name != self._name:
- assert name in self.COLORMAPS
- self._name = name
- self.notify()
+ def colormap(self):
+ """Color look-up table to use."""
+ return numpy.array(self._colormap, copy=True)
+
+ @colormap.setter
+ def colormap(self, colormap):
+ colormap = numpy.array(colormap, copy=True)
+ assert colormap.ndim == 2
+ assert colormap.shape[1] in (3, 4)
+ self._colormap = colormap
+ self._update_texture = True
+ self.notify()
@property
def norm(self):
@@ -459,7 +427,15 @@ class Colormap(event.Notifier, ProgramFunction):
:param GLProgram program: The program to set-up.
It MUST be in use and using this function.
"""
- gl.glUniform1i(program.uniforms['cmap.id'], self._COLORMAPS[self.name])
+ self.prepareGL2(context) # TODO see how to handle
+
+ if self._texture is None: # No colormap
+ return
+
+ self._texture.bind()
+
+ gl.glUniform1i(program.uniforms['cmap.texture'],
+ self._texture.texUnit)
gl.glUniform1i(program.uniforms['cmap.isLog'], self._norm == 'log')
min_, max_ = self.range_
@@ -469,3 +445,23 @@ class Colormap(event.Notifier, ProgramFunction):
gl.glUniform1f(program.uniforms['cmap.min'], min_)
gl.glUniform1f(program.uniforms['cmap.oneOverRange'],
(1. / (max_ - min_)) if max_ != min_ else 0.)
+
+ def prepareGL2(self, context):
+ if self._texture is None or self._update_texture:
+ if self._texture is not None:
+ self._texture.discard()
+
+ colormap = numpy.empty(
+ (16, self._colormap.shape[0], self._colormap.shape[1]),
+ dtype=self._colormap.dtype)
+ colormap[:] = self._colormap
+
+ format_ = gl.GL_RGBA if colormap.shape[-1] == 4 else gl.GL_RGB
+
+ self._texture = _glutils.Texture(
+ format_, colormap, format_,
+ texUnit=self._COLORMAP_TEXTURE_UNIT,
+ minFilter=gl.GL_NEAREST,
+ magFilter=gl.GL_NEAREST,
+ wrap=gl.GL_CLAMP_TO_EDGE)
+ self._update_texture = False
diff --git a/silx/gui/plot3d/scene/interaction.py b/silx/gui/plot3d/scene/interaction.py
index 68bfc13..2911b2c 100644
--- a/silx/gui/plot3d/scene/interaction.py
+++ b/silx/gui/plot3d/scene/interaction.py
@@ -440,6 +440,26 @@ class FocusManager(StateMachine):
# CameraControl ###############################################################
+class RotateCameraControl(FocusManager):
+ """Combine wheel and rotate state machine."""
+ def __init__(self, viewport,
+ orbitAroundCenter=False,
+ mode='center', scaleTransform=None):
+ handlers = (CameraWheel(viewport, mode, scaleTransform),
+ CameraRotate(viewport, orbitAroundCenter, LEFT_BTN))
+ super(RotateCameraControl, self).__init__(handlers)
+
+
+class PanCameraControl(FocusManager):
+ """Combine wheel, selectPan and rotate state machine."""
+ def __init__(self, viewport,
+ mode='center', scaleTransform=None,
+ selectCB=None):
+ handlers = (CameraWheel(viewport, mode, scaleTransform),
+ CameraSelectPan(viewport, LEFT_BTN, selectCB))
+ super(PanCameraControl, self).__init__(handlers)
+
+
class CameraControl(FocusManager):
"""Combine wheel, selectPan and rotate state machine."""
def __init__(self, viewport,
@@ -650,3 +670,12 @@ class PanPlaneRotateCameraControl(FocusManager):
orbitAroundCenter=False,
button=RIGHT_BTN))
super(PanPlaneRotateCameraControl, self).__init__(handlers)
+
+
+class PanPlaneZoomOnWheelControl(FocusManager):
+ """Combine zoom on wheel and pan plane state machines."""
+ def __init__(self, viewport, plane,
+ mode='center', scaleTransform=None):
+ handlers = (CameraWheel(viewport, mode, scaleTransform),
+ PlanePan(viewport, plane, LEFT_BTN))
+ super(PanPlaneZoomOnWheelControl, self).__init__(handlers)
diff --git a/silx/gui/plot3d/scene/primitives.py b/silx/gui/plot3d/scene/primitives.py
index ca2616a..fc38e09 100644
--- a/silx/gui/plot3d/scene/primitives.py
+++ b/silx/gui/plot3d/scene/primitives.py
@@ -292,8 +292,11 @@ class Geometry(core.Elem):
self.__bounds = numpy.zeros((2, 3), dtype=numpy.float32)
# Support vertex with to 2 to 4 coordinates
positions = self._attributes['position']
- self.__bounds[0, :positions.shape[1]] = positions.min(axis=0)[:3]
- self.__bounds[1, :positions.shape[1]] = positions.max(axis=0)[:3]
+ self.__bounds[0, :positions.shape[1]] = \
+ numpy.nanmin(positions, axis=0)[:3]
+ self.__bounds[1, :positions.shape[1]] = \
+ numpy.nanmax(positions, axis=0)[:3]
+ self.__bounds[numpy.isnan(self.__bounds)] = 0. # Avoid NaNs
return self.__bounds.copy()
def prepareGL2(self, ctx):
diff --git a/silx/gui/plot3d/scene/viewport.py b/silx/gui/plot3d/scene/viewport.py
index 83cda43..72e1ea3 100644
--- a/silx/gui/plot3d/scene/viewport.py
+++ b/silx/gui/plot3d/scene/viewport.py
@@ -314,6 +314,9 @@ class Viewport(event.Notifier):
(e.g., if spanning behind the viewpoint with perspective projection).
"""
bounds = self.scene.bounds(transformed=True)
+ if bounds is None:
+ bounds = numpy.array(((0., 0., 0.), (1., 1., 1.)),
+ dtype=numpy.float32)
bounds = self.camera.extrinsic.transformBounds(bounds)
if isinstance(self.camera.intrinsic, transform.Perspective):
@@ -337,7 +340,11 @@ class Viewport(event.Notifier):
It updates the camera position and depth extent.
Camera sight direction and up are not affected.
"""
- self.camera.resetCamera(self.scene.bounds(transformed=True))
+ bounds = self.scene.bounds(transformed=True)
+ if bounds is None:
+ bounds = numpy.array(((0., 0., 0.), (1., 1., 1.)),
+ dtype=numpy.float32)
+ self.camera.resetCamera(bounds)
def orbitCamera(self, direction, angle=1.):
"""Rotate the camera around center of the scene.
@@ -347,6 +354,9 @@ class Viewport(event.Notifier):
:param float angle: he angle in degrees of the rotation.
"""
bounds = self.scene.bounds(transformed=True)
+ if bounds is None:
+ bounds = numpy.array(((0., 0., 0.), (1., 1., 1.)),
+ dtype=numpy.float32)
center = 0.5 * (bounds[0] + bounds[1])
self.camera.orbit(direction, center, angle)
@@ -359,6 +369,9 @@ class Viewport(event.Notifier):
:param float step: The ratio of data to step for each pan.
"""
bounds = self.scene.bounds(transformed=True)
+ if bounds is None:
+ bounds = numpy.array(((0., 0., 0.), (1., 1., 1.)),
+ dtype=numpy.float32)
bounds = self.camera.extrinsic.transformBounds(bounds)
center = 0.5 * (bounds[0] + bounds[1])
ndcCenter = self.camera.intrinsic.transformPoint(
diff --git a/silx/gui/plot3d/scene/window.py b/silx/gui/plot3d/scene/window.py
index ad7e6e5..3c63c7a 100644
--- a/silx/gui/plot3d/scene/window.py
+++ b/silx/gui/plot3d/scene/window.py
@@ -244,6 +244,7 @@ class Window(event.Notifier):
void main(void) {
gl_FragColor = texture2D(texture, textureCoord);
+ gl_FragColor.a = 1.0;
}
""")
@@ -304,12 +305,11 @@ class Window(event.Notifier):
self._viewports.removeListener(self._updated)
self._viewports = event.NotifierList(iterable)
self._viewports.addListener(self._updated)
- self._dirty = True
+ self._updated(self)
def _updated(self, source, *args, **kwargs):
- if source is not self:
- self._dirty = True
- self.notify(*args, **kwargs)
+ self._dirty = True
+ self.notify(*args, **kwargs)
framebufferid = property(lambda self: self._framebufferid,
doc="Framebuffer ID used to perform rendering")
@@ -323,11 +323,12 @@ class Window(event.Notifier):
height, width = self.shape
image = numpy.empty((height, width, 3), dtype=numpy.uint8)
+ previousFramebuffer = gl.glGetInteger(gl.GL_FRAMEBUFFER_BINDING)
gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, self.framebufferid)
gl.glPixelStorei(gl.GL_PACK_ALIGNMENT, 1)
gl.glReadPixels(
0, 0, width, height, gl.GL_RGB, gl.GL_UNSIGNED_BYTE, image)
- gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, 0)
+ gl.glBindFramebuffer(gl.GL_FRAMEBUFFER, previousFramebuffer)
# glReadPixels gives bottom to top,
# while images are stored as top to bottom
diff --git a/silx/gui/plot3d/setup.py b/silx/gui/plot3d/setup.py
index b9d626f..bb6eaa5 100644
--- a/silx/gui/plot3d/setup.py
+++ b/silx/gui/plot3d/setup.py
@@ -32,7 +32,9 @@ from numpy.distutils.misc_util import Configuration
def configuration(parent_package='', top_path=None):
config = Configuration('plot3d', parent_package, top_path)
+ config.add_subpackage('actions')
config.add_subpackage('scene')
+ config.add_subpackage('tools')
config.add_subpackage('test')
config.add_subpackage('utils')
return config
diff --git a/silx/gui/plot3d/test/__init__.py b/silx/gui/plot3d/test/__init__.py
index 66a2f62..2e8c9f4 100644
--- a/silx/gui/plot3d/test/__init__.py
+++ b/silx/gui/plot3d/test/__init__.py
@@ -56,7 +56,11 @@ def suite():
# Import here to avoid loading modules if tests are disabled
from ..scene import test as test_scene
+ from .testGL import suite as testGLSuite
+ from .testScalarFieldView import suite as testScalarFieldViewSuite
test_suite = unittest.TestSuite()
+ test_suite.addTest(testGLSuite())
test_suite.addTest(test_scene.suite())
+ test_suite.addTest(testScalarFieldViewSuite())
return test_suite
diff --git a/silx/gui/plot3d/test/testGL.py b/silx/gui/plot3d/test/testGL.py
new file mode 100644
index 0000000..70f197f
--- /dev/null
+++ b/silx/gui/plot3d/test/testGL.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+# ###########################################################################*/
+"""Test OpenGL"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "10/08/2017"
+
+
+import logging
+import unittest
+
+from silx.gui._glutils import gl, OpenGLWidget
+from silx.gui.test.utils import TestCaseQt
+from silx.gui import qt
+
+
+_logger = logging.getLogger(__name__)
+
+
+class TestOpenGL(TestCaseQt):
+ """Tests of OpenGL widget."""
+
+ class OpenGLWidgetLogger(OpenGLWidget):
+ """Widget logging information of available OpenGL version"""
+
+ def __init__(self):
+ self._dump = False
+ super(TestOpenGL.OpenGLWidgetLogger, self).__init__(version=(1, 0))
+
+ def paintOpenGL(self):
+ """Perform the rendering and logging"""
+ if not self._dump:
+ self._dump = True
+ _logger.info('OpenGL info:')
+ _logger.info('\tQt OpenGL context version: %d.%d', *self.getOpenGLVersion())
+ _logger.info('\tGL_VERSION: %s' % gl.glGetString(gl.GL_VERSION))
+ _logger.info('\tGL_SHADING_LANGUAGE_VERSION: %s' %
+ gl.glGetString(gl.GL_SHADING_LANGUAGE_VERSION))
+ _logger.debug('\tGL_EXTENSIONS: %s' % gl.glGetString(gl.GL_EXTENSIONS))
+
+ gl.glClearColor(1., 1., 1., 1.)
+ gl.glClear(gl.GL_COLOR_BUFFER_BIT)
+
+ def testOpenGL(self):
+ """Log OpenGL version using an OpenGLWidget"""
+ super(TestOpenGL, self).setUp()
+ widget = self.OpenGLWidgetLogger()
+ widget.show()
+ widget.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.qWaitForWindowExposed(widget)
+ widget.close()
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestOpenGL))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot3d/test/testScalarFieldView.py b/silx/gui/plot3d/test/testScalarFieldView.py
new file mode 100644
index 0000000..5ad4051
--- /dev/null
+++ b/silx/gui/plot3d/test/testScalarFieldView.py
@@ -0,0 +1,114 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+# ###########################################################################*/
+"""Test ScalarFieldView widget"""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "11/07/2017"
+
+
+import logging
+import unittest
+
+import numpy
+
+from silx.test.utils import ParametricTestCase
+from silx.gui.test.utils import TestCaseQt
+from silx.gui import qt
+
+from silx.gui.plot3d.ScalarFieldView import ScalarFieldView
+from silx.gui.plot3d.SFViewParamTree import TreeView
+
+
+_logger = logging.getLogger(__name__)
+
+
+class TestScalarFieldView(TestCaseQt, ParametricTestCase):
+ """Tests of ScalarFieldView widget."""
+
+ def setUp(self):
+ super(TestScalarFieldView, self).setUp()
+ self.widget = ScalarFieldView()
+ self.widget.show()
+
+ # Commented as it slows down the tests
+ # self.qWaitForWindowExposed(self.widget)
+
+ def tearDown(self):
+ self.qapp.processEvents()
+ self.widget.setAttribute(qt.Qt.WA_DeleteOnClose)
+ self.widget.close()
+ del self.widget
+ super(TestScalarFieldView, self).tearDown()
+
+ @staticmethod
+ def _buildData(size):
+ """Make a 3D dataset"""
+ coords = numpy.linspace(-10, 10, size)
+ z = coords.reshape(-1, 1, 1)
+ y = coords.reshape(1, -1, 1)
+ x = coords.reshape(1, 1, -1)
+ return numpy.sin(x * y * z) / (x * y * z)
+
+ def testSimple(self):
+ """Set the data and an isosurface"""
+ data = self._buildData(size=32)
+
+ self.widget.setData(data)
+ self.widget.addIsosurface(0.5, (1., 0., 0., 0.5))
+ self.widget.addIsosurface(0.7, qt.QColor('green'))
+ self.qapp.processEvents()
+
+ def testNotFinite(self):
+ """Test with NaN and inf in data set"""
+
+ # Some NaNs and inf
+ data = self._buildData(size=32)
+ data[8, :, :] = numpy.nan
+ data[16, :, :] = numpy.inf
+ data[24, :, :] = - numpy.inf
+
+ self.widget.addIsosurface(0.5, 'red')
+ self.widget.setData(data, copy=True)
+ self.qapp.processEvents()
+ self.widget.setData(None)
+
+ # All NaNs or inf
+ data = numpy.empty((4, 4, 4), dtype=numpy.float32)
+ for value in (numpy.nan, numpy.inf):
+ with self.subTest(value=str(value)):
+ data[:] = value
+ self.widget.setData(data, copy=True)
+ self.qapp.processEvents()
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestScalarFieldView))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/gui/plot3d/ViewpointToolBar.py b/silx/gui/plot3d/tools/ViewpointTools.py
index d062c1b..1346c1c 100644
--- a/silx/gui/plot3d/ViewpointToolBar.py
+++ b/silx/gui/plot3d/tools/ViewpointTools.py
@@ -28,14 +28,14 @@ from __future__ import absolute_import
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "15/09/2016"
+__date__ = "08/09/2017"
from silx.gui import qt
from silx.gui.icons import getQIcon
-class ViewpointActionGroup(qt.QActionGroup):
+class _ViewpointActionGroup(qt.QActionGroup):
"""ActionGroup of actions to reset the viewpoint.
As for QActionGroup, add group's actions to the widget with:
@@ -57,7 +57,7 @@ class ViewpointActionGroup(qt.QActionGroup):
)
def __init__(self, plot3D, parent=None):
- super(ViewpointActionGroup, self).__init__(parent)
+ super(_ViewpointActionGroup, self).__init__(parent)
self.setExclusive(False)
self._plot3D = plot3D
@@ -66,6 +66,7 @@ class ViewpointActionGroup(qt.QActionGroup):
iconname, text, tooltip = actionInfo
action = qt.QAction(getQIcon(iconname), text, None)
+ action.setIconVisibleInMenu(True)
action.setCheckable(False)
action.setToolTip(tooltip)
self.addAction(action)
@@ -90,7 +91,7 @@ class ViewpointToolBar(qt.QToolBar):
def __init__(self, parent=None, plot3D=None, title='Viewpoint control'):
super(ViewpointToolBar, self).__init__(title, parent)
- self._actionGroup = ViewpointActionGroup(plot3D)
+ self._actionGroup = _ViewpointActionGroup(plot3D)
assert plot3D is not None
self._plot3D = plot3D
self.addActions(self._actionGroup.actions())
@@ -112,3 +113,23 @@ class ViewpointToolBar(qt.QToolBar):
# """Projection combo box listener"""
# self._plot3D.setProjection(
# 'perspective' if text == 'Perspective' else 'orthographic')
+
+
+class ViewpointToolButton(qt.QToolButton):
+ """A toolbutton with a drop-down list of ways to reset the viewpoint.
+
+ :param parent: See :class:`QToolButton`
+ :param Plot3DWiddget plot3D: The widget to control
+ """
+
+ def __init__(self, parent=None, plot3D=None):
+ super(ViewpointToolButton, self).__init__(parent)
+
+ self._actionGroup = _ViewpointActionGroup(plot3D)
+
+ menu = qt.QMenu(self)
+ menu.addActions(self._actionGroup.actions())
+ self.setMenu(menu)
+ self.setPopupMode(qt.QToolButton.InstantPopup)
+ self.setIcon(getQIcon('cube'))
+ self.setToolTip('Reset the viewpoint to a defined position')
diff --git a/silx/gui/plot3d/tools/__init__.py b/silx/gui/plot3d/tools/__init__.py
new file mode 100644
index 0000000..e14f604
--- /dev/null
+++ b/silx/gui/plot3d/tools/__init__.py
@@ -0,0 +1,32 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""This module provides tool widgets that can be attached to a plot3DWidget."""
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "08/09/2017"
+
+from .toolbars import InteractiveModeToolBar, OutputToolBar
+from .ViewpointTools import ViewpointToolBar, ViewpointToolButton
diff --git a/silx/gui/plot3d/Plot3DToolBar.py b/silx/gui/plot3d/tools/toolbars.py
index cf11362..c8be226 100644
--- a/silx/gui/plot3d/Plot3DToolBar.py
+++ b/silx/gui/plot3d/tools/toolbars.py
@@ -22,52 +22,109 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""This module provides a toolbar with tools for a Plot3DWidget.
+"""This module provides toolbars with tools for a Plot3DWidget.
-It provides:
+It provides the following toolbars:
-- Copy
-- Save
-- Print
+- :class:`InteractiveModeToolBar` with:
+ - Set interactive mode to rotation
+ - Set interactive mode to pan
+
+- :class:`OutputToolBar` with:
+ - Copy
+ - Save
+ - Video
+ - Print
"""
from __future__ import absolute_import
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "10/01/2017"
+__date__ = "06/09/2017"
import logging
from silx.gui import qt
-from . import Plot3DActions
+from .. import actions
_logger = logging.getLogger(__name__)
-class Plot3DToolBar(qt.QToolBar):
+class InteractiveModeToolBar(qt.QToolBar):
+ """Toolbar providing icons to change the interaction mode
+
+ :param parent: See :class:`QWidget`
+ :param str title: Title of the toolbar.
+ """
+
+ def __init__(self, parent=None, title='Plot3D Interaction'):
+ super(InteractiveModeToolBar, self).__init__(title, parent)
+
+ self._plot3d = None
+
+ self._rotateAction = actions.mode.RotateArcballAction(parent=self)
+ self.addAction(self._rotateAction)
+
+ self._panAction = actions.mode.PanAction(parent=self)
+ self.addAction(self._panAction)
+
+ def setPlot3DWidget(self, widget):
+ """Set the Plot3DWidget this toolbar is associated with
+
+ :param Plot3DWidget widget: The widget to copy/save/print
+ """
+ self._plot3d = widget
+ self.getRotateAction().setPlot3DWidget(widget)
+ self.getPanAction().setPlot3DWidget(widget)
+
+ def getPlot3DWidget(self):
+ """Return the Plot3DWidget associated to this toolbar.
+
+ If no widget is associated, it returns None.
+
+ :rtype: qt.QWidget
+ """
+ return self._plot3d
+
+ def getRotateAction(self):
+ """Returns the QAction setting rotate interaction of the Plot3DWidget
+
+ :rtype: qt.QAction
+ """
+ return self._rotateAction
+
+ def getPanAction(self):
+ """Returns the QAction setting pan interaction of the Plot3DWidget
+
+ :rtype: qt.QAction
+ """
+ return self._panAction
+
+
+class OutputToolBar(qt.QToolBar):
"""Toolbar providing icons to copy, save and print the OpenGL scene
:param parent: See :class:`QWidget`
:param str title: Title of the toolbar.
"""
- def __init__(self, parent=None, title='Plot3D'):
- super(Plot3DToolBar, self).__init__(title, parent)
+ def __init__(self, parent=None, title='Plot3D Output'):
+ super(OutputToolBar, self).__init__(title, parent)
self._plot3d = None
- self._copyAction = Plot3DActions.CopyAction(parent=self)
+ self._copyAction = actions.io.CopyAction(parent=self)
self.addAction(self._copyAction)
- self._saveAction = Plot3DActions.SaveAction(parent=self)
+ self._saveAction = actions.io.SaveAction(parent=self)
self.addAction(self._saveAction)
- self._videoAction = Plot3DActions.VideoAction(parent=self)
+ self._videoAction = actions.io.VideoAction(parent=self)
self.addAction(self._videoAction)
- self._printAction = Plot3DActions.PrintAction(parent=self)
+ self._printAction = actions.io.PrintAction(parent=self)
self.addAction(self._printAction)
def setPlot3DWidget(self, widget):
diff --git a/silx/gui/setup.py b/silx/gui/setup.py
index fbe9058..163cabf 100644
--- a/silx/gui/setup.py
+++ b/silx/gui/setup.py
@@ -24,7 +24,7 @@
# ###########################################################################*/
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "16/01/2017"
+__date__ = "04/05/2017"
from numpy.distutils.misc_util import Configuration
diff --git a/silx/gui/test/test_icons.py b/silx/gui/test/test_icons.py
index f363c43..d747761 100644
--- a/silx/gui/test/test_icons.py
+++ b/silx/gui/test/test_icons.py
@@ -26,13 +26,17 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "06/09/2017"
import gc
import unittest
import weakref
+import tempfile
+import shutil
+import os
+import silx.resources
from silx.gui import qt
from silx.gui.test.utils import TestCaseQt
from silx.gui import icons
@@ -41,14 +45,49 @@ from silx.gui import icons
class TestIcons(TestCaseQt):
"""Test to check that icons module."""
+ @classmethod
+ def setUpClass(cls):
+ super(TestIcons, cls).setUpClass()
+
+ cls.tmpDirectory = tempfile.mkdtemp(prefix="resource_")
+ os.mkdir(os.path.join(cls.tmpDirectory, "gui"))
+ destination = os.path.join(cls.tmpDirectory, "gui", "icons")
+ os.mkdir(destination)
+ shutil.copy(silx.resources.resource_filename("gui/icons/zoom-in.png"), destination)
+ shutil.copy(silx.resources.resource_filename("gui/icons/zoom-out.svg"), destination)
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestIcons, cls).tearDownClass()
+ shutil.rmtree(cls.tmpDirectory)
+
+ def setUp(self):
+ # Store the original configuration
+ self._oldResources = dict(silx.resources._RESOURCE_DIRECTORIES)
+ silx.resources.register_resource_directory("test", "foo.bar", forced_path=self.tmpDirectory)
+ unittest.TestCase.setUp(self)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ # Restiture the original configuration
+ silx.resources._RESOURCE_DIRECTORIES = self._oldResources
+
+ def testIcon(self):
+ icon = icons.getQIcon("silx:gui/icons/zoom-out")
+ self.assertIsNotNone(icon)
+
+ def testPrefix(self):
+ icon = icons.getQIcon("silx:gui/icons/zoom-out")
+ self.assertIsNotNone(icon)
+
def testSvgIcon(self):
if "svg" not in qt.supportedImageFormats():
self.skipTest("SVG not supported")
- icon = icons.getQIcon("test-svg")
+ icon = icons.getQIcon("test:gui/icons/zoom-out")
self.assertIsNotNone(icon)
def testPngIcon(self):
- icon = icons.getQIcon("test-png")
+ icon = icons.getQIcon("test:gui/icons/zoom-in")
self.assertIsNotNone(icon)
def testUnexistingIcon(self):
@@ -99,16 +138,19 @@ class TestAnimatedIcons(TestCaseQt):
icon = icons.MultiImageAnimatedIcon("process-working")
self.assertIsNotNone(icon)
+ def testPrefixedResourceExists(self):
+ icon = icons.MultiImageAnimatedIcon("silx:gui/icons/process-working")
+ self.assertIsNotNone(icon)
+
def testMultiImageIconNotExists(self):
self.assertRaises(ValueError, icons.MultiImageAnimatedIcon, "not-exists")
def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestIcons))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestAnimatedIcons))
+ test_suite.addTest(loadTests(TestIcons))
+ test_suite.addTest(loadTests(TestAnimatedIcons))
return test_suite
diff --git a/silx/gui/test/utils.py b/silx/gui/test/utils.py
index 50cf7bf..19c448a 100644
--- a/silx/gui/test/utils.py
+++ b/silx/gui/test/utils.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2017 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
@@ -26,7 +26,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "11/04/2017"
+__date__ = "01/09/2017"
import gc
@@ -35,8 +35,8 @@ import unittest
import time
import functools
import sys
+import os
-logging.basicConfig()
_logger = logging.getLogger(__name__)
from silx.gui import qt
@@ -349,8 +349,36 @@ class TestCaseQt(unittest.TestCase):
return result
+ def logScreenShot(self, level=logging.ERROR):
+ """Take a screenshot and log it into the logging system if the
+ logger is enabled for the expected level.
-class SignalListener():
+ The screenshot is stored in the directory "./build/test-debug", and
+ the logging system only log the path to this file.
+
+ :param level: Logging level
+ """
+ if not _logger.isEnabledFor(level):
+ return
+ basedir = os.path.abspath(os.path.join("build", "test-debug"))
+ if not os.path.exists(basedir):
+ os.makedirs(basedir)
+ filename = "Screenshot_%s.png" % self.id()
+ filename = os.path.join(basedir, filename)
+
+ if not hasattr(self.qapp, "primaryScreen"):
+ # Qt4
+ winId = qt.QApplication.desktop().winId()
+ pixmap = qt.QPixmap.grabWindow(winId)
+ else:
+ # Qt5
+ screen = self.qapp.primaryScreen()
+ pixmap = screen.grabWindow(0)
+ pixmap.save(filename)
+ _logger.log(level, "Screenshot saved at %s", filename)
+
+
+class SignalListener(object):
"""Util to listen a Qt event and store parameters
"""
diff --git a/silx/gui/widgets/FloatEdit.py b/silx/gui/widgets/FloatEdit.py
new file mode 100644
index 0000000..fd6d8a7
--- /dev/null
+++ b/silx/gui/widgets/FloatEdit.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""Module contains a float editor
+"""
+
+from __future__ import division
+
+__authors__ = ["V.A. Sole", "T. Vincent"]
+__license__ = "MIT"
+__date__ = "02/10/2017"
+
+from .. import qt
+
+
+class FloatEdit(qt.QLineEdit):
+ """Field to edit a float value.
+
+ :param parent: See :class:`QLineEdit`
+ :param float value: The value to set the QLineEdit to.
+ """
+ def __init__(self, parent=None, value=None):
+ qt.QLineEdit.__init__(self, parent)
+ validator = qt.QDoubleValidator(self)
+ self.setValidator(validator)
+ self.setAlignment(qt.Qt.AlignRight)
+ if value is not None:
+ self.setValue(value)
+
+ def value(self):
+ """Return the QLineEdit current value as a float."""
+ text = self.text()
+ value, validated = self.validator().locale().toDouble(text)
+ if not validated:
+ self.setValue(value)
+ return value
+
+ def setValue(self, value):
+ """Set the current value of the LineEdit
+
+ :param float value: The value to set the QLineEdit to.
+ """
+ text = self.validator().locale().toString(value)
+ self.setText(text)
diff --git a/silx/gui/widgets/FrameBrowser.py b/silx/gui/widgets/FrameBrowser.py
index 783a70a..6737e9c 100644
--- a/silx/gui/widgets/FrameBrowser.py
+++ b/silx/gui/widgets/FrameBrowser.py
@@ -43,6 +43,8 @@ class FrameBrowser(qt.QWidget):
"""Frame browser widget, with 4 buttons/icons and a line edit to provide
a way of selecting a frame index in a stack of images.
+ .. image:: img/FrameBrowser.png
+
It can be used in more generic case to select an integer within a range.
:param QWidget parent: Parent widget
@@ -215,6 +217,8 @@ class HorizontalSliderWithBrowser(qt.QAbstractSlider):
"""
Slider widget combining a :class:`QSlider` and a :class:`FrameBrowser`.
+ .. image:: img/HorizontalSliderWithBrowser.png
+
The data model is an integer within a range.
The default value is the default :class:`QSlider` value (0),
diff --git a/silx/gui/widgets/PeriodicTable.py b/silx/gui/widgets/PeriodicTable.py
index 2f1ca78..db71483 100644
--- a/silx/gui/widgets/PeriodicTable.py
+++ b/silx/gui/widgets/PeriodicTable.py
@@ -499,6 +499,8 @@ class _ElementButton(qt.QPushButton):
class PeriodicTable(qt.QWidget):
"""Periodic Table widget
+ .. image:: img/PeriodicTable.png
+
The following example shows how to connect clicking to selection::
from silx.gui import qt
@@ -686,6 +688,8 @@ class PeriodicCombo(qt.QComboBox):
"""
Combo list with all atomic elements of the periodic table
+ .. image:: img/PeriodicCombo.png
+
:param bool detailed: True (default) display element symbol, Z and name.
False display only element symbol and Z.
:param elements: List of items (:class:`PeriodicTableItem` objects) to
@@ -741,6 +745,8 @@ class PeriodicCombo(qt.QComboBox):
class PeriodicList(qt.QTreeWidget):
"""List of atomic elements in a :class:`QTreeView`
+ .. image:: img/PeriodicList.png
+
:param QWidget parent: Parent widget
:param bool detailed: True (default) display element symbol, Z and name.
False display only element symbol and Z.
diff --git a/silx/gui/widgets/PrintGeometryDialog.py b/silx/gui/widgets/PrintGeometryDialog.py
new file mode 100644
index 0000000..0613ce0
--- /dev/null
+++ b/silx/gui/widgets/PrintGeometryDialog.py
@@ -0,0 +1,222 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+
+
+from silx.gui import qt
+from silx.gui.widgets.FloatEdit import FloatEdit
+
+
+class PrintGeometryWidget(qt.QWidget):
+ """Widget to specify the size and aspect ratio of an item
+ before sending it to the print preview dialog.
+
+ Use methods :meth:`setPrintGeometry` and :meth:`getPrintGeometry`
+ to interact with the widget.
+ """
+ def __init__(self, parent=None):
+ super(PrintGeometryWidget, self).__init__(parent)
+ self.mainLayout = qt.QGridLayout(self)
+ self.mainLayout.setContentsMargins(0, 0, 0, 0)
+ self.mainLayout.setSpacing(2)
+ hbox = qt.QWidget()
+ hboxLayout = qt.QHBoxLayout(hbox)
+ hboxLayout.setContentsMargins(0, 0, 0, 0)
+ hboxLayout.setSpacing(2)
+ label = qt.QLabel(self)
+ label.setText("Units")
+ label.setAlignment(qt.Qt.AlignCenter)
+ self._pageButton = qt.QRadioButton()
+ self._pageButton.setText("Page")
+ self._inchButton = qt.QRadioButton()
+ self._inchButton.setText("Inches")
+ self._cmButton = qt.QRadioButton()
+ self._cmButton.setText("Centimeters")
+ self._buttonGroup = qt.QButtonGroup(self)
+ self._buttonGroup.addButton(self._pageButton)
+ self._buttonGroup.addButton(self._inchButton)
+ self._buttonGroup.addButton(self._cmButton)
+ self._buttonGroup.setExclusive(True)
+
+ # units
+ self.mainLayout.addWidget(label, 0, 0, 1, 4)
+ hboxLayout.addWidget(self._pageButton)
+ hboxLayout.addWidget(self._inchButton)
+ hboxLayout.addWidget(self._cmButton)
+ self.mainLayout.addWidget(hbox, 1, 0, 1, 4)
+ self._pageButton.setChecked(True)
+
+ # xOffset
+ label = qt.QLabel(self)
+ label.setText("X Offset:")
+ self.mainLayout.addWidget(label, 2, 0)
+ self._xOffset = FloatEdit(self, 0.1)
+ self.mainLayout.addWidget(self._xOffset, 2, 1)
+
+ # yOffset
+ label = qt.QLabel(self)
+ label.setText("Y Offset:")
+ self.mainLayout.addWidget(label, 2, 2)
+ self._yOffset = FloatEdit(self, 0.1)
+ self.mainLayout.addWidget(self._yOffset, 2, 3)
+
+ # width
+ label = qt.QLabel(self)
+ label.setText("Width:")
+ self.mainLayout.addWidget(label, 3, 0)
+ self._width = FloatEdit(self, 0.9)
+ self.mainLayout.addWidget(self._width, 3, 1)
+
+ # height
+ label = qt.QLabel(self)
+ label.setText("Height:")
+ self.mainLayout.addWidget(label, 3, 2)
+ self._height = FloatEdit(self, 0.9)
+ self.mainLayout.addWidget(self._height, 3, 3)
+
+ # aspect ratio
+ self._aspect = qt.QCheckBox(self)
+ self._aspect.setText("Keep screen aspect ratio")
+ self._aspect.setChecked(True)
+ self.mainLayout.addWidget(self._aspect, 4, 1, 1, 2)
+
+ def getPrintGeometry(self):
+ """Return the print geometry dictionary.
+
+ See :meth:`setPrintGeometry` for documentation about the
+ print geometry dictionary."""
+ ddict = {}
+ if self._inchButton.isChecked():
+ ddict['units'] = "inches"
+ elif self._cmButton.isChecked():
+ ddict['units'] = "centimeters"
+ else:
+ ddict['units'] = "page"
+
+ ddict['xOffset'] = self._xOffset.value()
+ ddict['yOffset'] = self._yOffset.value()
+ ddict['width'] = self._width.value()
+ ddict['height'] = self._height.value()
+
+ if self._aspect.isChecked():
+ ddict['keepAspectRatio'] = True
+ else:
+ ddict['keepAspectRatio'] = False
+ return ddict
+
+ def setPrintGeometry(self, geometry=None):
+ """Set the print geometry.
+
+ The geometry parameters must be provided as a dictionary with
+ the following keys:
+
+ - *"xOffset"* (float)
+ - *"yOffset"* (float)
+ - *"width"* (float)
+ - *"height"* (float)
+ - *"units"*: possible values *"page", "inch", "cm"*
+ - *"keepAspectRatio"*: *True* or *False*
+
+ If *units* is *"page"*, the values should be floats in [0, 1.]
+ and are interpreted as a fraction of the page width or height.
+
+ :param dict geometry: Geometry parameters, as a dictionary."""
+ if geometry is None:
+ geometry = {}
+ oldDict = self.getPrintGeometry()
+ for key in ["units", "xOffset", "yOffset",
+ "width", "height", "keepAspectRatio"]:
+ geometry[key] = geometry.get(key, oldDict[key])
+
+ if geometry['units'].lower().startswith("inc"):
+ self._inchButton.setChecked(True)
+ elif geometry['units'].lower().startswith("c"):
+ self._cmButton.setChecked(True)
+ else:
+ self._pageButton.setChecked(True)
+
+ self._xOffset.setText("%s" % float(geometry['xOffset']))
+ self._yOffset.setText("%s" % float(geometry['yOffset']))
+ self._width.setText("%s" % float(geometry['width']))
+ self._height.setText("%s" % float(geometry['height']))
+ if geometry['keepAspectRatio']:
+ self._aspect.setChecked(True)
+ else:
+ self._aspect.setChecked(False)
+
+
+class PrintGeometryDialog(qt.QDialog):
+ """Dialog embedding a :class:`PrintGeometryWidget`.
+
+ Use methods :meth:`setPrintGeometry` and :meth:`getPrintGeometry`
+ to interact with the widget.
+
+ Execute method :meth:`exec_` to run the dialog.
+ The return value of that method is *True* if the geometry was set
+ (*Ok* button clicked) or *False* if the user clicked the *Cancel*
+ button.
+ """
+
+ def __init__(self, parent=None):
+ qt.QDialog.__init__(self, parent)
+ self.setWindowTitle("Set print size preferences")
+ layout = qt.QVBoxLayout(self)
+ layout.setContentsMargins(0, 0, 0, 0)
+ layout.setSpacing(0)
+ self.configurationWidget = PrintGeometryWidget(self)
+ hbox = qt.QWidget(self)
+ hboxLayout = qt.QHBoxLayout(hbox)
+ self.okButton = qt.QPushButton(hbox)
+ self.okButton.setText("Accept")
+ self.okButton.setAutoDefault(False)
+ self.rejectButton = qt.QPushButton(hbox)
+ self.rejectButton.setText("Dismiss")
+ self.rejectButton.setAutoDefault(False)
+ self.okButton.clicked.connect(self.accept)
+ self.rejectButton.clicked.connect(self.reject)
+ hboxLayout.setContentsMargins(0, 0, 0, 0)
+ hboxLayout.setSpacing(2)
+ # hboxLayout.addWidget(qt.HorizontalSpacer(hbox))
+ hboxLayout.addWidget(self.okButton)
+ hboxLayout.addWidget(self.rejectButton)
+ # hboxLayout.addWidget(qt.HorizontalSpacer(hbox))
+ layout.addWidget(self.configurationWidget)
+ layout.addWidget(hbox)
+
+ def setPrintGeometry(self, geometry):
+ """Return the print geometry dictionary.
+
+ See :meth:`PrintGeometryWidget.setPrintGeometry` for documentation on
+ print geometry dictionary.
+
+ :param dict geometry: Print geometry parameters dictionary.
+ """
+ self.configurationWidget.setPrintGeometry(geometry)
+
+ def getPrintGeometry(self):
+ """Return the print geometry dictionary.
+
+ See :meth:`PrintGeometryWidget.setPrintGeometry` for documentation on
+ print geometry dictionary."""
+ return self.configurationWidget.getPrintGeometry()
diff --git a/silx/gui/widgets/PrintPreview.py b/silx/gui/widgets/PrintPreview.py
new file mode 100644
index 0000000..158d6b7
--- /dev/null
+++ b/silx/gui/widgets/PrintPreview.py
@@ -0,0 +1,704 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2004-2017 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.
+#
+# ###########################################################################*/
+"""This module implements a print preview dialog.
+
+The dialog provides methods to send images, pixmaps and SVG
+items to the page to be printed.
+
+The user can interactively move and resize the items.
+"""
+import sys
+import logging
+from silx.gui import qt
+
+
+__authors__ = ["V.A. Sole", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "11/07/2017"
+
+
+_logger = logging.getLogger(__name__)
+
+
+class PrintPreviewDialog(qt.QDialog):
+ """Print preview dialog widget.
+ """
+ def __init__(self, parent=None, printer=None):
+
+ qt.QDialog.__init__(self, parent)
+ self.setWindowTitle("Print Preview")
+ self.setModal(False)
+ self.resize(400, 500)
+
+ self.mainLayout = qt.QVBoxLayout(self)
+ self.mainLayout.setContentsMargins(0, 0, 0, 0)
+ self.mainLayout.setSpacing(0)
+
+ self._buildToolbar()
+
+ self.printer = printer
+ # :class:`QPrinter` (paint device that paints on a printer).
+ # :meth:`showEvent` has been reimplemented to enforce printer
+ # setup.
+
+ self.printDialog = None
+ # :class:`QPrintDialog` (dialog for specifying the printer's
+ # configuration)
+
+ self.scene = None
+ # :class:`QGraphicsScene` (surface for managing
+ # 2D graphical items)
+
+ self.page = None
+ # :class:`QGraphicsRectItem` used as white background page on which
+ # to display the print preview.
+
+ self.view = None
+ # :class:`QGraphicsView` widget for displaying :attr:`scene`
+
+ self._svgItems = []
+ # List storing :class:`QSvgRenderer` items to be printed, added in
+ # :meth:`addSvgItem`, cleared in :meth:`_clearAll`.
+ # This ensures that there is a reference pointing to the items,
+ # which ensures they are not destroyed before being printed.
+
+ self._viewScale = 1.0
+ # Zoom level (1.0 is 100%)
+
+ self._toBeCleared = False
+ # Flag indicating that all items must be removed from :attr:`scene`
+ # and from :attr:`_svgItems`.
+ # Set to True after a successful printing. The widget is then hidden,
+ # and it will be cleared the next time it is shown.
+ # Reset to False after :meth:`_clearAll` has done its job.
+
+ def _buildToolbar(self):
+ toolBar = qt.QWidget(self)
+ # a layout for the toolbar
+ toolsLayout = qt.QHBoxLayout(toolBar)
+ toolsLayout.setContentsMargins(0, 0, 0, 0)
+ toolsLayout.setSpacing(0)
+
+ hideBut = qt.QPushButton("Hide", toolBar)
+ hideBut.setToolTip("Hide print preview dialog")
+ hideBut.clicked.connect(self.hide)
+
+ cancelBut = qt.QPushButton("Clear All", toolBar)
+ cancelBut.setToolTip("Remove all items")
+ cancelBut.clicked.connect(self._clearAll)
+
+ removeBut = qt.QPushButton("Remove",
+ toolBar)
+ removeBut.setToolTip("Remove selected item (use left click to select)")
+ removeBut.clicked.connect(self._remove)
+
+ setupBut = qt.QPushButton("Setup", toolBar)
+ setupBut.setToolTip("Select and configure a printer")
+ setupBut.clicked.connect(self.setup)
+
+ printBut = qt.QPushButton("Print", toolBar)
+ printBut.setToolTip("Print page and close print preview")
+ printBut.clicked.connect(self._print)
+
+ zoomPlusBut = qt.QPushButton("Zoom +", toolBar)
+ zoomPlusBut.clicked.connect(self._zoomPlus)
+
+ zoomMinusBut = qt.QPushButton("Zoom -", toolBar)
+ zoomMinusBut.clicked.connect(self._zoomMinus)
+
+ toolsLayout.addWidget(hideBut)
+ toolsLayout.addWidget(printBut)
+ toolsLayout.addWidget(cancelBut)
+ toolsLayout.addWidget(removeBut)
+ toolsLayout.addWidget(setupBut)
+ # toolsLayout.addStretch()
+ # toolsLayout.addWidget(marginLabel)
+ # toolsLayout.addWidget(self.marginSpin)
+ toolsLayout.addStretch()
+ # toolsLayout.addWidget(scaleLabel)
+ # toolsLayout.addWidget(self.scaleCombo)
+ toolsLayout.addWidget(zoomPlusBut)
+ toolsLayout.addWidget(zoomMinusBut)
+ # toolsLayout.addStretch()
+ self.toolBar = toolBar
+ self.mainLayout.addWidget(self.toolBar)
+
+ def _buildStatusBar(self):
+ """Create the status bar used to display the printer name
+ or output file name."""
+ # status bar
+ statusBar = qt.QStatusBar(self)
+ self.targetLabel = qt.QLabel(statusBar)
+ self._updateTargetLabel()
+ statusBar.addWidget(self.targetLabel)
+ self.mainLayout.addWidget(statusBar)
+
+ def _updateTargetLabel(self):
+ """Update printer name or file name shown in the status bar."""
+ if self.printer is None:
+ self.targetLabel.setText("Undefined printer")
+ return
+ if self.printer.outputFileName():
+ self.targetLabel.setText("File:" +
+ self.printer.outputFileName())
+ else:
+ self.targetLabel.setText("Printer:" +
+ self.printer.printerName())
+
+ def _updatePrinter(self):
+ """Resize :attr:`page`, :attr:`scene` and :attr:`view` to :attr:`printer`
+ width and height."""
+ printer = self.printer
+ assert printer is not None, \
+ "_updatePrinter should not be called unless a printer is defined"
+ if self.scene is None:
+ self.scene = qt.QGraphicsScene()
+ self.scene.setBackgroundBrush(qt.QColor(qt.Qt.lightGray))
+ self.scene.setSceneRect(qt.QRectF(0, 0, printer.width(), printer.height()))
+
+ if self.page is None:
+ self.page = qt.QGraphicsRectItem(0, 0, printer.width(), printer.height())
+ self.page.setBrush(qt.QColor(qt.Qt.white))
+ self.scene.addItem(self.page)
+
+ self.scene.setSceneRect(qt.QRectF(0, 0, printer.width(), printer.height()))
+ self.page.setPos(qt.QPointF(0.0, 0.0))
+ self.page.setRect(qt.QRectF(0, 0, printer.width(), printer.height()))
+
+ if self.view is None:
+ self.view = qt.QGraphicsView(self.scene)
+ self.mainLayout.addWidget(self.view)
+ self._buildStatusBar()
+ # self.view.scale(1./self._viewScale, 1./self._viewScale)
+ self.view.fitInView(self.page.rect(), qt.Qt.KeepAspectRatio)
+ self._viewScale = 1.00
+ self._updateTargetLabel()
+
+ # Public methods
+ def addImage(self, image, title=None, comment=None, commentPosition=None):
+ """Add an image to the print preview scene.
+
+ :param QImage image: Image to be added to the scene
+ :param str title: Title shown above (centered) the image
+ :param str comment: Comment displayed below the image
+ :param commentPosition: "CENTER" or "LEFT"
+ """
+ self.addPixmap(qt.QPixmap.fromImage(image),
+ title=title, comment=comment,
+ commentPosition=commentPosition)
+
+ def addPixmap(self, pixmap, title=None, comment=None, commentPosition=None):
+ """Add a pixmap to the print preview scene
+
+ :param QPixmap pixmap: Pixmap to be added to the scene
+ :param str title: Title shown above (centered) the pixmap
+ :param str comment: Comment displayed below the pixmap
+ :param commentPosition: "CENTER" or "LEFT"
+ """
+ if self._toBeCleared:
+ self._clearAll()
+ self.ensurePrinterIsSet()
+ if self.printer is None:
+ _logger.error("printer is not set, cannot add pixmap to page")
+ return
+ if title is None:
+ title = ' ' * 88
+ if comment is None:
+ comment = ' ' * 88
+ if commentPosition is None:
+ commentPosition = "CENTER"
+ if qt.qVersion() < "5.0":
+ rectItem = qt.QGraphicsRectItem(self.page, self.scene)
+ else:
+ rectItem = qt.QGraphicsRectItem(self.page)
+
+ rectItem.setRect(qt.QRectF(1, 1,
+ pixmap.width(), pixmap.height()))
+
+ pen = rectItem.pen()
+ color = qt.QColor(qt.Qt.red)
+ color.setAlpha(1)
+ pen.setColor(color)
+ rectItem.setPen(pen)
+ rectItem.setZValue(1)
+ rectItem.setFlag(qt.QGraphicsItem.ItemIsSelectable, True)
+ rectItem.setFlag(qt.QGraphicsItem.ItemIsMovable, True)
+ rectItem.setFlag(qt.QGraphicsItem.ItemIsFocusable, False)
+
+ rectItemResizeRect = _GraphicsResizeRectItem(rectItem, self.scene)
+ rectItemResizeRect.setZValue(2)
+
+ if qt.qVersion() < "5.0":
+ pixmapItem = qt.QGraphicsPixmapItem(rectItem, self.scene)
+ else:
+ pixmapItem = qt.QGraphicsPixmapItem(rectItem)
+ pixmapItem.setPixmap(pixmap)
+ pixmapItem.setZValue(0)
+
+ # I add the title
+ if qt.qVersion() < "5.0":
+ textItem = qt.QGraphicsTextItem(title, rectItem, self.scene)
+ else:
+ textItem = qt.QGraphicsTextItem(title, rectItem)
+ textItem.setTextInteractionFlags(qt.Qt.TextEditorInteraction)
+ offset = 0.5 * textItem.boundingRect().width()
+ textItem.moveBy(0.5 * pixmap.width() - offset, -20)
+ textItem.setZValue(2)
+
+ # I add the comment
+ if qt.qVersion() < "5.0":
+ commentItem = qt.QGraphicsTextItem(comment, rectItem, self.scene)
+ else:
+ commentItem = qt.QGraphicsTextItem(comment, rectItem)
+ commentItem.setTextInteractionFlags(qt.Qt.TextEditorInteraction)
+ offset = 0.5 * commentItem.boundingRect().width()
+ if commentPosition.upper() == "LEFT":
+ x = 1
+ else:
+ x = 0.5 * pixmap.width() - offset
+ commentItem.moveBy(x, pixmap.height() + 20)
+ commentItem.setZValue(2)
+
+ rectItem.moveBy(20, 40)
+
+ def addSvgItem(self, item, title=None,
+ comment=None, commentPosition=None,
+ viewBox=None):
+ """Add a SVG item to the scene.
+
+ :param QSvgRenderer item: SVG item to be added to the scene.
+ :param str title: Title shown above (centered) the SVG item.
+ :param str comment: Comment displayed below the SVG item.
+ :param str commentPosition: "CENTER" or "LEFT"
+ :param QRectF viewBox: Bounding box for the item on the print page
+ (xOffset, yOffset, width, height). If None, use original
+ item size.
+ """
+ if not qt.HAS_SVG:
+ raise RuntimeError("Missing QtSvg library.")
+ if not isinstance(item, qt.QSvgRenderer):
+ raise TypeError("addSvgItem: QSvgRenderer expected")
+ if self._toBeCleared:
+ self._clearAll()
+ self.ensurePrinterIsSet()
+ if self.printer is None:
+ _logger.error("printer is not set, cannot add SvgItem to page")
+ return
+
+ if title is None:
+ title = 50 * ' '
+ if comment is None:
+ comment = 80 * ' '
+ if commentPosition is None:
+ commentPosition = "CENTER"
+
+ if viewBox is None:
+ if hasattr(item, "_viewBox"):
+ # PyMca compatibility: viewbox attached to item
+ viewBox = item._viewBox
+ else:
+ # try the original item viewbox
+ viewBox = item.viewBoxF()
+
+ svgItem = _GraphicsSvgRectItem(viewBox, self.page)
+ svgItem.setSvgRenderer(item)
+
+ svgItem.setCacheMode(qt.QGraphicsItem.NoCache)
+ svgItem.setZValue(0)
+ svgItem.setFlag(qt.QGraphicsItem.ItemIsSelectable, True)
+ svgItem.setFlag(qt.QGraphicsItem.ItemIsMovable, True)
+ svgItem.setFlag(qt.QGraphicsItem.ItemIsFocusable, False)
+
+ rectItemResizeRect = _GraphicsResizeRectItem(svgItem, self.scene)
+ rectItemResizeRect.setZValue(2)
+
+ self._svgItems.append(item)
+
+ if qt.qVersion() < '5.0':
+ textItem = qt.QGraphicsTextItem(title, svgItem, self.scene)
+ else:
+ textItem = qt.QGraphicsTextItem(title, svgItem)
+ textItem.setTextInteractionFlags(qt.Qt.TextEditorInteraction)
+ title_offset = 0.5 * textItem.boundingRect().width()
+ textItem.setZValue(1)
+ textItem.setFlag(qt.QGraphicsItem.ItemIsMovable, True)
+
+ dummyComment = 80 * "1"
+ if qt.qVersion() < '5.0':
+ commentItem = qt.QGraphicsTextItem(dummyComment, svgItem, self.scene)
+ else:
+ commentItem = qt.QGraphicsTextItem(dummyComment, svgItem)
+ commentItem.setTextInteractionFlags(qt.Qt.TextEditorInteraction)
+ scaleCalculationRect = qt.QRectF(commentItem.boundingRect())
+ scale = svgItem.boundingRect().width() / scaleCalculationRect.width()
+ comment_offset = 0.5 * commentItem.boundingRect().width()
+ if commentPosition.upper() == "LEFT":
+ x = 1
+ else:
+ x = 0.5 * svgItem.boundingRect().width() - comment_offset * scale # fixme: centering
+ commentItem.moveBy(svgItem.boundingRect().x() + x,
+ svgItem.boundingRect().y() + svgItem.boundingRect().height())
+ commentItem.setPlainText(comment)
+ commentItem.setZValue(1)
+
+ commentItem.setFlag(qt.QGraphicsItem.ItemIsMovable, True)
+ if qt.qVersion() < "5.0":
+ commentItem.scale(scale, scale)
+ else:
+ # the correct equivalent would be:
+ # rectItem.setTransform(qt.QTransform.fromScale(scalex, scaley))
+ commentItem.setScale(scale)
+ textItem.moveBy(svgItem.boundingRect().x() +
+ 0.5 * svgItem.boundingRect().width() - title_offset * scale,
+ svgItem.boundingRect().y())
+ if qt.qVersion() < "5.0":
+ textItem.scale(scale, scale)
+ else:
+ # the correct equivalent would be:
+ # rectItem.setTransform(qt.QTransform.fromScale(scalex, scaley))
+ textItem.setScale(scale)
+
+ def setup(self):
+ """Open a print dialog to ensure the :attr:`printer` is set.
+
+ If the setting fails or is cancelled, :attr:`printer` is reset to
+ *None*.
+ """
+ if self.printer is None:
+ self.printer = qt.QPrinter()
+ if self.printDialog is None:
+ self.printDialog = qt.QPrintDialog(self.printer, self)
+ if self.printDialog.exec_():
+ if self.printer.width() <= 0 or self.printer.height() <= 0:
+ self.message = qt.QMessageBox(self)
+ self.message.setIcon(qt.QMessageBox.Critical)
+ self.message.setText("Unknown library error \non printer initialization")
+ self.message.setWindowTitle("Library Error")
+ self.message.setModal(0)
+ self.printer = None
+ return
+ self.printer.setFullPage(True)
+ self._updatePrinter()
+ else:
+ # printer setup cancelled, check for a possible previous configuration
+ if self.page is None:
+ # not initialized
+ self.printer = None
+
+ def ensurePrinterIsSet(self):
+ """If the printer is not already set, try to interactively
+ setup the printer using a QPrintDialog.
+ In case of failure, hide widget and log a warning.
+ """
+ if self.printer is None:
+ self.setup()
+ if self.printer is None:
+ self.hide()
+ _logger.warning("Printer setup failed or was cancelled, " +
+ "but printer is required.")
+
+ def setOutputFileName(self, name):
+ """Set output filename.
+
+ Setting a non-empty name enables printing to file.
+
+ :param str name: File name (path)"""
+ self.printer.setOutputFileName(name)
+
+ # overloaded methods
+ def exec_(self):
+ if self._toBeCleared:
+ self._clearAll()
+ return qt.QDialog.exec_(self)
+
+ def raise_(self):
+ if self._toBeCleared:
+ self._clearAll()
+ return qt.QDialog.raise_(self)
+
+ def showEvent(self, event):
+ """Reimplemented to force printer setup.
+ In case of failure, hide the widget."""
+ if self._toBeCleared:
+ self._clearAll()
+ self.ensurePrinterIsSet()
+
+ return super(PrintPreviewDialog, self).showEvent(event)
+
+ # button callbacks
+ def _print(self):
+ """Do the printing, hide the print preview dialog,
+ set :attr:`_toBeCleared` flag to True to trigger clearing the
+ next time the dialog is shown.
+
+ If the printer is not setup, do it first."""
+ printer = self.printer
+
+ painter = qt.QPainter()
+ if not painter.begin(printer) or printer is None:
+ _logger.error("Cannot initialize printer")
+ return
+ try:
+ self.scene.render(painter, qt.QRectF(0, 0, printer.width(), printer.height()),
+ qt.QRectF(self.page.rect().x(), self.page.rect().y(),
+ self.page.rect().width(), self.page.rect().height()),
+ qt.Qt.KeepAspectRatio)
+ painter.end()
+ self.hide()
+ self.accept()
+ self._toBeCleared = True
+ except: # FIXME
+ painter.end()
+ qt.QMessageBox.critical(self, "ERROR",
+ 'Printing problem:\n %s' % sys.exc_info()[1])
+ _logger.error('printing problem:\n %s' % sys.exc_info()[1])
+ return
+
+ def _zoomPlus(self):
+ self._viewScale *= 1.20
+ self.view.scale(1.20, 1.20)
+
+ def _zoomMinus(self):
+ self._viewScale *= 0.80
+ self.view.scale(0.80, 0.80)
+
+ def _clearAll(self):
+ """
+ Clear the print preview window, remove all items
+ but keep the page.
+ """
+ itemlist = self.scene.items()
+ keep = self.page
+ while len(itemlist) != 1:
+ if itemlist.index(keep) == 0:
+ self.scene.removeItem(itemlist[1])
+ else:
+ self.scene.removeItem(itemlist[0])
+ itemlist = self.scene.items()
+ self._svgItems = []
+ self._toBeCleared = False
+
+ def _remove(self):
+ """Remove selected item in :attr:`scene`.
+ """
+ itemlist = self.scene.items()
+
+ # this loop is not efficient if there are many items ...
+ for item in itemlist:
+ if item.isSelected():
+ self.scene.removeItem(item)
+
+
+class SingletonPrintPreviewDialog(PrintPreviewDialog):
+ """Singleton print preview dialog.
+
+ All widgets in a program that instantiate this class will share
+ a single print preview dialog. This enables sending
+ multiple images to a single page to be printed.
+ """
+ _instance = None
+
+ def __new__(self, *var, **kw):
+ if self._instance is None:
+ self._instance = PrintPreviewDialog(*var, **kw)
+ return self._instance
+
+
+class _GraphicsSvgRectItem(qt.QGraphicsRectItem):
+ """:class:`qt.QGraphicsRectItem` with an attached
+ :class:`qt.QSvgRenderer`, and with a painter redefined to render
+ the SVG item."""
+ def setSvgRenderer(self, renderer):
+ """
+
+ :param QSvgRenderer renderer: svg renderer
+ """
+ self._renderer = renderer
+
+ def paint(self, painter, *var, **kw):
+ self._renderer.render(painter, self.boundingRect())
+
+
+class _GraphicsResizeRectItem(qt.QGraphicsRectItem):
+ """Resizable QGraphicsRectItem."""
+ def __init__(self, parent=None, scene=None, keepratio=True):
+ if qt.qVersion() < '5.0':
+ qt.QGraphicsRectItem.__init__(self, parent, scene)
+ else:
+ qt.QGraphicsRectItem.__init__(self, parent)
+ rect = parent.boundingRect()
+ x = rect.x()
+ y = rect.y()
+ w = rect.width()
+ h = rect.height()
+ self._newRect = None
+ self.keepRatio = keepratio
+ self.setRect(qt.QRectF(x + w - 40, y + h - 40, 40, 40))
+ self.setAcceptHoverEvents(True)
+ pen = qt.QPen()
+ color = qt.QColor(qt.Qt.white)
+ color.setAlpha(0)
+ pen.setColor(color)
+ pen.setStyle(qt.Qt.NoPen)
+ self.setPen(pen)
+ self.setBrush(color)
+ self.setFlag(self.ItemIsMovable, True)
+ self.show()
+
+ def hoverEnterEvent(self, event):
+ if self.parentItem().isSelected():
+ self.parentItem().setSelected(False)
+ if self.keepRatio:
+ self.setCursor(qt.QCursor(qt.Qt.SizeFDiagCursor))
+ else:
+ self.setCursor(qt.QCursor(qt.Qt.SizeAllCursor))
+ self.setBrush(qt.QBrush(qt.Qt.yellow, qt.Qt.SolidPattern))
+ return qt.QGraphicsRectItem.hoverEnterEvent(self, event)
+
+ def hoverLeaveEvent(self, event):
+ self.setCursor(qt.QCursor(qt.Qt.ArrowCursor))
+ pen = qt.QPen()
+ color = qt.QColor(qt.Qt.white)
+ color.setAlpha(0)
+ pen.setColor(color)
+ pen.setStyle(qt.Qt.NoPen)
+ self.setPen(pen)
+ self.setBrush(color)
+ return qt.QGraphicsRectItem.hoverLeaveEvent(self, event)
+
+ def mousePressEvent(self, event):
+ if self._newRect is not None:
+ self._newRect = None
+ self._point0 = self.pos()
+ parent = self.parentItem()
+ scene = self.scene()
+ # following line prevents dragging along the previously selected
+ # item when resizing another one
+ scene.clearSelection()
+ rect = parent.rect()
+ self._x = rect.x()
+ self._y = rect.y()
+ self._w = rect.width()
+ self._h = rect.height()
+ self._ratio = self._w / self._h
+ if qt.qVersion() < "5.0":
+ self._newRect = qt.QGraphicsRectItem(parent, scene)
+ else:
+ self._newRect = qt.QGraphicsRectItem(parent)
+ self._newRect.setRect(qt.QRectF(self._x,
+ self._y,
+ self._w,
+ self._h))
+ qt.QGraphicsRectItem.mousePressEvent(self, event)
+
+ def mouseMoveEvent(self, event):
+ point1 = self.pos()
+ deltax = point1.x() - self._point0.x()
+ deltay = point1.y() - self._point0.y()
+ if self.keepRatio:
+ r1 = (self._w + deltax) / self._w
+ r2 = (self._h + deltay) / self._h
+ if r1 < r2:
+ self._newRect.setRect(qt.QRectF(self._x,
+ self._y,
+ self._w + deltax,
+ (self._w + deltax) / self._ratio))
+ else:
+ self._newRect.setRect(qt.QRectF(self._x,
+ self._y,
+ (self._h + deltay) * self._ratio,
+ self._h + deltay))
+ else:
+ self._newRect.setRect(qt.QRectF(self._x,
+ self._y,
+ self._w + deltax,
+ self._h + deltay))
+ qt.QGraphicsRectItem.mouseMoveEvent(self, event)
+
+ def mouseReleaseEvent(self, event):
+ point1 = self.pos()
+ deltax = point1.x() - self._point0.x()
+ deltay = point1.y() - self._point0.y()
+ self.moveBy(-deltax, -deltay)
+ parent = self.parentItem()
+
+ # deduce scale from rectangle
+ if (qt.qVersion() < "5.0") or self.keepRatio:
+ scalex = self._newRect.rect().width() / self._w
+ scaley = scalex
+ else:
+ scalex = self._newRect.rect().width() / self._w
+ scaley = self._newRect.rect().height() / self._h
+ if qt.qVersion() < "5.0":
+ parent.scale(scalex, scaley)
+ else:
+ # the correct equivalent would be:
+ # rectItem.setTransform(qt.QTransform.fromScale(scalex, scaley))
+ parent.setScale(scalex)
+
+ self.scene().removeItem(self._newRect)
+ self._newRect = None
+ qt.QGraphicsRectItem.mouseReleaseEvent(self, event)
+
+
+def main():
+ """
+ """
+ import sys
+
+ if len(sys.argv) < 2:
+ print("give an image file as parameter please.")
+ sys.exit(1)
+
+ if len(sys.argv) > 2:
+ print("only one parameter please.")
+ sys.exit(1)
+
+ filename = sys.argv[1]
+ w = PrintPreviewDialog()
+ w.resize(400, 500)
+
+ comment = ""
+ for i in range(20):
+ comment += "Line number %d: En un lugar de La Mancha de cuyo nombre ...\n" % i
+
+ if filename[-3:] == "svg":
+ item = qt.QSvgRenderer(filename, w.page)
+ w.addSvgItem(item, title=filename,
+ comment=comment, commentPosition="CENTER")
+ else:
+ w.addPixmap(qt.QPixmap.fromImage(qt.QImage(filename)),
+ title=filename,
+ comment=comment,
+ commentPosition="CENTER")
+ w.addImage(qt.QImage(filename), comment=comment, commentPosition="LEFT")
+
+ sys.exit(w.exec_())
+
+
+if __name__ == '__main__':
+ a = qt.QApplication(sys.argv)
+ main()
+ a.exec_()
diff --git a/silx/gui/widgets/TableWidget.py b/silx/gui/widgets/TableWidget.py
index fad80ee..8167fec 100644
--- a/silx/gui/widgets/TableWidget.py
+++ b/silx/gui/widgets/TableWidget.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2017 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
@@ -50,7 +50,7 @@ creating the widgets, or later by calling their :meth:`enableCut` and
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "26/01/2017"
+__date__ = "03/07/2017"
import sys
@@ -104,6 +104,8 @@ class CopySelectedCellsAction(qt.QAction):
Put this text into the clipboard.
"""
selected_idx = self.table.selectedIndexes()
+ if not selected_idx:
+ return
selected_idx_tuples = [(idx.row(), idx.column()) for idx in selected_idx]
selected_rows = [idx[0] for idx in selected_idx_tuples]
@@ -334,6 +336,41 @@ class PasteCellsAction(qt.QAction):
return True
+class CopySingleCellAction(qt.QAction):
+ """QAction to copy text from a single cell in a modified
+ :class:`QTableWidget`.
+
+ This action relies on the fact that the text in the last clicked cell
+ are stored in :attr:`_last_cell_clicked` of the modified widget.
+
+ In most cases, :class:`CopySelectedCellsAction` handles single cells,
+ but if the selection mode of the widget has been set to NoSelection
+ it is necessary to use this class instead.
+
+ :param table: :class:`QTableView` to which this action belongs.
+ """
+ def __init__(self, table):
+ if not isinstance(table, qt.QTableView):
+ raise ValueError('CopySingleCellAction must be initialised ' +
+ 'with a QTableWidget.')
+ super(CopySingleCellAction, self).__init__(table)
+ self.setText("Copy cell")
+ self.setToolTip("Copy cell content into the clipboard.")
+ self.triggered.connect(self.copyCellToClipboard)
+ self.table = table
+
+ def copyCellToClipboard(self):
+ """
+ """
+ cell_text = self.table._text_last_cell_clicked
+ if cell_text is None:
+ return
+
+ # put this text into clipboard
+ qapp = qt.QApplication.instance()
+ qapp.clipboard().setText(cell_text)
+
+
class TableWidget(qt.QTableWidget):
""":class:`QTableWidget` with a context menu displaying up to 5 actions:
@@ -350,14 +387,25 @@ class TableWidget(qt.QTableWidget):
overwriting data (no *Undo* action is available). Use :meth:`enablePaste`
and :meth:`enableCut` to activate them.
+ .. image:: img/TableWidget.png
+
:param parent: Parent QWidget
:param bool cut: Enable cut action
:param bool paste: Enable paste action
"""
def __init__(self, parent=None, cut=False, paste=False):
super(TableWidget, self).__init__(parent)
- self.addAction(CopySelectedCellsAction(self))
- self.addAction(CopyAllCellsAction(self))
+ self._text_last_cell_clicked = None
+
+ self.copySelectedCellsAction = CopySelectedCellsAction(self)
+ self.copyAllCellsAction = CopyAllCellsAction(self)
+ self.copySingleCellAction = None
+ self.pasteCellsAction = None
+ self.cutSelectedCellsAction = None
+ self.cutAllCellsAction = None
+
+ self.addAction(self.copySelectedCellsAction)
+ self.addAction(self.copyAllCellsAction)
if cut:
self.enableCut()
if paste:
@@ -365,6 +413,12 @@ class TableWidget(qt.QTableWidget):
self.setContextMenuPolicy(qt.Qt.ActionsContextMenu)
+ def mousePressEvent(self, event):
+ item = self.itemAt(event.pos())
+ if item is not None:
+ self._text_last_cell_clicked = item.text()
+ super(TableWidget, self).mousePressEvent(event)
+
def enablePaste(self):
"""Enable paste action, to paste data from the clipboard into the
table.
@@ -374,7 +428,8 @@ class TableWidget(qt.QTableWidget):
This action can cause data to be overwritten.
There is currently no *Undo* action to retrieve lost data.
"""
- self.addAction(PasteCellsAction(self))
+ self.pasteCellsAction = PasteCellsAction(self)
+ self.addAction(self.pasteCellsAction)
def enableCut(self):
"""Enable cut action.
@@ -383,8 +438,40 @@ class TableWidget(qt.QTableWidget):
This action can cause data to be deleted.
There is currently no *Undo* action to retrieve lost data."""
- self.addAction(CutSelectedCellsAction(self))
- self.addAction(CutAllCellsAction(self))
+ self.cutSelectedCellsAction = CutSelectedCellsAction(self)
+ self.cutAllCellsAction = CutAllCellsAction(self)
+ self.addAction(self.cutSelectedCellsAction)
+ self.addAction(self.cutAllCellsAction)
+
+ def setSelectionMode(self, mode):
+ """Overloaded from QTableWidget to disable cut/copy selection
+ actions in case mode is NoSelection
+
+ :param mode:
+ :return:
+ """
+ if mode == qt.QTableView.NoSelection:
+ self.copySelectedCellsAction.setVisible(False)
+ self.copySelectedCellsAction.setEnabled(False)
+ if self.cutSelectedCellsAction is not None:
+ self.cutSelectedCellsAction.setVisible(False)
+ self.cutSelectedCellsAction.setEnabled(False)
+ if self.copySingleCellAction is None:
+ self.copySingleCellAction = CopySingleCellAction(self)
+ self.insertAction(self.copySelectedCellsAction, # before first action
+ self.copySingleCellAction)
+ self.copySingleCellAction.setVisible(True)
+ self.copySingleCellAction.setEnabled(True)
+ else:
+ self.copySelectedCellsAction.setVisible(True)
+ self.copySelectedCellsAction.setEnabled(True)
+ if self.cutSelectedCellsAction is not None:
+ self.cutSelectedCellsAction.setVisible(True)
+ self.cutSelectedCellsAction.setEnabled(True)
+ if self.copySingleCellAction is not None:
+ self.copySingleCellAction.setVisible(False)
+ self.copySingleCellAction.setEnabled(False)
+ super(TableWidget, self).setSelectionMode(mode)
class TableView(qt.QTableView):
@@ -414,9 +501,24 @@ class TableView(qt.QTableView):
"""
def __init__(self, parent=None, cut=False, paste=False):
super(TableView, self).__init__(parent)
+ self._text_last_cell_clicked = None
+
self.cut = cut
self.paste = paste
+ self.copySelectedCellsAction = None
+ self.copyAllCellsAction = None
+ self.copySingleCellAction = None
+ self.pasteCellsAction = None
+ self.cutSelectedCellsAction = None
+ self.cutAllCellsAction = None
+
+ def mousePressEvent(self, event):
+ qindex = self.indexAt(event.pos())
+ if self.copyAllCellsAction is not None: # model was set
+ self._text_last_cell_clicked = self.model().data(qindex)
+ super(TableView, self).mousePressEvent(event)
+
def setModel(self, model):
"""Set the data model for the table view, activate the actions
and the context menu.
@@ -425,8 +527,10 @@ class TableView(qt.QTableView):
"""
super(TableView, self).setModel(model)
- self.addAction(CopySelectedCellsAction(self))
- self.addAction(CopyAllCellsAction(self))
+ self.copySelectedCellsAction = CopySelectedCellsAction(self)
+ self.copyAllCellsAction = CopyAllCellsAction(self)
+ self.addAction(self.copySelectedCellsAction)
+ self.addAction(self.copyAllCellsAction)
if self.cut:
self.enableCut()
if self.paste:
@@ -443,7 +547,8 @@ class TableView(qt.QTableView):
This action can cause data to be overwritten.
There is currently no *Undo* action to retrieve lost data.
"""
- self.addAction(PasteCellsAction(self))
+ self.pasteCellsAction = PasteCellsAction(self)
+ self.addAction(self.pasteCellsAction)
def enableCut(self):
"""Enable cut action.
@@ -453,8 +558,10 @@ class TableView(qt.QTableView):
This action can cause data to be deleted.
There is currently no *Undo* action to retrieve lost data.
"""
- self.addAction(CutSelectedCellsAction(self))
- self.addAction(CutAllCellsAction(self))
+ self.cutSelectedCellsAction = CutSelectedCellsAction(self)
+ self.cutAllCellsAction = CutAllCellsAction(self)
+ self.addAction(self.cutSelectedCellsAction)
+ self.addAction(self.cutAllCellsAction)
def addAction(self, action):
# ensure the actions are not added multiple times:
@@ -466,6 +573,37 @@ class TableView(qt.QTableView):
return None
super(TableView, self).addAction(action)
+ def setSelectionMode(self, mode):
+ """Overloaded from QTableView to disable cut/copy selection
+ actions in case mode is NoSelection
+
+ :param mode:
+ :return:
+ """
+ if mode == qt.QTableView.NoSelection:
+ self.copySelectedCellsAction.setVisible(False)
+ self.copySelectedCellsAction.setEnabled(False)
+ if self.cutSelectedCellsAction is not None:
+ self.cutSelectedCellsAction.setVisible(False)
+ self.cutSelectedCellsAction.setEnabled(False)
+ if self.copySingleCellAction is None:
+ self.copySingleCellAction = CopySingleCellAction(self)
+ self.insertAction(self.copySelectedCellsAction, # before first action
+ self.copySingleCellAction)
+ self.copySingleCellAction.setVisible(True)
+ self.copySingleCellAction.setEnabled(True)
+ else:
+ self.copySelectedCellsAction.setVisible(True)
+ self.copySelectedCellsAction.setEnabled(True)
+ if self.cutSelectedCellsAction is not None:
+ self.cutSelectedCellsAction.setVisible(True)
+ self.cutSelectedCellsAction.setEnabled(True)
+ if self.copySingleCellAction is not None:
+ self.copySingleCellAction.setVisible(False)
+ self.copySingleCellAction.setEnabled(False)
+ super(TableView, self).setSelectionMode(mode)
+
+
if __name__ == "__main__":
app = qt.QApplication([])
diff --git a/silx/gui/widgets/ThreadPoolPushButton.py b/silx/gui/widgets/ThreadPoolPushButton.py
index 29e831d..4dba488 100644
--- a/silx/gui/widgets/ThreadPoolPushButton.py
+++ b/silx/gui/widgets/ThreadPoolPushButton.py
@@ -102,6 +102,8 @@ class ThreadPoolPushButton(WaitingPushButton):
>>> button.setCallable(math.pow, 2, 16)
>>> button.succeeded.connect(print) # python3
+ .. image:: img/ThreadPoolPushButton.png
+
>>> # Compute a wrong value
>>> import math
>>> button = ThreadPoolPushButton(text="Compute sqrt(-1)")
diff --git a/silx/gui/widgets/WaitingPushButton.py b/silx/gui/widgets/WaitingPushButton.py
index 49ab9b9..499de1a 100644
--- a/silx/gui/widgets/WaitingPushButton.py
+++ b/silx/gui/widgets/WaitingPushButton.py
@@ -40,6 +40,8 @@ class WaitingPushButton(qt.QPushButton):
The component is graphically disabled when it is in waiting. Then we
overwrite the enabled method to dissociate the 2 concepts:
graphically enabled/disabled, and enabled/disabled
+
+ .. image:: img/WaitingPushButton.png
"""
def __init__(self, parent=None, text=None, icon=None):
diff --git a/silx/gui/widgets/test/__init__.py b/silx/gui/widgets/test/__init__.py
index afa0f78..7affc20 100644
--- a/silx/gui/widgets/test/__init__.py
+++ b/silx/gui/widgets/test/__init__.py
@@ -28,10 +28,11 @@ from . import test_periodictable
from . import test_tablewidget
from . import test_threadpoolpushbutton
from . import test_hierarchicaltableview
+from . import test_printpreview
__authors__ = ["V. Valls", "P. Knobel"]
__license__ = "MIT"
-__date__ = "07/04/2017"
+__date__ = "19/07/2017"
def suite():
@@ -40,6 +41,7 @@ def suite():
[test_threadpoolpushbutton.suite(),
test_tablewidget.suite(),
test_periodictable.suite(),
+ test_printpreview.suite(),
test_hierarchicaltableview.suite(),
])
return test_suite
diff --git a/silx/gui/widgets/test/test_printpreview.py b/silx/gui/widgets/test/test_printpreview.py
new file mode 100644
index 0000000..ecb165a
--- /dev/null
+++ b/silx/gui/widgets/test/test_printpreview.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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.
+#
+# ###########################################################################*/
+"""Test PrintPreview"""
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "19/07/2017"
+
+
+import unittest
+from silx.gui.test.utils import TestCaseQt
+from silx.gui.widgets.PrintPreview import PrintPreviewDialog
+from silx.gui import qt
+
+from silx.resources import resource_filename
+
+
+class TestPrintPreview(TestCaseQt):
+ def testShow(self):
+ p = qt.QPrinter()
+ d = PrintPreviewDialog(printer=p)
+ d.show()
+ self.qapp.processEvents()
+
+ def testAddImage(self):
+ p = qt.QPrinter()
+ d = PrintPreviewDialog(printer=p)
+ d.addImage(qt.QImage(resource_filename("gui/icons/clipboard.png")))
+ self.qapp.processEvents()
+
+ def testAddSvg(self):
+ p = qt.QPrinter()
+ d = PrintPreviewDialog(printer=p)
+ d.addSvgItem(qt.QSvgRenderer(resource_filename("gui/icons/clipboard.svg"), d.page))
+ self.qapp.processEvents()
+
+ def testAddPixmap(self):
+ p = qt.QPrinter()
+ d = PrintPreviewDialog(printer=p)
+ d.addPixmap(qt.QPixmap.fromImage(qt.QImage(resource_filename("gui/icons/clipboard.png"))))
+ self.qapp.processEvents()
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(
+ unittest.defaultTestLoader.loadTestsFromTestCase(TestPrintPreview))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/image/backprojection.py b/silx/image/backprojection.py
new file mode 100644
index 0000000..63f99ca
--- /dev/null
+++ b/silx/image/backprojection.py
@@ -0,0 +1,25 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+
+from silx.opencl.backprojection import *
diff --git a/silx/image/bilinear.c b/silx/image/bilinear.c
index 6185331..d622e24 100644
--- a/silx/image/bilinear.c
+++ b/silx/image/bilinear.c
@@ -1,28 +1,26 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [],
+ "language": "c"
+ },
+ "module_name": "silx.image.bilinear"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +39,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +51,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +267,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +288,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +327,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +353,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +437,13 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
#define __PYX_HAVE__silx__image__bilinear
#define __PYX_HAVE_API__silx__image__bilinear
-#include "math.h"
+#include <math.h>
#include "pythread.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +453,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +461,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +505,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +523,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +552,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +632,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -424,6 +643,7 @@ static const char *__pyx_f[] = {
"silx/image/bilinear.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +653,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +689,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +727,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -541,7 +764,7 @@ struct __pyx_obj_4silx_5image_8bilinear_BilinearImage {
};
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -550,6 +773,7 @@ struct __pyx_obj_4silx_5image_8bilinear_BilinearImage {
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -565,7 +789,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -578,7 +802,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -601,7 +825,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -618,6 +842,20 @@ struct __pyx_memoryviewslice_obj {
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
/* "silx/image/bilinear.pyx":39
*
*
@@ -634,7 +872,7 @@ struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage {
static struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *__pyx_vtabptr_4silx_5image_8bilinear_BilinearImage;
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -654,7 +892,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -666,6 +904,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -682,19 +923,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -717,18 +958,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -743,31 +985,44 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
-#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) : \
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -775,30 +1030,59 @@ 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);
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -824,71 +1108,140 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
+/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
#define __PYX_FORCE_INIT_THREADS 0
#endif
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -904,12 +1257,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -922,7 +1278,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -938,16 +1295,19 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -959,9 +1319,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -975,52 +1346,55 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
-static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-static PyObject *__pyx_memview_get_float(const char *itemp);
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj);
-
-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);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1031,19 +1405,25 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, float __pyx_v_x, float __pyx_v_y); /* proto*/
static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, size_t __pyx_v_x, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, size_t __pyx_v_idx); /* proto*/
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1071,6 +1451,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1115,161 +1497,105 @@ 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 int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
-static void __pyx_pf_4silx_5image_8bilinear_13BilinearImage_2__dealloc__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4__call__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_10coarse_local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, size_t __pyx_v_x); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinates(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_src, PyObject *__pyx_v_dst, int __pyx_v_linewidth); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4data___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4maxi___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4mini___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_5width___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6height___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* 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_4silx_5image_8bilinear_BilinearImage(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_O[] = "O";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_doc[] = "__doc__";
-static char __pyx_k_dst[] = "dst";
-static char __pyx_k_max[] = "max";
-static char __pyx_k_min[] = "min";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_src[] = "src";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_date[] = "__date__";
-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_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_coord[] = "coord";
-static char __pyx_k_debug[] = "debug";
-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_numpy[] = "numpy";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_ravel[] = "ravel";
-static char __pyx_k_round[] = "round";
-static char __pyx_k_shape[] = "shape";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_zeros[] = "zeros";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_logger[] = "logger";
-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_asarray[] = "asarray";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_float32[] = "float32";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_logging[] = "logging";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_warning[] = "warning";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_J_Kieffer[] = "J. Kieffer";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_getLogger[] = "getLogger";
-static char __pyx_k_linewidth[] = "linewidth";
-static char __pyx_k_15_09_2016[] = "15/09/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-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_coarse_local_maxi[] = "coarse_local_maxi";
-static char __pyx_k_strided_and_direct[] = "<strided and direct>";
-static char __pyx_k_silx_image_bilinear[] = "silx.image.bilinear";
-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_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_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_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_Bilinear_interpolator_peak_finde[] = "Bilinear interpolator, peak finder, line-profile for images";
-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_Failed_to_find_root_using_second[] = "Failed to find root using second order expansion";
-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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_Singular_determinant_Hessian_und[] = "Singular determinant, Hessian undefined";
-static char __pyx_k_Source_and_destination_points_ar[] = "Source and destination points are the same";
-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_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_doc[] = "__doc__";
+static const char __pyx_k_dst[] = "dst";
+static const char __pyx_k_max[] = "max";
+static const char __pyx_k_min[] = "min";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_src[] = "src";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_coord[] = "coord";
+static const char __pyx_k_debug[] = "debug";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_ravel[] = "ravel";
+static const char __pyx_k_round[] = "round";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_logger[] = "logger";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_asarray[] = "asarray";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_float32[] = "float32";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_warning[] = "warning";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_J_Kieffer[] = "J. Kieffer";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_getLogger[] = "getLogger";
+static const char __pyx_k_linewidth[] = "linewidth";
+static const char __pyx_k_15_09_2016[] = "15/09/2016";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_coarse_local_maxi[] = "coarse_local_maxi";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_Bilinear_interpolator_peak_finde[] = "Bilinear interpolator, peak finder, line-profile for images";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Failed_to_find_root_using_second[] = "Failed to find root using second order expansion";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_Singular_determinant_Hessian_und[] = "Singular determinant, Hessian undefined";
+static const char __pyx_k_Source_and_destination_points_ar[] = "Source and destination points are the same";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static PyObject *__pyx_kp_s_15_09_2016;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Bilinear_interpolator_peak_finde;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
@@ -1314,6 +1640,7 @@ static PyObject *__pyx_n_s_dst;
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_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_flags;
@@ -1349,7 +1676,6 @@ static PyObject *__pyx_n_s_ravel;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_shape;
-static PyObject *__pyx_kp_s_silx_image_bilinear;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_src;
static PyObject *__pyx_n_s_start;
@@ -1364,8 +1690,57 @@ 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_unpack;
static PyObject *__pyx_n_s_warning;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
+static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
+static void __pyx_pf_4silx_5image_8bilinear_13BilinearImage_2__dealloc__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4__call__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coord); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_10coarse_local_maxi(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, size_t __pyx_v_x); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinates(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_coordinates); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self, PyObject *__pyx_v_src, PyObject *__pyx_v_dst, int __pyx_v_linewidth); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4data___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4maxi___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4mini___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_5width___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6height___get__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__pyx_v_self); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_4silx_5image_8bilinear_BilinearImage(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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
@@ -1379,17 +1754,18 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__11;
-static PyObject *__pyx_slice__12;
static PyObject *__pyx_slice__13;
+static PyObject *__pyx_slice__14;
+static PyObject *__pyx_slice__15;
static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
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;
/* "silx/image/bilinear.pyx":51
* cdef float c_funct(self, float, float) nogil
@@ -1403,9 +1779,6 @@ static PyObject *__pyx_tuple__20;
static int __pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
@@ -1427,7 +1800,7 @@ static int __pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(PyObject *
else goto __pyx_L5_argtuple_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 = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -1438,14 +1811,14 @@ static int __pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(PyObject *
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.bilinear.BilinearImage.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "data"); __PYX_ERR(0, 51, __pyx_L1_error)
}
__pyx_r = __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(((struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self), __pyx_v_data);
@@ -1470,9 +1843,6 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "silx/image/bilinear.pyx":56
@@ -1484,15 +1854,16 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __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 = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 56, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (unlikely(!__pyx_t_3)) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 56, __pyx_L1_error)
}
}
#endif
@@ -1504,12 +1875,12 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
* self.width = data.shape[1]
* self.maxi = data.max()
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __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, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_self->height = __pyx_t_4;
@@ -1520,12 +1891,12 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
* self.maxi = data.max()
* self.mini = data.min()
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __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, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->width = __pyx_t_4;
@@ -1536,10 +1907,10 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
* self.mini = data.min()
* self.data = numpy.ascontiguousarray(data, dtype=numpy.float32)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_max); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -1549,14 +1920,14 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
}
}
if (__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->maxi = __pyx_t_6;
@@ -1567,10 +1938,10 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
* self.data = numpy.ascontiguousarray(data, dtype=numpy.float32)
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_min); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_min); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -1580,14 +1951,14 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
}
}
if (__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->mini = __pyx_t_6;
@@ -1598,32 +1969,32 @@ static int __pyx_pf_4silx_5image_8bilinear_13BilinearImage___cinit__(struct __py
*
* def __dealloc__(self):
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_t_8);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
__pyx_v_self->data = __pyx_t_9;
@@ -1677,9 +2048,6 @@ static void __pyx_pw_4silx_5image_8bilinear_13BilinearImage_3__dealloc__(PyObjec
static void __pyx_pf_4silx_5image_8bilinear_13BilinearImage_2__dealloc__(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *__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);
/* "silx/image/bilinear.pyx":64
@@ -1690,7 +2058,7 @@ static void __pyx_pf_4silx_5image_8bilinear_13BilinearImage_2__dealloc__(struct
* def __call__(self, coord):
*/
__pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(Py_None);
- if (unlikely(!__pyx_t_1.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 64, __pyx_L1_error)
__PYX_XDEC_MEMVIEW(&__pyx_v_self->data, 0);
__pyx_v_self->data = __pyx_t_1;
__pyx_t_1.memview = NULL;
@@ -1708,7 +2076,7 @@ static void __pyx_pf_4silx_5image_8bilinear_13BilinearImage_2__dealloc__(struct
goto __pyx_L0;
__pyx_L1_error:;
__PYX_XDEC_MEMVIEW(&__pyx_t_1, 1);
- __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
@@ -1729,9 +2097,6 @@ struct wrapperbase __pyx_wrapperbase_4silx_5image_8bilinear_13BilinearImage_4__c
#endif
static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_coord = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
@@ -1753,7 +2118,7 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_5__call__(PyObj
else goto __pyx_L5_argtuple_error;
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 66, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -1764,7 +2129,7 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_5__call__(PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 66, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.bilinear.BilinearImage.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -1783,9 +2148,6 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4__call__(struc
PyObject *__pyx_t_1 = NULL;
float __pyx_t_2;
float __pyx_t_3;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__call__", 0);
/* "silx/image/bilinear.pyx":74
@@ -1796,15 +2158,15 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4__call__(struc
* @cython.boundscheck(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 74, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_t_2, __pyx_t_3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -1856,27 +2218,24 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
double __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- int __pyx_t_12;
- int __pyx_t_13;
- int __pyx_t_14;
- int __pyx_t_15;
- int __pyx_t_16;
- int __pyx_t_17;
- int __pyx_t_18;
- int __pyx_t_19;
- int __pyx_t_20;
- int __pyx_t_21;
- int __pyx_t_22;
- int __pyx_t_23;
- int __pyx_t_24;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_17;
+ Py_ssize_t __pyx_t_18;
+ Py_ssize_t __pyx_t_19;
+ Py_ssize_t __pyx_t_20;
+ Py_ssize_t __pyx_t_21;
+ Py_ssize_t __pyx_t_22;
+ Py_ssize_t __pyx_t_23;
+ Py_ssize_t __pyx_t_24;
/* "silx/image/bilinear.pyx":89
* """
@@ -2021,10 +2380,18 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* elif i0 == i1:
* res = (self.data[i0, j0] * (y1 - d1)) + (self.data[i0, j1] * (d1 - y0))
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 103, __pyx_L1_error)}
__pyx_t_7 = __pyx_v_i0;
__pyx_t_8 = __pyx_v_j0;
__pyx_v_res = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_7 * __pyx_v_self->data.strides[0]) )) + __pyx_t_8)) )));
+
+ /* "silx/image/bilinear.pyx":102
+ * j0 = < int > y0
+ * j1 = < int > y1
+ * if (i0 == i1) and (j0 == j1): # <<<<<<<<<<<<<<
+ * res = self.data[i0, j0]
+ * elif i0 == i1:
+ */
goto __pyx_L3;
}
@@ -2045,13 +2412,21 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* elif j0 == j1:
* res = (self.data[i0, j0] * (x1 - d0)) + (self.data[i1, j0] * (d0 - x0))
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 105, __pyx_L1_error)}
__pyx_t_9 = __pyx_v_i0;
__pyx_t_10 = __pyx_v_j0;
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 105, __pyx_L1_error)}
__pyx_t_11 = __pyx_v_i0;
__pyx_t_12 = __pyx_v_j1;
__pyx_v_res = (((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_9 * __pyx_v_self->data.strides[0]) )) + __pyx_t_10)) ))) * (__pyx_v_y1 - __pyx_v_d1)) + ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_11 * __pyx_v_self->data.strides[0]) )) + __pyx_t_12)) ))) * (__pyx_v_d1 - __pyx_v_y0)));
+
+ /* "silx/image/bilinear.pyx":104
+ * if (i0 == i1) and (j0 == j1):
+ * res = self.data[i0, j0]
+ * elif i0 == i1: # <<<<<<<<<<<<<<
+ * res = (self.data[i0, j0] * (y1 - d1)) + (self.data[i0, j1] * (d1 - y0))
+ * elif j0 == j1:
+ */
goto __pyx_L3;
}
@@ -2072,15 +2447,31 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* else:
* res = (self.data[i0, j0] * (x1 - d0) * (y1 - d1)) \
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 107, __pyx_L1_error)}
__pyx_t_13 = __pyx_v_i0;
__pyx_t_14 = __pyx_v_j0;
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 107, __pyx_L1_error)}
__pyx_t_15 = __pyx_v_i1;
__pyx_t_16 = __pyx_v_j0;
__pyx_v_res = (((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_13 * __pyx_v_self->data.strides[0]) )) + __pyx_t_14)) ))) * (__pyx_v_x1 - __pyx_v_d0)) + ((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_15 * __pyx_v_self->data.strides[0]) )) + __pyx_t_16)) ))) * (__pyx_v_d0 - __pyx_v_x0)));
+
+ /* "silx/image/bilinear.pyx":106
+ * elif i0 == i1:
+ * res = (self.data[i0, j0] * (y1 - d1)) + (self.data[i0, j1] * (d1 - y0))
+ * elif j0 == j1: # <<<<<<<<<<<<<<
+ * res = (self.data[i0, j0] * (x1 - d0)) + (self.data[i1, j0] * (d0 - x0))
+ * else:
+ */
goto __pyx_L3;
}
+
+ /* "silx/image/bilinear.pyx":112
+ * + (self.data[i1, j0] * (d0 - x0) * (y1 - d1)) \
+ * + (self.data[i0, j1] * (x1 - d0) * (d1 - y0)) \
+ * + (self.data[i1, j1] * (d0 - x0) * (d1 - y0)) # <<<<<<<<<<<<<<
+ * return res
+ *
+ */
/*else*/ {
/* "silx/image/bilinear.pyx":109
@@ -2090,7 +2481,7 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* + (self.data[i1, j0] * (d0 - x0) * (y1 - d1)) \
* + (self.data[i0, j1] * (x1 - d0) * (d1 - y0)) \
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 109, __pyx_L1_error)}
__pyx_t_17 = __pyx_v_i0;
__pyx_t_18 = __pyx_v_j0;
@@ -2101,7 +2492,7 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* + (self.data[i0, j1] * (x1 - d0) * (d1 - y0)) \
* + (self.data[i1, j1] * (d0 - x0) * (d1 - y0))
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 110, __pyx_L1_error)}
__pyx_t_19 = __pyx_v_i1;
__pyx_t_20 = __pyx_v_j0;
@@ -2112,7 +2503,7 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* + (self.data[i1, j1] * (d0 - x0) * (d1 - y0))
* return res
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 111, __pyx_L1_error)}
__pyx_t_21 = __pyx_v_i0;
__pyx_t_22 = __pyx_v_j1;
@@ -2123,7 +2514,7 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
* return res
*
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 112, __pyx_L1_error)}
__pyx_t_23 = __pyx_v_i1;
__pyx_t_24 = __pyx_v_j1;
__pyx_v_res = ((((((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_17 * __pyx_v_self->data.strides[0]) )) + __pyx_t_18)) ))) * (__pyx_v_x1 - __pyx_v_d0)) * (__pyx_v_y1 - __pyx_v_d1)) + (((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_19 * __pyx_v_self->data.strides[0]) )) + __pyx_t_20)) ))) * (__pyx_v_d0 - __pyx_v_x0)) * (__pyx_v_y1 - __pyx_v_d1))) + (((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_21 * __pyx_v_self->data.strides[0]) )) + __pyx_t_22)) ))) * (__pyx_v_x1 - __pyx_v_d0)) * (__pyx_v_d1 - __pyx_v_y0))) + (((*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_23 * __pyx_v_self->data.strides[0]) )) + __pyx_t_24)) ))) * (__pyx_v_d0 - __pyx_v_x0)) * (__pyx_v_d1 - __pyx_v_y0)));
@@ -2150,7 +2541,7 @@ static float __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct(struct __pyx
/* function exit code */
__pyx_L1_error:;
- __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.c_funct", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.c_funct", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
@@ -2191,9 +2582,6 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
float __pyx_t_5;
float __pyx_t_6;
int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("opp_f", 0);
/* "silx/image/bilinear.pyx":127
@@ -2205,7 +2593,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
*/
if ((likely(PyTuple_CheckExact(__pyx_v_coord))) || (PyList_CheckExact(__pyx_v_coord))) {
PyObject* sequence = __pyx_v_coord;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -2213,9 +2601,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 127, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
@@ -2226,21 +2614,21 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_v_coord); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_v_coord); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
__pyx_t_4 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L4_unpacking_done;
@@ -2248,12 +2636,12 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 127, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
- __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_d0 = __pyx_t_5;
__pyx_v_d1 = __pyx_t_6;
@@ -2276,6 +2664,14 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
* res = self.mini + d1
*/
__pyx_v_res = (__pyx_v_self->mini + __pyx_v_d0);
+
+ /* "silx/image/bilinear.pyx":128
+ * float d0, d1, res
+ * d0, d1 = coord
+ * if d0 < 0: # <<<<<<<<<<<<<<
+ * res = self.mini + d0
+ * elif d1 < 0:
+ */
goto __pyx_L5;
}
@@ -2297,6 +2693,14 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
* res = self.mini - d0 + self.height - 1
*/
__pyx_v_res = (__pyx_v_self->mini + __pyx_v_d1);
+
+ /* "silx/image/bilinear.pyx":130
+ * if d0 < 0:
+ * res = self.mini + d0
+ * elif d1 < 0: # <<<<<<<<<<<<<<
+ * res = self.mini + d1
+ * elif d0 > (self.height - 1):
+ */
goto __pyx_L5;
}
@@ -2318,6 +2722,14 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
* res = self.mini - d1 + self.width - 1
*/
__pyx_v_res = (((__pyx_v_self->mini - __pyx_v_d0) + __pyx_v_self->height) - 1.0);
+
+ /* "silx/image/bilinear.pyx":132
+ * elif d1 < 0:
+ * res = self.mini + d1
+ * elif d0 > (self.height - 1): # <<<<<<<<<<<<<<
+ * res = self.mini - d0 + self.height - 1
+ * elif d1 > self.width - 1:
+ */
goto __pyx_L5;
}
@@ -2339,17 +2751,25 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
* res = self.c_funct(d1, d0)
*/
__pyx_v_res = (((__pyx_v_self->mini - __pyx_v_d1) + __pyx_v_self->width) - 1.0);
+
+ /* "silx/image/bilinear.pyx":134
+ * elif d0 > (self.height - 1):
+ * res = self.mini - d0 + self.height - 1
+ * elif d1 > self.width - 1: # <<<<<<<<<<<<<<
+ * res = self.mini - d1 + self.width - 1
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "silx/image/bilinear.pyx":137
+ /* "silx/image/bilinear.pyx":137
* res = self.mini - d1 + self.width - 1
* else:
* res = self.c_funct(d1, d0) # <<<<<<<<<<<<<<
* return - res
*
*/
+ /*else*/ {
__pyx_v_res = ((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_v_d1, __pyx_v_d0);
}
__pyx_L5:;
@@ -2362,7 +2782,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6opp_f(struct _
* @cython.boundscheck(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble((-__pyx_v_res)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((-__pyx_v_res)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
@@ -2444,33 +2864,30 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
size_t __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
- long __pyx_t_7;
- long __pyx_t_8;
- long __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
- int __pyx_t_13;
- long __pyx_t_14;
- int __pyx_t_15;
- int __pyx_t_16;
- int __pyx_t_17;
- long __pyx_t_18;
- long __pyx_t_19;
- long __pyx_t_20;
- long __pyx_t_21;
- int __pyx_t_22;
- long __pyx_t_23;
- long __pyx_t_24;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_17;
+ Py_ssize_t __pyx_t_18;
+ Py_ssize_t __pyx_t_19;
+ Py_ssize_t __pyx_t_20;
+ Py_ssize_t __pyx_t_21;
+ Py_ssize_t __pyx_t_22;
+ Py_ssize_t __pyx_t_23;
+ Py_ssize_t __pyx_t_24;
long __pyx_t_25;
int __pyx_t_26;
long __pyx_t_27;
int __pyx_t_28;
- int __pyx_t_29;
- int __pyx_t_30;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_29;
+ Py_ssize_t __pyx_t_30;
__Pyx_RefNannySetupContext("local_maxi", 0);
/* "silx/image/bilinear.pyx":161
@@ -2491,37 +2908,37 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
*
* current0 = res // self.width
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coord, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->width); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_self->width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __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[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_coord, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_coord, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_res = ((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_local_maxi(__pyx_v_self, __pyx_t_4);
@@ -2580,7 +2997,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a01 = self.data[current0 - 1, current1 ]
* a02 = self.data[current0 - 1, current1 + 1]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 170, __pyx_L1_error)}
__pyx_t_7 = (__pyx_v_current0 - 1);
__pyx_t_8 = (__pyx_v_current1 - 1);
__pyx_v_a00 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_7 * __pyx_v_self->data.strides[0]) )) + __pyx_t_8)) )));
@@ -2592,7 +3009,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a02 = self.data[current0 - 1, current1 + 1]
* a10 = self.data[current0 , current1 - 1]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 171, __pyx_L1_error)}
__pyx_t_9 = (__pyx_v_current0 - 1);
__pyx_t_10 = __pyx_v_current1;
__pyx_v_a01 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_9 * __pyx_v_self->data.strides[0]) )) + __pyx_t_10)) )));
@@ -2604,7 +3021,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a10 = self.data[current0 , current1 - 1]
* a11 = self.data[current0 , current1 ]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 172, __pyx_L1_error)}
__pyx_t_11 = (__pyx_v_current0 - 1);
__pyx_t_12 = (__pyx_v_current1 + 1);
__pyx_v_a02 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_11 * __pyx_v_self->data.strides[0]) )) + __pyx_t_12)) )));
@@ -2616,7 +3033,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a11 = self.data[current0 , current1 ]
* a12 = self.data[current0 , current1 + 1]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 173, __pyx_L1_error)}
__pyx_t_13 = __pyx_v_current0;
__pyx_t_14 = (__pyx_v_current1 - 1);
__pyx_v_a10 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_13 * __pyx_v_self->data.strides[0]) )) + __pyx_t_14)) )));
@@ -2628,7 +3045,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a12 = self.data[current0 , current1 + 1]
* a20 = self.data[current0 + 1, current1 - 1]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 174, __pyx_L1_error)}
__pyx_t_15 = __pyx_v_current0;
__pyx_t_16 = __pyx_v_current1;
__pyx_v_a11 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_15 * __pyx_v_self->data.strides[0]) )) + __pyx_t_16)) )));
@@ -2640,7 +3057,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a20 = self.data[current0 + 1, current1 - 1]
* a21 = self.data[current0 + 1, current1 ]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 175, __pyx_L1_error)}
__pyx_t_17 = __pyx_v_current0;
__pyx_t_18 = (__pyx_v_current1 + 1);
__pyx_v_a12 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_17 * __pyx_v_self->data.strides[0]) )) + __pyx_t_18)) )));
@@ -2652,7 +3069,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a21 = self.data[current0 + 1, current1 ]
* a22 = self.data[current0 + 1, current1 - 1]
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 176, __pyx_L1_error)}
__pyx_t_19 = (__pyx_v_current0 + 1);
__pyx_t_20 = (__pyx_v_current1 - 1);
__pyx_v_a20 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_19 * __pyx_v_self->data.strides[0]) )) + __pyx_t_20)) )));
@@ -2664,7 +3081,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* a22 = self.data[current0 + 1, current1 - 1]
* d00 = a12 - 2.0 * a11 + a10
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 177, __pyx_L1_error)}
__pyx_t_21 = (__pyx_v_current0 + 1);
__pyx_t_22 = __pyx_v_current1;
__pyx_v_a21 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_21 * __pyx_v_self->data.strides[0]) )) + __pyx_t_22)) )));
@@ -2676,7 +3093,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* d00 = a12 - 2.0 * a11 + a10
* d11 = a21 - 2.0 * a11 + a01
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 178, __pyx_L1_error)}
__pyx_t_23 = (__pyx_v_current0 + 1);
__pyx_t_24 = (__pyx_v_current1 - 1);
__pyx_v_a22 = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_23 * __pyx_v_self->data.strides[0]) )) + __pyx_t_24)) )));
@@ -2734,26 +3151,34 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* else:
* delta0 = ((a12 - a10) * d01 + (a01 - a21) * d11) / denom
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/image/bilinear.pyx":183
+ * d01 = (a00 - a02 - a20 + a22) / 4.0
+ * denom = 2.0 * (d00 * d11 - d01 * d01)
+ * if abs(denom) < 1e-10: # <<<<<<<<<<<<<<
+ * logger.debug("Singular determinant, Hessian undefined")
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "silx/image/bilinear.pyx":186
+ /* "silx/image/bilinear.pyx":186
* logger.debug("Singular determinant, Hessian undefined")
* else:
* delta0 = ((a12 - a10) * d01 + (a01 - a21) * d11) / denom # <<<<<<<<<<<<<<
* delta1 = ((a10 - a12) * d00 + (a21 - a01) * d01) / denom
* if abs(delta0) <= 1.0 and abs(delta1) <= 1.0:
*/
+ /*else*/ {
__pyx_v_delta0 = ((((__pyx_v_a12 - __pyx_v_a10) * __pyx_v_d01) + ((__pyx_v_a01 - __pyx_v_a21) * __pyx_v_d11)) / __pyx_v_denom);
/* "silx/image/bilinear.pyx":187
@@ -2791,37 +3216,45 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* logger.debug("Failed to find root using second order expansion")
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble((__pyx_v_delta0 + ((double)__pyx_v_current0))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_delta0 + ((double)__pyx_v_current0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_delta1 + ((double)__pyx_v_current1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_delta1 + ((double)__pyx_v_current1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "silx/image/bilinear.pyx":188
+ * delta0 = ((a12 - a10) * d01 + (a01 - a21) * d11) / denom
+ * delta1 = ((a10 - a12) * d00 + (a21 - a01) * d01) / denom
+ * if abs(delta0) <= 1.0 and abs(delta1) <= 1.0: # <<<<<<<<<<<<<<
+ * # Result is OK if lower than 0.5.
+ * return (delta0 + float(current0), delta1 + float(current1))
+ */
}
- /*else*/ {
- /* "silx/image/bilinear.pyx":192
+ /* "silx/image/bilinear.pyx":192
* return (delta0 + float(current0), delta1 + float(current1))
* else:
* logger.debug("Failed to find root using second order expansion") # <<<<<<<<<<<<<<
* # refinement of the position by a simple center of mass of the last valid region used
* for i0 in range(current0 - 1, current0 + 2):
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -2858,7 +3291,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* sum0 += tmp * i0
* sum1 += tmp * i1
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 196, __pyx_L1_error)}
__pyx_t_29 = __pyx_v_i0;
__pyx_t_30 = __pyx_v_i1;
__pyx_v_tmp = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_29 * __pyx_v_self->data.strides[0]) )) + __pyx_t_30)) )));
@@ -2910,25 +3343,39 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* return (float(current0), float(current1))
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyFloat_FromDouble((__pyx_v_sum0 / __pyx_v_sum)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((__pyx_v_sum0 / __pyx_v_sum)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_sum1 / __pyx_v_sum)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_sum1 / __pyx_v_sum)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
__pyx_t_3 = 0;
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/image/bilinear.pyx":200
+ * sum1 += tmp * i1
+ * sum += tmp
+ * if sum > 0: # <<<<<<<<<<<<<<
+ * return (sum0 / sum, sum1 / sum)
+ *
+ */
}
- goto __pyx_L3;
+
+ /* "silx/image/bilinear.pyx":168
+ * current0 = res // self.width
+ * current1 = res % self.width
+ * if (current0 > 0) and (current0 < self.height - 1) and (current1 > 0) and (current1 < self.width - 1): # <<<<<<<<<<<<<<
+ * # Use second order polynomial Taylor expansion
+ * a00 = self.data[current0 - 1, current1 - 1]
+ */
}
- __pyx_L3:;
/* "silx/image/bilinear.pyx":203
* return (sum0 / sum, sum1 / sum)
@@ -2938,16 +3385,16 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_8local_maxi(str
* cpdef size_t coarse_local_maxi(self, size_t x):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_current0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_current0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_current1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_v_current1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __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 = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_r = __pyx_t_3;
@@ -2994,22 +3441,19 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(s
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
size_t __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("coarse_local_maxi", 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_coarse_local_maxi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_coarse_local_maxi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_4silx_5image_8bilinear_13BilinearImage_11coarse_local_maxi)) {
- __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -3019,22 +3463,42 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(s
}
}
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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __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 = 205; __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __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_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_7 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_7;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -3069,7 +3533,7 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(s
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.coarse_local_maxi", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.coarse_local_maxi", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -3081,14 +3545,11 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_11coarse_local_
static char __pyx_doc_4silx_5image_8bilinear_13BilinearImage_10coarse_local_maxi[] = "BilinearImage.coarse_local_maxi(self, size_t x) -> size_t\nReturn the nearest local maximum ... without sub-pixel refinement\n\n :param idx: start index (=row*width+column)\n :return: local maximum index\n ";
static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_11coarse_local_maxi(PyObject *__pyx_v_self, PyObject *__pyx_arg_x) {
size_t __pyx_v_x;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("coarse_local_maxi (wrapper)", 0);
assert(__pyx_arg_x); {
- __pyx_v_x = __Pyx_PyInt_As_size_t(__pyx_arg_x); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_x = __Pyx_PyInt_As_size_t(__pyx_arg_x); if (unlikely((__pyx_v_x == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
@@ -3107,12 +3568,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_10coarse_local_
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("coarse_local_maxi", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(__pyx_v_self, __pyx_v_x, 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi(__pyx_v_self, __pyx_v_x, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3152,8 +3610,8 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
float __pyx_v_value;
float __pyx_v_old_value;
size_t __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
int __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
@@ -3164,13 +3622,10 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
size_t __pyx_t_10;
int __pyx_t_11;
int __pyx_t_12;
- int __pyx_t_13;
- int __pyx_t_14;
+ Py_ssize_t __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
int __pyx_t_15;
int __pyx_t_16;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
/* "silx/image/bilinear.pyx":225
* """
@@ -3197,7 +3652,7 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
* old_value = value - 1.0
* new0, new1 = current0, current1
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 230, __pyx_L1_error)}
__pyx_t_1 = __pyx_v_current0;
__pyx_t_2 = __pyx_v_current1;
__pyx_v_value = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_1 * __pyx_v_self->data.strides[0]) )) + __pyx_t_2)) )));
@@ -3336,7 +3791,7 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
* if tmp > value:
* new0, new1 = i0, i1
*/
- if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 242, __pyx_L1_error)}
__pyx_t_13 = __pyx_v_i0;
__pyx_t_14 = __pyx_v_i1;
__pyx_v_tmp = (*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_self->data.data + __pyx_t_13 * __pyx_v_self->data.strides[0]) )) + __pyx_t_14)) )));
@@ -3371,9 +3826,15 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
* return self.width * current0 + current1
*/
__pyx_v_value = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "silx/image/bilinear.pyx":243
+ * for i1 in range(start1, stop1):
+ * tmp = self.data[i0, i1]
+ * if tmp > value: # <<<<<<<<<<<<<<
+ * new0, new1 = i0, i1
+ * value = tmp
+ */
}
- __pyx_L9:;
}
}
@@ -3410,7 +3871,7 @@ static size_t __pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi(struct
/* function exit code */
__pyx_L1_error:;
- __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.c_local_maxi", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.image.bilinear.BilinearImage.c_local_maxi", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
@@ -3460,9 +3921,6 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
size_t __pyx_t_11;
size_t __pyx_t_12;
PyObject *__pyx_t_13 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("map_coordinates", 0);
/* "silx/image/bilinear.pyx":259
@@ -3472,9 +3930,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* size = coordinates[0].size
* d0 = numpy.ascontiguousarray(coordinates[0].ravel(), dtype=numpy.float32)
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_shape = __pyx_t_2;
@@ -3487,12 +3945,12 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* d0 = numpy.ascontiguousarray(coordinates[0].ravel(), dtype=numpy.float32)
* d1 = numpy.ascontiguousarray(coordinates[1].ravel(), dtype=numpy.float32)
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_t_1); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_size = __pyx_t_3;
@@ -3503,18 +3961,18 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* d1 = numpy.ascontiguousarray(coordinates[1].ravel(), dtype=numpy.float32)
* assert size == d1.size
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __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 = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_coordinates, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ravel); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ravel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -3524,34 +3982,34 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
}
}
if (__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __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 = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_6);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_d0 = __pyx_t_7;
__pyx_t_7.memview = NULL;
@@ -3564,18 +4022,18 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* assert size == d1.size
* res = numpy.empty(size, dtype=numpy.float32)
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_coordinates, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_coordinates, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ravel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ravel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3585,34 +4043,34 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
}
}
if (__pyx_t_5) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_6);
__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 = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_4);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_d1 = __pyx_t_7;
__pyx_t_7.memview = NULL;
@@ -3627,21 +4085,21 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
*/
#ifndef CYTHON_WITHOUT_ASSERTIONS
if (unlikely(!Py_OptimizeFlag)) {
- __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_d1, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_d1, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (unlikely(!__pyx_t_8)) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 263, __pyx_L1_error)
}
}
#endif
@@ -3653,34 +4111,34 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* with nogil:
* for i in range(size):
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __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, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_5);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_res = __pyx_t_7;
__pyx_t_7.memview = NULL;
@@ -3751,15 +4209,15 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
* @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 = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_res, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_res, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3769,26 +4227,46 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
}
}
if (!__pyx_t_1) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3798,18 +4276,36 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_12map_coordinat
}
}
if (!__pyx_t_6) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_shape};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_shape};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_shape);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
@@ -3860,9 +4356,6 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_15profile_line(
PyObject *__pyx_v_src = 0;
PyObject *__pyx_v_dst = 0;
int __pyx_v_linewidth;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("profile_line (wrapper)", 0);
@@ -3887,7 +4380,7 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_15profile_line(
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dst)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("profile_line", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("profile_line", 0, 2, 3, 1); __PYX_ERR(0, 271, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -3896,7 +4389,7 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_15profile_line(
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "profile_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "profile_line") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -3910,14 +4403,14 @@ static PyObject *__pyx_pw_4silx_5image_8bilinear_13BilinearImage_15profile_line(
__pyx_v_src = values[0];
__pyx_v_dst = values[1];
if (values[2]) {
- __pyx_v_linewidth = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_linewidth == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_linewidth = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_linewidth == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
} else {
__pyx_v_linewidth = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("profile_line", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("profile_line", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.bilinear.BilinearImage.profile_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -3967,9 +4460,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
int __pyx_t_13;
int __pyx_t_14;
int __pyx_t_15;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_16;
__Pyx_RefNannySetupContext("profile_line", 0);
/* "silx/image/bilinear.pyx":293
@@ -3981,7 +4472,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*/
if ((likely(PyTuple_CheckExact(__pyx_v_src))) || (PyList_CheckExact(__pyx_v_src))) {
PyObject* sequence = __pyx_v_src;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -3989,9 +4480,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 293, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
@@ -4002,21 +4493,21 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_2);
#else
- __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
#endif
} else {
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_v_src); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_v_src); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
__pyx_t_4 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L4_unpacking_done;
@@ -4024,12 +4515,12 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 293, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
- __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_src_row = __pyx_t_5;
__pyx_v_src_col = __pyx_t_6;
@@ -4043,7 +4534,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*/
if ((likely(PyTuple_CheckExact(__pyx_v_dst))) || (PyList_CheckExact(__pyx_v_dst))) {
PyObject* sequence = __pyx_v_dst;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -4051,9 +4542,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 294, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
@@ -4064,21 +4555,21 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
__Pyx_INCREF(__pyx_t_2);
__Pyx_INCREF(__pyx_t_1);
#else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
#endif
} else {
Py_ssize_t index = -1;
- __pyx_t_3 = PyObject_GetIter(__pyx_v_dst); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_GetIter(__pyx_v_dst); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
index = 0; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_2);
index = 1; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
__pyx_t_4 = NULL;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L6_unpacking_done;
@@ -4086,12 +4577,12 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 294, __pyx_L1_error)
__pyx_L6_unpacking_done:;
}
- __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_dst_row = __pyx_t_6;
__pyx_v_dst_col = __pyx_t_5;
@@ -4121,12 +4612,12 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
* return numpy.array([self.c_funct(src_col, src_row)])
* d_row = dst_row - src_row
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warning); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -4139,20 +4630,20 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
* d_col = dst_col - src_col
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_v_src_col, __pyx_v_src_row)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_v_src_col, __pyx_v_src_row)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -4162,24 +4653,52 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 297, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/image/bilinear.pyx":295
+ * src_row, src_col = src
+ * dst_row, dst_col = dst
+ * if (src_row == dst_row) and (src_col == dst_col): # <<<<<<<<<<<<<<
+ * logger.warning("Source and destination points are the same")
+ * return numpy.array([self.c_funct(src_col, src_row)])
+ */
}
/* "silx/image/bilinear.pyx":298
@@ -4217,14 +4736,8 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*
*/
if (unlikely(__pyx_v_length == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
PyErr_SetString(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 303, __pyx_L1_error)
}
__pyx_v_row_width = (__pyx_v_d_col / __pyx_v_length);
@@ -4237,14 +4750,8 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*/
__pyx_t_5 = (-__pyx_v_d_row);
if (unlikely(__pyx_v_length == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
PyErr_SetString(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 304, __pyx_L1_error)
}
__pyx_v_col_width = (__pyx_t_5 / __pyx_v_length);
@@ -4266,14 +4773,8 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*/
__pyx_t_5 = ((float)(__pyx_v_lengt - 1));
if (unlikely(__pyx_t_5 == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
PyErr_SetString(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 307, __pyx_L1_error)
}
__pyx_v_d_row = (__pyx_v_d_row / __pyx_t_5);
@@ -4286,14 +4787,8 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*/
__pyx_t_5 = ((float)(__pyx_v_lengt - 1));
if (unlikely(__pyx_t_5 == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
PyErr_SetString(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 308, __pyx_L1_error)
}
__pyx_v_d_col = (__pyx_v_d_col / __pyx_t_5);
@@ -4304,34 +4799,34 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
*
* # Offset position to the center of the bottom pixels of the profile
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_lengt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_lengt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_t_2);
- if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_result = __pyx_t_11;
__pyx_t_11.memview = NULL;
@@ -4481,6 +4976,14 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
__pyx_t_8 = ((__pyx_v_new_row < __pyx_v_self->height) != 0);
__pyx_t_7 = __pyx_t_8;
__pyx_L18_bool_binop_done:;
+
+ /* "silx/image/bilinear.pyx":327
+ * new_row = row + j * row_width
+ * new_col = col + j * col_width
+ * if ((new_col >= 0) and (new_col < self.width) and # <<<<<<<<<<<<<<
+ * (new_row >= 0) and (new_row < self.height)):
+ * cnt = cnt + 1
+ */
if (__pyx_t_7) {
/* "silx/image/bilinear.pyx":329
@@ -4500,9 +5003,15 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
* result[i] += sum / cnt
*/
__pyx_v_sum = (__pyx_v_sum + ((struct __pyx_vtabstruct_4silx_5image_8bilinear_BilinearImage *)__pyx_v_self->__pyx_vtab)->c_funct(__pyx_v_self, __pyx_v_new_col, __pyx_v_new_row));
- goto __pyx_L17;
+
+ /* "silx/image/bilinear.pyx":327
+ * new_row = row + j * row_width
+ * new_col = col + j * col_width
+ * if ((new_col >= 0) and (new_col < self.width) and # <<<<<<<<<<<<<<
+ * (new_row >= 0) and (new_row < self.height)):
+ * cnt = cnt + 1
+ */
}
- __pyx_L17:;
}
/* "silx/image/bilinear.pyx":331
@@ -4530,14 +5039,20 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
#ifdef WITH_THREAD
PyGILState_Release(__pyx_gilstate_save);
#endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L11_error;}
+ __PYX_ERR(0, 332, __pyx_L11_error)
}
- __pyx_t_14 = __pyx_v_i;
- if (__pyx_t_14 < 0) __pyx_t_14 += __pyx_v_result.shape[0];
- *((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_result.data) + __pyx_t_14)) )) += (__pyx_v_sum / __pyx_v_cnt);
- goto __pyx_L22;
+ __pyx_t_16 = __pyx_v_i;
+ if (__pyx_t_16 < 0) __pyx_t_16 += __pyx_v_result.shape[0];
+ *((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_result.data) + __pyx_t_16)) )) += (__pyx_v_sum / __pyx_v_cnt);
+
+ /* "silx/image/bilinear.pyx":331
+ * cnt = cnt + 1
+ * sum = sum + self.c_funct(new_col, new_row)
+ * if cnt: # <<<<<<<<<<<<<<
+ * result[i] += sum / cnt
+ *
+ */
}
- __pyx_L22:;
}
}
@@ -4571,15 +5086,15 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
* return numpy.asarray(result) # <<<<<<<<<<<<<<
*/
__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 = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_result, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -4589,19 +5104,39 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_14profile_line(
}
}
if (!__pyx_t_3) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_r = __pyx_t_2;
@@ -4658,13 +5193,10 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4data___get__(s
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 = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->data, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_v_self->data.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 43, __pyx_L1_error)}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->data, 2, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 43, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4706,12 +5238,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4maxi___get__(s
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 = PyFloat_FromDouble(__pyx_v_self->maxi); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->maxi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4745,12 +5274,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_4mini___get__(s
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 = PyFloat_FromDouble(__pyx_v_self->mini); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->mini); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4792,12 +5318,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_5width___get__(
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_FromSize_t(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4831,12 +5354,9 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6height___get__
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_FromSize_t(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_self->height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4853,7 +5373,7 @@ static PyObject *__pyx_pf_4silx_5image_8bilinear_13BilinearImage_6height___get__
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -4869,9 +5389,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -4899,12 +5416,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -4918,7 +5435,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4932,14 +5449,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -4951,19 +5468,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -4980,7 +5497,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -4992,19 +5509,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -5013,12 +5527,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -5027,7 +5541,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -5037,21 +5551,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -5061,95 +5583,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -5159,43 +5694,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -5205,42 +5749,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -5249,7 +5801,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -5257,19 +5809,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -5278,7 +5830,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -5290,20 +5842,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -5312,7 +5872,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -5324,34 +5884,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -5360,7 +5928,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -5369,19 +5937,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -5391,7 +5959,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -5400,7 +5968,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -5410,21 +5978,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -5434,7 +6010,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -5443,7 +6019,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -5451,30 +6027,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -5483,7 +6047,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -5492,14 +6056,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5512,7 +6088,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5523,7 +6099,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -5537,14 +6113,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -5555,16 +6131,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -5573,18 +6146,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -5592,21 +6165,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -5614,11 +6195,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -5628,21 +6216,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -5652,7 +6248,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -5662,7 +6258,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -5672,7 +6268,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -5682,7 +6278,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -5692,7 +6288,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -5701,7 +6297,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -5711,7 +6307,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -5720,7 +6316,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -5730,7 +6326,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -5739,22 +6335,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -5767,7 +6371,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -5797,7 +6401,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -5810,18 +6414,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -5831,7 +6435,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -5839,10 +6443,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -5852,7 +6464,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -5862,7 +6474,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -5870,32 +6482,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -5907,84 +6532,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
/* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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;
}
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+/* "View.MemoryView":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -5992,15 +6661,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6014,24 +6683,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -6039,16 +6705,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6068,7 +6734,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6082,24 +6748,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -6107,16 +6770,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6136,7 +6799,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -6150,35 +6813,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -6198,7 +6858,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -6215,12 +6875,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -6230,96 +6887,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -6330,7 +6995,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -6342,7 +7007,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -6365,7 +7030,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -6377,9 +7042,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -6401,7 +7063,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -6412,25 +7074,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -6443,7 +7105,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -6457,7 +7119,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -6471,19 +7133,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -6495,7 +7157,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -6510,7 +7172,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -6524,7 +7186,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -6533,7 +7195,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -6542,7 +7204,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -6552,7 +7214,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -6560,21 +7222,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -6587,7 +7255,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -6601,9 +7269,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -6628,7 +7293,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -6637,7 +7302,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -6649,43 +7314,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -6698,7 +7358,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -6707,14 +7367,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -6727,16 +7387,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -6746,7 +7406,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -6755,90 +7415,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -6847,7 +7594,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -6856,7 +7603,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -6868,8 +7615,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -6877,7 +7622,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -6890,19 +7635,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -6913,41 +7663,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -6959,8 +7812,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -6980,12 +7833,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -6994,7 +7844,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7006,25 +7856,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -7033,7 +7885,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -7044,18 +7896,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7065,7 +7917,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -7075,8 +7927,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -7095,7 +7947,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -7109,14 +7961,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7128,12 +7980,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -7144,7 +7993,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -7155,20 +8004,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7176,39 +8033,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -7216,25 +8073,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -7242,14 +8107,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -7272,7 +8137,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -7286,14 +8151,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7302,24 +8167,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7327,111 +8189,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -7456,7 +8334,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -7476,24 +8354,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -7501,81 +8376,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -7592,12 +8478,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -7605,11 +8501,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -7621,7 +8523,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -7643,7 +8545,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -7660,55 +8562,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -7729,7 +8628,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -7738,7 +8637,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -7756,12 +8655,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -7770,7 +8666,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -7779,7 +8675,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -7789,7 +8685,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -7798,7 +8694,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -7808,17 +8704,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -7826,22 +8730,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -7850,7 +8762,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -7860,7 +8772,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -7868,24 +8780,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -7895,21 +8815,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -7919,7 +8845,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -7932,8 +8858,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -7947,6 +8875,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -7964,7 +8893,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -7985,7 +8914,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -7999,33 +8928,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -8046,7 +8972,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -8067,41 +8993,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -8109,26 +9031,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -8138,38 +9062,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -8177,14 +9129,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -8197,51 +9157,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -8249,7 +9220,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -8275,7 +9246,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -8296,31 +9267,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -8331,53 +9300,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -8387,66 +9364,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -8455,9 +9452,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -8474,7 +9471,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -8485,7 +9482,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8499,14 +9496,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -8521,7 +9518,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -8531,7 +9528,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -8540,22 +9537,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -8565,7 +9570,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -8574,22 +9579,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -8599,7 +9612,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -8608,22 +9621,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -8633,7 +9654,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -8642,22 +9663,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -8667,7 +9696,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -8677,7 +9706,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -8687,7 +9716,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -8697,7 +9726,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -8706,7 +9735,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -8719,7 +9748,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8737,78 +9766,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -8823,49 +9849,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -8876,77 +9902,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -8955,102 +9980,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9059,110 +10091,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__12, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9171,55 +10206,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -9234,55 +10266,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -9297,51 +10326,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -9349,11 +10375,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -9370,156 +10396,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_int_1);
__pyx_v_result = __pyx_int_1;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -9528,18 +10513,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9550,8 +10534,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -9564,20 +10548,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -9587,7 +10571,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -9596,9 +10580,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -9608,8 +10600,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -9622,7 +10614,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9636,25 +10628,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -9662,54 +10651,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9730,7 +10719,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -9744,24 +10733,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -9769,27 +10755,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -9809,7 +10795,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -9823,48 +10809,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -9883,8 +10866,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -9897,49 +10880,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -9957,8 +10937,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -9971,26 +10951,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -9999,7 +10976,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -10008,17 +10985,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -10026,14 +11003,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -10051,7 +11028,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10065,14 +11042,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -10080,12 +11057,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -10094,7 +11068,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -10103,17 +11077,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -10121,13 +11095,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10146,7 +11120,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -10161,40 +11135,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -10203,7 +11174,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -10215,7 +11186,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -10237,7 +11208,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -10251,18 +11222,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -10276,7 +11247,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -10305,12 +11276,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -10321,49 +11289,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -10372,7 +11348,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -10381,7 +11357,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -10394,25 +11370,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -10421,7 +11399,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -10431,13 +11409,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -10448,7 +11426,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -10458,27 +11436,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__11);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__11);
- __Pyx_GIVEREF(__pyx_slice__11);
+ __Pyx_INCREF(__pyx_slice__13);
+ __Pyx_GIVEREF(__pyx_slice__13);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__13);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -10486,22 +11464,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__14); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -10509,17 +11495,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -10532,29 +11526,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -10573,18 +11575,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -10595,17 +11597,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -10615,29 +11617,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__13);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__13);
- __Pyx_GIVEREF(__pyx_slice__13);
+ __Pyx_INCREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__15);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -10647,32 +11655,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -10698,76 +11706,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -10776,7 +11791,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -10815,12 +11830,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -10830,7 +11842,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -10839,7 +11851,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -10850,36 +11862,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -10887,20 +11899,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -10911,7 +11931,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -10921,7 +11941,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -10931,7 +11951,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -10940,7 +11960,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -10949,7 +11969,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -10961,25 +11981,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -10988,7 +12010,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -10999,7 +12021,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -11009,27 +12031,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -11040,7 +12070,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -11049,7 +12079,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -11058,16 +12088,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -11075,24 +12105,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -11101,20 +12139,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -11123,20 +12161,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -11145,55 +12183,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -11204,7 +12242,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -11214,18 +12252,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -11234,73 +12272,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -11322,7 +12368,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -11337,11 +12383,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -11351,7 +12394,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -11361,7 +12404,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -11369,11 +12412,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -11387,28 +12436,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -11420,7 +12483,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -11438,19 +12501,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -11460,7 +12529,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -11470,7 +12539,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -11479,7 +12548,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -11489,7 +12558,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -11497,13 +12566,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -11513,7 +12596,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -11523,7 +12606,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -11531,38 +12614,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -11570,24 +12676,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -11597,7 +12711,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -11607,7 +12721,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -11616,7 +12730,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -11626,7 +12740,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -11634,13 +12748,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -11650,7 +12778,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -11658,49 +12786,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -11710,7 +12861,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -11718,11 +12869,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -11731,7 +12888,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -11741,7 +12898,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -11749,11 +12906,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -11763,7 +12926,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -11771,11 +12934,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -11784,7 +12953,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -11793,7 +12962,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -11804,7 +12973,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -11814,7 +12983,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -11822,23 +12991,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -11848,7 +13025,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -11858,7 +13035,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -11868,7 +13045,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -11876,39 +13053,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -11918,7 +13125,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -11942,7 +13149,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -11962,21 +13169,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -11986,7 +13190,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -11996,7 +13200,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -12004,28 +13208,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -12033,20 +13225,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -12055,7 +13255,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -12065,7 +13265,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -12073,13 +13273,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -12089,7 +13295,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -12098,7 +13304,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -12108,35 +13314,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -12146,32 +13366,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -12180,7 +13408,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -12190,7 +13418,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -12198,11 +13426,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -12212,7 +13446,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -12231,7 +13465,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -12254,11 +13488,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -12268,7 +13499,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -12278,7 +13509,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -12288,7 +13519,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -12299,7 +13530,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -12308,7 +13539,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -12320,7 +13551,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -12332,7 +13563,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -12350,20 +13581,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -12373,7 +13610,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -12397,7 +13634,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -12410,17 +13647,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -12429,7 +13666,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -12441,7 +13678,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -12454,12 +13691,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -12469,7 +13703,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -12477,30 +13711,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -12519,7 +13761,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -12533,12 +13775,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -12548,32 +13787,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -12594,36 +13841,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -12632,11 +13879,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -12647,7 +13894,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -12657,7 +13904,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -12665,16 +13913,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -12683,7 +13929,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -12694,35 +13940,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -12731,7 +13985,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -12740,14 +13994,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -12755,7 +14009,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -12765,7 +14019,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -12775,7 +14029,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -12784,7 +14038,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -12793,7 +14047,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -12802,7 +14056,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -12811,7 +14065,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -12820,66 +14074,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -12887,7 +14203,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -12896,7 +14212,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -12908,7 +14224,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -12924,12 +14240,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -12944,36 +14261,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -12982,19 +14296,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -13005,7 +14327,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -13016,7 +14338,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -13024,7 +14346,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13041,10 +14363,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -13054,7 +14376,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -13064,7 +14386,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -13074,7 +14396,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -13083,7 +14405,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -13092,7 +14414,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -13103,59 +14425,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13167,7 +14470,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -13180,12 +14483,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -13194,7 +14494,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -13202,13 +14502,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -13227,7 +14527,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -13245,23 +14545,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -13271,7 +14568,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -13280,20 +14577,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -13304,7 +14609,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -13313,20 +14618,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -13345,7 +14650,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -13357,7 +14662,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -13367,7 +14672,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -13376,21 +14681,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -13403,7 +14716,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13420,7 +14733,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -13429,7 +14742,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -13438,17 +14751,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -13458,7 +14771,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -13467,7 +14780,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -13475,11 +14788,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13490,7 +14811,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -13500,7 +14821,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -13509,7 +14830,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -13517,11 +14838,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -13531,7 +14860,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -13540,21 +14869,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13567,7 +14904,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -13587,7 +14924,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -13596,7 +14933,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -13605,7 +14942,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -13614,7 +14951,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -13623,7 +14960,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -13633,7 +14970,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -13653,7 +14990,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -13667,9 +15004,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -13677,22 +15022,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -13701,7 +15054,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -13710,7 +15063,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -13721,22 +15074,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -13745,7 +15106,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -13754,7 +15115,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -13766,7 +15127,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -13777,7 +15138,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13787,7 +15148,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -13796,7 +15157,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13807,7 +15168,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13823,7 +15184,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -13833,7 +15194,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13844,7 +15205,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -13854,7 +15215,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -13864,7 +15225,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13877,7 +15238,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -13892,7 +15253,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -13902,7 +15263,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -13913,7 +15274,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -13922,7 +15283,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -13931,21 +15292,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -13954,7 +15323,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -13966,7 +15335,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -13976,7 +15345,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -13989,7 +15358,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14008,11 +15377,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -14022,7 +15388,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -14031,7 +15397,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -14040,7 +15406,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -14050,19 +15416,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -14071,7 +15443,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -14081,7 +15453,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14092,7 +15464,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -14101,17 +15473,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -14120,7 +15492,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14131,7 +15503,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -14141,53 +15513,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -14197,7 +15583,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14221,7 +15607,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -14236,62 +15622,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -14314,7 +15697,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14330,33 +15713,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -14366,26 +15746,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14410,7 +15810,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14427,16 +15827,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -14446,18 +15843,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -14467,39 +15864,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14524,7 +15949,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -14549,11 +15974,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -14562,7 +15984,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -14572,7 +15994,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -14581,7 +16003,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -14590,7 +16012,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -14599,7 +16021,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -14609,7 +16031,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -14617,10 +16039,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -14630,7 +16060,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -14638,11 +16068,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -14658,7 +16095,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14669,7 +16106,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -14679,7 +16116,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -14689,7 +16126,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -14698,7 +16135,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -14706,25 +16143,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -14734,62 +16185,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -14797,11 +16260,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -14811,51 +16280,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
*
- * 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)
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -14864,7 +16348,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -14873,7 +16357,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -14882,7 +16366,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -14891,7 +16375,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -14900,7 +16384,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -14909,12 +16393,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -14928,28 +16426,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -14958,7 +16462,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -14967,7 +16471,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -14976,7 +16480,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -14985,7 +16489,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -14995,7 +16499,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -15019,21 +16523,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -15042,87 +16546,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -15130,7 +16634,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15141,7 +16645,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -15151,7 +16655,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -15159,11 +16663,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15174,7 +16684,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15189,7 +16699,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -15198,7 +16708,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15213,7 +16723,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15229,7 +16739,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -15240,7 +16750,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -15250,7 +16760,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -15260,7 +16770,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -15268,36 +16778,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -15307,7 +16841,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15319,7 +16853,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -15329,7 +16863,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15338,7 +16872,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -15347,7 +16881,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -15356,7 +16890,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -15367,7 +16901,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15383,7 +16917,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -15392,7 +16926,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -15401,7 +16935,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -15411,7 +16945,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -15422,7 +16956,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -15431,7 +16965,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -15440,22 +16974,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -15464,7 +17006,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -15476,7 +17018,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15501,10 +17043,11 @@ static PyObject *__pyx_tp_new_4silx_5image_8bilinear_BilinearImage(PyTypeObject
p->__pyx_vtab = __pyx_vtabptr_4silx_5image_8bilinear_BilinearImage;
p->data.data = NULL;
p->data.memview = NULL;
- if (unlikely(__pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
+ if (unlikely(__pyx_pw_4silx_5image_8bilinear_13BilinearImage_1__cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_4silx_5image_8bilinear_BilinearImage(PyObject *o) {
@@ -15556,11 +17099,11 @@ static PyMethodDef __pyx_methods_4silx_5image_8bilinear_BilinearImage[] = {
};
static struct PyGetSetDef __pyx_getsets_4silx_5image_8bilinear_BilinearImage[] = {
- {(char *)"data", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_data, 0, 0, 0},
- {(char *)"maxi", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_maxi, 0, 0, 0},
- {(char *)"mini", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_mini, 0, 0, 0},
- {(char *)"width", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_width, 0, 0, 0},
- {(char *)"height", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_height, 0, 0, 0},
+ {(char *)"data", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_data, 0, (char *)0, 0},
+ {(char *)"maxi", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_maxi, 0, (char *)0, 0},
+ {(char *)"mini", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_mini, 0, (char *)0, 0},
+ {(char *)"width", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_width, 0, (char *)0, 0},
+ {(char *)"height", __pyx_getprop_4silx_5image_8bilinear_13BilinearImage_height, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -15575,8 +17118,9 @@ static PyTypeObject __pyx_type_4silx_5image_8bilinear_BilinearImage = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15620,6 +17164,7 @@ static PyTypeObject __pyx_type_4silx_5image_8bilinear_BilinearImage = {
0, /*tp_finalize*/
#endif
};
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -15631,12 +17176,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -15687,7 +17234,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -15696,7 +17243,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -15747,8 +17294,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15852,8 +17400,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -15914,10 +17463,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -15995,39 +17545,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -16039,15 +17589,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -16098,8 +17648,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -16199,7 +17750,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -16207,7 +17758,7 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -16222,8 +17773,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -16300,6 +17852,7 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_15_09_2016, __pyx_k_15_09_2016, sizeof(__pyx_k_15_09_2016), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
{&__pyx_kp_s_Bilinear_interpolator_peak_finde, __pyx_k_Bilinear_interpolator_peak_finde, sizeof(__pyx_k_Bilinear_interpolator_peak_finde), 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},
@@ -16344,6 +17897,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
@@ -16379,7 +17933,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
{&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
- {&__pyx_kp_s_silx_image_bilinear, __pyx_k_silx_image_bilinear, sizeof(__pyx_k_silx_image_bilinear), 0, 0, 1, 0},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_s_src, __pyx_k_src, sizeof(__pyx_k_src), 0, 0, 1, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
@@ -16394,25 +17947,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
{&__pyx_n_s_warning, __pyx_k_warning, sizeof(__pyx_k_warning), 0, 0, 1, 1},
- {&__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_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __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 = 194; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 164, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 194, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 131, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16429,7 +17976,7 @@ static int __Pyx_InitCachedConstants(void) {
* else:
* delta0 = ((a12 - a10) * d01 + (a01 - a21) * d11) / denom
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Singular_determinant_Hessian_und); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Singular_determinant_Hessian_und); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 184, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
@@ -16440,7 +17987,7 @@ static int __Pyx_InitCachedConstants(void) {
* # refinement of the position by a simple center of mass of the last valid region used
* for i0 in range(current0 - 1, current0 + 2):
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_find_root_using_second); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_find_root_using_second); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
@@ -16451,196 +17998,210 @@ static int __Pyx_InitCachedConstants(void) {
* return numpy.array([self.c_funct(src_col, src_row)])
* d_row = dst_row - src_row
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Source_and_destination_points_ar); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Source_and_destination_points_ar); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__8 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__9 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__12 = PyTuple_New(1); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__12, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__11);
- __Pyx_GIVEREF(__pyx_slice__11);
+ __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__13);
+ __Pyx_GIVEREF(__pyx_slice__13);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__12);
- __Pyx_GIVEREF(__pyx_slice__12);
+ __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__13);
- __Pyx_GIVEREF(__pyx_slice__13);
+ __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(1, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
-
- /* "silx/image/bilinear.pyx":36
- * from libc.math cimport floor, ceil, sin, cos, sqrt, atan2
- * import logging
- * logger = logging.getLogger("silx.image.bilinear") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_silx_image_bilinear); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__16 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __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_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __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_strided_and_direct); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -16649,11 +18210,11 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16669,9 +18230,10 @@ PyMODINIT_FUNC PyInit_bilinear(void)
{
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ static PyThread_type_lock __pyx_t_6[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -16683,17 +18245,24 @@ PyMODINIT_FUNC PyInit_bilinear(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_bilinear(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -16708,34 +18277,34 @@ PyMODINIT_FUNC PyInit_bilinear(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
if (__pyx_module_is_main_silx__image__bilinear) {
- 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 (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
if (!PyDict_GetItemString(modules, "silx.image.bilinear")) {
- if (unlikely(PyDict_SetItemString(modules, "silx.image.bilinear", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyDict_SetItemString(modules, "silx.image.bilinear", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -16749,11 +18318,11 @@ PyMODINIT_FUNC PyInit_bilinear(void)
__pyx_vtable_4silx_5image_8bilinear_BilinearImage.coarse_local_maxi = (size_t (*)(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *, size_t, int __pyx_skip_dispatch))__pyx_f_4silx_5image_8bilinear_13BilinearImage_coarse_local_maxi;
__pyx_vtable_4silx_5image_8bilinear_BilinearImage.c_local_maxi = (size_t (*)(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *, size_t))__pyx_f_4silx_5image_8bilinear_13BilinearImage_c_local_maxi;
__pyx_vtable_4silx_5image_8bilinear_BilinearImage.c_funct = (float (*)(struct __pyx_obj_4silx_5image_8bilinear_BilinearImage *, float, float))__pyx_f_4silx_5image_8bilinear_13BilinearImage_c_funct;
- if (PyType_Ready(&__pyx_type_4silx_5image_8bilinear_BilinearImage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4silx_5image_8bilinear_BilinearImage) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
__pyx_type_4silx_5image_8bilinear_BilinearImage.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_5image_8bilinear_BilinearImage, "__call__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_5image_8bilinear_BilinearImage, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 39, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
__pyx_wrapperbase_4silx_5image_8bilinear_13BilinearImage_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
__pyx_wrapperbase_4silx_5image_8bilinear_13BilinearImage_4__call__.doc = __pyx_doc_4silx_5image_8bilinear_13BilinearImage_4__call__;
@@ -16761,13 +18330,16 @@ PyMODINIT_FUNC PyInit_bilinear(void)
}
}
#endif
- if (__Pyx_SetVtable(__pyx_type_4silx_5image_8bilinear_BilinearImage.tp_dict, __pyx_vtabptr_4silx_5image_8bilinear_BilinearImage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyObject_SetAttrString(__pyx_m, "BilinearImage", (PyObject *)&__pyx_type_4silx_5image_8bilinear_BilinearImage) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4silx_5image_8bilinear_BilinearImage.tp_dict, __pyx_vtabptr_4silx_5image_8bilinear_BilinearImage) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "BilinearImage", (PyObject *)&__pyx_type_4silx_5image_8bilinear_BilinearImage) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
__pyx_ptype_4silx_5image_8bilinear_BilinearImage = &__pyx_type_4silx_5image_8bilinear_BilinearImage;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -16778,23 +18350,26 @@ PyMODINIT_FUNC PyInit_bilinear(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
/* "silx/image/bilinear.pyx":26
* # THE SOFTWARE.
@@ -16803,12 +18378,12 @@ PyMODINIT_FUNC PyInit_bilinear(void)
* __license__ = "MIT"
* __date__ = "15/09/2016"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_J_Kieffer);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_J_Kieffer);
__Pyx_GIVEREF(__pyx_kp_s_J_Kieffer);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_J_Kieffer);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/bilinear.pyx":27
@@ -16818,7 +18393,7 @@ PyMODINIT_FUNC PyInit_bilinear(void)
* __date__ = "15/09/2016"
* __doc__ = "Bilinear interpolator, peak finder, line-profile for images"
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
/* "silx/image/bilinear.pyx":28
* __authors__ = ["J. Kieffer"]
@@ -16827,7 +18402,7 @@ PyMODINIT_FUNC PyInit_bilinear(void)
* __doc__ = "Bilinear interpolator, peak finder, line-profile for images"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_09_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_09_2016) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
/* "silx/image/bilinear.pyx":29
* __license__ = "MIT"
@@ -16836,7 +18411,7 @@ PyMODINIT_FUNC PyInit_bilinear(void)
*
* import cython
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_s_Bilinear_interpolator_peak_finde) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_doc, __pyx_kp_s_Bilinear_interpolator_peak_finde) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
/* "silx/image/bilinear.pyx":33
* import cython
@@ -16845,39 +18420,84 @@ PyMODINIT_FUNC PyInit_bilinear(void)
* from libc.math cimport floor, ceil, sin, cos, sqrt, atan2
* import logging
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/bilinear.pyx":35
* import numpy
* from libc.math cimport floor, ceil, sin, cos, sqrt, atan2
* import logging # <<<<<<<<<<<<<<
- * logger = logging.getLogger("silx.image.bilinear")
+ * 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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __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 = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/bilinear.pyx":36
* from libc.math cimport floor, ceil, sin, cos, sqrt, atan2
* import logging
- * logger = logging.getLogger("silx.image.bilinear") # <<<<<<<<<<<<<<
+ * logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __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_ERR(0, 36, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/bilinear.pyx":1
@@ -16885,121 +18505,147 @@ PyMODINIT_FUNC PyInit_bilinear(void)
* #
* # Project: silx (originally pyFAI)
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __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
+ /* "View.MemoryView":283
*
* 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__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __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
+ /* "View.MemoryView":284
* 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__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __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
+ /* "View.MemoryView":287
*
*
* 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__19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __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
+ /* "View.MemoryView":288
*
* 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__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_6[0] = PyThread_allocate_lock();
+ __pyx_t_6[1] = PyThread_allocate_lock();
+ __pyx_t_6[2] = PyThread_allocate_lock();
+ __pyx_t_6[3] = PyThread_allocate_lock();
+ __pyx_t_6[4] = PyThread_allocate_lock();
+ __pyx_t_6[5] = PyThread_allocate_lock();
+ __pyx_t_6[6] = PyThread_allocate_lock();
+ __pyx_t_6[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -17013,6 +18659,9 @@ PyMODINIT_FUNC PyInit_bilinear(void)
__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 silx.image.bilinear", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -17030,7 +18679,8 @@ PyMODINIT_FUNC PyInit_bilinear(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -17047,6 +18697,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -17060,6 +18711,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -17073,6 +18725,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -17174,6 +18827,7 @@ bad:
return -1;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -17199,6 +18853,92 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* PyIntBinop */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* GetItemInt */
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
@@ -17207,8 +18947,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -17221,8 +18962,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -17234,9 +18976,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -17260,10 +19003,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -17277,6 +19019,145 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
@@ -17296,6 +19177,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
+/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
@@ -17315,6 +19197,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
+/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
@@ -17327,6 +19210,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -17334,19 +19222,33 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -17360,9 +19262,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+/* GetModuleGlobalName */
+ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -17377,7 +19280,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -17926,7 +19830,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -17982,7 +19887,6 @@ no_fail:
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
@@ -18061,10 +19965,10 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -18074,29 +19978,33 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -18117,21 +20025,28 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* IterFinish */
+ static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
@@ -18164,7 +20079,8 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
#endif
}
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+/* UnpackItemEndCheck */
+ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
@@ -18175,7 +20091,8 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
return 0;
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -18201,9 +20118,11 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -18242,6 +20161,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -18275,10 +20195,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -18338,7 +20261,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -18358,7 +20281,8 @@ bad:
}
#endif
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -18395,7 +20319,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -18478,14 +20403,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -18497,13 +20424,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -18523,11 +20457,13 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -18539,23 +20475,18 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -18565,16 +20496,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -18585,7 +20528,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -18603,7 +20546,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -18627,37 +20570,236 @@ bad:
return -1;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -18674,13 +20816,14 @@ bad:
return -1;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -18753,7 +20896,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -18826,7 +20970,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -18854,102 +20998,244 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ *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);
+}
+
+/* Capsule */
+ 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;
}
-#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; \
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #endif
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) {
+ return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
+ float value = __pyx_PyFloat_AsFloat(obj);
+ if ((value == (float)-1) && PyErr_Occurred())
+ return 0;
+ *(float *) itemp = value;
+ return 1;
+}
+
+/* MemviewSliceCopyTemplate */
+ 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 size_t __Pyx_PyInt_As_size_t(PyObject *x) {
- const size_t neg_one = (size_t) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+ const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -18966,36 +21252,129 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (size_t) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
+ return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
+ return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
+ return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (size_t) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(size_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (size_t) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
if (sizeof(size_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
- } else if (sizeof(size_t) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19004,7 +21383,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
size_t val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19027,7 +21406,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
}
} else {
size_t val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (size_t) -1;
val = __Pyx_PyInt_As_size_t(tmp);
Py_DECREF(tmp);
@@ -19043,8 +21422,9 @@ raise_neg_overflow:
return (size_t) -1;
}
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19061,36 +21441,129 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19099,7 +21572,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19122,7 +21595,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
}
} else {
int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
@@ -19138,206 +21611,9 @@ raise_neg_overflow:
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 PyObject *__pyx_memview_get_float(const char *itemp) {
- return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
-}
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
- float value = __pyx_PyFloat_AsFloat(obj);
- if ((value == (float)-1) && PyErr_Occurred())
- return 0;
- *(float *) itemp = value;
- return 1;
-}
-
-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;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19354,36 +21630,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19392,7 +21761,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19415,7 +21784,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -19431,8 +21800,9 @@ raise_neg_overflow:
return (char) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19449,36 +21819,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19487,7 +21950,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19510,7 +21973,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -19526,7 +21989,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -19566,7 +22030,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -19747,7 +22212,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(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) };
@@ -19769,7 +22235,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -19791,7 +22258,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -19813,7 +22281,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -19828,7 +22297,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -19866,7 +22336,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -19907,7 +22377,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -19928,8 +22398,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -19937,9 +22409,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -19948,11 +22421,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -19977,18 +22453,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/image/bilinear.pyx b/silx/image/bilinear.pyx
index ce440b4..0b072df 100644
--- a/silx/image/bilinear.pyx
+++ b/silx/image/bilinear.pyx
@@ -33,7 +33,7 @@ from cython.view cimport array as cvarray
import numpy
from libc.math cimport floor, ceil, sin, cos, sqrt, atan2
import logging
-logger = logging.getLogger("silx.image.bilinear")
+logger = logging.getLogger(__name__)
cdef class BilinearImage:
diff --git a/silx/image/phantomgenerator.py b/silx/image/phantomgenerator.py
new file mode 100644
index 0000000..10b249b
--- /dev/null
+++ b/silx/image/phantomgenerator.py
@@ -0,0 +1,160 @@
+# 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__ = ["N. Vigano", "H. Payno", "P. Paleo"]
+__license__ = "MIT"
+__date__ = "19/09/2017"
+
+import numpy
+
+
+class PhantomGenerator(object):
+ """
+ Class for generating Phantoms
+ """
+
+ class _Ellipsoid:
+ def __init__(self, a, b, c, x0, y0, z0, alpha, mu):
+ self.a = a
+ self.b = b
+ self.c = c
+ self.x0 = x0
+ self.y0 = y0
+ self.z0 = z0
+ self.alpha = alpha * numpy.pi / 180.0
+ self.mu = mu
+ self.cosAlpha = numpy.cos(self.alpha)
+ self.sinAlpha = numpy.sin(self.alpha)
+
+ SHEPP_LOGAN = [
+ # a b c x0 y0 z0 alpha mu
+ _Ellipsoid(0.69, 0.92, 0.90, 0.0, 0.0, 0.0, 0.0, 0.10),
+ _Ellipsoid(0.6624, 0.874, 0.88, 0.0, -0.02, 0.0, 0.0, -0.08),
+ _Ellipsoid(0.11, 0.31, 0.21, 0.22, -0.0, 0.0, -18.0, -0.02),
+ _Ellipsoid(0.16, 0.41, 0.22, -0.22, 0.0, -0.25, 18.0, -0.02),
+ _Ellipsoid(0.21, 0.25, 0.35, 0.0, 0.35, -0.25, 0.0, 0.03),
+ _Ellipsoid(0.046, 0.046, 0.046, 0.0, 0.10, -0.25, 0.0, 0.01),
+ _Ellipsoid(0.046, 0.046, 0.02, 0.0, -0.10, -0.25, 0.0, 0.01),
+ _Ellipsoid(0.046, 0.023, 0.02, -0.08, -0.605, -0.25, 0.0, 0.01),
+ _Ellipsoid(0.023, 0.023, 0.10, 0.0, -0.605, -0.25, 0.0, 0.01),
+ _Ellipsoid(0.023, 0.046, 0.10, 0.06, -0.605, -0.25, 0.0, 0.01)
+ ]
+
+ @staticmethod
+ def get2DPhantomSheppLogan(n, ellipsoidID=None):
+ """
+ generate a classical 2D shepp logan phantom.
+
+ :param n: The width (and height) of the phantom to generate
+ :param ellipsoidID: The Id of the ellipsoid to pick. If None will
+ produce every ellipsoid
+ :return numpy.ndarray: shepp logan phantom
+ """
+ assert(ellipsoidID is None or (ellipsoidID >= 0 and ellipsoidID < len(PhantomGenerator.SHEPP_LOGAN)))
+ if ellipsoidID is None:
+ area = PhantomGenerator._get2DPhantom(n,
+ PhantomGenerator.SHEPP_LOGAN)
+ else:
+ area = PhantomGenerator._get2DPhantom(n,
+ [PhantomGenerator.SHEPP_LOGAN[ellipsoidID]])
+
+ indices = numpy.abs(area) > 0
+ area[indices] = numpy.multiply(area[indices] + 0.1, 5)
+ return area / 100.0
+
+ @staticmethod
+ def _get2DPhantom(n, phantomSpec):
+ area = numpy.ndarray(shape=(n, n))
+ area.fill(0.)
+
+ count = 0
+ for ell in phantomSpec:
+ count = count+1
+ for x in range(n):
+ sumSquareXandY = PhantomGenerator._getSquareXandYsum(n, x, ell)
+ indices = sumSquareXandY <= 1
+ area[indices, x] = ell.mu
+ return area
+
+ @staticmethod
+ def _getSquareXandYsum(n, x, ell):
+ supportX1 = numpy.ndarray(shape=(n, ))
+ supportX2 = numpy.ndarray(shape=(n, ))
+ support_consts = numpy.ndarray(shape=(n, ))
+
+ xScaled = float(2*x-n)/float(n)
+ xCos = xScaled * ell.cosAlpha
+ xSin = -xScaled * ell.sinAlpha
+ supportX1.fill(xCos)
+ supportX2.fill(xSin)
+
+ supportY1 = numpy.arange(n)
+ support_consts.fill(2.)
+ supportY1 = numpy.multiply(support_consts, supportY1)
+ support_consts.fill(n)
+ supportY1 = numpy.subtract(supportY1, support_consts)
+ support_consts.fill(n)
+ supportY1 = numpy.divide(supportY1, support_consts)
+ supportY2 = numpy.array(supportY1)
+
+ support_consts.fill(ell.sinAlpha)
+ supportY1 = numpy.add(supportX1,
+ numpy.multiply(supportY1, support_consts))
+ support_consts.fill(ell.cosAlpha)
+ supportY2 = numpy.add(supportX2,
+ numpy.multiply(supportY2, support_consts))
+
+ support_consts.fill(ell.x0)
+ supportY1 = numpy.subtract(supportY1, support_consts)
+ support_consts.fill(ell.y0)
+ supportY2 = numpy.subtract(supportY2, support_consts)
+
+ support_consts.fill(ell.a)
+ supportY1 = numpy.power((numpy.divide(supportY1, support_consts)),
+ 2)
+ support_consts.fill(ell.b)
+ supportY2 = numpy.power(numpy.divide(supportY2, support_consts),
+ 2)
+
+ return numpy.add(supportY1, supportY2)
+
+ @staticmethod
+ def _getSquareZ(n, ell):
+ supportZ1 = numpy.arange(n)
+ support_consts = numpy.ndarray(shape=(n, ))
+ support_consts.fill(2.)
+ supportZ1 = numpy.multiply(support_consts, supportZ1)
+ support_consts.fill(n)
+ supportZ1 = numpy.subtract(supportZ1, support_consts)
+ support_consts.fill(n)
+ supportZ1 = numpy.divide(supportZ1, support_consts)
+
+ support_consts.fill(ell.z0)
+ supportZ1 = numpy.subtract(supportZ1, ell.z0)
+
+ support_consts.fill(ell.c)
+ return numpy.power(numpy.divide(supportZ1, support_consts),
+ 2)
+
diff --git a/silx/image/projection.py b/silx/image/projection.py
new file mode 100644
index 0000000..5c76c35
--- /dev/null
+++ b/silx/image/projection.py
@@ -0,0 +1,25 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+
+from silx.opencl.projection import *
diff --git a/silx/image/reconstruction.py b/silx/image/reconstruction.py
new file mode 100644
index 0000000..875b66b
--- /dev/null
+++ b/silx/image/reconstruction.py
@@ -0,0 +1,25 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+
+from silx.opencl.reconstruction import *
diff --git a/silx/image/shapes.c b/silx/image/shapes.c
index 19c5913..43a3283 100644
--- a/silx/image/shapes.c
+++ b/silx/image/shapes.c
@@ -1,28 +1,26 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [],
+ "language": "c"
+ },
+ "module_name": "silx.image.shapes"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +39,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +51,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +267,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +288,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +327,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +353,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +437,13 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
#define __PYX_HAVE__silx__image__shapes
#define __PYX_HAVE_API__silx__image__shapes
-#include "math.h"
+#include <math.h>
#include "pythread.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +453,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +461,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +505,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +523,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +552,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +632,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -424,6 +643,7 @@ static const char *__pyx_f[] = {
"silx/image/shapes.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +653,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +689,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +727,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -538,7 +761,7 @@ struct __pyx_obj_4silx_5image_6shapes_Polygon {
};
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -547,6 +770,7 @@ struct __pyx_obj_4silx_5image_6shapes_Polygon {
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -562,7 +786,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -575,7 +799,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -598,7 +822,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -629,7 +853,21 @@ struct __pyx_vtabstruct_4silx_5image_6shapes_Polygon {
static struct __pyx_vtabstruct_4silx_5image_6shapes_Polygon *__pyx_vtabptr_4silx_5image_6shapes_Polygon;
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -649,7 +887,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -661,6 +899,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -677,19 +918,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -712,18 +953,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -738,29 +980,41 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -786,33 +1040,84 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -820,72 +1125,116 @@ 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);
+/* abs_int.proto */
static CYTHON_INLINE unsigned int __Pyx_abs_int(int x) {
if (unlikely(x == -INT_MAX-1))
return ((unsigned int)INT_MAX) + 1U;
return (unsigned int) abs(x);
}
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
+/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#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)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -901,12 +1250,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -919,7 +1263,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -935,14 +1280,21 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -954,9 +1306,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -970,60 +1333,66 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-static PyObject *__pyx_memview_get_float(const char *itemp);
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);
-static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
-
-static PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
-static int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
-
-static PyObject *__pyx_memview_get_int(const char *itemp);
-static int __pyx_memview_set_int(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
-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);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1034,17 +1403,23 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, float __pyx_v_row, float __pyx_v_col); /* proto*/
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1072,6 +1447,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1119,180 +1496,132 @@ 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 int __pyx_pf_4silx_5image_6shapes_7Polygon___init__(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, PyObject *__pyx_v_vertices); /* proto */
-static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_2is_inside(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
-static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, int __pyx_v_height, int __pyx_v_width); /* proto */
-static PyObject *__pyx_pf_4silx_5image_6shapes_polygon_fill_mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_shape); /* proto */
-static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_row0, int __pyx_v_col0, int __pyx_v_row1, int __pyx_v_col1, int __pyx_v_width); /* proto */
-static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_crow, int __pyx_v_ccol, float __pyx_v_radius); /* 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_4silx_5image_6shapes_Polygon(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_O[] = "O";
-static char __pyx_k_a[] = "a";
-static char __pyx_k_b[] = "b";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_da[] = "da";
-static char __pyx_k_db[] = "db";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_col[] = "col";
-static char __pyx_k_dev[] = "dev";
-static char __pyx_k_max[] = "max";
-static char __pyx_k_min[] = "min";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_row[] = "row";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_ccol[] = "ccol";
-static char __pyx_k_col0[] = "col0";
-static char __pyx_k_col1[] = "col1";
-static char __pyx_k_cols[] = "cols";
-static char __pyx_k_crow[] = "crow";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_dcol[] = "dcol";
-static char __pyx_k_drow[] = "drow";
-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_row0[] = "row0";
-static char __pyx_k_row1[] = "row1";
-static char __pyx_k_rows[] = "rows";
-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_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-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_index[] = "index";
-static char __pyx_k_int32[] = "int32";
-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_uint8[] = "uint8";
-static char __pyx_k_where[] = "where";
-static char __pyx_k_width[] = "width";
-static char __pyx_k_zeros[] = "zeros";
-static char __pyx_k_arange[] = "arange";
-static char __pyx_k_coords[] = "coords";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_height[] = "height";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_offset[] = "offset";
-static char __pyx_k_radius[] = "radius";
-static char __pyx_k_status[] = "__status__";
-static char __pyx_k_step_a[] = "step_a";
-static char __pyx_k_step_b[] = "step_b";
-static char __pyx_k_struct[] = "struct";
-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_float32[] = "float32";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_a_coords[] = "a_coords";
-static char __pyx_k_b_coords[] = "b_coords";
-static char __pyx_k_i_radius[] = "i_radius";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_vertices[] = "vertices";
-static char __pyx_k_T_Vincent[] = "T. Vincent";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_draw_line[] = "draw_line";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_make_mask[] = "make_mask";
-static char __pyx_k_03_06_2016[] = "03/06/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_len_coords[] = "len_coords";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_circle_fill[] = "circle_fill";
-static char __pyx_k_Jrme_Kieffer[] = "J\303\251r\303\264me Kieffer";
-static char __pyx_k_invert_coords[] = "invert_coords";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-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_polygon_fill_mask[] = "polygon_fill_mask";
-static char __pyx_k_silx_image_shapes[] = "silx.image.shapes";
-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_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_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_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/image/shapes.pyx";
-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_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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_This_module_provides_functions_m[] = "This module provides functions making masks on an image.\n\n- :func:`circle_fill` function generates coordinates of a circle in an image.\n- :func:`draw_line` function generates coordinates of a line in an image.\n- :func:`polygon_fill_mask` function generates a mask from a set of points\n defining a polygon.\n\nThe :class:`Polygon` class provides checking if a point is inside a polygon.\n\nThe whole module uses the (row, col) (i.e., (y, x))) convention\nfor 2D coordinates.\n";
-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_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_a[] = "a";
+static const char __pyx_k_b[] = "b";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_da[] = "da";
+static const char __pyx_k_db[] = "db";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_col[] = "col";
+static const char __pyx_k_dev[] = "dev";
+static const char __pyx_k_max[] = "max";
+static const char __pyx_k_min[] = "min";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_row[] = "row";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_ccol[] = "ccol";
+static const char __pyx_k_col0[] = "col0";
+static const char __pyx_k_col1[] = "col1";
+static const char __pyx_k_cols[] = "cols";
+static const char __pyx_k_crow[] = "crow";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_dcol[] = "dcol";
+static const char __pyx_k_drow[] = "drow";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_row0[] = "row0";
+static const char __pyx_k_row1[] = "row1";
+static const char __pyx_k_rows[] = "rows";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_delta[] = "delta";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_index[] = "index";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_uint8[] = "uint8";
+static const char __pyx_k_where[] = "where";
+static const char __pyx_k_width[] = "width";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_arange[] = "arange";
+static const char __pyx_k_coords[] = "coords";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_height[] = "height";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_offset[] = "offset";
+static const char __pyx_k_radius[] = "radius";
+static const char __pyx_k_status[] = "__status__";
+static const char __pyx_k_step_a[] = "step_a";
+static const char __pyx_k_step_b[] = "step_b";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_asarray[] = "asarray";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_float32[] = "float32";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_a_coords[] = "a_coords";
+static const char __pyx_k_b_coords[] = "b_coords";
+static const char __pyx_k_i_radius[] = "i_radius";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_vertices[] = "vertices";
+static const char __pyx_k_T_Vincent[] = "T. Vincent";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_draw_line[] = "draw_line";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_make_mask[] = "make_mask";
+static const char __pyx_k_03_06_2016[] = "03/06/2016";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_len_coords[] = "len_coords";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_circle_fill[] = "circle_fill";
+static const char __pyx_k_Jrme_Kieffer[] = "J\303\251r\303\264me Kieffer";
+static const char __pyx_k_invert_coords[] = "invert_coords";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_polygon_fill_mask[] = "polygon_fill_mask";
+static const char __pyx_k_silx_image_shapes[] = "silx.image.shapes";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/image/shapes.pyx";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_This_module_provides_functions_m[] = "This module provides functions making masks on an image.\n\n- :func:`circle_fill` function generates coordinates of a circle in an image.\n- :func:`draw_line` function generates coordinates of a line in an image.\n- :func:`polygon_fill_mask` function generates a mask from a set of points\n defining a polygon.\n\nThe :class:`Polygon` class provides checking if a point is inside a polygon.\n\nThe whole module uses the (row, col) (i.e., (y, x))) convention\nfor 2D coordinates.\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
static PyObject *__pyx_kp_s_03_06_2016;
+static PyObject *__pyx_n_s_ASCII;
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;
@@ -1348,6 +1677,7 @@ static PyObject *__pyx_n_s_drow;
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_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_flags;
@@ -1372,7 +1702,6 @@ static PyObject *__pyx_n_s_make_mask;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_memview;
static PyObject *__pyx_n_s_min;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
@@ -1409,11 +1738,54 @@ 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_unpack;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_vertices;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_s_width;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
+static int __pyx_pf_4silx_5image_6shapes_7Polygon___init__(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, PyObject *__pyx_v_vertices); /* proto */
+static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_2is_inside(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, PyObject *__pyx_v_row, PyObject *__pyx_v_col); /* proto */
+static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_obj_4silx_5image_6shapes_Polygon *__pyx_v_self, int __pyx_v_height, int __pyx_v_width); /* proto */
+static PyObject *__pyx_pf_4silx_5image_6shapes_polygon_fill_mask(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_shape); /* proto */
+static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_row0, int __pyx_v_col0, int __pyx_v_row1, int __pyx_v_col1, int __pyx_v_width); /* proto */
+static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_crow, int __pyx_v_ccol, float __pyx_v_radius); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_4silx_5image_6shapes_Polygon(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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
@@ -1427,23 +1799,25 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__12;
-static PyObject *__pyx_slice__13;
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__15;
-static PyObject *__pyx_tuple__16;
+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__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_codeobj__17;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__28;
static PyObject *__pyx_codeobj__19;
static PyObject *__pyx_codeobj__21;
+static PyObject *__pyx_codeobj__23;
/* "silx/image/shapes.pyx":59
* cdef int nvert
@@ -1457,9 +1831,6 @@ static PyObject *__pyx_codeobj__21;
static int __pyx_pw_4silx_5image_6shapes_7Polygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_4silx_5image_6shapes_7Polygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vertices = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
@@ -1481,7 +1852,7 @@ static int __pyx_pw_4silx_5image_6shapes_7Polygon_1__init__(PyObject *__pyx_v_se
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[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 59, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -1492,7 +1863,7 @@ static int __pyx_pw_4silx_5image_6shapes_7Polygon_1__init__(PyObject *__pyx_v_se
}
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[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 59, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.Polygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -1514,9 +1885,6 @@ static int __pyx_pf_4silx_5image_6shapes_7Polygon___init__(struct __pyx_obj_4sil
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("__init__", 0);
/* "silx/image/shapes.pyx":60
@@ -1526,32 +1894,32 @@ static int __pyx_pf_4silx_5image_6shapes_7Polygon___init__(struct __pyx_obj_4sil
* self.nvert = self.vertices.shape[0]
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __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 = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
__Pyx_GIVEREF(__pyx_v_vertices);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 60, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__PYX_XDEC_MEMVIEW(&__pyx_v_self->vertices, 0);
__pyx_v_self->vertices = __pyx_t_6;
@@ -1565,7 +1933,7 @@ static int __pyx_pf_4silx_5image_6shapes_7Polygon___init__(struct __pyx_obj_4sil
*
* def is_inside(self, row, col):
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 61, __pyx_L1_error)}
__pyx_v_self->nvert = (__pyx_v_self->vertices.shape[0]);
/* "silx/image/shapes.pyx":59
@@ -1607,9 +1975,6 @@ static char __pyx_doc_4silx_5image_6shapes_7Polygon_2is_inside[] = "Polygon.is_i
static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_3is_inside(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_row = 0;
PyObject *__pyx_v_col = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_inside (wrapper)", 0);
@@ -1633,11 +1998,11 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_3is_inside(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("is_inside", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("is_inside", 1, 2, 2, 1); __PYX_ERR(0, 63, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_inside") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_inside") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -1650,7 +2015,7 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_3is_inside(PyObject *__p
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("is_inside", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("is_inside", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.Polygon.is_inside", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -1669,9 +2034,6 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_2is_inside(struct __pyx_
float __pyx_t_1;
float __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("is_inside", 0);
/* "silx/image/shapes.pyx":70
@@ -1682,9 +2044,9 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_2is_inside(struct __pyx_
* @cython.cdivision(True)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_row); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_col); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_4silx_5image_6shapes_Polygon *)__pyx_v_self->__pyx_vtab)->c_is_inside(__pyx_v_self, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_row); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error)
+ __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_col); if (unlikely((__pyx_t_2 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 70, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyBool_FromLong(((struct __pyx_vtabstruct_4silx_5image_6shapes_Polygon *)__pyx_v_self->__pyx_vtab)->c_is_inside(__pyx_v_self, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -1726,23 +2088,20 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
float __pyx_v_pt2y;
float __pyx_v_xinters;
int __pyx_r;
- long __pyx_t_1;
+ Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
- long __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
int __pyx_t_6;
- int __pyx_t_7;
+ Py_ssize_t __pyx_t_7;
Py_ssize_t __pyx_t_8;
- int __pyx_t_9;
+ Py_ssize_t __pyx_t_9;
Py_ssize_t __pyx_t_10;
int __pyx_t_11;
int __pyx_t_12;
float __pyx_t_13;
float __pyx_t_14;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
/* "silx/image/shapes.pyx":86
* cdef int index, is_inside
@@ -1760,7 +2119,7 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
* pt1y = self.vertices[self.nvert-1, 0]
* for index in range(self.nvert):
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 88, __pyx_L1_error)}
__pyx_t_1 = (__pyx_v_self->nvert - 1);
__pyx_t_2 = 1;
__pyx_v_pt1x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_1 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_2 * __pyx_v_self->vertices.strides[1]) )));
@@ -1772,7 +2131,7 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
* for index in range(self.nvert):
* pt2x = self.vertices[index, 1]
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 89, __pyx_L1_error)}
__pyx_t_3 = (__pyx_v_self->nvert - 1);
__pyx_t_4 = 0;
__pyx_v_pt1y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_3 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_4 * __pyx_v_self->vertices.strides[1]) )));
@@ -1795,7 +2154,7 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
* pt2y = self.vertices[index, 0]
*
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 91, __pyx_L1_error)}
__pyx_t_7 = __pyx_v_index;
__pyx_t_8 = 1;
__pyx_v_pt2x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_7 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_8 * __pyx_v_self->vertices.strides[1]) )));
@@ -1807,7 +2166,7 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
*
* if (((pt1y <= row and row < pt2y) or
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 92, __pyx_L1_error)}
__pyx_t_9 = __pyx_v_index;
__pyx_t_10 = 0;
__pyx_v_pt2y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_9 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_self->vertices.strides[1]) )));
@@ -1868,6 +2227,14 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
__pyx_t_12 = ((__pyx_v_col <= __pyx_v_pt2x) != 0);
__pyx_t_11 = __pyx_t_12;
__pyx_L6_bool_binop_done:;
+
+ /* "silx/image/shapes.pyx":94
+ * pt2y = self.vertices[index, 0]
+ *
+ * if (((pt1y <= row and row < pt2y) or # <<<<<<<<<<<<<<
+ * (pt2y <= row and row < pt1y)) and
+ * # Extra (optional) condition to avoid some computation
+ */
if (__pyx_t_11) {
/* "silx/image/shapes.pyx":98
@@ -1887,9 +2254,15 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
* return is_inside
*/
__pyx_v_is_inside = (__pyx_v_is_inside ^ (__pyx_v_col < __pyx_v_xinters));
- goto __pyx_L5;
+
+ /* "silx/image/shapes.pyx":94
+ * pt2y = self.vertices[index, 0]
+ *
+ * if (((pt1y <= row and row < pt2y) or # <<<<<<<<<<<<<<
+ * (pt2y <= row and row < pt1y)) and
+ * # Extra (optional) condition to avoid some computation
+ */
}
- __pyx_L5:;
/* "silx/image/shapes.pyx":100
* xinters = (row - pt1y) * (pt2x - pt1x) / (pt2y - pt1y) + pt1x
@@ -1924,7 +2297,7 @@ static int __pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside(struct __pyx_obj_4s
/* function exit code */
__pyx_L1_error:;
- __Pyx_WriteUnraisable("silx.image.shapes.Polygon.c_is_inside", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.image.shapes.Polygon.c_is_inside", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 1);
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
@@ -1944,9 +2317,6 @@ static char __pyx_doc_4silx_5image_6shapes_7Polygon_4make_mask[] = "Polygon.make
static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_5make_mask(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_height;
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("make_mask (wrapper)", 0);
@@ -1970,11 +2340,11 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_5make_mask(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("make_mask", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("make_mask", 1, 2, 2, 1); __PYX_ERR(0, 106, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_mask") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "make_mask") < 0)) __PYX_ERR(0, 106, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -1982,12 +2352,12 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_7Polygon_5make_mask(PyObject *__p
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
}
- __pyx_v_height = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_height == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_height = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_height == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error)
+ __pyx_v_width = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("make_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("make_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 106, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.Polygon.make_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -2026,32 +2396,28 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_
__Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
long __pyx_t_7;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_9;
int __pyx_t_10;
int __pyx_t_11;
- __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_13;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
Py_ssize_t __pyx_t_14;
- long __pyx_t_15;
- Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_15;
+ int __pyx_t_16;
int __pyx_t_17;
- int __pyx_t_18;
- int __pyx_t_19;
+ Py_ssize_t __pyx_t_18;
+ Py_ssize_t __pyx_t_19;
Py_ssize_t __pyx_t_20;
- int __pyx_t_21;
- Py_ssize_t __pyx_t_22;
- int __pyx_t_23;
- int __pyx_t_24;
- int __pyx_t_25;
+ Py_ssize_t __pyx_t_21;
+ int __pyx_t_22;
+ Py_ssize_t __pyx_t_23;
+ Py_ssize_t __pyx_t_24;
+ float __pyx_t_25;
float __pyx_t_26;
- float __pyx_t_27;
- long __pyx_t_28;
- int __pyx_t_29;
- int __pyx_t_30;
- int __pyx_t_31;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_27;
+ Py_ssize_t __pyx_t_28;
+ Py_ssize_t __pyx_t_29;
+ Py_ssize_t __pyx_t_30;
__Pyx_RefNannySetupContext("make_mask", 0);
/* "silx/image/shapes.pyx":113
@@ -2061,30 +2427,28 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_
* dtype=numpy.uint8)
* cdef int row_min, row_max, col_min, col_max # mask subpart to update
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __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 = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_height); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
/* "silx/image/shapes.pyx":114
* """
@@ -2093,12 +2457,14 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_
* cdef int row_min, row_max, col_min, col_max # mask subpart to update
* cdef int row, col, index # Loop indixes
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "silx/image/shapes.pyx":113
@@ -2108,13 +2474,13 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_
* dtype=numpy.uint8)
* cdef int row_min, row_max, col_min, col_max # mask subpart to update
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __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_4); __pyx_t_4 = 0;
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_mask = __pyx_t_6;
__pyx_t_6.memview = NULL;
@@ -2128,53 +2494,51 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_7Polygon_4make_mask(struct __pyx_
*
*/
__pyx_t_7 = 0;
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
- __pyx_t_8 = __pyx_v_self->vertices;
- __PYX_INC_MEMVIEW(&__pyx_t_8, 1);
- __pyx_t_10 = -1;
- __pyx_t_9.data = __pyx_t_8.data;
- __pyx_t_9.memview = __pyx_t_8.memview;
- __PYX_INC_MEMVIEW(&__pyx_t_9, 0);
- __pyx_t_9.shape[0] = __pyx_t_8.shape[0];
-__pyx_t_9.strides[0] = __pyx_t_8.strides[0];
- __pyx_t_9.suboffsets[0] = -1;
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 120, __pyx_L1_error)}
+ __pyx_t_8.data = __pyx_v_self->vertices.data;
+ __pyx_t_8.memview = __pyx_v_self->vertices.memview;
+ __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
+ __pyx_t_8.shape[0] = __pyx_v_self->vertices.shape[0];
+__pyx_t_8.strides[0] = __pyx_v_self->vertices.strides[0];
+ __pyx_t_8.suboffsets[0] = -1;
{
Py_ssize_t __pyx_tmp_idx = 0;
- Py_ssize_t __pyx_tmp_shape = __pyx_t_8.shape[1];
- Py_ssize_t __pyx_tmp_stride = __pyx_t_8.strides[1];
+ Py_ssize_t __pyx_tmp_shape = __pyx_v_self->vertices.shape[1];
+ Py_ssize_t __pyx_tmp_stride = __pyx_v_self->vertices.strides[1];
if (0 && (__pyx_tmp_idx < 0))
__pyx_tmp_idx += __pyx_tmp_shape;
if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 120, __pyx_L1_error)
}
- __pyx_t_9.data += __pyx_tmp_idx * __pyx_tmp_stride;
+ __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
}
-__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_9, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_11) {
- __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
+ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = __pyx_t_2;
__pyx_t_2 = 0;
@@ -2183,7 +2547,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
__pyx_t_5 = __pyx_t_4;
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_row_min = __pyx_t_10;
@@ -2195,56 +2559,54 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Can be replaced by prange(row_min, row_max, nogil=True)
*/
__pyx_t_10 = __pyx_v_height;
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}
- __pyx_t_8 = __pyx_v_self->vertices;
- __PYX_INC_MEMVIEW(&__pyx_t_8, 1);
- __pyx_t_13 = -1;
- __pyx_t_12.data = __pyx_t_8.data;
- __pyx_t_12.memview = __pyx_t_8.memview;
- __PYX_INC_MEMVIEW(&__pyx_t_12, 0);
- __pyx_t_12.shape[0] = __pyx_t_8.shape[0];
-__pyx_t_12.strides[0] = __pyx_t_8.strides[0];
- __pyx_t_12.suboffsets[0] = -1;
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 121, __pyx_L1_error)}
+ __pyx_t_8.data = __pyx_v_self->vertices.data;
+ __pyx_t_8.memview = __pyx_v_self->vertices.memview;
+ __PYX_INC_MEMVIEW(&__pyx_t_8, 0);
+ __pyx_t_8.shape[0] = __pyx_v_self->vertices.shape[0];
+__pyx_t_8.strides[0] = __pyx_v_self->vertices.strides[0];
+ __pyx_t_8.suboffsets[0] = -1;
{
Py_ssize_t __pyx_tmp_idx = 0;
- Py_ssize_t __pyx_tmp_shape = __pyx_t_8.shape[1];
- Py_ssize_t __pyx_tmp_stride = __pyx_t_8.strides[1];
+ Py_ssize_t __pyx_tmp_shape = __pyx_v_self->vertices.shape[1];
+ Py_ssize_t __pyx_tmp_stride = __pyx_v_self->vertices.strides[1];
if (0 && (__pyx_tmp_idx < 0))
__pyx_tmp_idx += __pyx_tmp_shape;
if (0 && (__pyx_tmp_idx < 0 || __pyx_tmp_idx >= __pyx_tmp_shape)) {
PyErr_SetString(PyExc_IndexError, "Index out of bounds (axis 1)");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 121, __pyx_L1_error)
}
- __pyx_t_12.data += __pyx_tmp_idx * __pyx_tmp_stride;
+ __pyx_t_8.data += __pyx_tmp_idx * __pyx_tmp_stride;
}
-__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_12, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+__pyx_t_5 = __pyx_memoryview_fromslice(__pyx_t_8, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_11) {
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_9) {
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_t_3;
__pyx_t_3 = 0;
@@ -2253,7 +2615,7 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
__pyx_t_4 = __pyx_t_5;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_row_max = __pyx_t_10;
@@ -2279,8 +2641,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # in the line and then run a xor scan to fill inner parts
*/
__pyx_t_10 = __pyx_v_row_max;
- for (__pyx_t_13 = __pyx_v_row_min; __pyx_t_13 < __pyx_t_10; __pyx_t_13+=1) {
- __pyx_v_row = __pyx_t_13;
+ for (__pyx_t_11 = __pyx_v_row_min; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
+ __pyx_v_row = __pyx_t_11;
/* "silx/image/shapes.pyx":129
* # in the line and then run a xor scan to fill inner parts
@@ -2289,10 +2651,10 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* pt1y = self.vertices[self.nvert-1, 0]
* col_min = width - 1
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L4_error;}}
- __pyx_t_7 = (__pyx_v_self->nvert - 1);
- __pyx_t_14 = 1;
- __pyx_v_pt1x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_7 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_14 * __pyx_v_self->vertices.strides[1]) )));
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 129, __pyx_L4_error)}
+ __pyx_t_12 = (__pyx_v_self->nvert - 1);
+ __pyx_t_13 = 1;
+ __pyx_v_pt1x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_12 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_13 * __pyx_v_self->vertices.strides[1]) )));
/* "silx/image/shapes.pyx":130
* # Adapted from http://alienryderflex.com/polygon_fill/
@@ -2301,10 +2663,10 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_min = width - 1
* col_max = 0
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L4_error;}}
- __pyx_t_15 = (__pyx_v_self->nvert - 1);
- __pyx_t_16 = 0;
- __pyx_v_pt1y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_15 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_16 * __pyx_v_self->vertices.strides[1]) )));
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 130, __pyx_L4_error)}
+ __pyx_t_14 = (__pyx_v_self->nvert - 1);
+ __pyx_t_15 = 0;
+ __pyx_v_pt1y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_14 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_15 * __pyx_v_self->vertices.strides[1]) )));
/* "silx/image/shapes.pyx":131
* pt1x = self.vertices[self.nvert-1, 1]
@@ -2340,9 +2702,9 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* pt2x = self.vertices[index, 1]
* pt2y = self.vertices[index, 0]
*/
- __pyx_t_17 = __pyx_v_self->nvert;
- for (__pyx_t_18 = 0; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
- __pyx_v_index = __pyx_t_18;
+ __pyx_t_16 = __pyx_v_self->nvert;
+ for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
+ __pyx_v_index = __pyx_t_17;
/* "silx/image/shapes.pyx":136
*
@@ -2351,10 +2713,10 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* pt2y = self.vertices[index, 0]
*
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L4_error;}}
- __pyx_t_19 = __pyx_v_index;
- __pyx_t_20 = 1;
- __pyx_v_pt2x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_19 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_20 * __pyx_v_self->vertices.strides[1]) )));
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 136, __pyx_L4_error)}
+ __pyx_t_18 = __pyx_v_index;
+ __pyx_t_19 = 1;
+ __pyx_v_pt2x = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_18 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_19 * __pyx_v_self->vertices.strides[1]) )));
/* "silx/image/shapes.pyx":137
* for index in range(self.nvert):
@@ -2363,10 +2725,10 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
*
* if ((pt1y <= row and row < pt2y) or
*/
- if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");{__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L4_error;}}
- __pyx_t_21 = __pyx_v_index;
- __pyx_t_22 = 0;
- __pyx_v_pt2y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_21 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_22 * __pyx_v_self->vertices.strides[1]) )));
+ if (unlikely(!__pyx_v_self->vertices.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 137, __pyx_L4_error)}
+ __pyx_t_20 = __pyx_v_index;
+ __pyx_t_21 = 0;
+ __pyx_v_pt2y = (*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->vertices.data + __pyx_t_20 * __pyx_v_self->vertices.strides[0]) ) + __pyx_t_21 * __pyx_v_self->vertices.strides[1]) )));
/* "silx/image/shapes.pyx":139
* pt2y = self.vertices[index, 0]
@@ -2375,15 +2737,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* (pt2y <= row and row < pt1y)):
* # Intersection casted to int so that ]x, x+1] => x
*/
- __pyx_t_23 = ((__pyx_v_pt1y <= __pyx_v_row) != 0);
- if (!__pyx_t_23) {
+ __pyx_t_22 = ((__pyx_v_pt1y <= __pyx_v_row) != 0);
+ if (!__pyx_t_22) {
goto __pyx_L12_next_or;
} else {
}
- __pyx_t_23 = ((__pyx_v_row < __pyx_v_pt2y) != 0);
- if (!__pyx_t_23) {
+ __pyx_t_22 = ((__pyx_v_row < __pyx_v_pt2y) != 0);
+ if (!__pyx_t_22) {
} else {
- __pyx_t_11 = __pyx_t_23;
+ __pyx_t_9 = __pyx_t_22;
goto __pyx_L11_bool_binop_done;
}
__pyx_L12_next_or:;
@@ -2395,16 +2757,24 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Intersection casted to int so that ]x, x+1] => x
* xinters = (<int>ceil(pt1x + (row - pt1y) *
*/
- __pyx_t_23 = ((__pyx_v_pt2y <= __pyx_v_row) != 0);
- if (__pyx_t_23) {
+ __pyx_t_22 = ((__pyx_v_pt2y <= __pyx_v_row) != 0);
+ if (__pyx_t_22) {
} else {
- __pyx_t_11 = __pyx_t_23;
+ __pyx_t_9 = __pyx_t_22;
goto __pyx_L11_bool_binop_done;
}
- __pyx_t_23 = ((__pyx_v_row < __pyx_v_pt1y) != 0);
- __pyx_t_11 = __pyx_t_23;
+ __pyx_t_22 = ((__pyx_v_row < __pyx_v_pt1y) != 0);
+ __pyx_t_9 = __pyx_t_22;
__pyx_L11_bool_binop_done:;
- if (__pyx_t_11) {
+
+ /* "silx/image/shapes.pyx":139
+ * pt2y = self.vertices[index, 0]
+ *
+ * if ((pt1y <= row and row < pt2y) or # <<<<<<<<<<<<<<
+ * (pt2y <= row and row < pt1y)):
+ * # Intersection casted to int so that ]x, x+1] => x
+ */
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":143
* # Intersection casted to int so that ]x, x+1] => x
@@ -2422,8 +2792,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_min = xinters
* if xinters > col_max:
*/
- __pyx_t_11 = ((__pyx_v_xinters < __pyx_v_col_min) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_xinters < __pyx_v_col_min) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":147
* # Update column range to patch
@@ -2433,9 +2803,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_max = xinters
*/
__pyx_v_col_min = __pyx_v_xinters;
- goto __pyx_L15;
+
+ /* "silx/image/shapes.pyx":146
+ *
+ * # Update column range to patch
+ * if xinters < col_min: # <<<<<<<<<<<<<<
+ * col_min = xinters
+ * if xinters > col_max:
+ */
}
- __pyx_L15:;
/* "silx/image/shapes.pyx":148
* if xinters < col_min:
@@ -2444,8 +2820,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_max = xinters
*
*/
- __pyx_t_11 = ((__pyx_v_xinters > __pyx_v_col_max) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_xinters > __pyx_v_col_max) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":149
* col_min = xinters
@@ -2455,9 +2831,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* if xinters < 0:
*/
__pyx_v_col_max = __pyx_v_xinters;
- goto __pyx_L16;
+
+ /* "silx/image/shapes.pyx":148
+ * if xinters < col_min:
+ * col_min = xinters
+ * if xinters > col_max: # <<<<<<<<<<<<<<
+ * col_max = xinters
+ *
+ */
}
- __pyx_L16:;
/* "silx/image/shapes.pyx":151
* col_max = xinters
@@ -2466,8 +2848,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Add an intersection to init value of xor scan
* is_inside ^= 1
*/
- __pyx_t_11 = ((__pyx_v_xinters < 0) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_xinters < 0) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":153
* if xinters < 0:
@@ -2477,6 +2859,14 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Mark intersection in mask
*/
__pyx_v_is_inside = (__pyx_v_is_inside ^ 1);
+
+ /* "silx/image/shapes.pyx":151
+ * col_max = xinters
+ *
+ * if xinters < 0: # <<<<<<<<<<<<<<
+ * # Add an intersection to init value of xor scan
+ * is_inside ^= 1
+ */
goto __pyx_L17;
}
@@ -2487,8 +2877,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Mark intersection in mask
* mask[row, xinters] ^= 1
*/
- __pyx_t_11 = ((__pyx_v_xinters < __pyx_v_width) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_xinters < __pyx_v_width) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":156
* elif xinters < width:
@@ -2497,15 +2887,28 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # else: do not consider intersection on the right
*
*/
- __pyx_t_24 = __pyx_v_row;
- __pyx_t_25 = __pyx_v_xinters;
- *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_24 * __pyx_v_mask.strides[0]) ) + __pyx_t_25 * __pyx_v_mask.strides[1]) )) ^= 1;
- goto __pyx_L17;
+ __pyx_t_23 = __pyx_v_row;
+ __pyx_t_24 = __pyx_v_xinters;
+ *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_23 * __pyx_v_mask.strides[0]) ) + __pyx_t_24 * __pyx_v_mask.strides[1]) )) ^= 1;
+
+ /* "silx/image/shapes.pyx":154
+ * # Add an intersection to init value of xor scan
+ * is_inside ^= 1
+ * elif xinters < width: # <<<<<<<<<<<<<<
+ * # Mark intersection in mask
+ * mask[row, xinters] ^= 1
+ */
}
__pyx_L17:;
- goto __pyx_L10;
+
+ /* "silx/image/shapes.pyx":139
+ * pt2y = self.vertices[index, 0]
+ *
+ * if ((pt1y <= row and row < pt2y) or # <<<<<<<<<<<<<<
+ * (pt2y <= row and row < pt1y)):
+ * # Intersection casted to int so that ]x, x+1] => x
+ */
}
- __pyx_L10:;
/* "silx/image/shapes.pyx":159
* # else: do not consider intersection on the right
@@ -2514,10 +2917,10 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
*
* if col_min < col_max:
*/
- __pyx_t_26 = __pyx_v_pt2x;
- __pyx_t_27 = __pyx_v_pt2y;
- __pyx_v_pt1x = __pyx_t_26;
- __pyx_v_pt1y = __pyx_t_27;
+ __pyx_t_25 = __pyx_v_pt2x;
+ __pyx_t_26 = __pyx_v_pt2y;
+ __pyx_v_pt1x = __pyx_t_25;
+ __pyx_v_pt1y = __pyx_t_26;
}
/* "silx/image/shapes.pyx":161
@@ -2527,8 +2930,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # Clip column range to mask
* if col_min < 0:
*/
- __pyx_t_11 = ((__pyx_v_col_min < __pyx_v_col_max) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_col_min < __pyx_v_col_max) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":163
* if col_min < col_max:
@@ -2537,8 +2940,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_min = 0
* if col_max > width - 1:
*/
- __pyx_t_11 = ((__pyx_v_col_min < 0) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_col_min < 0) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":164
* # Clip column range to mask
@@ -2548,9 +2951,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_max = width - 1
*/
__pyx_v_col_min = 0;
- goto __pyx_L19;
+
+ /* "silx/image/shapes.pyx":163
+ * if col_min < col_max:
+ * # Clip column range to mask
+ * if col_min < 0: # <<<<<<<<<<<<<<
+ * col_min = 0
+ * if col_max > width - 1:
+ */
}
- __pyx_L19:;
/* "silx/image/shapes.pyx":165
* if col_min < 0:
@@ -2559,8 +2968,8 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* col_max = width - 1
*
*/
- __pyx_t_11 = ((__pyx_v_col_max > (__pyx_v_width - 1)) != 0);
- if (__pyx_t_11) {
+ __pyx_t_9 = ((__pyx_v_col_max > (__pyx_v_width - 1)) != 0);
+ if (__pyx_t_9) {
/* "silx/image/shapes.pyx":166
* col_min = 0
@@ -2570,9 +2979,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* # xor exclusive scan
*/
__pyx_v_col_max = (__pyx_v_width - 1);
- goto __pyx_L20;
+
+ /* "silx/image/shapes.pyx":165
+ * if col_min < 0:
+ * col_min = 0
+ * if col_max > width - 1: # <<<<<<<<<<<<<<
+ * col_max = width - 1
+ *
+ */
}
- __pyx_L20:;
/* "silx/image/shapes.pyx":169
*
@@ -2581,9 +2996,9 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* current = mask[row, col]
* mask[row, col] = is_inside
*/
- __pyx_t_28 = (__pyx_v_col_max + 1);
- for (__pyx_t_17 = __pyx_v_col_min; __pyx_t_17 < __pyx_t_28; __pyx_t_17+=1) {
- __pyx_v_col = __pyx_t_17;
+ __pyx_t_7 = (__pyx_v_col_max + 1);
+ for (__pyx_t_16 = __pyx_v_col_min; __pyx_t_16 < __pyx_t_7; __pyx_t_16+=1) {
+ __pyx_v_col = __pyx_t_16;
/* "silx/image/shapes.pyx":170
* # xor exclusive scan
@@ -2592,9 +3007,9 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* mask[row, col] = is_inside
* is_inside = current ^ is_inside
*/
- __pyx_t_18 = __pyx_v_row;
- __pyx_t_29 = __pyx_v_col;
- __pyx_v_current = (*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_18 * __pyx_v_mask.strides[0]) ) + __pyx_t_29 * __pyx_v_mask.strides[1]) )));
+ __pyx_t_27 = __pyx_v_row;
+ __pyx_t_28 = __pyx_v_col;
+ __pyx_v_current = (*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_27 * __pyx_v_mask.strides[0]) ) + __pyx_t_28 * __pyx_v_mask.strides[1]) )));
/* "silx/image/shapes.pyx":171
* for col in range(col_min, col_max + 1):
@@ -2603,9 +3018,9 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
* is_inside = current ^ is_inside
*
*/
- __pyx_t_30 = __pyx_v_row;
- __pyx_t_31 = __pyx_v_col;
- *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_30 * __pyx_v_mask.strides[0]) ) + __pyx_t_31 * __pyx_v_mask.strides[1]) )) = __pyx_v_is_inside;
+ __pyx_t_29 = __pyx_v_row;
+ __pyx_t_30 = __pyx_v_col;
+ *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_mask.data + __pyx_t_29 * __pyx_v_mask.strides[0]) ) + __pyx_t_30 * __pyx_v_mask.strides[1]) )) = __pyx_v_is_inside;
/* "silx/image/shapes.pyx":172
* current = mask[row, col]
@@ -2616,9 +3031,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
*/
__pyx_v_is_inside = (__pyx_v_current ^ __pyx_v_is_inside);
}
- goto __pyx_L18;
+
+ /* "silx/image/shapes.pyx":161
+ * pt1x, pt1y = pt2x, pt2y
+ *
+ * if col_min < col_max: # <<<<<<<<<<<<<<
+ * # Clip column range to mask
+ * if col_min < 0:
+ */
}
- __pyx_L18:;
}
}
@@ -2654,15 +3075,15 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_asarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_mask, 2, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_mask, 2, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -2672,19 +3093,39 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
}
}
if (!__pyx_t_2) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- 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+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_4;
@@ -2708,8 +3149,6 @@ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
__Pyx_XDECREF(__pyx_t_5);
__PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
__Pyx_AddTraceback("silx.image.shapes.Polygon.make_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -2734,9 +3173,6 @@ static PyMethodDef __pyx_mdef_4silx_5image_6shapes_1polygon_fill_mask = {"polygo
static PyObject *__pyx_pw_4silx_5image_6shapes_1polygon_fill_mask(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_vertices = 0;
PyObject *__pyx_v_shape = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("polygon_fill_mask (wrapper)", 0);
@@ -2760,11 +3196,11 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_1polygon_fill_mask(PyObject *__py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("polygon_fill_mask", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("polygon_fill_mask", 1, 2, 2, 1); __PYX_ERR(0, 178, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon_fill_mask") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polygon_fill_mask") < 0)) __PYX_ERR(0, 178, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2777,7 +3213,7 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_1polygon_fill_mask(PyObject *__py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("polygon_fill_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("polygon_fill_mask", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 178, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.polygon_fill_mask", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -2798,11 +3234,8 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_polygon_fill_mask(CYTHON_UNUSED P
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- Py_ssize_t __pyx_t_6;
+ int __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("polygon_fill_mask", 0);
/* "silx/image/shapes.pyx":188
@@ -2813,24 +3246,24 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_polygon_fill_mask(CYTHON_UNUSED P
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vertices);
__Pyx_GIVEREF(__pyx_v_vertices);
- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4silx_5image_6shapes_Polygon)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_vertices);
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4silx_5image_6shapes_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_mask); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_make_mask); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
__pyx_t_6 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2840,20 +3273,42 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_polygon_fill_mask(CYTHON_UNUSED P
__pyx_t_6 = 1;
}
}
- __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_3, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2901,9 +3356,6 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_3draw_line(PyObject *__pyx_self,
int __pyx_v_row1;
int __pyx_v_col1;
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("draw_line (wrapper)", 0);
@@ -2930,17 +3382,17 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_3draw_line(PyObject *__pyx_self,
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col0)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 1); __PYX_ERR(0, 193, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row1)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 2); __PYX_ERR(0, 193, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_col1)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, 3); __PYX_ERR(0, 193, __pyx_L3_error)
}
case 4:
if (kw_args > 0) {
@@ -2949,7 +3401,7 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_3draw_line(PyObject *__pyx_self,
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_line") < 0)) __PYX_ERR(0, 193, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -2962,19 +3414,19 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_3draw_line(PyObject *__pyx_self,
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_row0 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_row0 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_col0 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_col0 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_row1 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_row1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_col1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_col1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_row0 = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_row0 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
+ __pyx_v_col0 = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_col0 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
+ __pyx_v_row1 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_row1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
+ __pyx_v_col1 = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_col1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
if (values[4]) {
- __pyx_v_width = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_width = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_width == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
} else {
__pyx_v_width = ((int)1);
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("draw_line", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 193, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -3015,17 +3467,13 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
__Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
- long __pyx_t_13;
+ long __pyx_t_12;
+ int __pyx_t_13;
int __pyx_t_14;
- int __pyx_t_15;
- int __pyx_t_16;
- int __pyx_t_17;
- int __pyx_t_18;
- int __pyx_t_19;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_17;
+ Py_ssize_t __pyx_t_18;
__Pyx_RefNannySetupContext("draw_line", 0);
/* "silx/image/shapes.pyx":220
@@ -3083,33 +3531,33 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
*/
__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 = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_row0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_row0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __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 = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __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, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -3122,33 +3570,33 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
* if width < 1:
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_col0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_col0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -3161,17 +3609,25 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* numpy.array((col0,), dtype=numpy.int32))
*
*/
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
__pyx_t_8 = 0;
__pyx_t_9 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
+
+ /* "silx/image/shapes.pyx":224
+ * invert_coords = dcol < drow
+ *
+ * if dcol == 0 and drow == 0: # <<<<<<<<<<<<<<
+ * return (numpy.array((row0,), dtype=numpy.int32),
+ * numpy.array((col0,), dtype=numpy.int32))
+ */
}
/* "silx/image/shapes.pyx":228
@@ -3192,9 +3648,15 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* # Set a and b according to segment octant
*/
__pyx_v_width = 1;
- goto __pyx_L6;
+
+ /* "silx/image/shapes.pyx":228
+ * numpy.array((col0,), dtype=numpy.int32))
+ *
+ * if width < 1: # <<<<<<<<<<<<<<
+ * width = 1
+ *
+ */
}
- __pyx_L6:;
/* "silx/image/shapes.pyx":232
*
@@ -3269,17 +3731,25 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* else:
*/
__pyx_v_b = __pyx_v_row0;
+
+ /* "silx/image/shapes.pyx":232
+ *
+ * # Set a and b according to segment octant
+ * if not invert_coords: # <<<<<<<<<<<<<<
+ * da = dcol
+ * db = drow
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "silx/image/shapes.pyx":241
+ /* "silx/image/shapes.pyx":241
*
* else:
* da = drow # <<<<<<<<<<<<<<
* db = dcol
* step_a = 1 if row1 > row0 else -1
*/
+ /*else*/ {
__pyx_v_da = __pyx_v_drow;
/* "silx/image/shapes.pyx":242
@@ -3346,44 +3816,44 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* a_coords = numpy.empty((da + 1, width), dtype=numpy.int32)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_da + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_da + 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8);
__pyx_t_5 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_4);
- if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_b_coords = __pyx_t_11;
__pyx_t_11.memview = NULL;
@@ -3396,48 +3866,48 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
* with nogil:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_da + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_da + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_width); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
__pyx_t_4 = 0;
__pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __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 = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_5);
- if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_5);
+ if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_a_coords = __pyx_t_12;
- __pyx_t_12.memview = NULL;
- __pyx_t_12.data = NULL;
+ __pyx_v_a_coords = __pyx_t_11;
+ __pyx_t_11.memview = NULL;
+ __pyx_t_11.data = NULL;
/* "silx/image/shapes.pyx":251
* a_coords = numpy.empty((da + 1, width), dtype=numpy.int32)
@@ -3478,8 +3948,8 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* for offset in range(width):
* b_coords[index, offset] = b + offset
*/
- __pyx_t_13 = (__pyx_v_da + 1);
- for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_13; __pyx_t_10+=1) {
+ __pyx_t_12 = (__pyx_v_da + 1);
+ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_12; __pyx_t_10+=1) {
__pyx_v_index = __pyx_t_10;
/* "silx/image/shapes.pyx":255
@@ -3489,9 +3959,9 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* b_coords[index, offset] = b + offset
* a_coords[index, offset] = a
*/
- __pyx_t_14 = __pyx_v_width;
- for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
- __pyx_v_offset = __pyx_t_15;
+ __pyx_t_13 = __pyx_v_width;
+ for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
+ __pyx_v_offset = __pyx_t_14;
/* "silx/image/shapes.pyx":256
* for index in range(da + 1):
@@ -3500,9 +3970,9 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* a_coords[index, offset] = a
*
*/
- __pyx_t_16 = __pyx_v_index;
- __pyx_t_17 = __pyx_v_offset;
- *((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_b_coords.data + __pyx_t_16 * __pyx_v_b_coords.strides[0]) ) + __pyx_t_17 * __pyx_v_b_coords.strides[1]) )) = (__pyx_v_b + __pyx_v_offset);
+ __pyx_t_15 = __pyx_v_index;
+ __pyx_t_16 = __pyx_v_offset;
+ *((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_b_coords.data + __pyx_t_15 * __pyx_v_b_coords.strides[0]) ) + __pyx_t_16 * __pyx_v_b_coords.strides[1]) )) = (__pyx_v_b + __pyx_v_offset);
/* "silx/image/shapes.pyx":257
* for offset in range(width):
@@ -3511,9 +3981,9 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
* if delta >= 0: # M2: Move by step_a + step_b
*/
- __pyx_t_18 = __pyx_v_index;
- __pyx_t_19 = __pyx_v_offset;
- *((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_a_coords.data + __pyx_t_18 * __pyx_v_a_coords.strides[0]) ) + __pyx_t_19 * __pyx_v_a_coords.strides[1]) )) = __pyx_v_a;
+ __pyx_t_17 = __pyx_v_index;
+ __pyx_t_18 = __pyx_v_offset;
+ *((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_a_coords.data + __pyx_t_17 * __pyx_v_a_coords.strides[0]) ) + __pyx_t_18 * __pyx_v_a_coords.strides[1]) )) = __pyx_v_a;
}
/* "silx/image/shapes.pyx":259
@@ -3543,9 +4013,15 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
*/
__pyx_v_delta = (__pyx_v_delta - (2 * __pyx_v_da));
- goto __pyx_L15;
+
+ /* "silx/image/shapes.pyx":259
+ * a_coords[index, offset] = a
+ *
+ * if delta >= 0: # M2: Move by step_a + step_b # <<<<<<<<<<<<<<
+ * b += step_b
+ * delta -= 2 * da
+ */
}
- __pyx_L15:;
/* "silx/image/shapes.pyx":264
* # else M1: Move by step_a
@@ -3603,15 +4079,15 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* else:
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_b_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __pyx_memoryview_fromslice(__pyx_v_b_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
@@ -3621,25 +4097,45 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
}
}
if (!__pyx_t_6) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_9};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -3650,15 +4146,15 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* else:
* return (numpy.asarray(a_coords).reshape(-1),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_a_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_a_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
@@ -3668,25 +4164,45 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
}
}
if (!__pyx_t_6) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
@@ -3697,37 +4213,45 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* numpy.asarray(a_coords).reshape(-1))
* else:
*/
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
__pyx_t_5 = 0;
__pyx_t_8 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
+
+ /* "silx/image/shapes.pyx":267
+ * delta += 2 * db
+ *
+ * if not invert_coords: # <<<<<<<<<<<<<<
+ * return (numpy.asarray(b_coords).reshape(-1),
+ * numpy.asarray(a_coords).reshape(-1))
+ */
}
- /*else*/ {
- /* "silx/image/shapes.pyx":271
+ /* "silx/image/shapes.pyx":271
* numpy.asarray(a_coords).reshape(-1))
* else:
* return (numpy.asarray(a_coords).reshape(-1), # <<<<<<<<<<<<<<
* numpy.asarray(b_coords).reshape(-1))
*
*/
+ /*else*/ {
__Pyx_XDECREF(__pyx_r);
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_a_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_a_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -3737,25 +4261,45 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
}
}
if (!__pyx_t_7) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __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_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_8};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -3766,15 +4310,15 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
*
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_b_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_b_coords, 2, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
@@ -3784,25 +4328,45 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
}
}
if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __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;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -3813,12 +4377,12 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
* numpy.asarray(b_coords).reshape(-1))
*
*/
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
__pyx_t_9 = 0;
__pyx_t_5 = 0;
__pyx_r = __pyx_t_8;
@@ -3843,7 +4407,6 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_2draw_line(CYTHON_UNUSED PyObject
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
__Pyx_AddTraceback("silx.image.shapes.draw_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -3870,9 +4433,6 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_5circle_fill(PyObject *__pyx_self
int __pyx_v_crow;
int __pyx_v_ccol;
float __pyx_v_radius;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("circle_fill (wrapper)", 0);
@@ -3897,16 +4457,16 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_5circle_fill(PyObject *__pyx_self
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ccol)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, 1); __PYX_ERR(0, 275, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, 2); __PYX_ERR(0, 275, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle_fill") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "circle_fill") < 0)) __PYX_ERR(0, 275, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -3915,13 +4475,13 @@ static PyObject *__pyx_pw_4silx_5image_6shapes_5circle_fill(PyObject *__pyx_self
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
}
- __pyx_v_crow = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_crow == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_ccol = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ccol == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_radius = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_radius == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_crow = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_crow == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
+ __pyx_v_ccol = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_ccol == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
+ __pyx_v_radius = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_radius == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("circle_fill", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 275, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.image.shapes.circle_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -3949,12 +4509,10 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
- PyObject *(*__pyx_t_10)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *(*__pyx_t_11)(PyObject *);
__Pyx_RefNannySetupContext("circle_fill", 0);
/* "silx/image/shapes.pyx":286
@@ -3982,25 +4540,23 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* dtype=numpy.float32) ** 2
* len_coords = len(coords)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_arange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_From_int((-__pyx_v_i_radius)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int((-__pyx_v_i_radius)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyFloat_FromDouble((ceil(__pyx_v_radius) + 1.0)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((ceil(__pyx_v_radius) + 1.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_3 = 0;
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
/* "silx/image/shapes.pyx":290
*
@@ -4009,12 +4565,14 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* len_coords = len(coords)
* # rows, cols = where(row**2 + col**2 < radius**2)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "silx/image/shapes.pyx":289
@@ -4024,7 +4582,7 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* dtype=numpy.float32) ** 2
* len_coords = len(coords)
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -4037,7 +4595,7 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* len_coords = len(coords)
* # rows, cols = where(row**2 + col**2 < radius**2)
*/
- __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_coords = __pyx_t_3;
@@ -4050,7 +4608,7 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* # rows, cols = where(row**2 + col**2 < radius**2)
* rows, cols = numpy.where(coords.reshape(1, len_coords) +
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_coords); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 291, __pyx_L1_error)
__pyx_v_len_coords = __pyx_t_6;
/* "silx/image/shapes.pyx":293
@@ -4060,41 +4618,61 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* coords.reshape(len_coords, 1) < radius ** 2)
* return rows + crow - i_radius, cols + ccol - i_radius
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_coords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_6 = 1;
+ __pyx_t_8 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_7) {
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_int_1, __pyx_t_1};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_int_1, __pyx_t_1};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_INCREF(__pyx_int_1);
+ __Pyx_GIVEREF(__pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_int_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_6, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_6, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "silx/image/shapes.pyx":294
@@ -4103,37 +4681,57 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* coords.reshape(len_coords, 1) < radius ** 2) # <<<<<<<<<<<<<<
* return rows + crow - i_radius, cols + ccol - i_radius
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_coords); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_coords, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_len_coords); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = NULL;
- __pyx_t_6 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- __pyx_t_6 = 1;
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_int_1};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_int_1};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_t_1);
+ __Pyx_INCREF(__pyx_int_1);
+ __Pyx_GIVEREF(__pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_int_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_6, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_6, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_1 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
/* "silx/image/shapes.pyx":293
* len_coords = len(coords)
@@ -4142,8 +4740,8 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* coords.reshape(len_coords, 1) < radius ** 2)
* return rows + crow - i_radius, cols + ccol - i_radius
*/
- __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -4153,13 +4751,13 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* coords.reshape(len_coords, 1) < radius ** 2) # <<<<<<<<<<<<<<
* return rows + crow - i_radius, cols + ccol - i_radius
*/
- __pyx_t_2 = PyFloat_FromDouble(powf(__pyx_v_radius, 2.0)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble(powf(__pyx_v_radius, 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -4169,24 +4767,44 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
}
}
if (!__pyx_t_2) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -4194,44 +4812,44 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 293, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_9);
#else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
+ __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext;
+ index = 0; __pyx_t_4 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
__Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_5); if (unlikely(!__pyx_t_8)) goto __pyx_L3_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = NULL;
+ index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_5); if (unlikely(!__pyx_t_9)) goto __pyx_L3_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_5), 2) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
+ __pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
goto __pyx_L4_unpacking_done;
__pyx_L3_unpacking_failed:;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = NULL;
+ __pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 293, __pyx_L1_error)
__pyx_L4_unpacking_done:;
}
@@ -4244,8 +4862,8 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
*/
__pyx_v_rows = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_v_cols = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_cols = __pyx_t_9;
+ __pyx_t_9 = 0;
/* "silx/image/shapes.pyx":295
* rows, cols = numpy.where(coords.reshape(1, len_coords) +
@@ -4253,34 +4871,34 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
* return rows + crow - i_radius, cols + ccol - i_radius # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_crow); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_crow); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyNumber_Add(__pyx_v_rows, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyNumber_Add(__pyx_v_rows, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ccol); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ccol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyNumber_Add(__pyx_v_cols, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyNumber_Add(__pyx_v_cols, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i_radius); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
__pyx_t_4 = 0;
__pyx_t_5 = 0;
__pyx_r = __pyx_t_3;
@@ -4303,8 +4921,8 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("silx.image.shapes.circle_fill", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -4316,7 +4934,7 @@ static PyObject *__pyx_pf_4silx_5image_6shapes_4circle_fill(CYTHON_UNUSED PyObje
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -4332,9 +4950,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -4362,12 +4977,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -4381,7 +4996,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4395,14 +5010,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -4414,19 +5029,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -4443,7 +5058,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -4455,19 +5070,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -4476,12 +5088,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -4490,7 +5102,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -4500,21 +5112,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -4524,95 +5144,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -4622,43 +5255,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -4668,42 +5310,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -4712,7 +5362,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -4720,19 +5370,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -4741,7 +5391,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -4753,20 +5403,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -4775,7 +5433,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -4787,34 +5445,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -4823,7 +5489,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -4832,19 +5498,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -4854,7 +5520,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -4863,7 +5529,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -4873,21 +5539,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -4897,7 +5571,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -4906,7 +5580,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -4914,30 +5588,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -4946,7 +5608,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -4955,14 +5617,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -4975,7 +5649,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -4986,7 +5660,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -5000,14 +5674,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -5018,16 +5692,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -5036,18 +5707,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -5055,21 +5726,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -5077,11 +5756,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -5091,21 +5777,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -5115,7 +5809,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -5125,7 +5819,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -5135,7 +5829,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -5145,7 +5839,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -5155,7 +5849,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -5164,7 +5858,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -5174,7 +5868,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -5183,7 +5877,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -5193,7 +5887,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -5202,22 +5896,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -5230,7 +5932,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -5260,7 +5962,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -5273,18 +5975,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -5294,7 +5996,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -5302,10 +6004,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -5315,7 +6025,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -5325,7 +6035,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -5333,32 +6043,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -5370,84 +6093,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
/* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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;
}
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+/* "View.MemoryView":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -5455,15 +6222,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -5477,24 +6244,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -5502,16 +6266,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -5531,7 +6295,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -5545,24 +6309,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -5570,16 +6331,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -5599,7 +6360,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -5613,35 +6374,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -5661,7 +6419,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -5678,12 +6436,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -5693,96 +6448,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -5793,7 +6556,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -5805,7 +6568,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -5828,7 +6591,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -5840,9 +6603,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -5864,7 +6624,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -5875,25 +6635,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -5906,7 +6666,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -5920,7 +6680,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -5934,19 +6694,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -5958,7 +6718,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -5973,7 +6733,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -5987,7 +6747,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -5996,7 +6756,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -6005,7 +6765,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -6015,7 +6775,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -6023,21 +6783,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -6050,7 +6816,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -6064,9 +6830,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -6091,7 +6854,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -6100,7 +6863,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -6112,43 +6875,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -6161,7 +6919,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -6170,14 +6928,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -6190,16 +6948,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -6209,7 +6967,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -6218,90 +6976,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -6310,7 +7155,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -6319,7 +7164,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -6331,8 +7176,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -6340,7 +7183,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -6353,19 +7196,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -6376,41 +7224,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -6422,8 +7373,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -6443,12 +7394,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -6457,7 +7405,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -6469,25 +7417,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -6496,7 +7446,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -6507,18 +7457,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -6528,7 +7478,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -6538,8 +7488,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -6558,7 +7508,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -6572,14 +7522,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -6591,12 +7541,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -6607,7 +7554,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -6618,20 +7565,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -6639,39 +7594,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -6679,25 +7634,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -6705,14 +7668,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -6735,7 +7698,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -6749,14 +7712,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -6765,24 +7728,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -6790,111 +7750,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -6919,7 +7895,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -6939,24 +7915,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -6964,81 +7937,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -7055,12 +8039,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -7068,11 +8062,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -7084,7 +8084,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -7106,7 +8106,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -7123,55 +8123,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -7192,7 +8189,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -7201,7 +8198,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -7219,12 +8216,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -7233,7 +8227,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -7242,7 +8236,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -7252,7 +8246,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -7261,7 +8255,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -7271,17 +8265,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -7289,22 +8291,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -7313,7 +8323,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -7323,7 +8333,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -7331,24 +8341,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -7358,21 +8376,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -7382,7 +8406,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -7395,8 +8419,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -7410,6 +8436,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -7427,7 +8454,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -7448,7 +8475,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -7462,33 +8489,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -7509,7 +8533,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -7530,41 +8554,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -7572,26 +8592,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -7601,38 +8623,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -7640,14 +8690,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -7660,51 +8718,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -7712,7 +8781,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -7738,7 +8807,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -7759,31 +8828,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -7794,53 +8861,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -7850,66 +8925,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -7918,9 +9013,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -7937,7 +9032,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -7948,7 +9043,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -7962,14 +9057,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7984,7 +9079,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -7994,7 +9089,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -8003,22 +9098,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -8028,7 +9131,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -8037,22 +9140,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -8062,7 +9173,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -8071,22 +9182,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -8096,7 +9215,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -8105,22 +9224,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -8130,7 +9257,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -8140,7 +9267,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -8150,7 +9277,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -8160,7 +9287,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -8169,7 +9296,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -8182,7 +9309,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8200,78 +9327,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -8286,49 +9410,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -8339,77 +9463,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -8418,102 +9541,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -8522,110 +9652,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__13, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -8634,55 +9767,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -8697,55 +9827,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -8760,51 +9887,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -8812,11 +9936,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -8833,156 +9957,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -8991,18 +10074,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9013,8 +10095,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -9027,20 +10109,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -9050,7 +10132,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -9059,9 +10141,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -9071,8 +10161,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -9085,7 +10175,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9099,25 +10189,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -9125,54 +10212,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9193,7 +10280,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -9207,24 +10294,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -9232,27 +10316,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -9272,7 +10356,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -9286,48 +10370,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -9346,8 +10427,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -9360,49 +10441,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -9420,8 +10498,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -9434,26 +10512,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -9462,7 +10537,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -9471,17 +10546,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -9489,14 +10564,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -9514,7 +10589,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -9528,14 +10603,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -9543,12 +10618,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -9557,7 +10629,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -9566,17 +10638,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -9584,13 +10656,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -9609,7 +10681,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -9624,40 +10696,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -9666,7 +10735,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -9678,7 +10747,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -9700,7 +10769,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -9714,18 +10783,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -9739,7 +10808,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -9768,12 +10837,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -9784,49 +10850,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -9835,7 +10909,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -9844,7 +10918,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -9857,25 +10931,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -9884,7 +10960,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -9894,13 +10970,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -9911,7 +10987,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -9921,27 +10997,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__12);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__12);
- __Pyx_GIVEREF(__pyx_slice__12);
+ __Pyx_INCREF(__pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -9949,22 +11025,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__13); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__15); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -9972,17 +11056,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -9995,29 +11087,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -10036,18 +11136,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -10058,17 +11158,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -10078,29 +11178,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__14);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__14);
- __Pyx_GIVEREF(__pyx_slice__14);
+ __Pyx_INCREF(__pyx_slice__16);
+ __Pyx_GIVEREF(__pyx_slice__16);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -10110,32 +11216,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -10161,76 +11267,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -10239,7 +11352,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -10278,12 +11391,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -10293,7 +11403,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -10302,7 +11412,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -10313,36 +11423,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -10350,20 +11460,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -10374,7 +11492,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -10384,7 +11502,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -10394,7 +11512,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -10403,7 +11521,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -10412,7 +11530,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -10424,25 +11542,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -10451,7 +11571,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -10462,7 +11582,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -10472,27 +11592,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -10503,7 +11631,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -10512,7 +11640,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -10521,16 +11649,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -10538,24 +11666,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -10564,20 +11700,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -10586,20 +11722,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -10608,55 +11744,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -10667,7 +11803,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -10677,18 +11813,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -10697,73 +11833,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -10785,7 +11929,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -10800,11 +11944,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -10814,7 +11955,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -10824,7 +11965,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -10832,11 +11973,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -10850,28 +11997,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -10883,7 +12044,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -10901,19 +12062,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -10923,7 +12090,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -10933,7 +12100,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -10942,7 +12109,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -10952,7 +12119,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -10960,13 +12127,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -10976,7 +12157,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -10986,7 +12167,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -10994,38 +12175,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -11033,24 +12237,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -11060,7 +12272,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -11070,7 +12282,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -11079,7 +12291,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -11089,7 +12301,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -11097,13 +12309,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -11113,7 +12339,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -11121,49 +12347,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -11173,7 +12422,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -11181,11 +12430,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -11194,7 +12449,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -11204,7 +12459,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -11212,11 +12467,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -11226,7 +12487,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -11234,11 +12495,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -11247,7 +12514,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -11256,7 +12523,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -11267,7 +12534,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -11277,7 +12544,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -11285,23 +12552,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -11311,7 +12586,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -11321,7 +12596,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -11331,7 +12606,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -11339,39 +12614,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -11381,7 +12686,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -11405,7 +12710,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -11425,21 +12730,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -11449,7 +12751,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -11459,7 +12761,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -11467,28 +12769,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -11496,20 +12786,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -11518,7 +12816,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -11528,7 +12826,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -11536,13 +12834,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -11552,7 +12856,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -11561,7 +12865,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -11571,35 +12875,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -11609,32 +12927,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -11643,7 +12969,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -11653,7 +12979,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -11661,11 +12987,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -11675,7 +13007,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -11694,7 +13026,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -11717,11 +13049,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -11731,7 +13060,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -11741,7 +13070,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -11751,7 +13080,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -11762,7 +13091,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -11771,7 +13100,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -11783,7 +13112,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -11795,7 +13124,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -11813,20 +13142,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -11836,7 +13171,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -11860,7 +13195,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -11873,17 +13208,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -11892,7 +13227,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -11904,7 +13239,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -11917,12 +13252,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -11932,7 +13264,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -11940,30 +13272,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -11982,7 +13322,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -11996,12 +13336,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -12011,32 +13348,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -12057,36 +13402,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -12095,11 +13440,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -12110,7 +13455,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -12120,7 +13465,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -12128,16 +13474,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -12146,7 +13490,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -12157,35 +13501,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -12194,7 +13546,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -12203,14 +13555,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -12218,7 +13570,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -12228,7 +13580,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -12238,7 +13590,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -12247,7 +13599,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -12256,7 +13608,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -12265,7 +13617,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -12274,7 +13626,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -12283,66 +13635,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -12350,7 +13764,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -12359,7 +13773,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -12371,7 +13785,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -12387,12 +13801,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -12407,36 +13822,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -12445,19 +13857,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -12468,7 +13888,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -12479,7 +13899,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -12487,7 +13907,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -12504,10 +13924,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -12517,7 +13937,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -12527,7 +13947,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -12537,7 +13957,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -12546,7 +13966,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -12555,7 +13975,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -12566,59 +13986,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -12630,7 +14031,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -12643,12 +14044,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -12657,7 +14055,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -12665,13 +14063,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -12690,7 +14088,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -12708,23 +14106,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -12734,7 +14129,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -12743,20 +14138,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -12767,7 +14170,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -12776,20 +14179,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -12808,7 +14211,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -12820,7 +14223,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -12830,7 +14233,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -12839,21 +14242,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -12866,7 +14277,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -12883,7 +14294,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -12892,7 +14303,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -12901,17 +14312,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -12921,7 +14332,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -12930,7 +14341,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -12938,11 +14349,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -12953,7 +14372,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -12963,7 +14382,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -12972,7 +14391,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -12980,11 +14399,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -12994,7 +14421,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -13003,21 +14430,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13030,7 +14465,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -13050,7 +14485,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -13059,7 +14494,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -13068,7 +14503,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -13077,7 +14512,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -13086,7 +14521,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -13096,7 +14531,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -13116,7 +14551,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -13130,9 +14565,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -13140,22 +14583,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -13164,7 +14615,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -13173,7 +14624,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -13184,22 +14635,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -13208,7 +14667,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -13217,7 +14676,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -13229,7 +14688,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -13240,7 +14699,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13250,7 +14709,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -13259,7 +14718,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13270,7 +14729,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13286,7 +14745,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -13296,7 +14755,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13307,7 +14766,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -13317,7 +14776,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -13327,7 +14786,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13340,7 +14799,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -13355,7 +14814,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -13365,7 +14824,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -13376,7 +14835,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -13385,7 +14844,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -13394,21 +14853,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -13417,7 +14884,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -13429,7 +14896,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -13439,7 +14906,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -13452,7 +14919,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13471,11 +14938,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -13485,7 +14949,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -13494,7 +14958,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -13503,7 +14967,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -13513,19 +14977,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -13534,7 +15004,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -13544,7 +15014,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13555,7 +15025,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -13564,17 +15034,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -13583,7 +15053,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13594,7 +15064,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -13604,53 +15074,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -13660,7 +15144,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -13684,7 +15168,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -13699,62 +15183,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -13777,7 +15258,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -13793,33 +15274,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -13829,26 +15307,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -13873,7 +15371,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -13890,16 +15388,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -13909,18 +15404,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -13930,39 +15425,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -13987,7 +15510,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -14012,11 +15535,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -14025,7 +15545,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -14035,7 +15555,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -14044,7 +15564,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -14053,7 +15573,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -14062,7 +15582,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -14072,7 +15592,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -14080,10 +15600,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -14093,7 +15621,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -14101,11 +15629,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -14121,7 +15656,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14132,7 +15667,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -14142,7 +15677,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -14152,7 +15687,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -14161,7 +15696,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -14169,25 +15704,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -14197,62 +15746,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -14260,11 +15821,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -14274,51 +15841,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
+ *
+ * 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);
+
+ /* "View.MemoryView":1297
*
- * 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)
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -14327,7 +15909,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -14336,7 +15918,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -14345,7 +15927,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -14354,7 +15936,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -14363,7 +15945,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -14372,12 +15954,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -14391,28 +15987,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -14421,7 +16023,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -14430,7 +16032,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -14439,7 +16041,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -14448,7 +16050,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -14458,7 +16060,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -14482,21 +16084,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -14505,87 +16107,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -14593,7 +16195,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -14604,7 +16206,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -14614,7 +16216,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -14622,11 +16224,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -14637,7 +16245,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14652,7 +16260,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -14661,7 +16269,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14676,7 +16284,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14692,7 +16300,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -14703,7 +16311,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -14713,7 +16321,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -14723,7 +16331,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -14731,36 +16339,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -14770,7 +16402,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14782,7 +16414,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -14792,7 +16424,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -14801,7 +16433,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -14810,7 +16442,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -14819,7 +16451,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -14830,7 +16462,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14846,7 +16478,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -14855,7 +16487,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -14864,7 +16496,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -14874,7 +16506,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -14885,7 +16517,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -14894,7 +16526,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -14903,22 +16535,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -14927,7 +16567,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -14939,7 +16579,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14995,8 +16635,9 @@ static PyTypeObject __pyx_type_4silx_5image_6shapes_Polygon = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15040,6 +16681,7 @@ static PyTypeObject __pyx_type_4silx_5image_6shapes_Polygon = {
0, /*tp_finalize*/
#endif
};
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -15051,12 +16693,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -15107,7 +16751,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -15116,7 +16760,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -15167,8 +16811,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15272,8 +16917,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -15334,10 +16980,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -15415,39 +17062,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -15459,15 +17106,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -15518,8 +17165,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -15619,7 +17267,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -15627,7 +17275,7 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -15642,8 +17290,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -15720,6 +17369,7 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_03_06_2016, __pyx_k_03_06_2016, sizeof(__pyx_k_03_06_2016), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 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_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},
@@ -15775,6 +17425,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
@@ -15799,7 +17450,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
{&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
{&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
- {&__pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__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},
@@ -15836,29 +17486,24 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1},
{&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
{&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
- {&__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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 90, __pyx_L1_error)
+ __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 120, __pyx_L1_error)
+ __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 131, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -15875,7 +17520,7 @@ static int __Pyx_InitCachedConstants(void) {
* numpy.asarray(a_coords).reshape(-1))
* else:
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
@@ -15886,7 +17531,7 @@ static int __Pyx_InitCachedConstants(void) {
* else:
* return (numpy.asarray(a_coords).reshape(-1),
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
@@ -15897,7 +17542,7 @@ static int __Pyx_InitCachedConstants(void) {
* numpy.asarray(b_coords).reshape(-1))
*
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
@@ -15908,130 +17553,155 @@ static int __Pyx_InitCachedConstants(void) {
*
*
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__10 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__11);
- __Pyx_GIVEREF(__pyx_tuple__11);
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__13 = PyTuple_New(1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__13, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__12);
- __Pyx_GIVEREF(__pyx_slice__12);
+ __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__13);
- __Pyx_GIVEREF(__pyx_slice__13);
+ __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__14);
- __Pyx_GIVEREF(__pyx_slice__14);
+ __pyx_slice__16 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__16)) __PYX_ERR(1, 682, __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:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
/* "silx/image/shapes.pyx":178
*
@@ -16040,10 +17710,10 @@ static int __Pyx_InitCachedConstants(void) {
* """Return a mask of boolean, True for pixels inside a polygon.
*
*/
- __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_vertices, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
- __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_polygon_fill_mask, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__18 = PyTuple_Pack(2, __pyx_n_s_vertices, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_polygon_fill_mask, 178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 178, __pyx_L1_error)
/* "silx/image/shapes.pyx":193
* @cython.wraparound(False)
@@ -16052,10 +17722,10 @@ static int __Pyx_InitCachedConstants(void) {
* """Line includes both end points.
* Width is handled by drawing parallel lines, so junctions of lines belonging
*/
- __pyx_tuple__18 = PyTuple_Pack(19, __pyx_n_s_row0, __pyx_n_s_col0, __pyx_n_s_row1, __pyx_n_s_col1, __pyx_n_s_width, __pyx_n_s_drow, __pyx_n_s_dcol, __pyx_n_s_invert_coords, __pyx_n_s_db, __pyx_n_s_da, __pyx_n_s_delta, __pyx_n_s_b, __pyx_n_s_a, __pyx_n_s_step_a, __pyx_n_s_step_b, __pyx_n_s_index, __pyx_n_s_offset, __pyx_n_s_b_coords, __pyx_n_s_a_coords); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
- __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_draw_line, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__20 = PyTuple_Pack(19, __pyx_n_s_row0, __pyx_n_s_col0, __pyx_n_s_row1, __pyx_n_s_col1, __pyx_n_s_width, __pyx_n_s_drow, __pyx_n_s_dcol, __pyx_n_s_invert_coords, __pyx_n_s_db, __pyx_n_s_da, __pyx_n_s_delta, __pyx_n_s_b, __pyx_n_s_a, __pyx_n_s_step_a, __pyx_n_s_step_b, __pyx_n_s_index, __pyx_n_s_offset, __pyx_n_s_b_coords, __pyx_n_s_a_coords); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 193, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(5, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_draw_line, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 193, __pyx_L1_error)
/* "silx/image/shapes.pyx":275
*
@@ -16064,65 +17734,65 @@ static int __Pyx_InitCachedConstants(void) {
* """Generates coordinate of image points lying in a disk.
*
*/
- __pyx_tuple__20 = PyTuple_Pack(8, __pyx_n_s_crow, __pyx_n_s_ccol, __pyx_n_s_radius, __pyx_n_s_i_radius, __pyx_n_s_len_coords, __pyx_n_s_coords, __pyx_n_s_rows, __pyx_n_s_cols); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
- __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_circle_fill, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__22 = PyTuple_Pack(8, __pyx_n_s_crow, __pyx_n_s_ccol, __pyx_n_s_radius, __pyx_n_s_i_radius, __pyx_n_s_len_coords, __pyx_n_s_coords, __pyx_n_s_rows, __pyx_n_s_cols); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 275, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_circle_fill, 275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 275, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* 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[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* 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[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* 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[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* 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[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -16131,11 +17801,11 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16150,9 +17820,7 @@ PyMODINIT_FUNC PyInit_shapes(void)
#endif
{
PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ static PyThread_type_lock __pyx_t_2[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -16164,17 +17832,24 @@ PyMODINIT_FUNC PyInit_shapes(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_shapes(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -16189,34 +17864,34 @@ PyMODINIT_FUNC PyInit_shapes(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
if (__pyx_module_is_main_silx__image__shapes) {
- 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 (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
if (!PyDict_GetItemString(modules, "silx.image.shapes")) {
- if (unlikely(PyDict_SetItemString(modules, "silx.image.shapes", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyDict_SetItemString(modules, "silx.image.shapes", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -16228,15 +17903,18 @@ PyMODINIT_FUNC PyInit_shapes(void)
/*--- Type init code ---*/
__pyx_vtabptr_4silx_5image_6shapes_Polygon = &__pyx_vtable_4silx_5image_6shapes_Polygon;
__pyx_vtable_4silx_5image_6shapes_Polygon.c_is_inside = (int (*)(struct __pyx_obj_4silx_5image_6shapes_Polygon *, float, float))__pyx_f_4silx_5image_6shapes_7Polygon_c_is_inside;
- if (PyType_Ready(&__pyx_type_4silx_5image_6shapes_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4silx_5image_6shapes_Polygon) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
__pyx_type_4silx_5image_6shapes_Polygon.tp_print = 0;
- if (__Pyx_SetVtable(__pyx_type_4silx_5image_6shapes_Polygon.tp_dict, __pyx_vtabptr_4silx_5image_6shapes_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyObject_SetAttrString(__pyx_m, "Polygon", (PyObject *)&__pyx_type_4silx_5image_6shapes_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type_4silx_5image_6shapes_Polygon.tp_dict, __pyx_vtabptr_4silx_5image_6shapes_Polygon) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
+ if (PyObject_SetAttrString(__pyx_m, "Polygon", (PyObject *)&__pyx_type_4silx_5image_6shapes_Polygon) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
__pyx_ptype_4silx_5image_6shapes_Polygon = &__pyx_type_4silx_5image_6shapes_Polygon;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -16247,23 +17925,26 @@ PyMODINIT_FUNC PyInit_shapes(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
/* "silx/image/shapes.pyx":38
* """
@@ -16272,15 +17953,15 @@ PyMODINIT_FUNC PyInit_shapes(void)
* __license__ = "MIT"
* __date__ = "03/06/2016"
*/
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_Jrme_Kieffer);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Jrme_Kieffer);
__Pyx_GIVEREF(__pyx_kp_s_Jrme_Kieffer);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_Jrme_Kieffer);
__Pyx_INCREF(__pyx_kp_s_T_Vincent);
- PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_T_Vincent);
__Pyx_GIVEREF(__pyx_kp_s_T_Vincent);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_T_Vincent);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/shapes.pyx":39
@@ -16290,7 +17971,7 @@ PyMODINIT_FUNC PyInit_shapes(void)
* __date__ = "03/06/2016"
* __status__ = "dev"
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 39, __pyx_L1_error)
/* "silx/image/shapes.pyx":40
* __authors__ = ["Jrme Kieffer", "T. Vincent"]
@@ -16299,7 +17980,7 @@ PyMODINIT_FUNC PyInit_shapes(void)
* __status__ = "dev"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_03_06_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_03_06_2016) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
/* "silx/image/shapes.pyx":41
* __license__ = "MIT"
@@ -16308,7 +17989,7 @@ PyMODINIT_FUNC PyInit_shapes(void)
*
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_status, __pyx_n_s_dev) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_status, __pyx_n_s_dev) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
/* "silx/image/shapes.pyx":45
*
@@ -16317,9 +17998,9 @@ PyMODINIT_FUNC PyInit_shapes(void)
* from libc.math cimport ceil, fabs
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/shapes.pyx":178
@@ -16329,9 +18010,9 @@ PyMODINIT_FUNC PyInit_shapes(void)
* """Return a mask of boolean, True for pixels inside a polygon.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_1polygon_fill_mask, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_1polygon_fill_mask, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon_fill_mask, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_polygon_fill_mask, __pyx_t_1) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/shapes.pyx":193
@@ -16341,9 +18022,9 @@ PyMODINIT_FUNC PyInit_shapes(void)
* """Line includes both end points.
* Width is handled by drawing parallel lines, so junctions of lines belonging
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_3draw_line, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_3draw_line, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw_line, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_draw_line, __pyx_t_1) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/shapes.pyx":275
@@ -16353,9 +18034,9 @@ PyMODINIT_FUNC PyInit_shapes(void)
* """Generates coordinate of image points lying in a disk.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_5circle_fill, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_5image_6shapes_5circle_fill, NULL, __pyx_n_s_silx_image_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle_fill, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_circle_fill, __pyx_t_1) < 0) __PYX_ERR(0, 275, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/image/shapes.pyx":1
@@ -16363,121 +18044,147 @@ PyMODINIT_FUNC PyInit_shapes(void)
* # /[inserted by cython to avoid comment start]*##########################################################################
* #
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __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
+ /* "View.MemoryView":283
*
* 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[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __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
+ /* "View.MemoryView":284
* 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[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __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
+ /* "View.MemoryView":287
*
*
* 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[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __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
+ /* "View.MemoryView":288
*
* 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[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_2[0] = PyThread_allocate_lock();
+ __pyx_t_2[1] = PyThread_allocate_lock();
+ __pyx_t_2[2] = PyThread_allocate_lock();
+ __pyx_t_2[3] = PyThread_allocate_lock();
+ __pyx_t_2[4] = PyThread_allocate_lock();
+ __pyx_t_2[5] = PyThread_allocate_lock();
+ __pyx_t_2[6] = PyThread_allocate_lock();
+ __pyx_t_2[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16507,7 +18214,8 @@ PyMODINIT_FUNC PyInit_shapes(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -16524,6 +18232,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -16537,6 +18246,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -16550,6 +18260,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -16651,6 +18362,7 @@ bad:
return -1;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -16676,9 +18388,10 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -16693,7 +18406,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -16712,7 +18426,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -17261,7 +18976,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -17317,7 +19033,6 @@ no_fail:
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
@@ -17396,10 +19111,10 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -17409,29 +19124,33 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -17452,9 +19171,268 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -17473,7 +19451,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -17485,6 +19464,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -17492,18 +19476,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -17511,8 +19504,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -17525,8 +19519,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -17538,9 +19533,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -17564,10 +19560,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -17581,26 +19576,30 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* IterFinish */
+ static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
@@ -17633,7 +19632,8 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
#endif
}
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+/* UnpackItemEndCheck */
+ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
@@ -17644,7 +19644,8 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
return 0;
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -17670,9 +19671,11 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -17711,6 +19714,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -17744,10 +19748,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -17807,7 +19814,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -17827,7 +19834,8 @@ bad:
}
#endif
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -17864,7 +19872,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -17947,14 +19956,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -17966,13 +19977,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -17992,11 +20010,13 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -18008,23 +20028,18 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -18034,16 +20049,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -18054,7 +20081,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -18072,7 +20099,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -18096,30 +20123,112 @@ bad:
return -1;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* None */
+ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -18136,13 +20245,14 @@ bad:
return -1;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -18215,7 +20325,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -18288,7 +20399,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -18316,211 +20427,121 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
- }
+ 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];
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ return 1;
}
-#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))
- }
+/* OverlappingSlices */
+ 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 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 (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
}
- {
-#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+ }
+ *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);
+}
+
+/* Capsule */
+ 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
- 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;
- }
+ cobj = PyCObject_FromVoidPtr(p, NULL);
#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;
+ return cobj;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -18531,10 +20552,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-static PyObject *__pyx_memview_get_float(const char *itemp) {
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) {
return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
}
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
float value = __pyx_PyFloat_AsFloat(obj);
if ((value == (float)-1) && PyErr_Occurred())
return 0;
@@ -18542,22 +20564,27 @@ static int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
return 1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -18568,22 +20595,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
- const unsigned char neg_one = (unsigned char) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
+ const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(unsigned char) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned char) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(unsigned char) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned char) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -18594,105 +20626,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char valu
}
}
-static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
- const unsigned char neg_one = (unsigned 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(unsigned char) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
- } else {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- goto raise_neg_overflow;
- }
- return (unsigned 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(unsigned char, digit, ((PyLongObject*)x)->ob_digit[0]);
- }
- #endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- goto raise_neg_overflow;
- }
- if (sizeof(unsigned char) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(unsigned char) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned 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(unsigned char, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
- }
- #endif
-#endif
- if (sizeof(unsigned char) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, long, PyLong_AsLong(x))
- } else if (sizeof(unsigned char) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned 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
- unsigned 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 (unsigned char) -1;
- }
- } else {
- unsigned char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned char) -1;
- val = __Pyx_PyInt_As_unsigned_char(tmp);
- Py_DECREF(tmp);
- return val;
- }
-raise_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to unsigned char");
- return (unsigned char) -1;
-raise_neg_overflow:
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned char");
- return (unsigned char) -1;
-}
-
-static PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
return (PyObject *) __Pyx_PyInt_From_unsigned_char(*(unsigned char *) itemp);
}
-static int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
+static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
unsigned char value = __Pyx_PyInt_As_unsigned_char(obj);
if ((value == (unsigned char)-1) && PyErr_Occurred())
return 0;
@@ -18700,10 +20638,11 @@ static int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
return 1;
}
-static PyObject *__pyx_memview_get_int(const char *itemp) {
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
}
-static int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
+static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
int value = __Pyx_PyInt_As_int(obj);
if ((value == (int)-1) && PyErr_Occurred())
return 0;
@@ -18711,64 +20650,8 @@ static int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
return 1;
}
-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
+/* MemviewSliceCopyTemplate */
+ 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,
@@ -18834,20 +20717,387 @@ no_fail:
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);
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
#endif
- return cobj;
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
}
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
+ const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(unsigned char) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (unsigned char) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
+ return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
+ return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
+ return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(unsigned char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(unsigned char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ unsigned char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (unsigned char) -1;
+ }
+ } else {
+ unsigned char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (unsigned char) -1;
+ val = __Pyx_PyInt_As_unsigned_char(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to unsigned char");
+ return (unsigned char) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned char");
+ return (unsigned char) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -18864,36 +21114,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -18902,7 +21245,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -18925,7 +21268,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -18941,8 +21284,9 @@ raise_neg_overflow:
return (char) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -18959,36 +21303,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -18997,7 +21434,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19020,7 +21457,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -19036,7 +21473,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -19076,7 +21514,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -19257,7 +21696,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -19279,7 +21719,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_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), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -19301,7 +21742,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -19323,7 +21765,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -19338,7 +21781,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -19376,7 +21820,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -19417,7 +21861,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -19438,8 +21882,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -19447,9 +21893,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -19458,11 +21905,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -19487,18 +21937,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/image/sift.py b/silx/image/sift.py
index 1a9ac8c..cb1e6bd 100644
--- a/silx/image/sift.py
+++ b/silx/image/sift.py
@@ -1 +1,25 @@
-from silx.opencl.sift import * \ No newline at end of file
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+
+from silx.opencl.sift import *
diff --git a/silx/image/test/__init__.py b/silx/image/test/__init__.py
index e99eaa2..4c5a2e9 100644
--- a/silx/image/test/__init__.py
+++ b/silx/image/test/__init__.py
@@ -31,6 +31,7 @@ import unittest
from . import test_bilinear
from . import test_shapes
from . import test_medianfilter
+from . import test_tomography
def suite():
@@ -39,4 +40,5 @@ def suite():
test_suite.addTest(test_bilinear.suite())
test_suite.addTest(test_medianfilter.suite())
test_suite.addTest(test_shapes.suite())
+ test_suite.addTest(test_tomography.suite())
return test_suite
diff --git a/silx/image/test/test_bilinear.py b/silx/image/test/test_bilinear.py
index 1789aca..564dfad 100644
--- a/silx/image/test/test_bilinear.py
+++ b/silx/image/test/test_bilinear.py
@@ -3,7 +3,7 @@
# Project: silx (originally pyFAI)
# https://github.com/silx-kit/silx
#
-# Copyright (C) 2012-2016 European Synchrotron Radiation Facility, Grenoble, France
+# Copyright (C) 2012-2017 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
@@ -29,7 +29,7 @@ __date__ = "02/08/2016"
import unittest
import numpy
import logging
-logger = logging.getLogger("test_bilinear")
+logger = logging.getLogger(__name__)
from ..bilinear import BilinearImage
diff --git a/silx/image/test/test_shapes.py b/silx/image/test/test_shapes.py
index ed85165..0c5ab5e 100644
--- a/silx/image/test/test_shapes.py
+++ b/silx/image/test/test_shapes.py
@@ -27,7 +27,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/12/2016"
+__date__ = "15/05/2017"
import logging
@@ -37,9 +37,7 @@ import numpy
from silx.test.utils import ParametricTestCase
from silx.image import shapes
-logging.basicConfig()
_logger = logging.getLogger(__name__)
-_logger.setLevel(logging.WARNING)
class TestPolygonFill(ParametricTestCase):
diff --git a/silx/image/test/test_tomography.py b/silx/image/test/test_tomography.py
new file mode 100644
index 0000000..2a6a33c
--- /dev/null
+++ b/silx/image/test/test_tomography.py
@@ -0,0 +1,66 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ############################################################################*/
+"""
+Tests that the functions of tomography are valid
+"""
+
+__authors__ = ["H. Payno"]
+__license__ = "MIT"
+__date__ = "12/09/2017"
+
+import unittest
+import numpy
+from silx.test.utils import utilstest
+from silx.image import tomography
+
+class TestTomography(unittest.TestCase):
+ """
+
+ """
+
+ def setUp(self):
+ self.sinoTrueData = numpy.load(utilstest.getfile("sino500.npz"))["data"]
+
+ def testCalcCenterCentroid(self):
+ centerTD = tomography.calc_center_centroid(self.sinoTrueData)
+ self.assertTrue(numpy.isclose(centerTD, 256, rtol=0.01))
+
+ def testCalcCenterCorr(self):
+ centerTrueData = tomography.calc_center_corr(self.sinoTrueData,
+ fullrot=False,
+ props=1)
+ self.assertTrue(numpy.isclose(centerTrueData, 256, rtol=0.01))
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ for testClass in (TestTomography, ):
+ test_suite.addTest(
+ unittest.defaultTestLoader.loadTestsFromTestCase(testClass))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/image/tomography.py b/silx/image/tomography.py
new file mode 100644
index 0000000..3666455
--- /dev/null
+++ b/silx/image/tomography.py
@@ -0,0 +1,159 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2017 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.
+#
+# ############################################################################*/
+"""
+This module contains utilitary functions for tomography
+"""
+
+__author__ = ["P. Paleo"]
+__license__ = "MIT"
+__date__ = "12/09/2017"
+
+
+import numpy as np
+from math import pi
+from silx.math.fit import leastsq
+
+
+def rescale_intensity(img, from_subimg=None, percentiles=None):
+ """
+ clamp intensity into the [2, 98] percentiles
+
+ :param img:
+ :param from_subimg:
+ :param percentiles:
+ :return: the rescale intensity
+ """
+ if percentiles is None:
+ percentiles = [2, 98]
+ else:
+ assert type(percentiles) in (tuple, list)
+ assert(len(percentiles) == 2)
+ data = from_subimg if from_subimg is not None else img
+ imin, imax = np.percentile(data, percentiles)
+ res = np.clip(img, imin, imax)
+ return res
+
+
+def calc_center_corr(sino, fullrot=False, props=1):
+ """
+ Compute a guess of the Center of Rotation (CoR) of a given sinogram.
+ The computation is based on the correlation between the line projections at
+ angle (theta = 0) and at angle (theta = 180).
+
+ Note that for most scans, the (theta=180) angle is not included,
+ so the CoR might be underestimated.
+ In a [0, 360[ scan, the projection angle at (theta=180) is exactly in the
+ middle for odd number of projections.
+
+ :param numpy.ndarray sino: Sinogram
+ :param bool fullrot: optional. If False (default), the scan is assumed to
+ be [0, 180).
+ If True, the scan is assumed to be [0, 380).
+ :param int props: optional. Number of propositions for the CoR
+ """
+
+ n_a, n_d = sino.shape
+ first = 0
+ last = -1 if not(fullrot) else n_a // 2
+ proj1 = sino[first, :]
+ proj2 = sino[last, :][::-1]
+
+ # Compute the correlation in the Fourier domain
+ proj1_f = np.fft.fft(proj1, 2 * n_d)
+ proj2_f = np.fft.fft(proj2, 2 * n_d)
+ corr = np.abs(np.fft.ifft(proj1_f * proj2_f.conj()))
+
+ if props == 1:
+ pos = np.argmax(corr)
+ if pos > n_d // 2:
+ pos -= n_d
+ return (n_d + pos) / 2.
+ else:
+ corr_argsorted = np.argsort(corr)[:props]
+ corr_argsorted[corr_argsorted > n_d // 2] -= n_d
+ return (n_d + corr_argsorted) / 2.
+
+
+def _sine_function(t, offset, amplitude, phase):
+ """
+ Helper function for calc_center_centroid
+ """
+ n_angles = t.shape[0]
+ res = amplitude * np.sin(2 * pi * (1. / (2 * n_angles)) * t + phase)
+ return offset + res
+
+
+def _sine_function_derivative(t, params, eval_idx):
+ """
+ Helper function for calc_center_centroid
+ """
+ offset, amplitude, phase = params
+ n_angles = t.shape[0]
+ w = 2.0 * pi * (1. / (2.0 * n_angles)) * t + phase
+ grad = (1.0, np.sin(w), amplitude*np.cos(w))
+ return grad[eval_idx]
+
+
+def calc_center_centroid(sino):
+ """
+ Compute a guess of the Center of Rotation (CoR) of a given sinogram.
+ The computation is based on the computation of the centroid of each
+ projection line, which should be a sine function according to the
+ Helgason-Ludwig condition.
+ This method is unlikely to work in local tomography.
+
+ :param numpy.ndarray sino: Sinogram
+ """
+
+ n_a, n_d = sino.shape
+ # Compute the vector of centroids of the sinogram
+ i = np.arange(n_d)
+ centroids = np.sum(sino*i, axis=1)/np.sum(sino, axis=1)
+
+ # Fit with a sine function : phase, amplitude, offset
+ # Using non-linear Levenberg–Marquardt algorithm
+ angles = np.linspace(0, n_a, n_a, True)
+ # Initial parameter vector
+ cmax, cmin = centroids.max(), centroids.min()
+ offs = (cmax + cmin) / 2.
+ amp = (cmax - cmin) / 2.
+ phi = 1.1
+ p0 = (offs, amp, phi)
+
+ constraints = np.zeros((3, 3))
+
+ popt, _ = leastsq(model=_sine_function,
+ xdata=angles,
+ ydata=centroids,
+ p0=p0,
+ sigma=None,
+ constraints=constraints,
+ model_deriv=None,
+ epsfcn=None,
+ deltachi=None,
+ full_output=0,
+ check_finite=True,
+ left_derivative=False,
+ max_iter=100)
+ return popt[0]
diff --git a/silx/io/__init__.py b/silx/io/__init__.py
index 4e3cace..96f6708 100644
--- a/silx/io/__init__.py
+++ b/silx/io/__init__.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2017 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
@@ -26,20 +26,16 @@
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "20/01/2017"
+__date__ = "15/05/2017"
-import logging
-
-
-# Init logging once for the whole module
-logging.basicConfig()
-
from .utils import open # pylint:disable=redefined-builtin
from .utils import save1D
from .utils import is_dataset
from .utils import is_file
from .utils import is_group
+from .utils import is_softlink
-__all__ = ["save1D", "is_dataset", "is_file", "is_group"] # avoid to import open with "import *"
+# avoid to import open with "import *"
+__all__ = ["save1D", "is_dataset", "is_file", "is_group", "is_softlink"]
diff --git a/silx/io/commonh5.py b/silx/io/commonh5.py
new file mode 100644
index 0000000..0f5ac02
--- /dev/null
+++ b/silx/io/commonh5.py
@@ -0,0 +1,991 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016-2017 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.
+#
+# ############################################################################*/
+"""
+This module contains generic objects, emulating *h5py* groups, datasets and
+files. They are used in :mod:`spech5` and :mod:`fabioh5`.
+
+.. note:: This module has a dependency on the `h5py <http://www.h5py.org/>`_
+ library, which is not a mandatory dependency for `silx`.
+"""
+import collections
+import h5py
+import numpy
+from silx.third_party import six
+
+from .utils import is_dataset
+
+__authors__ = ["V. Valls", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "21/09/2017"
+
+
+class _MappingProxyType(collections.MutableMapping):
+ """Read-only dictionary
+
+ This class is available since Python 3.3, but not on earlyer Python
+ versions.
+ """
+
+ def __init__(self, data):
+ self._data = data
+
+ def __getitem__(self, key):
+ return self._data[key]
+
+ def __len__(self):
+ return len(self._data)
+
+ def __iter__(self):
+ return iter(self._data)
+
+ def get(self, key, default=None):
+ return self._data.get(key, default)
+
+ def __setitem__(self, key, value):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+ def __delitem__(self, key):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+ def pop(self, key):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+ def clear(self):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+ def update(self, key, value):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+ def setdefault(self, key):
+ raise RuntimeError("Cannot modify read-only dictionary")
+
+
+class Node(object):
+ """This is the base class for all :mod:`spech5` and :mod:`fabioh5`
+ classes. It represents a tree node, and knows its parent node
+ (:attr:`parent`).
+ The API mimics a *h5py* node, with following attributes: :attr:`file`,
+ :attr:`attrs`, :attr:`name`, and :attr:`basename`.
+ """
+
+ def __init__(self, name, parent=None, attrs=None):
+ self.__parent = parent
+ self.__basename = name
+ self.__attrs = {}
+ if attrs is not None:
+ self.__attrs.update(attrs)
+
+ def _set_basename(self, name):
+ self.__basename = name
+
+ @property
+ def h5py_class(self):
+ """Returns the h5py classes which is mimicked by this class. It can be
+ one of `h5py.File, h5py.Group` or `h5py.Dataset`
+
+ :rtype: Class
+ """
+ raise NotImplementedError()
+
+ @property
+ def parent(self):
+ """Returns the parent of the node.
+
+ :rtype: Node
+ """
+ return self.__parent
+
+ @property
+ def file(self):
+ """Returns the file node of this node.
+
+ :rtype: Node
+ """
+ node = self
+ while node.__parent is not None:
+ node = node.__parent
+ if isinstance(node, File):
+ return node
+ else:
+ return None
+
+ def _set_parent(self, parent):
+ """Set the parent of this node.
+
+ It do not update the parent object.
+
+ :param Node parent: New parent for this node
+ """
+ self.__parent = parent
+
+ @property
+ def attrs(self):
+ """Returns HDF5 attributes of this node.
+
+ :rtype: dict
+ """
+ if self._is_editable():
+ return self.__attrs
+ else:
+ return _MappingProxyType(self.__attrs)
+
+ @property
+ def name(self):
+ """Returns the HDF5 name of this node.
+ """
+ if self.__parent is None:
+ return "/"
+ if self.__parent.name == "/":
+ return "/" + self.basename
+ return self.__parent.name + "/" + self.basename
+
+ @property
+ def basename(self):
+ """Returns the HDF5 basename of this node.
+ """
+ return self.__basename
+
+ def _is_editable(self):
+ """Returns true if the file is editable or if the node is not linked
+ to a tree.
+
+ :rtype: bool
+ """
+ f = self.file
+ return f is None or f.mode == "w"
+
+
+class Dataset(Node):
+ """This class handles a numpy data object, as a mimicry of a
+ *h5py.Dataset*.
+ """
+
+ def __init__(self, name, data, parent=None, attrs=None):
+ Node.__init__(self, name, parent, attrs=attrs)
+ if data is not None:
+ self._check_data(data)
+ self.__data = data
+
+ def _check_data(self, data):
+ """Check that the data provided by the dataset is valid.
+
+ :param numpy.ndarray data: Data associated to the dataset
+
+ :raises TypeError: In the case the data is not valid.
+ """
+ chartype = data.dtype.char
+ if chartype in ["U", "O"]:
+ msg = "Type of the dataset '%s' is not supported. Found '%s'."
+ raise TypeError(msg % (self.name, data.dtype))
+
+ def _set_data(self, data):
+ """Set the data exposed by the dataset.
+
+ It have to be called only one time before the data is used. It should
+ not be edited after use.
+
+ :param numpy.ndarray data: Data associated to the dataset
+ """
+ self._check_data(data)
+ self.__data = data
+
+ def _get_data(self):
+ """Returns the exposed data
+
+ :rtype: numpy.ndarray
+ """
+ return self.__data
+
+ @property
+ def h5py_class(self):
+ """Returns the h5py classes which is mimicked by this class. It can be
+ one of `h5py.File, h5py.Group` or `h5py.Dataset`
+
+ :rtype: Class
+ """
+ return h5py.Dataset
+
+ @property
+ def dtype(self):
+ """Returns the numpy datatype exposed by this dataset.
+
+ :rtype: numpy.dtype
+ """
+ return self._get_data().dtype
+
+ @property
+ def shape(self):
+ """Returns the shape of the data exposed by this dataset.
+
+ :rtype: tuple
+ """
+ if isinstance(self._get_data(), numpy.ndarray):
+ return self._get_data().shape
+ else:
+ return tuple()
+
+ @property
+ def size(self):
+ """Returns the size of the data exposed by this dataset.
+
+ :rtype: int
+ """
+ if isinstance(self._get_data(), numpy.ndarray):
+ return self._get_data().size
+ else:
+ # It is returned as float64 1.0 by h5py
+ return numpy.float64(1.0)
+
+ def __len__(self):
+ """Returns the size of the data exposed by this dataset.
+
+ :rtype: int
+ """
+ if isinstance(self._get_data(), numpy.ndarray):
+ return len(self._get_data())
+ else:
+ # It is returned as float64 1.0 by h5py
+ raise TypeError("Attempt to take len() of scalar dataset")
+
+ def __getitem__(self, item):
+ """Returns the slice of the data exposed by this dataset.
+
+ :rtype: numpy.ndarray
+ """
+ if not isinstance(self._get_data(), numpy.ndarray):
+ if item == Ellipsis:
+ return numpy.array(self._get_data())
+ elif item == tuple():
+ return self._get_data()
+ else:
+ raise ValueError("Scalar can only be reached with an ellipsis or an empty tuple")
+ return self._get_data().__getitem__(item)
+
+ def __str__(self):
+ basename = self.name.split("/")[-1]
+ return '<HDF5-like dataset "%s": shape %s, type "%s">' % \
+ (basename, self.shape, self.dtype.str)
+
+ def __getslice__(self, i, j):
+ """Returns the slice of the data exposed by this dataset.
+
+ Deprecated but still in use for python 2.7
+
+ :rtype: numpy.ndarray
+ """
+ return self.__getitem__(slice(i, j, None))
+
+ @property
+ def value(self):
+ """Returns the data exposed by this dataset.
+
+ Deprecated by h5py. It is prefered to use indexing `[()]`.
+
+ :rtype: numpy.ndarray
+ """
+ return self._get_data()
+
+ @property
+ def compression(self):
+ """Returns compression as provided by `h5py.Dataset`.
+
+ There is no compression."""
+ return None
+
+ @property
+ def compression_opts(self):
+ """Returns compression options as provided by `h5py.Dataset`.
+
+ There is no compression."""
+ return None
+
+ @property
+ def chunks(self):
+ """Returns chunks as provided by `h5py.Dataset`.
+
+ There is no chunks."""
+ return None
+
+ def __array__(self, dtype=None):
+ # Special case for (0,)*-shape datasets
+ if numpy.product(self.shape) == 0:
+ return self[()]
+ else:
+ return numpy.array(self[...], dtype=self.dtype if dtype is None else dtype)
+
+ def __iter__(self):
+ """Iterate over the first axis. TypeError if scalar."""
+ if len(self.shape) == 0:
+ raise TypeError("Can't iterate over a scalar dataset")
+ return self._get_data().__iter__()
+
+ # make comparisons and operations on the data
+ def __eq__(self, other):
+ """When comparing datasets, compare the actual data."""
+ if is_dataset(other):
+ return self[()] == other[()]
+ return self[()] == other
+
+ def __add__(self, other):
+ return self[()] + other
+
+ def __radd__(self, other):
+ return other + self[()]
+
+ def __sub__(self, other):
+ return self[()] - other
+
+ def __rsub__(self, other):
+ return other - self[()]
+
+ def __mul__(self, other):
+ return self[()] * other
+
+ def __rmul__(self, other):
+ return other * self[()]
+
+ def __truediv__(self, other):
+ return self[()] / other
+
+ def __rtruediv__(self, other):
+ return other / self[()]
+
+ def __floordiv__(self, other):
+ return self[()] // other
+
+ def __rfloordiv__(self, other):
+ return other // self[()]
+
+ def __neg__(self):
+ return -self[()]
+
+ def __abs__(self):
+ return abs(self[()])
+
+ def __float__(self):
+ return float(self[()])
+
+ def __int__(self):
+ return int(self[()])
+
+ def __bool__(self):
+ if self[()]:
+ return True
+ return False
+
+ def __nonzero__(self):
+ # python 2
+ return self.__bool__()
+
+ def __ne__(self, other):
+ if is_dataset(other):
+ return self[()] != other[()]
+ else:
+ return self[()] != other
+
+ def __lt__(self, other):
+ if is_dataset(other):
+ return self[()] < other[()]
+ else:
+ return self[()] < other
+
+ def __le__(self, other):
+ if is_dataset(other):
+ return self[()] <= other[()]
+ else:
+ return self[()] <= other
+
+ def __gt__(self, other):
+ if is_dataset(other):
+ return self[()] > other[()]
+ else:
+ return self[()] > other
+
+ def __ge__(self, other):
+ if is_dataset(other):
+ return self[()] >= other[()]
+ else:
+ return self[()] >= other
+
+ def __getattr__(self, item):
+ """Proxy to underlying numpy array methods.
+ """
+ data = self._get_data()
+ if hasattr(data, item):
+ return getattr(data, item)
+
+ raise AttributeError("Dataset has no attribute %s" % item)
+
+
+class _LinkToDataset(Dataset):
+ """Virtual dataset providing link to another dataset"""
+
+ def __init__(self, name, target, parent=None):
+ Dataset.__init__(self, name, data=None, parent=parent)
+ self.__target = target
+
+ def _get_data(self):
+ return self.__target._get_data()
+
+ @property
+ def attrs(self):
+ return self.__target.attrs
+
+
+class LazyLoadableDataset(Dataset):
+ """Abstract dataset which provides a lazy loading of the data.
+
+ The class has to be inherited and the :meth:`_create_data` method has to be
+ implemented to return the numpy data exposed by the dataset. This factory
+ method is only called once, when the data is needed.
+ """
+
+ def __init__(self, name, parent=None, attrs=None):
+ super(LazyLoadableDataset, self).__init__(name, None, parent, attrs=attrs)
+ self._is_initialized = False
+
+ def _create_data(self):
+ """
+ Factory to create the data exposed by the dataset when it is needed.
+
+ It has to be implemented for the class to work.
+
+ :rtype: numpy.ndarray
+ """
+ raise NotImplementedError()
+
+ def _get_data(self):
+ """Returns the data exposed by the dataset.
+
+ Overwrite Dataset method :meth:`_get_data` to implement the lazy
+ loading feature.
+
+ :rtype: numpy.ndarray
+ """
+ if not self._is_initialized:
+ data = self._create_data()
+ # is_initialized before set_data to avoid infinit initialization
+ # is case of wrong check of the data
+ self._is_initialized = True
+ self._set_data(data)
+ return super(LazyLoadableDataset, self)._get_data()
+
+
+class SoftLink(Node):
+ """This class is a tree node that mimics a *h5py.Softlink*.
+
+ In this implementation, the path to the target must be absolute.
+ """
+ def __init__(self, name, path, parent=None):
+ assert str(path).startswith("/") # TODO: h5py also allows a relative path
+
+ Node.__init__(self, name, parent)
+
+ # attr target defined for spech5 backward compatibility
+ self.target = str(path)
+
+ @property
+ def h5py_class(self):
+ """Returns the h5py class which is mimicked by this class
+ (:class:`h5py.SoftLink`).
+
+ :rtype: Class
+ """
+ return h5py.SoftLink
+
+ @property
+ def path(self):
+ """Soft link value. Not guaranteed to be a valid path."""
+ return self.target
+
+
+class Group(Node):
+ """This class mimics a `h5py.Group`."""
+
+ def __init__(self, name, parent=None, attrs=None):
+ Node.__init__(self, name, parent, attrs=attrs)
+ self.__items = collections.OrderedDict()
+
+ def _get_items(self):
+ """Returns the child items as a name-node dictionary.
+
+ :rtype: dict
+ """
+ return self.__items
+
+ def add_node(self, node):
+ """Add a child to this group.
+
+ :param Node node: Child to add to this group
+ """
+ self._get_items()[node.basename] = node
+ node._set_parent(self)
+
+ @property
+ def h5py_class(self):
+ """Returns the h5py classes which is mimicked by this class.
+
+ It returns `h5py.Group`
+
+ :rtype: Class
+ """
+ return h5py.Group
+
+ def _get(self, name, getlink):
+ """If getlink is True and name points to an existing SoftLink, this
+ SoftLink is returned. In all other situations, we try to return a
+ Group or Dataset, or we raise a KeyError if we fail."""
+ if "/" not in name:
+ result = self._get_items()[name]
+ elif name.startswith("/"):
+ root = self.file
+ if name == "/":
+ return root
+ result = root._get(name[1:], getlink)
+ else:
+ path = name.split("/")
+ result = self
+ for item_name in path:
+ if isinstance(result, SoftLink):
+ # traverse links
+ l_name, l_target = result.name, result.path
+ result = result.file.get(l_target)
+ if result is None:
+ raise KeyError(
+ "Unable to open object (broken SoftLink %s -> %s)" %
+ (l_name, l_target))
+ if not item_name:
+ # trailing "/" in name (legal for accessing Groups only)
+ if isinstance(result, Group):
+ continue
+ if not isinstance(result, Group):
+ raise KeyError("Unable to open object (Component not found)")
+ result = result._get_items()[item_name]
+
+ if isinstance(result, SoftLink) and not getlink:
+ link = result
+ target = result.file.get(link.path)
+ if result is None:
+ msg = "Unable to open object (broken SoftLink %s -> %s)"
+ raise KeyError(msg % (link.name, link.path))
+ # Convert SoftLink into typed group/dataset
+ if isinstance(target, Group):
+ result = _LinkToGroup(name=link.basename, target=target, parent=link.parent)
+ elif isinstance(target, Dataset):
+ result = _LinkToDataset(name=link.basename, target=target, parent=link.parent)
+ else:
+ raise TypeError("Unexpected target type %s" % type(target))
+
+ return result
+
+ def get(self, name, default=None, getclass=False, getlink=False):
+ """Retrieve an item or other information.
+
+ If getlink only is true, the returned value is always `h5py.HardLink`,
+ because this implementation do not use links. Like the original
+ implementation.
+
+ :param str name: name of the item
+ :param object default: default value returned if the name is not found
+ :param bool getclass: if true, the returned object is the class of the object found
+ :param bool getlink: if true, links object are returned instead of the target
+ :return: An object, else None
+ :rtype: object
+ """
+ if name not in self:
+ return default
+
+ node = self._get(name, getlink=True)
+ if isinstance(node, SoftLink) and not getlink:
+ # get target
+ try:
+ node = self._get(name, getlink=False)
+ except KeyError:
+ return default
+ elif not isinstance(node, SoftLink) and getlink:
+ # ExternalLink objects don't exist in silx, so it must be a HardLink
+ node = h5py.HardLink()
+
+ if getclass:
+ if hasattr(node, "h5py_class"):
+ obj = node.h5py_class
+ else:
+ obj = node.__class__
+ else:
+ obj = node
+ return obj
+
+ def __setitem__(self, name, obj):
+ """Add an object to the group.
+
+ :param str name: Location on the group to store the object.
+ This path name must not exists.
+ :param object obj: Object to store on the file. According to the type,
+ the behaviour will not be the same.
+
+ - `commonh5.SoftLink`: Create the corresponding link.
+ - `numpy.ndarray`: The array is converted to a dataset object.
+ - `commonh5.Node`: A hard link should be created pointing to the
+ given object. This implementation uses a soft link.
+ If the node do not have parent it is connected to the tree
+ without using a link (that's a hard link behaviour).
+ - other object: Convert first the object with ndarray and then
+ store it. ValueError if the resulting array dtype is not
+ supported.
+ """
+ if name in self:
+ # From the h5py API
+ raise RuntimeError("Unable to create link (name already exists)")
+
+ elements = name.rsplit("/", 1)
+ if len(elements) == 1:
+ parent = self
+ basename = elements[0]
+ else:
+ group_path, basename = elements
+ if group_path in self:
+ parent = self[group_path]
+ else:
+ parent = self.create_group(group_path)
+
+ if isinstance(obj, SoftLink):
+ obj._set_basename(basename)
+ node = obj
+ elif isinstance(obj, Node):
+ if obj.parent is None:
+ obj._set_basename(basename)
+ node = obj
+ else:
+ node = SoftLink(basename, obj.name)
+ elif isinstance(obj, numpy.dtype):
+ node = Dataset(basename, data=obj)
+ elif isinstance(obj, numpy.ndarray):
+ node = Dataset(basename, data=obj)
+ else:
+ data = numpy.array(obj)
+ try:
+ node = Dataset(basename, data=data)
+ except TypeError as e:
+ raise ValueError(e.args[0])
+
+ parent.add_node(node)
+
+ def __getitem__(self, name):
+ """Return a child from his name.
+
+ :param name str: name of a member or a path throug members using '/'
+ separator. A '/' as a prefix access to the root item of the tree.
+ :rtype: Node
+ """
+ if name is None or name == "":
+ raise ValueError("No name")
+ return self._get(name, getlink=False)
+
+ def __contains__(self, name):
+ """Returns true if name is an existing child of this group.
+
+ :rtype: bool
+ """
+ if "/" not in name:
+ return name in self._get_items()
+
+ if name.startswith("/"):
+ # h5py allows to access any valid full path from any group
+ node = self.file
+ else:
+ node = self
+
+ name = name.lstrip("/")
+ basenames = name.split("/")
+ for basename in basenames:
+ if basename.strip() == "":
+ # presence of a trailing "/" in name
+ # (OK for groups, not for datasets)
+ if isinstance(node, SoftLink):
+ # traverse links
+ node = node.file.get(node.path, getlink=False)
+ if node is None:
+ # broken link
+ return False
+ if node.h5py_class == h5py.Dataset:
+ return False
+ continue
+ if basename not in node._get_items():
+ return False
+ node = node[basename]
+
+ return True
+
+ def __len__(self):
+ """Returns the number of children contained in this group.
+
+ :rtype: int
+ """
+ return len(self._get_items())
+
+ def __iter__(self):
+ """Iterate over member names"""
+ for x in self._get_items().__iter__():
+ yield x
+
+ if six.PY2:
+ def keys(self):
+ """Returns a list of the children's names."""
+ return self._get_items().keys()
+
+ def values(self):
+ """Returns a list of the children nodes (groups and datasets).
+
+ .. versionadded:: 0.6
+ """
+ return self._get_items().values()
+
+ def items(self):
+ """Returns a list of tuples containing (name, node) pairs.
+ """
+ return self._get_items().items()
+
+ else:
+ def keys(self):
+ """Returns an iterator over the children's names in a group."""
+ return self._get_items().keys()
+
+ def values(self):
+ """Returns an iterator over the children nodes (groups and datasets)
+ in a group.
+
+ .. versionadded:: 0.6
+ """
+ return self._get_items().values()
+
+ def items(self):
+ """Returns items iterator containing name-node mapping.
+
+ :rtype: iterator
+ """
+ return self._get_items().items()
+
+ def visit(self, func, visit_links=False):
+ """Recursively visit all names in this group and subgroups.
+ See the documentation for `h5py.Group.visit` for more help.
+
+ :param func: Callable (function, method or callable object)
+ :type func: function
+ """
+ origin_name = self.name
+ return self._visit(func, origin_name, visit_links)
+
+ def visititems(self, func, visit_links=False):
+ """Recursively visit names and objects in this group.
+ See the documentation for `h5py.Group.visititems` for more help.
+
+ :param func: Callable (function, method or callable object)
+ :type func: function
+ :param bool visit_links: If *False*, ignore links. If *True*,
+ call `func(name)` for links and recurse into target groups.
+ """
+ origin_name = self.name
+ return self._visit(func, origin_name, visit_links,
+ visititems=True)
+
+ def _visit(self, func, origin_name,
+ visit_links=False, visititems=False):
+ """
+
+ :param origin_name: name of first group that initiated the recursion
+ This is used to compute the relative path from each item's
+ absolute path.
+ """
+ for member in self.values():
+ ret = None
+ if not isinstance(member, SoftLink) or visit_links:
+ relative_name = member.name[len(origin_name):]
+ # remove leading slash and unnecessary trailing slash
+ relative_name = relative_name.strip("/")
+ if visititems:
+ ret = func(relative_name, member)
+ else:
+ ret = func(relative_name)
+ if ret is not None:
+ return ret
+ if isinstance(member, Group):
+ member._visit(func, origin_name, visit_links, visititems)
+
+ def create_group(self, name):
+ """Create and return a new subgroup.
+
+ Name may be absolute or relative. Fails if the target name already
+ exists.
+
+ :param str name: Name of the new group
+ """
+ if not self._is_editable():
+ raise RuntimeError("File is not editable")
+ if name in self:
+ raise ValueError("Unable to create group (name already exists)")
+
+ if name.startswith("/"):
+ name = name[1:]
+ return self.file.create_group(name)
+
+ elements = name.split('/')
+ group = self
+ for basename in elements:
+ if basename in group:
+ group = group[basename]
+ if not isinstance(group, Group):
+ raise RuntimeError("Unable to create group (group parent is missing")
+ else:
+ node = Group(basename)
+ group.add_node(node)
+ group = node
+ return group
+
+ def create_dataset(self, name, shape=None, dtype=None, data=None, **kwds):
+ """Create and return a sub dataset.
+
+ :param str name: Name of the dataset.
+ :param shape: Dataset shape. Use "()" for scalar datasets.
+ Required if "data" isn't provided.
+ :param dtype: Numpy dtype or string.
+ If omitted, dtype('f') will be used.
+ Required if "data" isn't provided; otherwise, overrides data
+ array's dtype.
+ :param numpy.ndarray data: Provide data to initialize the dataset.
+ If used, you can omit shape and dtype arguments.
+ :param kwds: Extra arguments. Nothing yet supported.
+ """
+ if not self._is_editable():
+ raise RuntimeError("File is not editable")
+ if len(kwds) > 0:
+ raise TypeError("Extra args provided, but nothing supported")
+ if "/" in name:
+ raise TypeError("Path are not supported")
+ if data is None:
+ if dtype is None:
+ dtype = numpy.float
+ data = numpy.empty(shape=shape, dtype=dtype)
+ elif dtype is not None:
+ data = data.astype(dtype)
+ dataset = Dataset(name, data)
+ self.add_node(dataset)
+ return dataset
+
+
+class _LinkToGroup(Group):
+ """Virtual group providing link to another group"""
+
+ def __init__(self, name, target, parent=None):
+ Group.__init__(self, name, parent=parent)
+ self.__target = target
+
+ def _get_items(self):
+ return self.__target._get_items()
+
+ @property
+ def attrs(self):
+ return self.__target.attrs
+
+
+class LazyLoadableGroup(Group):
+ """Abstract group which provides a lazy loading of the child.
+
+ The class has to be inherited and the :meth:`_create_child` method has
+ to be implemented to add (:meth:`_add_node`) all children. This factory
+ is only called once, when children are needed.
+ """
+
+ def __init__(self, name, parent=None, attrs=None):
+ Group.__init__(self, name, parent, attrs)
+ self.__is_initialized = False
+
+ def _get_items(self):
+ """Returns the internal structure which contains the children.
+
+ It overwrite method :meth:`_get_items` to implement the lazy
+ loading feature.
+
+ :rtype: dict
+ """
+ if not self.__is_initialized:
+ self.__is_initialized = True
+ self._create_child()
+ return Group._get_items(self)
+
+ def _create_child(self):
+ """
+ Factory to create the child contained by the group when it is needed.
+
+ It has to be implemented to work.
+ """
+ raise NotImplementedError()
+
+
+class File(Group):
+ """This class is the special :class:`Group` that is the root node
+ of the tree structure. It mimics `h5py.File`."""
+
+ def __init__(self, name=None, mode=None, attrs=None):
+ """
+ Constructor
+
+ :param str name: File name if it exists
+ :param str mode: Access mode
+ - "r": Read-only. Methods :meth:`create_dataset` and
+ :meth:`create_group` are locked.
+ - "w": File is editable. Methods :meth:`create_dataset` and
+ :meth:`create_group` are available.
+ :param dict attrs: Default attributes
+ """
+ Group.__init__(self, name="", parent=None, attrs=attrs)
+ self._file_name = name
+ if mode is None:
+ mode = "r"
+ assert(mode in ["r", "w"])
+ self._mode = mode
+
+ @property
+ def filename(self):
+ return self._file_name
+
+ @property
+ def mode(self):
+ return self._mode
+
+ @property
+ def h5py_class(self):
+ """Returns the :class:`h5py.File` class"""
+ return h5py.File
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
+ def close(self):
+ """Close the object, and free up associated resources.
+ """
+ # should be implemented in subclass
+ pass
diff --git a/silx/io/convert.py b/silx/io/convert.py
new file mode 100644
index 0000000..41f1e36
--- /dev/null
+++ b/silx/io/convert.py
@@ -0,0 +1,302 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016-2017 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.
+#
+# ############################################################################*/
+"""This module provides classes and function to convert file formats supported
+by *silx* into HDF5 file. Currently, SPEC file and fabio images are the
+supported formats.
+
+Read the documentation of :mod:`silx.io.spech5` and :mod:`silx.io.fabioh5` for
+information on the structure of the output HDF5 files.
+
+Strings are written to the HDF5 datasets as fixed-length ASCII (NumPy *S* type).
+This is done in order to produce files that have maximum compatibility with
+other HDF5 libraries, as recommended in the
+`h5py documentation <http://docs.h5py.org/en/latest/strings.html#how-to-store-text-strings>`_.
+
+If you read the files back with *h5py* in Python 3, you will recover strings
+as bytes, which you should decode to transform them into python strings::
+
+ >>> import h5py
+ >>> f = h5py.File("myfile.h5")
+ >>> f["/1.1/instrument/specfile/scan_header"][0]
+ b'#S 94 ascan del -0.5 0.5 20 1'
+ >>> f["/1.1/instrument/specfile/scan_header"][0].decode()
+ '#S 94 ascan del -0.5 0.5 20 1'
+
+Arrays of strings, such as file and scan headers, are stored as fixed-length
+strings. The length of all strings in an array is equal to the length of the
+longest string. Shorter strings are right-padded with blank spaces.
+
+.. note:: This module has a dependency on the `h5py <http://www.h5py.org/>`_
+ library, which is not a mandatory dependency for `silx`. You might need
+ to install it if you don't already have it.
+"""
+
+import numpy
+import logging
+
+import silx.io
+from silx.io import is_dataset, is_group, is_softlink
+
+__authors__ = ["P. Knobel"]
+__license__ = "MIT"
+__date__ = "14/09/2017"
+
+_logger = logging.getLogger(__name__)
+
+try:
+ import h5py
+except ImportError as e:
+ _logger.error("Module " + __name__ + " requires h5py")
+ raise e
+
+
+def _create_link(h5f, link_name, target_name,
+ link_type="soft", overwrite_data=False):
+ """Create a link in a HDF5 file
+
+ If member with name ``link_name`` already exists, delete it first or
+ ignore link depending on global param ``overwrite_data``.
+
+ :param h5f: :class:`h5py.File` object
+ :param link_name: Link path
+ :param target_name: Handle for target group or dataset
+ :param str link_type: "soft" or "hard"
+ :param bool overwrite_data: If True, delete existing member (group,
+ dataset or link) with the same name. Default is False.
+ """
+ if link_name not in h5f:
+ _logger.debug("Creating link " + link_name + " -> " + target_name)
+ elif overwrite_data:
+ _logger.warn("Overwriting " + link_name + " with link to " +
+ target_name)
+ del h5f[link_name]
+ else:
+ _logger.warn(link_name + " already exist. Can't create link to " +
+ target_name)
+ return None
+
+ if link_type == "hard":
+ h5f[link_name] = h5f[target_name]
+ elif link_type == "soft":
+ h5f[link_name] = h5py.SoftLink(target_name)
+ else:
+ raise ValueError("link_type must be 'hard' or 'soft'")
+
+
+class Hdf5Writer(object):
+ """Converter class to write the content of a data file to a HDF5 file.
+ """
+ def __init__(self,
+ h5path='/',
+ overwrite_data=False,
+ link_type="soft",
+ create_dataset_args=None,
+ min_size=500):
+ """
+
+ :param h5path: Target path where the scan groups will be written
+ in the output HDF5 file.
+ :param bool overwrite_data:
+ See documentation of :func:`write_to_h5`
+ :param str link_type: ``"hard"`` or ``"soft"`` (default)
+ :param dict create_dataset_args: Dictionary of args you want to pass to
+ ``h5py.File.create_dataset``.
+ See documentation of :func:`write_to_h5`
+ :param int min_size:
+ See documentation of :func:`write_to_h5`
+ """
+ self.h5path = h5path
+ if not h5path.startswith("/"):
+ # target path must be absolute
+ self.h5path = "/" + h5path
+ if not self.h5path.endswith("/"):
+ self.h5path += "/"
+
+ self._h5f = None
+ """h5py.File object, assigned in :meth:`write`"""
+
+ if create_dataset_args is None:
+ create_dataset_args = {}
+ self.create_dataset_args = create_dataset_args
+
+ self.min_size = min_size
+
+ self.overwrite_data = overwrite_data # boolean
+
+ self.link_type = link_type
+ """'soft' or 'hard' """
+
+ self._links = []
+ """List of *(link_path, target_path)* tuples."""
+
+ def write(self, infile, h5f):
+ """Do the conversion from :attr:`sfh5` (Spec file) to *h5f* (HDF5)
+
+ All the parameters needed for the conversion have been initialized
+ in the constructor.
+
+ :param infile: :class:`SpecH5` object
+ :param h5f: :class:`h5py.File` instance
+ """
+ # Recurse through all groups and datasets to add them to the HDF5
+ self._h5f = h5f
+ infile.visititems(self.append_member_to_h5, visit_links=True)
+
+ # Handle the attributes of the root group
+ root_grp = h5f[self.h5path]
+ for key in infile.attrs:
+ if self.overwrite_data or key not in root_grp.attrs:
+ root_grp.attrs.create(key,
+ numpy.string_(infile.attrs[key]))
+
+ # Handle links at the end, when their targets are created
+ for link_name, target_name in self._links:
+ _create_link(self._h5f, link_name, target_name,
+ link_type=self.link_type,
+ overwrite_data=self.overwrite_data)
+ self._links = []
+
+ def append_member_to_h5(self, h5like_name, obj):
+ """Add one group or one dataset to :attr:`h5f`"""
+ h5_name = self.h5path + h5like_name.lstrip("/")
+
+ if is_softlink(obj):
+ # links to be created after all groups and datasets
+ h5_target = self.h5path + obj.path.lstrip("/")
+ self._links.append((h5_name, h5_target))
+
+ elif is_dataset(obj):
+ _logger.debug("Saving dataset: " + h5_name)
+
+ member_initially_exists = h5_name in self._h5f
+
+ if self.overwrite_data and member_initially_exists:
+ _logger.warn("Overwriting dataset: " + h5_name)
+ del self._h5f[h5_name]
+
+ if self.overwrite_data or not member_initially_exists:
+ # fancy arguments don't apply to small dataset
+ if obj.size < self.min_size:
+ ds = self._h5f.create_dataset(h5_name, data=obj.value)
+ else:
+ ds = self._h5f.create_dataset(h5_name, data=obj.value,
+ **self.create_dataset_args)
+ else:
+ ds = self._h5f[h5_name]
+
+ # add HDF5 attributes
+ for key in obj.attrs:
+ if self.overwrite_data or key not in ds.attrs:
+ ds.attrs.create(key, numpy.string_(obj.attrs[key]))
+
+ if not self.overwrite_data and member_initially_exists:
+ _logger.warn("Ignoring existing dataset: " + h5_name)
+
+ elif is_group(obj):
+ if h5_name not in self._h5f:
+ _logger.debug("Creating group: " + h5_name)
+ grp = self._h5f.create_group(h5_name)
+ else:
+ grp = self._h5f[h5_name]
+
+ # add HDF5 attributes
+ for key in obj.attrs:
+ if self.overwrite_data or key not in grp.attrs:
+ grp.attrs.create(key, numpy.string_(obj.attrs[key]))
+
+
+def write_to_h5(infile, h5file, h5path='/', mode="a",
+ overwrite_data=False, link_type="soft",
+ create_dataset_args=None, min_size=500):
+ """Write content of a h5py-like object into a HDF5 file.
+
+ :param infile: Path of input file, or :class:`commonh5.File` object
+ or :class:`commonh5.Group` object
+ :param h5file: Path of output HDF5 file or HDF5 file handle
+ (`h5py.File` object)
+ :param str h5path: Target path in HDF5 file in which scan groups are created.
+ Default is root (``"/"``)
+ :param str mode: Can be ``"r+"`` (read/write, file must exist),
+ ``"w"`` (write, existing file is lost), ``"w-"`` (write, fail
+ if exists) or ``"a"`` (read/write if exists, create otherwise).
+ This parameter is ignored if ``h5file`` is a file handle.
+ :param bool overwrite_data: If ``True``, existing groups and datasets can be
+ overwritten, if ``False`` they are skipped. This parameter is only
+ relevant if ``file_mode`` is ``"r+"`` or ``"a"``.
+ :param str link_type: *"soft"* (default) or *"hard"*
+ :param dict create_dataset_args: Dictionary of args you want to pass to
+ ``h5py.File.create_dataset``. This allows you to specify filters and
+ compression parameters. Don't specify ``name`` and ``data``.
+ These arguments are only applied to datasets larger than 1MB.
+ :param int min_size: Minimum number of elements in a dataset to apply
+ chunking and compression. Default is 500.
+
+ The structure of the spec data in an HDF5 file is described in the
+ documentation of :mod:`silx.io.spech5`.
+ """
+ writer = Hdf5Writer(h5path=h5path,
+ overwrite_data=overwrite_data,
+ link_type=link_type,
+ create_dataset_args=create_dataset_args,
+ min_size=min_size)
+
+ # both infile and h5file can be either file handle or a file name: 4 cases
+ if not isinstance(h5file, h5py.File) and not is_group(infile):
+ with silx.io.open(infile) as h5pylike:
+ with h5py.File(h5file, mode) as h5f:
+ writer.write(h5pylike, h5f)
+ elif isinstance(h5file, h5py.File) and not is_group(infile):
+ with silx.io.open(infile) as h5pylike:
+ writer.write(h5pylike, h5file)
+ elif is_group(infile) and not isinstance(h5file, h5py.File):
+ with h5py.File(h5file, mode) as h5f:
+ writer.write(infile, h5f)
+ else:
+ writer.write(infile, h5file)
+
+
+def convert(infile, h5file, mode="w-", create_dataset_args=None):
+ """Convert a supported file into an HDF5 file, write scans into the
+ root group (``/``).
+
+ This is a convenience shortcut to call::
+
+ write_to_h5(h5like, h5file, h5path='/',
+ mode="w-", link_type="soft")
+
+ :param infile: Path of input file or :class:`commonh5.File` object
+ or :class:`commonh5.Group` object
+ :param h5file: Path of output HDF5 file, or h5py.File object
+ :param mode: Can be ``"w"`` (write, existing file is
+ lost), ``"w-"`` (write, fail if exists). This is ignored
+ if ``h5file`` is a file handle.
+ :param create_dataset_args: Dictionary of args you want to pass to
+ ``h5py.File.create_dataset``. This allows you to specify filters and
+ compression parameters. Don't specify ``name`` and ``data``.
+ """
+ if mode not in ["w", "w-"]:
+ raise IOError("File mode must be 'w' or 'w-'. Use write_to_h5" +
+ " to append data to an existing HDF5 file.")
+ write_to_h5(infile, h5file, h5path='/', mode=mode,
+ create_dataset_args=create_dataset_args)
diff --git a/silx/io/dictdump.py b/silx/io/dictdump.py
index ae7a457..1860b7f 100644
--- a/silx/io/dictdump.py
+++ b/silx/io/dictdump.py
@@ -41,13 +41,13 @@ else:
h5py_missing = False
from .configdict import ConfigDict
-from .utils import is_group, is_file
-
-from silx.io import open as h5open
+from .utils import is_group
+from .utils import is_file as is_h5_file_like
+from .utils import open as h5open
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "10/02/2017"
+__date__ = "16/06/2017"
logger = logging.getLogger(__name__)
@@ -82,6 +82,76 @@ def _prepare_hdf5_dataset(array_like):
return array
+class _SafeH5FileWrite(object):
+ """Context manager returning a :class:`h5py.File` object.
+
+ If this object is initialized with a file path, we open the file
+ and then we close it on exiting.
+
+ If a :class:`h5py.File` instance is provided to :meth:`__init__` rather
+ than a path, we assume that the user is responsible for closing the
+ file.
+
+ This behavior is well suited for handling h5py file in a recursive
+ function. The object is created in the initial call if a path is provided,
+ and it is closed only at the end when all the processing is finished.
+ """
+ def __init__(self, h5file, mode="w"):
+ """
+
+ :param h5file: HDF5 file path or :class:`h5py.File` instance
+ :param str mode: Can be ``"r+"`` (read/write, file must exist),
+ ``"w"`` (write, existing file is lost), ``"w-"`` (write, fail if
+ exists) or ``"a"`` (read/write if exists, create otherwise).
+ This parameter is ignored if ``h5file`` is a file handle.
+ """
+ self.raw_h5file = h5file
+ self.mode = mode
+
+ def __enter__(self):
+ if not isinstance(self.raw_h5file, h5py.File):
+ self.h5file = h5py.File(self.raw_h5file, self.mode)
+ self.close_when_finished = True
+ else:
+ self.h5file = self.raw_h5file
+ self.close_when_finished = False
+ return self.h5file
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ if self.close_when_finished:
+ self.h5file.close()
+
+
+class _SafeH5FileRead(object):
+ """Context manager returning a :class:`h5py.File` or a
+ :class:`silx.io.spech5.SpecH5` or a :class:`silx.io.fabioh5.File` object.
+
+ The general behavior is the same as :class:`_SafeH5FileWrite` except
+ that SPEC files and all formats supported by fabio can also be opened,
+ but in read-only mode.
+ """
+ def __init__(self, h5file):
+ """
+
+ :param h5file: HDF5 file path or h5py.File-like object
+ """
+ self.raw_h5file = h5file
+
+ def __enter__(self):
+ if not is_h5_file_like(self.raw_h5file):
+ self.h5file = h5open(self.raw_h5file)
+ self.close_when_finished = True
+ else:
+ self.h5file = self.raw_h5file
+ self.close_when_finished = False
+
+ return self.h5file
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ if self.close_when_finished:
+ self.h5file.close()
+
+
def dicttoh5(treedict, h5file, h5path='/',
mode="w", overwrite_data=False,
create_dataset_args=None):
@@ -142,40 +212,32 @@ def dicttoh5(treedict, h5file, h5path='/',
if h5py_missing:
raise h5py_import_error
- if not isinstance(h5file, h5py.File):
- h5f = h5py.File(h5file, mode)
- else:
- h5f = h5file
-
if not h5path.endswith("/"):
h5path += "/"
- for key in treedict:
-
- if isinstance(treedict[key], dict) and len(treedict[key]):
- # non-empty group: recurse
- dicttoh5(treedict[key], h5f, h5path + key,
- overwrite_data=overwrite_data,
- create_dataset_args=create_dataset_args)
+ with _SafeH5FileWrite(h5file, mode=mode) as h5f:
+ for key in treedict:
+ if isinstance(treedict[key], dict) and len(treedict[key]):
+ # non-empty group: recurse
+ dicttoh5(treedict[key], h5f, h5path + key,
+ overwrite_data=overwrite_data,
+ create_dataset_args=create_dataset_args)
- elif treedict[key] is None or (isinstance(treedict[key], dict) and
- not len(treedict[key])):
- # Create empty group
- h5f.create_group(h5path + key)
+ elif treedict[key] is None or (isinstance(treedict[key], dict) and
+ not len(treedict[key])):
+ # Create empty group
+ h5f.create_group(h5path + key)
- else:
- ds = _prepare_hdf5_dataset(treedict[key])
- # can't apply filters on scalars (datasets with shape == () )
- if ds.shape == () or create_dataset_args is None:
- h5f.create_dataset(h5path + key,
- data=ds)
else:
- h5f.create_dataset(h5path + key,
- data=ds,
- **create_dataset_args)
-
- if isinstance(h5file, string_types):
- h5f.close()
+ ds = _prepare_hdf5_dataset(treedict[key])
+ # can't apply filters on scalars (datasets with shape == () )
+ if ds.shape == () or create_dataset_args is None:
+ h5f.create_dataset(h5path + key,
+ data=ds)
+ else:
+ h5f.create_dataset(h5path + key,
+ data=ds,
+ **create_dataset_args)
def _name_contains_string_in_list(name, strlist):
@@ -228,26 +290,18 @@ def h5todict(h5file, path="/", exclude_names=None):
if h5py_missing:
raise h5py_import_error
- if not is_file(h5file):
- h5f = h5open(h5file)
- else:
- h5f = h5file
-
- ddict = {}
- for key in h5f[path]:
- if _name_contains_string_in_list(key, exclude_names):
- continue
- if is_group(h5f[path + "/" + key]):
- ddict[key] = h5todict(h5f,
- path + "/" + key,
- exclude_names=exclude_names)
- else:
- # Convert HDF5 dataset to numpy array
- ddict[key] = h5f[path + "/" + key][...]
-
- if not is_file(h5file):
- # close file, if we opened it
- h5f.close()
+ with _SafeH5FileRead(h5file) as h5f:
+ ddict = {}
+ for key in h5f[path]:
+ if _name_contains_string_in_list(key, exclude_names):
+ continue
+ if is_group(h5f[path + "/" + key]):
+ ddict[key] = h5todict(h5f,
+ path + "/" + key,
+ exclude_names=exclude_names)
+ else:
+ # Convert HDF5 dataset to numpy array
+ ddict[key] = h5f[path + "/" + key][...]
return ddict
diff --git a/silx/io/fabioh5.py b/silx/io/fabioh5.py
index 092ac0c..3dfba96 100644
--- a/silx/io/fabioh5.py
+++ b/silx/io/fabioh5.py
@@ -28,472 +28,43 @@
.. note:: This module has a dependency on the `h5py <http://www.h5py.org/>`_
and `fabio <https://github.com/silx-kit/fabio>`_ libraries,
- which are not a mandatory dependencies for `silx`. You might need
- to install it if you don't already have it.
+ which are not mandatory dependencies for `silx`.
+
"""
import collections
-import numpy
-import numbers
+import datetime
import logging
-from silx.third_party import six
-
-_logger = logging.getLogger(__name__)
-
-try:
- import fabio
-except ImportError as e:
- _logger.error("Module %s requires fabio", __name__)
- raise e
-
-try:
- import h5py
-except ImportError as e:
- _logger.error("Module %s requires h5py", __name__)
- raise e
-
-
-class Node(object):
- """Main class for all fabioh5 classes. Help to manage a tree."""
-
- def __init__(self, name, parent=None):
- self.__parent = parent
- self.__basename = name
-
- @property
- def h5py_class(self):
- """Returns the h5py classes which is mimicked by this class. It can be
- one of `h5py.File, h5py.Group` or `h5py.Dataset`
-
- :rtype: Class
- """
- raise NotImplementedError()
-
- @property
- def parent(self):
- """Returns the parent of the node.
-
- :rtype: Node
- """
- return self.__parent
-
- @property
- def file(self):
- """Returns the file node of this node.
-
- :rtype: Node
- """
- node = self
- while node.__parent is not None:
- node = node.__parent
- if isinstance(node, File):
- return node
- else:
- return None
-
- def _set_parent(self, parent):
- """Set the parent of this node.
-
- It do not update the parent object.
-
- :param Node parent: New parent for this node
- """
- self.__parent = parent
-
- @property
- def attrs(self):
- """Returns HDF5 attributes of this node.
-
- :rtype: dict
- """
- return {}
-
- @property
- def name(self):
- """Returns the HDF5 name of this node.
- """
- if self.__parent is None:
- return "/"
- if self.__parent.name == "/":
- return "/" + self.basename
- return self.__parent.name + "/" + self.basename
-
- @property
- def basename(self):
- """Returns the HDF5 basename of this node.
- """
- return self.__basename
-
-
-class Dataset(Node):
- """Class which handle a numpy data as a mimic of a h5py.Dataset.
- """
-
- def __init__(self, name, data, parent=None, attrs=None):
- self.__data = data
- Node.__init__(self, name, parent)
- if attrs is None:
- self.__attrs = {}
- else:
- self.__attrs = attrs
-
- def _set_data(self, data):
- """Set the data exposed by the dataset.
-
- It have to be called only one time before the data is used. It should
- not be edited after use.
-
- :param numpy.ndarray data: Data associated to the dataset
- """
- self.__data = data
-
- def _get_data(self):
- """Returns the exposed data
-
- :rtype: numpy.ndarray
- """
- return self.__data
-
- @property
- def attrs(self):
- """Returns HDF5 attributes of this node.
-
- :rtype: dict
- """
- return self.__attrs
-
- @property
- def h5py_class(self):
- """Returns the h5py classes which is mimicked by this class. It can be
- one of `h5py.File, h5py.Group` or `h5py.Dataset`
-
- :rtype: Class
- """
- return h5py.Dataset
-
- @property
- def dtype(self):
- """Returns the numpy datatype exposed by this dataset.
-
- :rtype: numpy.dtype
- """
- return self._get_data().dtype
-
- @property
- def shape(self):
- """Returns the shape of the data exposed by this dataset.
-
- :rtype: tuple
- """
- if isinstance(self._get_data(), numpy.ndarray):
- return self._get_data().shape
- else:
- return tuple()
-
- @property
- def size(self):
- """Returns the size of the data exposed by this dataset.
-
- :rtype: int
- """
- if isinstance(self._get_data(), numpy.ndarray):
- return self._get_data().size
- else:
- # It is returned as float64 1.0 by h5py
- return numpy.float64(1.0)
-
- def __len__(self):
- """Returns the size of the data exposed by this dataset.
-
- :rtype: int
- """
- if isinstance(self._get_data(), numpy.ndarray):
- return len(self._get_data())
- else:
- # It is returned as float64 1.0 by h5py
- raise TypeError("Attempt to take len() of scalar dataset")
-
- def __getitem__(self, item):
- """Returns the slice of the data exposed by this dataset.
-
- :rtype: numpy.ndarray
- """
- if not isinstance(self._get_data(), numpy.ndarray):
- if item == Ellipsis:
- return numpy.array(self._get_data())
- elif item == tuple():
- return self._get_data()
- else:
- raise ValueError("Scalar can only be reached with an ellipsis or an empty tuple")
- return self._get_data().__getitem__(item)
-
- def __str__(self):
- basename = self.name.split("/")[-1]
- return '<FabIO dataset "%s": shape %s, type "%s">' % \
- (basename, self.shape, self.dtype.str)
-
- def __getslice__(self, i, j):
- """Returns the slice of the data exposed by this dataset.
-
- Deprecated but still in use for python 2.7
-
- :rtype: numpy.ndarray
- """
- return self.__getitem__(slice(i, j, None))
-
- @property
- def value(self):
- """Returns the data exposed by this dataset.
-
- Deprecated by h5py. It is prefered to use indexing `[()]`.
-
- :rtype: numpy.ndarray
- """
- return self._get_data()
-
- @property
- def compression(self):
- """Returns compression as provided by `h5py.Dataset`.
-
- There is no compression."""
- return None
-
- @property
- def compression_opts(self):
- """Returns compression options as provided by `h5py.Dataset`.
-
- There is no compression."""
- return None
-
- @property
- def chunks(self):
- """Returns chunks as provided by `h5py.Dataset`.
-
- There is no chunks."""
- return None
-
-
-class LazyLoadableDataset(Dataset):
- """Abstract dataset which provide a lazy loading of the data.
-
- The class have to be inherited and the :meth:`_create_data` have to be
- implemented to return the numpy data exposed by the dataset. This factory
- is only called ones, when the data is needed.
- """
-
- def __init__(self, name, parent=None, attrs=None):
- super(LazyLoadableDataset, self).__init__(name, None, parent, attrs=attrs)
- self.__is_initialized = False
-
- def _create_data(self):
- """
- Factory to create the data exposed by the dataset when it is needed.
-
- It have to be implemented to work.
-
- :rtype: numpy.ndarray
- """
- raise NotImplementedError()
-
- def _get_data(self):
- """Returns the data exposed by the dataset.
-
- Overwrite Dataset method :meth:`_get_data` to implement the lazy
- loading feature.
-
- :rtype: numpy.ndarray
- """
- if not self.__is_initialized:
- data = self._create_data()
- self._set_data(data)
- self.__is_initialized = True
- return super(LazyLoadableDataset, self)._get_data()
-
-
-class Group(Node):
- """Class which mimic a `h5py.Group`."""
-
- def __init__(self, name, parent=None, attrs=None):
- Node.__init__(self, name, parent)
- self.__items = collections.OrderedDict()
- if attrs is None:
- attrs = {}
- self.__attrs = attrs
-
- def _get_items(self):
- """Returns the child items as a name-node dictionary.
-
- :rtype: dict
- """
- return self.__items
-
- def add_node(self, node):
- """Add a child to this group.
-
- :param Node node: Child to add to this group
- """
- self._get_items()[node.basename] = node
- node._set_parent(self)
-
- @property
- def h5py_class(self):
- """Returns the h5py classes which is mimicked by this class.
-
- It returns `h5py.Group`
-
- :rtype: Class
- """
- return h5py.Group
-
- @property
- def attrs(self):
- """Returns HDF5 attributes of this node.
-
- :rtype: dict
- """
- return self.__attrs
-
- def items(self):
- """Returns items iterator containing name-node mapping.
-
- :rtype: iterator
- """
- return self._get_items().items()
-
- def get(self, name, default=None, getclass=False, getlink=False):
- """ Retrieve an item or other information.
-
- If getlink only is true, the returned value is always HardLink
- cause this implementation do not use links. Like the original
- implementation.
-
- :param str name: name of the item
- :param object default: default value returned if the name is not found
- :param bool getclass: if true, the returned object is the class of the object found
- :param bool getlink: if true, links object are returned instead of the target
- :return: An object, else None
- :rtype: object
- """
- if name not in self._get_items():
- return default
-
- if getlink:
- node = h5py.HardLink()
- else:
- node = self._get_items()[name]
-
- if getclass:
- obj = node.h5py_class
- else:
- obj = node
- return obj
-
- def __len__(self):
- """Returns the number of child contained in this group.
-
- :rtype: int
- """
- return len(self._get_items())
-
- def __iter__(self):
- """Iterate over member names"""
- for x in self._get_items().__iter__():
- yield x
-
- def __getitem__(self, name):
- """Return a child from is name.
-
- :param name str: name of a member or a path throug members using '/'
- separator. A '/' as a prefix access to the root item of the tree.
- :rtype: Node
- """
-
- if name is None or name == "":
- raise ValueError("No name")
-
- if "/" not in name:
- return self._get_items()[name]
-
- if name.startswith("/"):
- root = self
- while root.parent is not None:
- root = root.parent
- if name == "/":
- return root
- return root[name[1:]]
-
- path = name.split("/")
- result = self
- for item_name in path:
- if not isinstance(result, Group):
- raise KeyError("Unable to open object (Component not found)")
- result = result._get_items()[item_name]
-
- return result
-
- def __contains__(self, name):
- """Returns true is a name is an existing child of this group.
-
- :rtype: bool
- """
- return name in self._get_items()
-
- def keys(self):
- return self._get_items().keys()
-
-
-class LazyLoadableGroup(Group):
- """Abstract group which provide a lazy loading of the child.
-
- The class have to be inherited and the :meth:`_create_child` have to be
- implemented to add (:meth:`_add_node`) all child. This factory
- is only called ones, when child are needed.
- """
-
- def __init__(self, name, parent=None, attrs=None):
- Group.__init__(self, name, parent, attrs)
- self.__is_initialized = False
-
- def _get_items(self):
- """Returns internal structure which contains child.
-
- It overwrite method :meth:`_get_items` to implement the lazy
- loading feature.
+import numbers
- :rtype: dict
- """
- if not self.__is_initialized:
- self.__is_initialized = True
- self._create_child()
- return Group._get_items(self)
+import fabio
+import numpy
- def _create_child(self):
- """
- Factory to create the child contained by the group when it is needed.
+from . import commonh5
+from silx.third_party import six
+from silx import version as silx_version
- It have to be implemented to work.
- """
- raise NotImplementedError()
+_logger = logging.getLogger(__name__)
-class FrameData(LazyLoadableDataset):
+class FrameData(commonh5.LazyLoadableDataset):
"""Expose a cube of image from a Fabio file using `FabioReader` as
cache."""
def __init__(self, name, fabio_reader, parent=None):
attrs = {"interpretation": "image"}
- LazyLoadableDataset.__init__(self, name, parent, attrs=attrs)
+ commonh5.LazyLoadableDataset.__init__(self, name, parent, attrs=attrs)
self.__fabio_reader = fabio_reader
def _create_data(self):
return self.__fabio_reader.get_data()
-class RawHeaderData(LazyLoadableDataset):
+class RawHeaderData(commonh5.LazyLoadableDataset):
"""Lazy loadable raw header"""
def __init__(self, name, fabio_file, parent=None):
- LazyLoadableDataset.__init__(self, name, parent)
+ commonh5.LazyLoadableDataset.__init__(self, name, parent)
self.__fabio_file = fabio_file
def _create_data(self):
@@ -510,18 +81,18 @@ class RawHeaderData(LazyLoadableDataset):
for key, value in header.items():
data.append("%s: %s" % (str(key), str(value)))
- headers.append(u"\n".join(data))
+ headers.append(u"\n".join(data).encode("utf-8"))
# create the header list
- return numpy.array(headers)
+ return numpy.array(headers, dtype=numpy.string_)
-class MetadataGroup(LazyLoadableGroup):
+class MetadataGroup(commonh5.LazyLoadableGroup):
"""Abstract class for groups containing a reference to a fabio image.
"""
def __init__(self, name, metadata_reader, kind, parent=None, attrs=None):
- LazyLoadableGroup.__init__(self, name, parent, attrs)
+ commonh5.LazyLoadableGroup.__init__(self, name, parent, attrs)
self.__metadata_reader = metadata_reader
self.__kind = kind
@@ -529,7 +100,7 @@ class MetadataGroup(LazyLoadableGroup):
keys = self.__metadata_reader.get_keys(self.__kind)
for name in keys:
data = self.__metadata_reader.get_value(self.__kind, name)
- dataset = Dataset(name, data)
+ dataset = commonh5.Dataset(name, data)
self.add_node(dataset)
@property
@@ -537,14 +108,14 @@ class MetadataGroup(LazyLoadableGroup):
return self.__metadata_reader
-class DetectorGroup(LazyLoadableGroup):
+class DetectorGroup(commonh5.LazyLoadableGroup):
"""Define the detector group (sub group of instrument) using Fabio data.
"""
def __init__(self, name, fabio_reader, parent=None, attrs=None):
if attrs is None:
attrs = {"NX_class": "NXdetector"}
- LazyLoadableGroup.__init__(self, name, parent, attrs)
+ commonh5.LazyLoadableGroup.__init__(self, name, parent, attrs)
self.__fabio_reader = fabio_reader
def _create_child(self):
@@ -558,57 +129,56 @@ class DetectorGroup(LazyLoadableGroup):
self.add_node(others)
-class ImageGroup(LazyLoadableGroup):
+class ImageGroup(commonh5.LazyLoadableGroup):
"""Define the image group (sub group of measurement) using Fabio data.
"""
def __init__(self, name, fabio_reader, parent=None, attrs=None):
- LazyLoadableGroup.__init__(self, name, parent, attrs)
+ commonh5.LazyLoadableGroup.__init__(self, name, parent, attrs)
self.__fabio_reader = fabio_reader
def _create_child(self):
- data = FrameData("data", self.__fabio_reader)
+ basepath = self.parent.parent.name
+ data = commonh5.SoftLink("data", path=basepath + "/instrument/detector_0/data")
self.add_node(data)
-
- # TODO detector should be a real soft-link
- detector = DetectorGroup("info", self.__fabio_reader)
+ detector = commonh5.SoftLink("info", path=basepath + "/instrument/detector_0")
self.add_node(detector)
-class SampleGroup(LazyLoadableGroup):
+class SampleGroup(commonh5.LazyLoadableGroup):
"""Define the image group (sub group of measurement) using Fabio data.
"""
def __init__(self, name, fabio_reader, parent=None):
attrs = {"NXclass": "NXsample"}
- LazyLoadableGroup.__init__(self, name, parent, attrs)
+ commonh5.LazyLoadableGroup.__init__(self, name, parent, attrs)
self.__fabio_reader = fabio_reader
def _create_child(self):
if self.__fabio_reader.has_ub_matrix():
scalar = {"interpretation": "scalar"}
data = self.__fabio_reader.get_unit_cell_abc()
- data = Dataset("unit_cell_abc", data, attrs=scalar)
+ data = commonh5.Dataset("unit_cell_abc", data, attrs=scalar)
self.add_node(data)
unit_cell_data = numpy.zeros((1, 6), numpy.float32)
unit_cell_data[0, :3] = data
data = self.__fabio_reader.get_unit_cell_alphabetagamma()
- data = Dataset("unit_cell_alphabetagamma", data, attrs=scalar)
+ data = commonh5.Dataset("unit_cell_alphabetagamma", data, attrs=scalar)
self.add_node(data)
unit_cell_data[0, 3:] = data
- data = Dataset("unit_cell", unit_cell_data, attrs=scalar)
+ data = commonh5.Dataset("unit_cell", unit_cell_data, attrs=scalar)
self.add_node(data)
data = self.__fabio_reader.get_ub_matrix()
- data = Dataset("ub_matrix", data, attrs=scalar)
+ data = commonh5.Dataset("ub_matrix", data, attrs=scalar)
self.add_node(data)
-class MeasurementGroup(LazyLoadableGroup):
+class MeasurementGroup(commonh5.LazyLoadableGroup):
"""Define the measurement group for fabio file.
"""
def __init__(self, name, fabio_reader, parent=None, attrs=None):
- LazyLoadableGroup.__init__(self, name, parent, attrs)
+ commonh5.LazyLoadableGroup.__init__(self, name, parent, attrs)
self.__fabio_reader = fabio_reader
def _create_child(self):
@@ -628,7 +198,7 @@ class MeasurementGroup(LazyLoadableGroup):
# add all counters
for name in keys:
data = self.__fabio_reader.get_value(FabioReader.COUNTER, name)
- dataset = Dataset(name, data)
+ dataset = commonh5.Dataset(name, data)
self.add_node(dataset)
@@ -667,22 +237,29 @@ class FabioReader(object):
image = self.__fabio_file.getframe(frame).data
images.append(image)
+ # returns the data without extra dim in case of single frame
+ if len(images) == 1:
+ return images[0]
+
# get the max size
- max_shape = [0, 0]
+ max_dim = max([i.ndim for i in images])
+ max_shape = [0] * max_dim
for image in images:
- if image.shape[0] > max_shape[0]:
- max_shape[0] = image.shape[0]
- if image.shape[1] > max_shape[1]:
- max_shape[1] = image.shape[1]
+ for dim in range(image.ndim):
+ if image.shape[dim] > max_shape[dim]:
+ max_shape[dim] = image.shape[dim]
max_shape = tuple(max_shape)
# fix smallest images
for index, image in enumerate(images):
if image.shape == max_shape:
continue
- right_image = numpy.zeros(max_shape)
- right_image[0:image.shape[0], 0:image.shape[1]] = image
- images[index] = right_image
+ location = [slice(0, i) for i in image.shape]
+ while len(location) < max_dim:
+ location.append(0)
+ normalized_image = numpy.zeros(max_shape, dtype=image.dtype)
+ normalized_image[location] = image
+ images[index] = normalized_image
# create a cube
return numpy.array(images)
@@ -1058,7 +635,7 @@ class EdfFabioReader(FabioReader):
return self.__ub_matrix
-class File(Group):
+class File(commonh5.File):
"""Class which handle a fabio image as a mimick of a h5py.File.
"""
@@ -1071,7 +648,12 @@ class File(Group):
self.__must_be_closed = True
elif fabio_image is not None:
self.__fabio_image = fabio_image
- Group.__init__(self, name="", parent=None, attrs={"NX_class": "NXroot"})
+ file_name = self.__fabio_image.filename
+ attrs = {"NX_class": "NXroot",
+ "file_time": datetime.datetime.now().isoformat(),
+ "file_name": file_name,
+ "creator": "silx %s" % silx_version}
+ commonh5.File.__init__(self, name=file_name, attrs=attrs)
self.__fabio_reader = self.create_fabio_reader(self.__fabio_image)
scan = self.create_scan_group(self.__fabio_image, self.__fabio_reader)
self.add_node(scan)
@@ -1081,13 +663,13 @@ class File(Group):
:param FabioImage fabio_image: A Fabio image
:param FabioReader fabio_reader: A reader for the Fabio image
- :rtype: Group
+ :rtype: commonh5.Group
"""
- scan = Group("scan_0", attrs={"NX_class": "NXentry"})
- instrument = Group("instrument", attrs={"NX_class": "NXinstrument"})
+ scan = commonh5.Group("scan_0", attrs={"NX_class": "NXentry"})
+ instrument = commonh5.Group("instrument", attrs={"NX_class": "NXinstrument"})
measurement = MeasurementGroup("measurement", fabio_reader, attrs={"NX_class": "NXcollection"})
- file_ = Group("file", attrs={"NX_class": "NXcollection"})
+ file_ = commonh5.Group("file", attrs={"NX_class": "NXcollection"})
positioners = MetadataGroup("positioners", fabio_reader, FabioReader.POSITIONER, attrs={"NX_class": "NXpositioner"})
raw_header = RawHeaderData("scan_header", fabio_image, self)
detector = DetectorGroup("detector_0", fabio_reader)
@@ -1115,29 +697,6 @@ class File(Group):
metadata = FabioReader(fabio_file)
return metadata
- @property
- def h5py_class(self):
- return h5py.File
-
- @property
- def filename(self):
- return self.__fabio_image.filename
-
- def __enter__(self):
- return self
-
- def __exit__(self, type, value, tb): # pylint: disable=W0622
- """Called at the end of a `with` statement.
-
- It will close the internal FabioImage only if the FabioImage was
- created by the class itself. The reference to the FabioImage is anyway
- broken.
- """
- if self.__must_be_closed:
- self.close()
- else:
- self.__fabio_image = None
-
def close(self):
"""Close the object, and free up associated resources.
@@ -1146,6 +705,8 @@ class File(Group):
After calling this method, attempts to use the object may fail.
"""
- # It looks like there is no close on FabioImage
- # self.__fabio_image.close()
+ if self.__must_be_closed:
+ # It looks like there is no close on FabioImage
+ # self.__fabio_image.close()
+ pass
self.__fabio_image = None
diff --git a/silx/io/nxdata.py b/silx/io/nxdata.py
index c0e53fc..977721f 100644
--- a/silx/io/nxdata.py
+++ b/silx/io/nxdata.py
@@ -55,7 +55,7 @@ def _nxdata_warning(msg):
_logger.warning("NXdata warning: " + msg)
-def _get_attr(item, attr_name, default=None):
+def get_attr_as_string(item, attr_name, default=None):
"""Return item.attrs[attr_name]. If it is a byte-string or an array of
byte-strings, return it as a default python string.
@@ -72,12 +72,12 @@ def _get_attr(item, attr_name, default=None):
if six.PY3:
if hasattr(attr, "decode"):
# byte-string
- return attr.decode("ascii")
+ return attr.decode("utf-8")
elif isinstance(attr, numpy.ndarray) and hasattr(attr[0], "decode"):
- # array of byte-strinqs
- return [element.decode("ascii") for element in attr]
+ # array of byte-strings
+ return [element.decode("utf-8") for element in attr]
else:
- # attr is not a byte-strinq
+ # attr is not a byte-string
return attr
@@ -97,65 +97,65 @@ def is_valid_nxdata(group): # noqa
"""
if not is_group(group):
raise TypeError("group must be a h5py-like group")
- if _get_attr(group, "NX_class") != "NXdata":
+ if get_attr_as_string(group, "NX_class") != "NXdata":
return False
if "signal" not in group.attrs:
_logger.warning("NXdata group does not define a signal attr.")
return False
- signal_name = _get_attr(group, "signal")
+ signal_name = get_attr_as_string(group, "signal")
if signal_name not in group or not is_dataset(group[signal_name]):
_logger.warning(
- "Cannot find signal dataset '%s' in NXdata group" % signal_name)
+ "Cannot find signal dataset '%s' in NXdata group" % signal_name)
return False
ndim = len(group[signal_name].shape)
if "axes" in group.attrs:
- axes_names = _get_attr(group, "axes")
+ axes_names = get_attr_as_string(group, "axes")
if isinstance(axes_names, str):
axes_names = [axes_names]
if 1 < ndim < len(axes_names):
# ndim = 1 and several axes could be a scatter
_nxdata_warning(
- "More @axes defined than there are " +
- "signal dimensions: " +
- "%d axes, %d dimensions." % (len(axes_names), ndim))
+ "More @axes defined than there are " +
+ "signal dimensions: " +
+ "%d axes, %d dimensions." % (len(axes_names), ndim))
return False
# case of less axes than dimensions: number of axes must match
# dimensionality defined by @interpretation
if ndim > len(axes_names):
- interpretation = _get_attr(group[signal_name], "interpretation", None)
+ interpretation = get_attr_as_string(group[signal_name], "interpretation")
if interpretation is None:
- interpretation = _get_attr(group, "interpretation", None)
+ interpretation = get_attr_as_string(group, "interpretation")
if interpretation is None:
_nxdata_warning("No @interpretation and not enough" +
- " @axes defined.")
+ " @axes defined.")
return False
if interpretation not in _INTERPDIM:
_nxdata_warning("Unrecognized @interpretation=" + interpretation +
- " for data with wrong number of defined @axes.")
+ " for data with wrong number of defined @axes.")
return False
if len(axes_names) != _INTERPDIM[interpretation]:
_nxdata_warning(
- "%d-D signal with @interpretation=%s " % (ndim, interpretation) +
- "must define %d or %d axes." % (ndim, _INTERPDIM[interpretation]))
+ "%d-D signal with @interpretation=%s " % (ndim, interpretation) +
+ "must define %d or %d axes." % (ndim, _INTERPDIM[interpretation]))
return False
# Test consistency of @uncertainties
- uncertainties_names = _get_attr(group, "uncertainties")
+ uncertainties_names = get_attr_as_string(group, "uncertainties")
if uncertainties_names is None:
- uncertainties_names = _get_attr(group[signal_name], "uncertainties")
+ uncertainties_names = get_attr_as_string(group[signal_name], "uncertainties")
if isinstance(uncertainties_names, str):
uncertainties_names = [uncertainties_names]
if uncertainties_names is not None:
if len(uncertainties_names) != len(axes_names):
_nxdata_warning("@uncertainties does not define the same " +
- "number of fields than @axes")
+ "number of fields than @axes")
return False
# Test individual axes
@@ -180,22 +180,22 @@ def is_valid_nxdata(group): # noqa
# size is exactly the signal's size (weird n-d scatter)
if axis_size != signal_size:
_nxdata_warning("Axis %s is not a 1D dataset" % axis_name +
- " and its shape does not match the signal's shape")
+ " and its shape does not match the signal's shape")
return False
axis_len = axis_size
else:
# for a 1-d axis,
- fg_idx = _get_attr(group[axis_name], "first_good", 0)
- lg_idx = _get_attr(group[axis_name], "last_good", len(group[axis_name]) - 1)
+ fg_idx = group[axis_name].attrs.get("first_good", 0)
+ lg_idx = group[axis_name].attrs.get("last_good", len(group[axis_name]) - 1)
axis_len = lg_idx + 1 - fg_idx
if axis_len != signal_size:
if axis_len not in group[signal_name].shape + (1, 2):
_nxdata_warning(
- "Axis %s number of elements does not " % axis_name +
- "correspond to the length of any signal dimension,"
- " it does not appear to be a constant or a linear calibration," +
- " and this does not seem to be a scatter plot.")
+ "Axis %s number of elements does not " % axis_name +
+ "correspond to the length of any signal dimension,"
+ " it does not appear to be a constant or a linear calibration," +
+ " and this does not seem to be a scatter plot.")
return False
elif axis_len in (1, 2):
polynomial_axes_names.append(axis_name)
@@ -203,9 +203,9 @@ def is_valid_nxdata(group): # noqa
else:
if not is_scatter:
_nxdata_warning(
- "Axis %s number of elements is equal " % axis_name +
- "to the length of the signal, but this does not seem" +
- " to be a scatter (other axes have different sizes)")
+ "Axis %s number of elements is equal " % axis_name +
+ "to the length of the signal, but this does not seem" +
+ " to be a scatter (other axes have different sizes)")
return False
# Test individual uncertainties
@@ -223,7 +223,7 @@ def is_valid_nxdata(group): # noqa
if "errors" in group and is_dataset(group["errors"]):
if group["errors"].shape != group[signal_name].shape:
_nxdata_warning("Dataset containing standard deviations must " +
- "have the same dimensions as the signal.")
+ "have the same dimensions as the signal.")
return False
return True
@@ -245,7 +245,7 @@ class NXdata(object):
"""h5py-like group object compliant with NeXus NXdata specification.
"""
- self.signal = self.group[self.group.attrs["signal"]]
+ self.signal = self.group[get_attr_as_string(self.group, "signal")]
"""Signal dataset in this NXdata group.
"""
@@ -268,7 +268,7 @@ class NXdata(object):
# check if axis dataset defines @long_name
for i, dsname in enumerate(self.axes_dataset_names):
if dsname is not None and "long_name" in self.group[dsname].attrs:
- self.axes_names.append(self.group[dsname].attrs["long_name"])
+ self.axes_names.append(get_attr_as_string(self.group[dsname], "long_name"))
else:
self.axes_names.append(dsname)
@@ -303,9 +303,9 @@ class NXdata(object):
# "rgba-image", "hsla-image", "cmyk-image" # TODO
"vertex"]
- interpretation = _get_attr(self.signal, "interpretation", None)
+ interpretation = get_attr_as_string(self.signal, "interpretation")
if interpretation is None:
- interpretation = _get_attr(self.group, "interpretation", None)
+ interpretation = get_attr_as_string(self.group, "interpretation")
if interpretation not in allowed_interpretations:
_logger.warning("Interpretation %s is not valid." % interpretation +
@@ -347,7 +347,7 @@ class NXdata(object):
# use cache
return self._axes
ndims = len(self.signal.shape)
- axes_names = _get_attr(self.group, "axes")
+ axes_names = get_attr_as_string(self.group, "axes")
interpretation = self.interpretation
if axes_names is None:
@@ -386,8 +386,8 @@ class NXdata(object):
continue
if "first_good" not in axis.attrs and "last_good" not in axis.attrs:
continue
- fg_idx = _get_attr(axis, "first_good") or 0
- lg_idx = _get_attr(axis, "last_good") or (len(axis) - 1)
+ fg_idx = axis.attrs.get("first_good", 0)
+ lg_idx = axis.attrs.get("last_good", len(axis) - 1)
axes[i] = axis[fg_idx:lg_idx + 1]
self._axes = axes
@@ -403,9 +403,9 @@ class NXdata(object):
"." in that position in the *@axes* array), `None` is inserted in the
output list in its position.
"""
- axes_dataset_names = _get_attr(self.group, "axes")
+ axes_dataset_names = get_attr_as_string(self.group, "axes")
if axes_dataset_names is None:
- axes_dataset_names = _get_attr(self.group, "axes")
+ axes_dataset_names = get_attr_as_string(self.group, "axes")
ndims = len(self.signal.shape)
if axes_dataset_names is None:
@@ -415,6 +415,8 @@ class NXdata(object):
axes_dataset_names = [axes_dataset_names]
for i, axis_name in enumerate(axes_dataset_names):
+ if hasattr(axis_name, "decode"):
+ axis_name = axis_name.decode()
if axis_name == ".":
axes_dataset_names[i] = None
@@ -442,10 +444,13 @@ class NXdata(object):
:return: Dataset with axis errors, or None
:raise: KeyError if this group does not contain a dataset named axis_name
"""
+ # ensure axis_name is decoded, before comparing it with decoded attributes
+ if hasattr(axis_name, "decode"):
+ axis_name = axis_name.decode("utf-8")
if axis_name not in self.group:
# tolerate axis_name given as @long_name
for item in self.group:
- long_name = _get_attr(self.group[item], "long_name")
+ long_name = get_attr_as_string(self.group[item], "long_name")
if long_name is not None and long_name == axis_name:
axis_name = item
break
@@ -455,37 +460,40 @@ class NXdata(object):
len_axis = len(self.group[axis_name])
- fg_idx = _get_attr(self.group[axis_name], "first_good", 0)
- lg_idx = _get_attr(self.group[axis_name], "last_good", len_axis - 1)
+ fg_idx = self.group[axis_name].attrs.get("first_good", 0)
+ lg_idx = self.group[axis_name].attrs.get("last_good", len_axis - 1)
# case of axisname_errors dataset present
errors_name = axis_name + "_errors"
if errors_name in self.group and is_dataset(self.group[errors_name]):
- if fg_idx != 0 or lg_idx != (len_axis-1):
+ if fg_idx != 0 or lg_idx != (len_axis - 1):
return self.group[errors_name][fg_idx:lg_idx + 1]
else:
return self.group[errors_name]
# case of uncertainties dataset name provided in @uncertainties
- uncertainties_names = _get_attr(self.group, "uncertainties")
+ uncertainties_names = get_attr_as_string(self.group, "uncertainties")
if uncertainties_names is None:
- uncertainties_names = _get_attr(self.signal, "uncertainties")
+ uncertainties_names = get_attr_as_string(self.signal, "uncertainties")
if isinstance(uncertainties_names, str):
uncertainties_names = [uncertainties_names]
if uncertainties_names is not None:
# take the uncertainty with the same index as the axis in @axes
- axes_ds_names = _get_attr(self.group, "axes")
+ axes_ds_names = get_attr_as_string(self.group, "axes")
if axes_ds_names is None:
- axes_ds_names = _get_attr(self.signal, "axes")
+ axes_ds_names = get_attr_as_string(self.signal, "axes")
if isinstance(axes_ds_names, str):
axes_ds_names = [axes_ds_names]
- elif not isinstance(axes_ds_names, list):
- # transform numpy.ndarray(dtype('S21')) into list(str)
- axes_ds_names = map(str, axes_ds_names)
+ elif isinstance(axes_ds_names, numpy.ndarray):
+ # transform numpy.ndarray into list
+ axes_ds_names = list(axes_ds_names)
+ assert isinstance(axes_ds_names, list)
+ if hasattr(axes_ds_names[0], "decode"):
+ axes_ds_names = [ax_name.decode("utf-8") for ax_name in axes_ds_names]
if axis_name not in axes_ds_names:
raise KeyError("group attr @axes does not mention a dataset " +
"named '%s'" % axis_name)
errors = self.group[uncertainties_names[list(axes_ds_names).index(axis_name)]]
- if fg_idx == 0 and lg_idx == (len_axis-1):
+ if fg_idx == 0 and lg_idx == (len_axis - 1):
return errors # dataset
else:
return errors[fg_idx:lg_idx + 1] # numpy array
diff --git a/silx/io/rawh5.py b/silx/io/rawh5.py
new file mode 100644
index 0000000..ceabbdb
--- /dev/null
+++ b/silx/io/rawh5.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016-2017 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.
+#
+# ############################################################################*/
+"""
+This module contains wrapper from file format to h5py. The exposed layout is
+as close as possible to the original file format.
+"""
+import numpy
+from . import commonh5
+import logging
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "21/09/2017"
+
+
+_logger = logging.getLogger(__name__)
+
+
+class _FreeDataset(commonh5.Dataset):
+
+ def _check_data(self, data):
+ """Release the constriants checked on types cause we can reach more
+ types than the one available on h5py, and it is not supposed to be
+ converted into h5py."""
+ chartype = data.dtype.char
+ if chartype in ["U", "O"]:
+ msg = "Dataset '%s' uses an unsupported type '%s'."
+ msg = msg % (self.name, data.dtype)
+ _logger.warning(msg)
+
+
+class NumpyFile(commonh5.File):
+ """
+ Expose a numpy file `npy`, or `npz` as an h5py.File-like.
+
+ :param str name: Filename to load
+ """
+ def __init__(self, name=None):
+ commonh5.File.__init__(self, name=name, mode="w")
+ np_file = numpy.load(name)
+ if hasattr(np_file, "close"):
+ # For npz (created using by numpy.savez, numpy.savez_compressed)
+ for key, value in np_file.items():
+ self[key] = _FreeDataset(None, data=value)
+ np_file.close()
+ else:
+ # For npy (created using numpy.save)
+ value = np_file
+ dataset = _FreeDataset("data", data=value)
+ self.add_node(dataset)
diff --git a/silx/io/setup.py b/silx/io/setup.py
index 3483bcb..971d358 100644
--- a/silx/io/setup.py
+++ b/silx/io/setup.py
@@ -4,7 +4,7 @@
#
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2017 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
@@ -71,7 +71,7 @@ def configuration(parent_package='', top_path=None):
srcfiles = ['sfheader', 'sfinit', 'sflists', 'sfdata', 'sfindex',
'sflabel', 'sfmca', 'sftools', 'locale_management']
sources = [os.path.join('specfile', 'src', ffile + '.c') for ffile in srcfiles]
- sources.append(os.path.join('specfile', 'specfile.pyx'))
+ sources.append('specfile.pyx')
config.add_extension('specfile',
sources=sources,
diff --git a/silx/io/specfile/specfile.c b/silx/io/specfile.c
index 17e3eb2..e244f3d 100644
--- a/silx/io/specfile/specfile.c
+++ b/silx/io/specfile.c
@@ -1,28 +1,40 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "define_macros": [
+ [
+ "SPECFILE_POSIX",
+ null
+ ]
+ ],
+ "depends": [
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h",
+ "silx/io/specfile/include/SpecFileCython.h"
+ ],
+ "include_dirs": [
+ "silx/io/specfile/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.io.specfile"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +53,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +65,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +281,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +302,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +341,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +367,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,15 +451,11 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__specfile
-#define __PYX_HAVE_API__specfile
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
+#define __PYX_HAVE__silx__io__specfile
+#define __PYX_HAVE_API__silx__io__specfile
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "SpecFileCython.h"
@@ -247,20 +467,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +475,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +519,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +537,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +566,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,11 +646,13 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
+/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
@@ -442,12 +676,12 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "specfile.pyx",
+ "silx/io/specfile.pyx",
"__init__.pxd",
"type.pxd",
};
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":723
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -456,7 +690,7 @@ static const char *__pyx_f[] = {
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -465,7 +699,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -474,7 +708,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -483,7 +717,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -492,7 +726,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -501,7 +735,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -510,7 +744,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -519,7 +753,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -528,7 +762,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -537,7 +771,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -546,7 +780,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
*/
typedef npy_long __pyx_t_5numpy_int_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -555,7 +789,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -564,7 +798,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -573,7 +807,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -582,7 +816,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -591,7 +825,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -600,7 +834,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -609,7 +843,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -618,7 +852,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
*/
typedef npy_double __pyx_t_5numpy_float_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -627,7 +861,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
*/
typedef npy_double __pyx_t_5numpy_double_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -635,6 +869,7 @@ typedef npy_double __pyx_t_5numpy_double_t;
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
@@ -644,7 +879,9 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
@@ -654,14 +891,15 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
-struct __pyx_obj_8specfile_SpecFile;
-struct __pyx_obj_8specfile___pyx_scope_struct____iter__;
-struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__;
+struct __pyx_obj_4silx_2io_8specfile_SpecFile;
+struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__;
+struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -670,7 +908,7 @@ struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__;
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -679,7 +917,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -688,7 +926,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -704,31 +942,30 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
*
* cdef extern from "SpecFileCython.h":
*/
-typedef struct _SpecFile __pyx_t_16specfile_wrapper_SpecFileHandle;
+typedef struct _SpecFile __pyx_t_4silx_2io_16specfile_wrapper_SpecFileHandle;
-/* "specfile.pyx":647
+/* "silx/io/specfile.pyx":644
*
*
* cdef class SpecFile(object): # <<<<<<<<<<<<<<
* """
*
*/
-struct __pyx_obj_8specfile_SpecFile {
+struct __pyx_obj_4silx_2io_8specfile_SpecFile {
PyObject_HEAD
- __pyx_t_16specfile_wrapper_SpecFileHandle *handle;
+ __pyx_t_4silx_2io_16specfile_wrapper_SpecFileHandle *handle;
PyObject *filename;
- int __pyx___open_failed;
};
-/* "specfile.pyx":315
+/* "silx/io/specfile.pyx":314
* mca_index)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* """Return the next MCA data line each time this method is called.
*
*/
-struct __pyx_obj_8specfile___pyx_scope_struct____iter__ {
+struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ {
PyObject_HEAD
Py_ssize_t __pyx_v_mca_index;
PyObject *__pyx_v_self;
@@ -737,21 +974,24 @@ struct __pyx_obj_8specfile___pyx_scope_struct____iter__ {
};
-/* "specfile.pyx":698
+/* "silx/io/specfile.pyx":694
* return specfile_wrapper.SfScanNo(self.handle)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* """Return the next :class:`Scan` in a SpecFile each time this method
* is called.
*/
-struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ {
+struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ {
PyObject_HEAD
Py_ssize_t __pyx_v_scan_index;
- struct __pyx_obj_8specfile_SpecFile *__pyx_v_self;
+ struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self;
Py_ssize_t __pyx_t_0;
Py_ssize_t __pyx_t_1;
};
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -768,19 +1008,19 @@ struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ {
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -803,18 +1043,19 @@ struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ {
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -829,18 +1070,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectSetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
@@ -857,30 +1103,54 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
-static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
+/* PySequenceContains.proto */
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
int result = PySequence_Contains(seq, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -896,15 +1166,20 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
+/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -920,24 +1195,35 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
-#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) : \
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -945,22 +1231,77 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
+#endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* StringJoin.proto */
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
@@ -978,12 +1319,14 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno,
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif
-static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
+/* PyDictContains.proto */
+static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
-#if PY_MAJOR_VERSION >= 3
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
@@ -1003,11 +1346,13 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif
+/* decode_c_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, 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));
+/* decode_bytes.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
PyObject* string, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
@@ -1017,47 +1362,67 @@ static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
start, stop, encoding, errors, decode_func);
}
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) : \
- (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) : \
+/* SetItemInt.proto */
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
+/* IncludeStringH.proto */
#include <string.h>
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
+/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
+/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CyFunction_GetClosure(f) \
+#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
-#define __Pyx_CyFunction_GetClassObj(f) \
+#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
-#define __Pyx_CyFunction_Defaults(type, f) \
+#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
-#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
+#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
@@ -1081,7 +1446,7 @@ typedef struct {
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1097,11 +1462,12 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
-static int __Pyx_CyFunction_init(void);
+static int __pyx_CyFunction_init(void);
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1113,19 +1479,17 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
-
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
+/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
@@ -1138,7 +1502,8 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
@@ -1146,93 +1511,104 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
#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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
#if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(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);
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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);
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
#if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(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);
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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);
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
-#define __Pyx_Generator_USED
-#include <structmember.h>
-#include <frameobject.h>
-typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
+/* CoroutineBase.proto */
+typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
PyObject_HEAD
- __pyx_generator_body_t body;
+ __pyx_coroutine_body_t body;
PyObject *closure;
PyObject *exc_type;
PyObject *exc_value;
@@ -1242,21 +1618,39 @@ typedef struct {
PyObject *yieldfrom;
PyObject *gi_name;
PyObject *gi_qualname;
+ PyObject *gi_modulename;
int resume_label;
char is_running;
-} __pyx_GeneratorObject;
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
- PyObject *closure, PyObject *name, PyObject *qualname);
-static int __pyx_Generator_init(void);
-static int __Pyx_Generator_clear(PyObject* self);
+} __pyx_CoroutineObject;
+static __pyx_CoroutineObject *__Pyx__Coroutine_New(
+ PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name);
+static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif
+/* PatchModuleWithCoroutine.proto */
+static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
+
+/* PatchGeneratorABC.proto */
+static int __Pyx_patch_abc(void);
+
+/* Generator.proto */
+#define __Pyx_Generator_USED
+static PyTypeObject *__pyx_GeneratorType = 0;
+#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
+#define __Pyx_Generator_New(body, closure, name, qualname, module_name)\
+ __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname, module_name)
+static PyObject *__Pyx_Generator_Next(PyObject *self);
+static int __pyx_Generator_init(void);
+
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
@@ -1265,28 +1659,33 @@ static int __Pyx_check_binary_version(void);
#endif
#endif
+/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
+/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
/* Module declarations from 'cpython.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 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
@@ -1298,357 +1697,287 @@ 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*/
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void); /*proto*/
/* Module declarations from 'cython' */
-/* Module declarations from 'specfile_wrapper' */
+/* Module declarations from 'silx.io.specfile_wrapper' */
-/* Module declarations from 'specfile' */
-static PyTypeObject *__pyx_ptype_8specfile_SpecFile = 0;
-static PyTypeObject *__pyx_ptype_8specfile___pyx_scope_struct____iter__ = 0;
-static PyTypeObject *__pyx_ptype_8specfile___pyx_scope_struct_1___iter__ = 0;
-#define __Pyx_MODULE_NAME "specfile"
-int __pyx_module_is_main_specfile = 0;
+/* Module declarations from 'silx.io.specfile' */
+static PyTypeObject *__pyx_ptype_4silx_2io_8specfile_SpecFile = 0;
+static PyTypeObject *__pyx_ptype_4silx_2io_8specfile___pyx_scope_struct____iter__ = 0;
+static PyTypeObject *__pyx_ptype_4silx_2io_8specfile___pyx_scope_struct_1___iter__ = 0;
+#define __Pyx_MODULE_NAME "silx.io.specfile"
+int __pyx_module_is_main_silx__io__specfile = 0;
-/* Implementation of 'specfile' */
-static PyObject *__pyx_builtin_Exception;
+/* Implementation of 'silx.io.specfile' */
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_IOError;
+static PyObject *__pyx_builtin_KeyError;
+static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_map;
static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_open;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_RuntimeError;
-static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scan); /* proto */
-static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_specfile, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_record); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line_index); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */
-static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_); /* proto */
-static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
-static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
-static void __pyx_pf_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_pf_8specfile_8SpecFile_6__len__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_8__iter__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_number, PyObject *__pyx_v_scan_order); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_label); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
-static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_mca_index); /* 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 PyObject *__pyx_tp_new_8specfile_SpecFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_[] = "\n";
-static char __pyx_k_2[] = " {2,}";
-static char __pyx_k_3[] = "3";
-static char __pyx_k_B[] = "B";
-static char __pyx_k_F[] = "#F ";
-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_S[] = "#S ";
-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_w[] = "#(\\w+) *(.*)";
-static char __pyx_k_Zd[] = "Zd";
-static char __pyx_k_Zf[] = "Zf";
-static char __pyx_k_Zg[] = "Zg";
-static char __pyx_k__7[] = "#";
-static char __pyx_k_os[] = "os";
-static char __pyx_k_re[] = "re";
-static char __pyx_k_MCA[] = "MCA";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k__14[] = " ";
-static char __pyx_k__25[] = ".";
-static char __pyx_k__27[] = "', '";
-static char __pyx_k__28[] = "'";
-static char __pyx_k__29[] = "";
-static char __pyx_k_d_d[] = "%d.%d";
-static char __pyx_k_doc[] = "__doc__";
-static char __pyx_k_key[] = "key";
-static char __pyx_k_len[] = "__len__";
-static char __pyx_k_map[] = "map";
-static char __pyx_k_mca[] = "_mca";
-static char __pyx_k_msg[] = "msg";
-static char __pyx_k_ret[] = "ret";
-static char __pyx_k_sub[] = "sub";
-static char __pyx_k_sys[] = "sys";
-static char __pyx_k_w_2[] = "#@(\\w+) *(.*)";
-static char __pyx_k_Scan[] = "Scan";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_data[] = "_data";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_hkey[] = "hkey";
-static char __pyx_k_init[] = "__init__";
-static char __pyx_k_iter[] = "__iter__";
-static char __pyx_k_join[] = "join";
-static char __pyx_k_keys[] = "keys";
-static char __pyx_k_line[] = "line";
-static char __pyx_k_list[] = "_list";
-static char __pyx_k_main[] = "__main__";
-static char __pyx_k_name[] = "name";
-static char __pyx_k_open[] = "open";
-static char __pyx_k_path[] = "path";
-static char __pyx_k_scan[] = "scan";
-static char __pyx_k_self[] = "self";
-static char __pyx_k_send[] = "send";
-static char __pyx_k_stop[] = "stop";
-static char __pyx_k_test[] = "__test__";
-static char __pyx_k_CALIB[] = "CALIB";
-static char __pyx_k_CHANN[] = "CHANN";
-static char __pyx_k_ascii[] = "ascii";
-static char __pyx_k_close[] = "close";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_empty[] = "empty";
-static char __pyx_k_group[] = "group";
-static char __pyx_k_index[] = "index";
-static char __pyx_k_label[] = "label";
-static char __pyx_k_match[] = "match";
-static char __pyx_k_mca_2[] = "mca";
-static char __pyx_k_numpy[] = "numpy";
-static char __pyx_k_order[] = "order";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_shape[] = "shape";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_throw[] = "throw";
-static char __pyx_k_value[] = "value";
-static char __pyx_k_ERRORS[] = "ERRORS";
-static char __pyx_k_append[] = "append";
-static char __pyx_k_data_2[] = "data";
-static char __pyx_k_decode[] = "decode";
-static char __pyx_k_double[] = "double";
-static char __pyx_k_encode[] = "encode";
-static char __pyx_k_header[] = "_header";
-static char __pyx_k_hvalue[] = "hvalue";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_isfile[] = "isfile";
-static char __pyx_k_labels[] = "_labels";
-static char __pyx_k_length[] = "length";
-static char __pyx_k_logger[] = "_logger";
-static char __pyx_k_lstrip[] = "lstrip";
-static char __pyx_k_module[] = "__module__";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_number[] = "number";
-static char __pyx_k_object[] = "object";
-static char __pyx_k_record[] = "record";
-static char __pyx_k_scan_2[] = "_scan";
-static char __pyx_k_search[] = "search";
-static char __pyx_k_string[] = "string_";
-static char __pyx_k_SfError[] = "SfError";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_get_mca[] = "get_mca";
-static char __pyx_k_getitem[] = "__getitem__";
-static char __pyx_k_index_2[] = "_index";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_logging[] = "logging";
-static char __pyx_k_order_2[] = "_order";
-static char __pyx_k_os_path[] = "os.path";
-static char __pyx_k_prepare[] = "__prepare__";
-static char __pyx_k_version[] = "version";
-static char __pyx_k_warning[] = "warning";
-static char __pyx_k_KeyError[] = "KeyError";
-static char __pyx_k_L_header[] = "L_header";
-static char __pyx_k_P_Knobel[] = "P. Knobel";
-static char __pyx_k_Scan_mca[] = "Scan.mca";
-static char __pyx_k_channels[] = "channels";
-static char __pyx_k_filename[] = "filename";
-static char __pyx_k_header_2[] = "header";
-static char __pyx_k_labels_2[] = "labels";
-static char __pyx_k_number_2[] = "_number";
-static char __pyx_k_property[] = "property";
-static char __pyx_k_qualname[] = "__qualname__";
-static char __pyx_k_specfile[] = "_specfile";
-static char __pyx_k_Exception[] = "Exception";
-static char __pyx_k_MCA___len[] = "MCA.__len__";
-static char __pyx_k_Scan_data[] = "Scan.data";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_data_line[] = "data_line";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_getLogger[] = "getLogger";
-static char __pyx_k_increment[] = "increment";
-static char __pyx_k_match_mca[] = "match_mca";
-static char __pyx_k_mca_index[] = "mca_index";
-static char __pyx_k_metaclass[] = "__metaclass__";
-static char __pyx_k_transpose[] = "transpose";
-static char __pyx_k_27_09_2016[] = "27/09/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_MCA___init[] = "MCA.__init__";
-static char __pyx_k_MCA___iter[] = "MCA.__iter__";
-static char __pyx_k_Scan_index[] = "Scan.index";
-static char __pyx_k_Scan_order[] = "Scan.order";
-static char __pyx_k_Valid_keys[] = "\nValid keys: '";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_calib_line[] = "calib_line";
-static char __pyx_k_chann_line[] = "chann_line";
-static char __pyx_k_dictionary[] = "dictionary";
-static char __pyx_k_line_index[] = "line_index";
-static char __pyx_k_scan_index[] = "scan_index";
-static char __pyx_k_scan_order[] = "scan_order";
-static char __pyx_k_specfile_2[] = "specfile";
-static char __pyx_k_startswith[] = "startswith";
-static char __pyx_k_Scan___init[] = "Scan.__init__";
-static char __pyx_k_Scan_header[] = "Scan.header";
-static char __pyx_k_Scan_labels[] = "Scan.labels";
-static char __pyx_k_Scan_number[] = "Scan.number";
-static char __pyx_k_basicConfig[] = "basicConfig";
-static char __pyx_k_calib_lines[] = "calib_lines";
-static char __pyx_k_calibration[] = "calibration";
-static char __pyx_k_chann_lines[] = "chann_lines";
-static char __pyx_k_file_header[] = "file_header";
-static char __pyx_k_is_specfile[] = "is_specfile";
-static char __pyx_k_motor_names[] = "motor_names";
-static char __pyx_k_scan_header[] = "scan_header";
-static char __pyx_k_scan_number[] = "scan_number";
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static char __pyx_k_SfNoMcaError[] = "SfNoMcaError";
-static char __pyx_k_handle_error[] = "_handle_error";
-static char __pyx_k_version_info[] = "version_info";
-static char __pyx_k_MCA___getitem[] = "MCA.__getitem__";
-static char __pyx_k_SfErrFileOpen[] = "SfErrFileOpen";
-static char __pyx_k_SfErrFileRead[] = "SfErrFileRead";
-static char __pyx_k_motor_names_2[] = "_motor_names";
-static char __pyx_k_number_of_mca[] = "number_of_mca";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_Scan_data_line[] = "Scan.data_line";
-static char __pyx_k_SfErrFileClose[] = "SfErrFileClose";
-static char __pyx_k_SfErrFileWrite[] = "SfErrFileWrite";
-static char __pyx_k_SfErrLineEmpty[] = "SfErrLineEmpty";
-static char __pyx_k_parse_channels[] = "_parse_channels";
-static char __pyx_k_SpecFile___iter[] = "SpecFile.__iter__";
-static char __pyx_k_mca_header_dict[] = "mca_header_dict";
-static char __pyx_k_motor_positions[] = "motor_positions";
-static char __pyx_k_SF_ERR_FILE_OPEN[] = "SF_ERR_FILE_OPEN";
-static char __pyx_k_SF_ERR_NO_ERRORS[] = "SF_ERR_NO_ERRORS";
-static char __pyx_k_Scan_file_header[] = "Scan.file_header";
-static char __pyx_k_Scan_motor_names[] = "Scan.motor_names";
-static char __pyx_k_Scan_scan_header[] = "Scan.scan_header";
-static char __pyx_k_SfErrColNotFound[] = "SfErrColNotFound";
-static char __pyx_k_SfErrMcaNotFound[] = "SfErrMcaNotFound";
-static char __pyx_k_SfErrMemoryAlloc[] = "SfErrMemoryAlloc";
-static char __pyx_k_all_calib_values[] = "all_calib_values";
-static char __pyx_k_all_chann_values[] = "all_chann_values";
-static char __pyx_k_file_header_dict[] = "_file_header_dict";
-static char __pyx_k_get_error_string[] = "_get_error_string";
-static char __pyx_k_scan_header_dict[] = "_scan_header_dict";
-static char __pyx_k_SfErrLineNotFound[] = "SfErrLineNotFound";
-static char __pyx_k_SfErrScanNotFound[] = "SfErrScanNotFound";
-static char __pyx_k_SfErrUserNotFound[] = "SfErrUserNotFound";
-static char __pyx_k_file_header_lines[] = "_file_header_lines";
-static char __pyx_k_mca_header_dict_2[] = "_mca_header_dict";
-static char __pyx_k_motor_positions_2[] = "_motor_positions";
-static char __pyx_k_parse_calibration[] = "_parse_calibration";
-static char __pyx_k_scan_header_lines[] = "_scan_header_lines";
-static char __pyx_k_SfErrLabelNotFound[] = "SfErrLabelNotFound";
-static char __pyx_k_SfErrMotorNotFound[] = "SfErrMotorNotFound";
-static char __pyx_k_SfNoMca_returned_1[] = "(SfNoMca returned -1)";
-static char __pyx_k_add_or_concatenate[] = "_add_or_concatenate";
-static char __pyx_k_file_header_dict_2[] = "file_header_dict";
-static char __pyx_k_scan_header_dict_2[] = "scan_header_dict";
-static char __pyx_k_MCA__parse_channels[] = "MCA._parse_channels";
-static char __pyx_k_SfErrHeaderNotFound[] = "SfErrHeaderNotFound";
-static char __pyx_k_data_column_by_name[] = "data_column_by_name";
-static char __pyx_k_string_to_char_star[] = "_string_to_char_star";
-static char __pyx_k_Scan_mca_header_dict[] = "Scan.mca_header_dict";
-static char __pyx_k_Scan_motor_positions[] = "Scan.motor_positions";
-static char __pyx_k_record_exists_in_hdr[] = "record_exists_in_hdr";
-static char __pyx_k_SF_ERR_SCAN_NOT_FOUND[] = "SF_ERR_SCAN_NOT_FOUND";
-static char __pyx_k_Scan_file_header_dict[] = "Scan.file_header_dict";
-static char __pyx_k_Scan_scan_header_dict[] = "Scan.scan_header_dict";
-static char __pyx_k_SfErrPositionNotFound[] = "SfErrPositionNotFound";
-static char __pyx_k_one_line_calib_values[] = "one_line_calib_values";
-static char __pyx_k_one_line_chann_values[] = "one_line_chann_values";
-static char __pyx_k_MCA__parse_calibration[] = "MCA._parse_calibration";
-static char __pyx_k_motor_position_by_name[] = "motor_position_by_name";
-static char __pyx_k_Scan_data_column_by_name[] = "Scan.data_column_by_name";
-static char __pyx_k_Scan_record_exists_in_hdr[] = "Scan.record_exists_in_hdr";
-static char __pyx_k_Scan_motor_position_by_name[] = "Scan.motor_position_by_name";
-static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
-static char __pyx_k_Error_while_closing_SpecFile[] = "Error while closing SpecFile";
-static char __pyx_k_number_and_M_the_order_eg_2_3[] = " number and M the order (eg '2.3').";
-static char __pyx_k_MCA_index_must_be_in_range_0_d[] = "MCA index must be in range 0-%d";
-static char __pyx_k_param_specfile_Parent_SpecFile[] = "\n\n :param specfile: Parent SpecFile from which this scan is extracted.\n :type specfile: :class:`SpecFile`\n :param scan_index: Unique index defining the scan in the SpecFile\n :type scan_index: int\n\n Interface to access a SpecFile scan\n\n A scan is a block of descriptive header lines followed by a 2D data array.\n\n Following three ways of accessing a scan are equivalent::\n\n sf = SpecFile(\"/path/to/specfile.dat\")\n\n # Explicit class instantiation\n scan2 = Scan(sf, scan_index=2)\n\n # 0-based index on a SpecFile object\n scan2 = sf[2]\n\n # Using a \"n.m\" key (scan number starting with 1, scan order)\n scan2 = sf[\"3.1\"]\n ";
-static char __pyx_k_users_payno_Documents_dev_esrf[] = "/users/payno/Documents/dev/esrf/silx/paynoSilx/silx/silx/io/specfile/specfile.pyx";
-static char __pyx_k_Base_exception_inherited_by_all[] = "Base exception inherited by all exceptions raised when a\n C function from the legacy SpecFile library returns an error\n code.\n ";
-static char __pyx_k_Scan_index_must_be_in_range_0_d[] = "Scan index must be in range 0-%d";
-static char __pyx_k_The_scan_identification_key_can[] = "The scan identification key can be an integer representing ";
-static char __pyx_k_This_module_is_a_cython_binding[] = "\nThis module is a cython binding to wrap the C SpecFile library, to access\nSpecFile data within a python program.\n\nDocumentation for the original C library SpecFile can be found on the ESRF\nwebsite:\n`The manual for the SpecFile Library <http://www.esrf.eu/files/live/sites/www/files/Instrumentation/software/beamline-control/BLISS/documentation/SpecFileManual.pdf>`_\n\nExamples\n========\n\nStart by importing :class:`SpecFile` and instantiate it:\n\n.. code-block:: python\n\n from silx.io.specfile import SpecFile\n\n sf = SpecFile(\"test.dat\")\n\nA :class:`SpecFile` instance can be accessed like a dictionary to obtain a\n:class:`Scan` instance.\n\nIf the key is a string representing two values\nseparated by a dot (e.g. ``\"1.2\"``), they will be treated as the scan number\n(``#S`` header line) and the scan order::\n\n # get second occurrence of scan \"#S 1\"\n myscan = sf[\"1.2\"]\n\n # access scan data as a numpy array\n nlines, ncolumns = myscan.data.shape\n\nIf the key is an integer, it will be treated as a 0-based index::\n\n first_scan = sf[0]\n second_scan = sf[1]\n\nIt is also possible to browse through all scans using :class:`SpecFile` as\nan iterator::\n\n for scan in sf:\n print(scan.scan_header_dict['S'])\n\nMCA spectra can be selectively loaded using an instance of :class:`MCA`\nprovided by :class:`Scan`::\n\n # Only one MCA spectrum is loaded in memory\n second_mca = first_scan.mca[1]\n\n # Iterating trough all MCA spectra in a scan:\n for mca_data in first_scan.mca:\n print(sum(mca_data))\n\nClasses\n=======\n\n- :class:`SpecFile`\n- :class:`Scan`\n- :class:`MCA`\n\nExceptions\n==========\n\n- :class:`SfError`\n- :class:`SfErrMemoryAlloc`\n- :class:`SfErrFileOpen`\n- :class:`SfErrFileClose`\n- :class:`SfErrFileRead`\n- :class:`SfErrFileWrite`\n- :class:`SfErrLineNotFound`\n- :class:`SfErrScanNotFound`\n- :class:`SfErrHeaderNotFound`\n- :class:`SfErrLabelNotFound`\n- :class:`SfErrMotorNotFound`""\n- :class:`SfErrPositionNotFound`\n- :class:`SfErrLineEmpty`\n- :class:`SfErrUserNotFound`\n- :class:`SfErrColNotFound`\n- :class:`SfErrMcaNotFound`\n\n";
-static char __pyx_k_param_scan_Parent_Scan_instance[] = "\n\n :param scan: Parent Scan instance\n :type scan: :class:`Scan`\n\n :var calibration: MCA calibration :math:`(a, b, c)` (as in\n :math:`a + b x + c x\302\262`) from ``#@CALIB`` scan header.\n :type calibration: list of 3 floats, default ``[0., 1., 0.]``\n :var channels: MCA channels list from ``#@CHANN`` scan header.\n In the absence of a ``#@CHANN`` header, this attribute is a list\n ``[0, \342\200\246, N-1]`` where ``N`` is the length of the first spectrum.\n In the absence of MCA spectra, this attribute defaults to ``None``.\n :type channels: list of int\n\n This class provides access to Multi-Channel Analysis data. A :class:`MCA`\n instance can be indexed to access 1D numpy arrays representing single \n MCA\302\240spectra.\n\n To create a :class:`MCA` instance, you must provide a parent :class:`Scan`\n instance, which in turn will provide a reference to the original\n :class:`SpecFile` instance::\n\n sf = SpecFile(\"/path/to/specfile.dat\")\n scan2 = Scan(sf, scan_index=2)\n mcas_in_scan2 = MCA(scan2)\n for i in len(mcas_in_scan2):\n mca_data = mcas_in_scan2[i]\n ... # do some something with mca_data (1D numpy array)\n\n A more pythonic way to do the same work, without having to explicitly\n instantiate ``scan`` and ``mcas_in_scan``, would be::\n\n sf = SpecFile(\"specfilename.dat\")\n # scan2 from previous example can be referred to as sf[2]\n # mcas_in_scan2 from previous example can be referred to as scan2.mca\n for mca_data in sf[2].mca:\n ... # do some something with mca_data (1D numpy array)\n\n ";
-static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_Cannot_get_data_column_s_in_scan[] = "Cannot get data column %s in scan %d.%d";
-static char __pyx_k_Custom_exception_raised_when_SfN[] = "Custom exception raised when ``SfNoMca()`` returns ``-1``\n ";
-static char __pyx_k_Failed_to_retrieve_number_of_MCA[] = "Failed to retrieve number of MCA ";
-static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_MCA_calibration_line_CALIB_not_f[] = "MCA calibration line (@CALIB) not found";
-static char __pyx_k_MCA_index_should_be_an_integer_s[] = "MCA index should be an integer (%s provided)";
-static char __pyx_k_No_MCA_spectrum_found_in_this_sc[] = "No MCA spectrum found in this scan";
-static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
-static char __pyx_k_Parameter_value_must_be_a_string[] = "Parameter value must be a string.";
-static char __pyx_k_Unable_to_parse_file_header_line[] = "Unable to parse file header line ";
-static char __pyx_k_Unable_to_parse_scan_header_line[] = "Unable to parse scan header line ";
-static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_the_unique_scan_index_or_a_strin[] = "the unique scan index or a string 'N.M' with N being the scan";
-static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_builtin_ImportError;
+static const char __pyx_k_[] = "\n";
+static const char __pyx_k_2[] = " {2,}";
+static const char __pyx_k_3[] = "3";
+static const char __pyx_k_F[] = "#F ";
+static const char __pyx_k_L[] = "L";
+static const char __pyx_k_S[] = "#S ";
+static const char __pyx_k_f[] = "f";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_w[] = "#(\\w+) *(.*)";
+static const char __pyx_k__7[] = "#";
+static const char __pyx_k_os[] = "os";
+static const char __pyx_k_re[] = "re";
+static const char __pyx_k_MCA[] = "MCA";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k__14[] = " ";
+static const char __pyx_k__25[] = ".";
+static const char __pyx_k__27[] = "', '";
+static const char __pyx_k__28[] = "'";
+static const char __pyx_k_d_d[] = "%d.%d";
+static const char __pyx_k_doc[] = "__doc__";
+static const char __pyx_k_key[] = "key";
+static const char __pyx_k_len[] = "__len__";
+static const char __pyx_k_map[] = "map";
+static const char __pyx_k_mca[] = "_mca";
+static const char __pyx_k_msg[] = "msg";
+static const char __pyx_k_ret[] = "ret";
+static const char __pyx_k_sub[] = "sub";
+static const char __pyx_k_sys[] = "sys";
+static const char __pyx_k_w_2[] = "#@(\\w+) *(.*)";
+static const char __pyx_k_Scan[] = "Scan";
+static const char __pyx_k_args[] = "args";
+static const char __pyx_k_data[] = "_data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_hkey[] = "hkey";
+static const char __pyx_k_init[] = "__init__";
+static const char __pyx_k_iter[] = "__iter__";
+static const char __pyx_k_join[] = "join";
+static const char __pyx_k_keys[] = "keys";
+static const char __pyx_k_line[] = "line";
+static const char __pyx_k_list[] = "_list";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_open[] = "open";
+static const char __pyx_k_path[] = "path";
+static const char __pyx_k_scan[] = "scan";
+static const char __pyx_k_self[] = "self";
+static const char __pyx_k_send[] = "send";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_CALIB[] = "CALIB";
+static const char __pyx_k_CHANN[] = "CHANN";
+static const char __pyx_k_ascii[] = "ascii";
+static const char __pyx_k_close[] = "close";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_group[] = "group";
+static const char __pyx_k_index[] = "index";
+static const char __pyx_k_label[] = "label";
+static const char __pyx_k_match[] = "match";
+static const char __pyx_k_mca_2[] = "mca";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_order[] = "order";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_split[] = "split";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_strip[] = "strip";
+static const char __pyx_k_throw[] = "throw";
+static const char __pyx_k_value[] = "value";
+static const char __pyx_k_ERRORS[] = "ERRORS";
+static const char __pyx_k_append[] = "append";
+static const char __pyx_k_data_2[] = "data";
+static const char __pyx_k_decode[] = "decode";
+static const char __pyx_k_double[] = "double";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_header[] = "_header";
+static const char __pyx_k_hvalue[] = "hvalue";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_isfile[] = "isfile";
+static const char __pyx_k_labels[] = "_labels";
+static const char __pyx_k_length[] = "length";
+static const char __pyx_k_logger[] = "_logger";
+static const char __pyx_k_lstrip[] = "lstrip";
+static const char __pyx_k_module[] = "__module__";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_number[] = "number";
+static const char __pyx_k_object[] = "object";
+static const char __pyx_k_record[] = "record";
+static const char __pyx_k_scan_2[] = "_scan";
+static const char __pyx_k_search[] = "search";
+static const char __pyx_k_string[] = "string_";
+static const char __pyx_k_IOError[] = "IOError";
+static const char __pyx_k_SfError[] = "SfError";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_get_mca[] = "get_mca";
+static const char __pyx_k_getitem[] = "__getitem__";
+static const char __pyx_k_index_2[] = "_index";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_order_2[] = "_order";
+static const char __pyx_k_os_path[] = "os.path";
+static const char __pyx_k_prepare[] = "__prepare__";
+static const char __pyx_k_version[] = "version";
+static const char __pyx_k_warning[] = "warning";
+static const char __pyx_k_KeyError[] = "KeyError";
+static const char __pyx_k_L_header[] = "L_header";
+static const char __pyx_k_P_Knobel[] = "P. Knobel";
+static const char __pyx_k_Scan_mca[] = "Scan.mca";
+static const char __pyx_k_channels[] = "channels";
+static const char __pyx_k_filename[] = "filename";
+static const char __pyx_k_header_2[] = "header";
+static const char __pyx_k_labels_2[] = "labels";
+static const char __pyx_k_number_2[] = "_number";
+static const char __pyx_k_property[] = "property";
+static const char __pyx_k_qualname[] = "__qualname__";
+static const char __pyx_k_specfile[] = "_specfile";
+static const char __pyx_k_MCA___len[] = "MCA.__len__";
+static const char __pyx_k_Scan_data[] = "Scan.data";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_data_line[] = "data_line";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_getLogger[] = "getLogger";
+static const char __pyx_k_increment[] = "increment";
+static const char __pyx_k_match_mca[] = "match_mca";
+static const char __pyx_k_mca_index[] = "mca_index";
+static const char __pyx_k_metaclass[] = "__metaclass__";
+static const char __pyx_k_transpose[] = "transpose";
+static const char __pyx_k_11_08_2017[] = "11/08/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_MCA___init[] = "MCA.__init__";
+static const char __pyx_k_MCA___iter[] = "MCA.__iter__";
+static const char __pyx_k_Scan_index[] = "Scan.index";
+static const char __pyx_k_Scan_order[] = "Scan.order";
+static const char __pyx_k_Valid_keys[] = "\nValid keys: '";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_calib_line[] = "calib_line";
+static const char __pyx_k_chann_line[] = "chann_line";
+static const char __pyx_k_dictionary[] = "dictionary";
+static const char __pyx_k_line_index[] = "line_index";
+static const char __pyx_k_scan_index[] = "scan_index";
+static const char __pyx_k_scan_order[] = "scan_order";
+static const char __pyx_k_specfile_2[] = "specfile";
+static const char __pyx_k_startswith[] = "startswith";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_Scan___init[] = "Scan.__init__";
+static const char __pyx_k_Scan_header[] = "Scan.header";
+static const char __pyx_k_Scan_labels[] = "Scan.labels";
+static const char __pyx_k_Scan_number[] = "Scan.number";
+static const char __pyx_k_calib_lines[] = "calib_lines";
+static const char __pyx_k_calibration[] = "calibration";
+static const char __pyx_k_chann_lines[] = "chann_lines";
+static const char __pyx_k_file_header[] = "file_header";
+static const char __pyx_k_is_specfile[] = "is_specfile";
+static const char __pyx_k_motor_names[] = "motor_names";
+static const char __pyx_k_scan_header[] = "scan_header";
+static const char __pyx_k_scan_number[] = "scan_number";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_SfNoMcaError[] = "SfNoMcaError";
+static const char __pyx_k_handle_error[] = "_handle_error";
+static const char __pyx_k_version_info[] = "version_info";
+static const char __pyx_k_MCA___getitem[] = "MCA.__getitem__";
+static const char __pyx_k_SfErrFileOpen[] = "SfErrFileOpen";
+static const char __pyx_k_SfErrFileRead[] = "SfErrFileRead";
+static const char __pyx_k_motor_names_2[] = "_motor_names";
+static const char __pyx_k_number_of_mca[] = "number_of_mca";
+static const char __pyx_k_AttributeError[] = "AttributeError";
+static const char __pyx_k_Scan_data_line[] = "Scan.data_line";
+static const char __pyx_k_SfErrFileClose[] = "SfErrFileClose";
+static const char __pyx_k_SfErrFileWrite[] = "SfErrFileWrite";
+static const char __pyx_k_SfErrLineEmpty[] = "SfErrLineEmpty";
+static const char __pyx_k_parse_channels[] = "_parse_channels";
+static const char __pyx_k_SpecFile___iter[] = "SpecFile.__iter__";
+static const char __pyx_k_mca_header_dict[] = "mca_header_dict";
+static const char __pyx_k_motor_positions[] = "motor_positions";
+static const char __pyx_k_SF_ERR_FILE_OPEN[] = "SF_ERR_FILE_OPEN";
+static const char __pyx_k_SF_ERR_NO_ERRORS[] = "SF_ERR_NO_ERRORS";
+static const char __pyx_k_Scan_file_header[] = "Scan.file_header";
+static const char __pyx_k_Scan_motor_names[] = "Scan.motor_names";
+static const char __pyx_k_Scan_scan_header[] = "Scan.scan_header";
+static const char __pyx_k_SfErrColNotFound[] = "SfErrColNotFound";
+static const char __pyx_k_SfErrMcaNotFound[] = "SfErrMcaNotFound";
+static const char __pyx_k_SfErrMemoryAlloc[] = "SfErrMemoryAlloc";
+static const char __pyx_k_all_calib_values[] = "all_calib_values";
+static const char __pyx_k_all_chann_values[] = "all_chann_values";
+static const char __pyx_k_file_header_dict[] = "_file_header_dict";
+static const char __pyx_k_get_error_string[] = "_get_error_string";
+static const char __pyx_k_scan_header_dict[] = "_scan_header_dict";
+static const char __pyx_k_silx_io_specfile[] = "silx.io.specfile";
+static const char __pyx_k_SfErrLineNotFound[] = "SfErrLineNotFound";
+static const char __pyx_k_SfErrScanNotFound[] = "SfErrScanNotFound";
+static const char __pyx_k_SfErrUserNotFound[] = "SfErrUserNotFound";
+static const char __pyx_k_file_header_lines[] = "_file_header_lines";
+static const char __pyx_k_mca_header_dict_2[] = "_mca_header_dict";
+static const char __pyx_k_motor_positions_2[] = "_motor_positions";
+static const char __pyx_k_parse_calibration[] = "_parse_calibration";
+static const char __pyx_k_scan_header_lines[] = "_scan_header_lines";
+static const char __pyx_k_SfErrLabelNotFound[] = "SfErrLabelNotFound";
+static const char __pyx_k_SfErrMotorNotFound[] = "SfErrMotorNotFound";
+static const char __pyx_k_SfNoMca_returned_1[] = "(SfNoMca returned -1)";
+static const char __pyx_k_add_or_concatenate[] = "_add_or_concatenate";
+static const char __pyx_k_file_header_dict_2[] = "file_header_dict";
+static const char __pyx_k_scan_header_dict_2[] = "scan_header_dict";
+static const char __pyx_k_MCA__parse_channels[] = "MCA._parse_channels";
+static const char __pyx_k_SfErrHeaderNotFound[] = "SfErrHeaderNotFound";
+static const char __pyx_k_data_column_by_name[] = "data_column_by_name";
+static const char __pyx_k_string_to_char_star[] = "_string_to_char_star";
+static const char __pyx_k_Scan_mca_header_dict[] = "Scan.mca_header_dict";
+static const char __pyx_k_Scan_motor_positions[] = "Scan.motor_positions";
+static const char __pyx_k_record_exists_in_hdr[] = "record_exists_in_hdr";
+static const char __pyx_k_SF_ERR_SCAN_NOT_FOUND[] = "SF_ERR_SCAN_NOT_FOUND";
+static const char __pyx_k_Scan_file_header_dict[] = "Scan.file_header_dict";
+static const char __pyx_k_Scan_scan_header_dict[] = "Scan.scan_header_dict";
+static const char __pyx_k_SfErrPositionNotFound[] = "SfErrPositionNotFound";
+static const char __pyx_k_one_line_calib_values[] = "one_line_calib_values";
+static const char __pyx_k_one_line_chann_values[] = "one_line_chann_values";
+static const char __pyx_k_MCA__parse_calibration[] = "MCA._parse_calibration";
+static const char __pyx_k_motor_position_by_name[] = "motor_position_by_name";
+static const char __pyx_k_Scan_data_column_by_name[] = "Scan.data_column_by_name";
+static const char __pyx_k_Scan_record_exists_in_hdr[] = "Scan.record_exists_in_hdr";
+static const char __pyx_k_Scan_motor_position_by_name[] = "Scan.motor_position_by_name";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_Error_while_closing_SpecFile[] = "Error while closing SpecFile";
+static const char __pyx_k_number_and_M_the_order_eg_2_3[] = " number and M the order (eg '2.3').";
+static const char __pyx_k_MCA_index_must_be_in_range_0_d[] = "MCA index must be in range 0-%d";
+static const char __pyx_k_param_specfile_Parent_SpecFile[] = "\n\n :param specfile: Parent SpecFile from which this scan is extracted.\n :type specfile: :class:`SpecFile`\n :param scan_index: Unique index defining the scan in the SpecFile\n :type scan_index: int\n\n Interface to access a SpecFile scan\n\n A scan is a block of descriptive header lines followed by a 2D data array.\n\n Following three ways of accessing a scan are equivalent::\n\n sf = SpecFile(\"/path/to/specfile.dat\")\n\n # Explicit class instantiation\n scan2 = Scan(sf, scan_index=2)\n\n # 0-based index on a SpecFile object\n scan2 = sf[2]\n\n # Using a \"n.m\" key (scan number starting with 1, scan order)\n scan2 = sf[\"3.1\"]\n ";
+static const char __pyx_k_Base_exception_inherited_by_all[] = "Base exception inherited by all exceptions raised when a\n C function from the legacy SpecFile library returns an error\n code.\n ";
+static const char __pyx_k_Scan_index_must_be_in_range_0_d[] = "Scan index must be in range 0-%d";
+static const char __pyx_k_The_scan_identification_key_can[] = "The scan identification key can be an integer representing ";
+static const char __pyx_k_This_module_is_a_cython_binding[] = "\nThis module is a cython binding to wrap the C SpecFile library, to access\nSpecFile data within a python program.\n\nDocumentation for the original C library SpecFile can be found on the ESRF\nwebsite:\n`The manual for the SpecFile Library <http://www.esrf.eu/files/live/sites/www/files/Instrumentation/software/beamline-control/BLISS/documentation/SpecFileManual.pdf>`_\n\nExamples\n========\n\nStart by importing :class:`SpecFile` and instantiate it:\n\n.. code-block:: python\n\n from silx.io.specfile import SpecFile\n\n sf = SpecFile(\"test.dat\")\n\nA :class:`SpecFile` instance can be accessed like a dictionary to obtain a\n:class:`Scan` instance.\n\nIf the key is a string representing two values\nseparated by a dot (e.g. ``\"1.2\"``), they will be treated as the scan number\n(``#S`` header line) and the scan order::\n\n # get second occurrence of scan \"#S 1\"\n myscan = sf[\"1.2\"]\n\n # access scan data as a numpy array\n nlines, ncolumns = myscan.data.shape\n\nIf the key is an integer, it will be treated as a 0-based index::\n\n first_scan = sf[0]\n second_scan = sf[1]\n\nIt is also possible to browse through all scans using :class:`SpecFile` as\nan iterator::\n\n for scan in sf:\n print(scan.scan_header_dict['S'])\n\nMCA spectra can be selectively loaded using an instance of :class:`MCA`\nprovided by :class:`Scan`::\n\n # Only one MCA spectrum is loaded in memory\n second_mca = first_scan.mca[1]\n\n # Iterating trough all MCA spectra in a scan:\n for mca_data in first_scan.mca:\n print(sum(mca_data))\n\nClasses\n=======\n\n- :class:`SpecFile`\n- :class:`Scan`\n- :class:`MCA`\n\nExceptions\n==========\n\n- :class:`SfError`\n- :class:`SfErrMemoryAlloc`\n- :class:`SfErrFileOpen`\n- :class:`SfErrFileClose`\n- :class:`SfErrFileRead`\n- :class:`SfErrFileWrite`\n- :class:`SfErrLineNotFound`\n- :class:`SfErrScanNotFound`\n- :class:`SfErrHeaderNotFound`\n- :class:`SfErrLabelNotFound`\n- :class:`SfErrMotorNotFound`""\n- :class:`SfErrPositionNotFound`\n- :class:`SfErrLineEmpty`\n- :class:`SfErrUserNotFound`\n- :class:`SfErrColNotFound`\n- :class:`SfErrMcaNotFound`\n\n";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_param_scan_Parent_Scan_instance[] = "\n\n :param scan: Parent Scan instance\n :type scan: :class:`Scan`\n\n :var calibration: MCA calibration :math:`(a, b, c)` (as in\n :math:`a + b x + c x\302\262`) from ``#@CALIB`` scan header.\n :type calibration: list of 3 floats, default ``[0., 1., 0.]``\n :var channels: MCA channels list from ``#@CHANN`` scan header.\n In the absence of a ``#@CHANN`` header, this attribute is a list\n ``[0, \342\200\246, N-1]`` where ``N`` is the length of the first spectrum.\n In the absence of MCA spectra, this attribute defaults to ``None``.\n :type channels: list of int\n\n This class provides access to Multi-Channel Analysis data. A :class:`MCA`\n instance can be indexed to access 1D numpy arrays representing single\n MCA\302\240spectra.\n\n To create a :class:`MCA` instance, you must provide a parent :class:`Scan`\n instance, which in turn will provide a reference to the original\n :class:`SpecFile` instance::\n\n sf = SpecFile(\"/path/to/specfile.dat\")\n scan2 = Scan(sf, scan_index=2)\n mcas_in_scan2 = MCA(scan2)\n for i in len(mcas_in_scan2):\n mca_data = mcas_in_scan2[i]\n ... # do some something with mca_data (1D numpy array)\n\n A more pythonic way to do the same work, without having to explicitly\n instantiate ``scan`` and ``mcas_in_scan``, would be::\n\n sf = SpecFile(\"specfilename.dat\")\n # scan2 from previous example can be referred to as sf[2]\n # mcas_in_scan2 from previous example can be referred to as scan2.mca\n for mca_data in sf[2].mca:\n ... # do some something with mca_data (1D numpy array)\n\n ";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/io/specfile.pyx";
+static const char __pyx_k_Cannot_get_data_column_s_in_scan[] = "Cannot get data column %s in scan %d.%d";
+static const char __pyx_k_Custom_exception_raised_when_SfN[] = "Custom exception raised when ``SfNoMca()`` returns ``-1``\n ";
+static const char __pyx_k_Failed_to_retrieve_number_of_MCA[] = "Failed to retrieve number of MCA ";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_MCA_calibration_line_CALIB_not_f[] = "MCA calibration line (@CALIB) not found";
+static const char __pyx_k_MCA_index_should_be_an_integer_s[] = "MCA index should be an integer (%s provided)";
+static const char __pyx_k_No_MCA_spectrum_found_in_this_sc[] = "No MCA spectrum found in this scan";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Parameter_value_must_be_a_string[] = "Parameter value must be a string.";
+static const char __pyx_k_Unable_to_parse_file_header_line[] = "Unable to parse file header line ";
+static const char __pyx_k_Unable_to_parse_scan_header_line[] = "Unable to parse scan header line ";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_the_unique_scan_index_or_a_strin[] = "the unique scan index or a string 'N.M' with N being the scan";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
static PyObject *__pyx_kp_s_;
+static PyObject *__pyx_kp_s_11_08_2017;
static PyObject *__pyx_kp_s_2;
-static PyObject *__pyx_kp_s_27_09_2016;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_s_Base_exception_inherited_by_all;
@@ -1658,11 +1987,12 @@ static PyObject *__pyx_kp_s_Cannot_get_data_column_s_in_scan;
static PyObject *__pyx_kp_s_Custom_exception_raised_when_SfN;
static PyObject *__pyx_n_s_ERRORS;
static PyObject *__pyx_kp_s_Error_while_closing_SpecFile;
-static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_s_F;
static PyObject *__pyx_kp_s_Failed_to_retrieve_number_of_MCA;
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_IOError;
+static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_L;
@@ -1678,6 +2008,7 @@ static PyObject *__pyx_kp_s_MCA_calibration_line_CALIB_not_f;
static PyObject *__pyx_kp_s_MCA_index_must_be_in_range_0_d;
static PyObject *__pyx_kp_s_MCA_index_should_be_an_integer_s;
static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_n_s_MemoryError;
static PyObject *__pyx_kp_s_No_MCA_spectrum_found_in_this_sc;
static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
static PyObject *__pyx_kp_s_P_Knobel;
@@ -1745,7 +2076,6 @@ static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_ascii;
static PyObject *__pyx_n_s_authors;
-static PyObject *__pyx_n_s_basicConfig;
static PyObject *__pyx_n_s_calib_line;
static PyObject *__pyx_n_s_calib_lines;
static PyObject *__pyx_n_s_calibration;
@@ -1833,6 +2163,8 @@ static PyObject *__pyx_n_s_number_2;
static PyObject *__pyx_kp_s_number_and_M_the_order_eg_2_3;
static PyObject *__pyx_n_s_number_of_mca;
static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_one_line_calib_values;
static PyObject *__pyx_n_s_one_line_chann_values;
@@ -1867,6 +2199,7 @@ static PyObject *__pyx_n_s_search;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_silx_io_specfile;
static PyObject *__pyx_n_s_specfile;
static PyObject *__pyx_n_s_specfile_2;
static PyObject *__pyx_n_s_split;
@@ -1883,13 +2216,75 @@ static PyObject *__pyx_kp_s_the_unique_scan_index_or_a_strin;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_transpose;
static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
-static PyObject *__pyx_kp_s_users_payno_Documents_dev_esrf;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_kp_s_w;
static PyObject *__pyx_kp_s_w_2;
static PyObject *__pyx_n_s_warning;
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scan); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_specfile, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_record); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_label); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename); /* proto */
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile___cinit__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile_2__init__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename); /* proto */
+static void __pyx_pf_4silx_2io_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_pf_4silx_2io_8specfile_8SpecFile_6__len__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_8__iter__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_13keys(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile_15__contains__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_21index(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_number, PyObject *__pyx_v_scan_order); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_23number(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_25order(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_27_list(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_29list(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_31data(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_33data_column_by_name(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_label); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_35scan_header(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_37file_header(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_39columns(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_41command(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_43date(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_45labels(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_47motor_names(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_49motor_positions(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_51motor_position_by_name(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index); /* proto */
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_57get_mca(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_mca_index); /* 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 PyObject *__pyx_tp_new_4silx_2io_8specfile_SpecFile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float_0_;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_int_0;
@@ -1931,6 +2326,7 @@ static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
@@ -1939,6 +2335,7 @@ static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__43;
@@ -1966,7 +2363,7 @@ static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__91;
-static PyObject *__pyx_codeobj__38;
+static PyObject *__pyx_tuple__93;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__42;
static PyObject *__pyx_codeobj__44;
@@ -1994,8 +2391,9 @@ static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__92;
+static PyObject *__pyx_codeobj__94;
-/* "specfile.pyx":234
+/* "silx/io/specfile.pyx":233
*
* """
* def __init__(self, scan): # <<<<<<<<<<<<<<
@@ -2004,15 +2402,12 @@ static PyObject *__pyx_codeobj__92;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_3MCA___init__[] = "MCA.__init__(self, scan)";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8specfile_3MCA_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_3MCA___init__};
-static PyObject *__pyx_pw_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA___init__[] = "MCA.__init__(self, scan)";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_1__init__ = {"__init__", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_3MCA___init__};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_scan = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
@@ -2036,11 +2431,11 @@ static PyObject *__pyx_pw_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObjec
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scan)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 233, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 233, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2053,74 +2448,71 @@ static PyObject *__pyx_pw_8specfile_3MCA_1__init__(PyObject *__pyx_self, PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 233, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.MCA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_3MCA___init__(__pyx_self, __pyx_v_self, __pyx_v_scan);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA___init__(__pyx_self, __pyx_v_self, __pyx_v_scan);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scan) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_scan) {
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("__init__", 0);
- /* "specfile.pyx":235
+ /* "silx/io/specfile.pyx":234
* """
* def __init__(self, scan):
* self._scan = scan # <<<<<<<<<<<<<<
*
* # Header dict
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_2, __pyx_v_scan) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_2, __pyx_v_scan) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
- /* "specfile.pyx":238
+ /* "silx/io/specfile.pyx":237
*
* # Header dict
* self._header = scan.mca_header_dict # <<<<<<<<<<<<<<
*
* self.calibration = []
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scan, __pyx_n_s_mca_header_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_scan, __pyx_n_s_mca_header_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":240
+ /* "silx/io/specfile.pyx":239
* self._header = scan.mca_header_dict
*
* self.calibration = [] # <<<<<<<<<<<<<<
* """List of lists of calibration values,
* one list of 3 floats per MCA device or a single list applying to
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_calibration, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_calibration, __pyx_t_1) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":244
+ /* "silx/io/specfile.pyx":243
* one list of 3 floats per MCA device or a single list applying to
* all devices """
* self._parse_calibration() # <<<<<<<<<<<<<<
*
* self.channels = []
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_calibration); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_calibration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2130,38 +2522,38 @@ static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":246
+ /* "silx/io/specfile.pyx":245
* self._parse_calibration()
*
* self.channels = [] # <<<<<<<<<<<<<<
* """List of lists of channels,
* one list of integers per MCA device or a single list applying to
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_channels, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_channels, __pyx_t_1) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":250
+ /* "silx/io/specfile.pyx":249
* one list of integers per MCA device or a single list applying to
* all devices"""
* self._parse_channels() # <<<<<<<<<<<<<<
*
* def _parse_channels(self):
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_channels); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parse_channels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2171,16 +2563,16 @@ static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":234
+ /* "silx/io/specfile.pyx":233
*
* """
* def __init__(self, scan): # <<<<<<<<<<<<<<
@@ -2195,7 +2587,7 @@ static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile.MCA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2203,7 +2595,7 @@ static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "specfile.pyx":252
+/* "silx/io/specfile.pyx":251
* self._parse_channels()
*
* def _parse_channels(self): # <<<<<<<<<<<<<<
@@ -2212,21 +2604,21 @@ static PyObject *__pyx_pf_8specfile_3MCA___init__(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_3_parse_channels(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_3MCA_2_parse_channels[] = "MCA._parse_channels(self)\nFill :attr:`channels`";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_3_parse_channels = {"_parse_channels", (PyCFunction)__pyx_pw_8specfile_3MCA_3_parse_channels, METH_O, __pyx_doc_8specfile_3MCA_2_parse_channels};
-static PyObject *__pyx_pw_8specfile_3MCA_3_parse_channels(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_3_parse_channels(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA_2_parse_channels[] = "MCA._parse_channels(self)\nFill :attr:`channels`";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_3_parse_channels = {"_parse_channels", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_3_parse_channels, METH_O, __pyx_doc_4silx_2io_8specfile_3MCA_2_parse_channels};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_3_parse_channels(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_parse_channels (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_3MCA_2_parse_channels(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA_2_parse_channels(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_v_chann_lines = NULL;
PyObject *__pyx_v_all_chann_values = NULL;
PyObject *__pyx_v_one_line_chann_values = NULL;
@@ -2250,78 +2642,77 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
PyObject *__pyx_t_11 = NULL;
PyObject *(*__pyx_t_12)(PyObject *);
int __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_parse_channels", 0);
- /* "specfile.pyx":255
+ /* "silx/io/specfile.pyx":254
* """Fill :attr:`channels`"""
* # Channels list
* if "CHANN" in self._header: # <<<<<<<<<<<<<<
* chann_lines = self._header["CHANN"].split("\n")
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_n_s_CHANN, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_CHANN, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 254, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":256
+ /* "silx/io/specfile.pyx":255
* # Channels list
* if "CHANN" in self._header:
* chann_lines = self._header["CHANN"].split("\n") # <<<<<<<<<<<<<<
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
* for one_line_chann_values in all_chann_values:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_CHANN); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_CHANN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_chann_lines = __pyx_t_4;
__pyx_t_4 = 0;
- /* "specfile.pyx":257
+ /* "silx/io/specfile.pyx":256
* if "CHANN" in self._header:
* chann_lines = self._header["CHANN"].split("\n")
* all_chann_values = [chann_line.split() for chann_line in chann_lines] # <<<<<<<<<<<<<<
* for one_line_chann_values in all_chann_values:
* length, start, stop, increment = map(int, one_line_chann_values)
*/
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (likely(PyList_CheckExact(__pyx_v_chann_lines)) || PyTuple_CheckExact(__pyx_v_chann_lines)) {
__pyx_t_1 = __pyx_v_chann_lines; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chann_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_chann_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -2330,7 +2721,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
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 = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 256, __pyx_L1_error)
}
break;
}
@@ -2338,10 +2729,10 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
}
__Pyx_XDECREF_SET(__pyx_v_chann_line, __pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_chann_line, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_chann_line, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && likely(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);
@@ -2351,21 +2742,21 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
}
}
if (__pyx_t_9) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_all_chann_values = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "specfile.pyx":258
+ /* "silx/io/specfile.pyx":257
* chann_lines = self._header["CHANN"].split("\n")
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
* for one_line_chann_values in all_chann_values: # <<<<<<<<<<<<<<
@@ -2375,35 +2766,36 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
__pyx_t_4 = __pyx_v_all_chann_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
for (;;) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_XDECREF_SET(__pyx_v_one_line_chann_values, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":259
+ /* "silx/io/specfile.pyx":258
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
* for one_line_chann_values in all_chann_values:
* length, start, stop, increment = map(int, one_line_chann_values) # <<<<<<<<<<<<<<
* self.channels.append(list(range(start, stop + 1, increment)))
* elif len(self):
*/
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
+ __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+ __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyInt_Type)));
__Pyx_INCREF(__pyx_v_one_line_chann_values);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_one_line_chann_values);
__Pyx_GIVEREF(__pyx_v_one_line_chann_values);
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_one_line_chann_values);
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
PyObject* sequence = __pyx_t_7;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -2411,9 +2803,9 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
if (unlikely(size != 4)) {
if (size > 4) __Pyx_RaiseTooManyValuesError(4);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 258, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
@@ -2434,7 +2826,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
Py_ssize_t i;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
for (i=0; i < 4; i++) {
- PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(item);
*(temps[i]) = item;
}
@@ -2444,7 +2836,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
} else {
Py_ssize_t index = -1;
PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
- __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -2453,7 +2845,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
__Pyx_GOTREF(item);
*(temps[index]) = item;
}
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) __PYX_ERR(0, 258, __pyx_L1_error)
__pyx_t_12 = NULL;
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
goto __pyx_L9_unpacking_done;
@@ -2461,7 +2853,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_12 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 258, __pyx_L1_error)
__pyx_L9_unpacking_done:;
}
__Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_1);
@@ -2473,44 +2865,39 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
__Pyx_XDECREF_SET(__pyx_v_increment, __pyx_t_10);
__pyx_t_10 = 0;
- /* "specfile.pyx":260
+ /* "silx/io/specfile.pyx":259
* for one_line_chann_values in all_chann_values:
* length, start, stop, increment = map(int, one_line_chann_values)
* self.channels.append(list(range(start, stop + 1, increment))) # <<<<<<<<<<<<<<
* elif len(self):
* # in the absence of #@CHANN, use shape of first MCA
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_channels); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_channels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = PyNumber_Add(__pyx_v_stop, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_v_stop, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_start);
__Pyx_GIVEREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_start);
__Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10);
__Pyx_INCREF(__pyx_v_increment);
- PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_increment);
__Pyx_GIVEREF(__pyx_v_increment);
+ PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_v_increment);
__pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__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 = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_List(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_10); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_9); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "specfile.pyx":258
+ /* "silx/io/specfile.pyx":257
* chann_lines = self._header["CHANN"].split("\n")
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
* for one_line_chann_values in all_chann_values: # <<<<<<<<<<<<<<
@@ -2519,39 +2906,47 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
*/
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "silx/io/specfile.pyx":254
+ * """Fill :attr:`channels`"""
+ * # Channels list
+ * if "CHANN" in self._header: # <<<<<<<<<<<<<<
+ * chann_lines = self._header["CHANN"].split("\n")
+ * all_chann_values = [chann_line.split() for chann_line in chann_lines]
+ */
goto __pyx_L3;
}
- /* "specfile.pyx":261
+ /* "silx/io/specfile.pyx":260
* length, start, stop, increment = map(int, one_line_chann_values)
* self.channels.append(list(range(start, stop + 1, increment)))
* elif len(self): # <<<<<<<<<<<<<<
* # in the absence of #@CHANN, use shape of first MCA
* length = self[0].shape[0]
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 260, __pyx_L1_error)
__pyx_t_3 = (__pyx_t_5 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":263
+ /* "silx/io/specfile.pyx":262
* elif len(self):
* # in the absence of #@CHANN, use shape of first MCA
* length = self[0].shape[0] # <<<<<<<<<<<<<<
* start, stop, increment = (0, length - 1, 1)
* self.channels.append(list(range(start, stop + 1, increment)))
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_self, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_length = __pyx_t_4;
__pyx_t_4 = 0;
- /* "specfile.pyx":264
+ /* "silx/io/specfile.pyx":263
* # in the absence of #@CHANN, use shape of first MCA
* length = self[0].shape[0]
* start, stop, increment = (0, length - 1, 1) # <<<<<<<<<<<<<<
@@ -2560,58 +2955,60 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
*/
__pyx_t_4 = __pyx_int_0;
__Pyx_INCREF(__pyx_t_4);
- __pyx_t_10 = PyNumber_Subtract(__pyx_v_length, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_length, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = __pyx_int_1;
__Pyx_INCREF(__pyx_t_7);
__pyx_v_start = __pyx_t_4;
__pyx_t_4 = 0;
- __pyx_v_stop = __pyx_t_10;
- __pyx_t_10 = 0;
+ __pyx_v_stop = __pyx_t_9;
+ __pyx_t_9 = 0;
__pyx_v_increment = __pyx_t_7;
__pyx_t_7 = 0;
- /* "specfile.pyx":265
+ /* "silx/io/specfile.pyx":264
* length = self[0].shape[0]
* start, stop, increment = (0, length - 1, 1)
* self.channels.append(list(range(start, stop + 1, increment))) # <<<<<<<<<<<<<<
*
* def _parse_calibration(self):
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_channels); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_channels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_10 = PyNumber_Add(__pyx_v_stop, __pyx_int_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_stop, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_start);
__Pyx_GIVEREF(__pyx_v_start);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_start);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_9);
__Pyx_INCREF(__pyx_v_increment);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_increment);
__Pyx_GIVEREF(__pyx_v_increment);
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_increment);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__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 = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_List(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_10); if (unlikely(__pyx_t_13 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_13 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_4); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L3;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "silx/io/specfile.pyx":260
+ * length, start, stop, increment = map(int, one_line_chann_values)
+ * self.channels.append(list(range(start, stop + 1, increment)))
+ * elif len(self): # <<<<<<<<<<<<<<
+ * # in the absence of #@CHANN, use shape of first MCA
+ * length = self[0].shape[0]
+ */
}
__pyx_L3:;
- /* "specfile.pyx":252
+ /* "silx/io/specfile.pyx":251
* self._parse_channels()
*
* def _parse_channels(self): # <<<<<<<<<<<<<<
@@ -2630,7 +3027,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("specfile.MCA._parse_channels", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA._parse_channels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_chann_lines);
@@ -2646,7 +3043,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
return __pyx_r;
}
-/* "specfile.pyx":267
+/* "silx/io/specfile.pyx":266
* self.channels.append(list(range(start, stop + 1, increment)))
*
* def _parse_calibration(self): # <<<<<<<<<<<<<<
@@ -2655,21 +3052,21 @@ static PyObject *__pyx_pf_8specfile_3MCA_2_parse_channels(CYTHON_UNUSED PyObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_5_parse_calibration(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_3MCA_4_parse_calibration[] = "MCA._parse_calibration(self)\nFill :attr:`calibration`";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_5_parse_calibration = {"_parse_calibration", (PyCFunction)__pyx_pw_8specfile_3MCA_5_parse_calibration, METH_O, __pyx_doc_8specfile_3MCA_4_parse_calibration};
-static PyObject *__pyx_pw_8specfile_3MCA_5_parse_calibration(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_5_parse_calibration(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA_4_parse_calibration[] = "MCA._parse_calibration(self)\nFill :attr:`calibration`";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_5_parse_calibration = {"_parse_calibration", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_5_parse_calibration, METH_O, __pyx_doc_4silx_2io_8specfile_3MCA_4_parse_calibration};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_5_parse_calibration(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_parse_calibration (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_3MCA_4_parse_calibration(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA_4_parse_calibration(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_v_calib_lines = NULL;
PyObject *__pyx_v_all_calib_values = NULL;
PyObject *__pyx_v_one_line_calib_values = NULL;
@@ -2686,78 +3083,77 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_parse_calibration", 0);
- /* "specfile.pyx":270
+ /* "silx/io/specfile.pyx":269
* """Fill :attr:`calibration`"""
* # Channels list
* if "CALIB" in self._header: # <<<<<<<<<<<<<<
* calib_lines = self._header["CALIB"].split("\n")
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = (__Pyx_PySequence_Contains(__pyx_n_s_CALIB, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_CALIB, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":271
+ /* "silx/io/specfile.pyx":270
* # Channels list
* if "CALIB" in self._header:
* calib_lines = self._header["CALIB"].split("\n") # <<<<<<<<<<<<<<
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
* for one_line_calib_values in all_calib_values:
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_CALIB); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_CALIB); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_calib_lines = __pyx_t_4;
__pyx_t_4 = 0;
- /* "specfile.pyx":272
+ /* "silx/io/specfile.pyx":271
* if "CALIB" in self._header:
* calib_lines = self._header["CALIB"].split("\n")
* all_calib_values = [calib_line.split() for calib_line in calib_lines] # <<<<<<<<<<<<<<
* for one_line_calib_values in all_calib_values:
* self.calibration.append(list(map(float, one_line_calib_values)))
*/
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
if (likely(PyList_CheckExact(__pyx_v_calib_lines)) || PyTuple_CheckExact(__pyx_v_calib_lines)) {
__pyx_t_1 = __pyx_v_calib_lines; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
__pyx_t_6 = NULL;
} else {
- __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_calib_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_calib_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 271, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_6)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
} else {
if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
#else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -2766,7 +3162,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
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 = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 271, __pyx_L1_error)
}
break;
}
@@ -2774,10 +3170,10 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
}
__Pyx_XDECREF_SET(__pyx_v_calib_line, __pyx_t_7);
__pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_calib_line, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_calib_line, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && likely(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);
@@ -2787,21 +3183,21 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
}
}
if (__pyx_t_9) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
- __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 271, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_all_calib_values = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "specfile.pyx":273
+ /* "silx/io/specfile.pyx":272
* calib_lines = self._header["CALIB"].split("\n")
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
* for one_line_calib_values in all_calib_values: # <<<<<<<<<<<<<<
@@ -2811,47 +3207,43 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
__pyx_t_4 = __pyx_v_all_calib_values; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
for (;;) {
if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
__Pyx_XDECREF_SET(__pyx_v_one_line_calib_values, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":274
+ /* "silx/io/specfile.pyx":273
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
* for one_line_calib_values in all_calib_values:
* self.calibration.append(list(map(float, one_line_calib_values))) # <<<<<<<<<<<<<<
* else:
* # in the absence of #@calib, use default
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calibration); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calibration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
- PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)((PyObject*)(&PyFloat_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyFloat_Type))));
+ __Pyx_INCREF(((PyObject *)(&PyFloat_Type)));
+ __Pyx_GIVEREF(((PyObject *)(&PyFloat_Type)));
+ PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&PyFloat_Type)));
__Pyx_INCREF(__pyx_v_one_line_calib_values);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_one_line_calib_values);
__Pyx_GIVEREF(__pyx_v_one_line_calib_values);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_one_line_calib_values);
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__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 = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_7); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 273, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "specfile.pyx":273
+ /* "silx/io/specfile.pyx":272
* calib_lines = self._header["CALIB"].split("\n")
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
* for one_line_calib_values in all_calib_values: # <<<<<<<<<<<<<<
@@ -2860,37 +3252,45 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
*/
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "silx/io/specfile.pyx":269
+ * """Fill :attr:`calibration`"""
+ * # Channels list
+ * if "CALIB" in self._header: # <<<<<<<<<<<<<<
+ * calib_lines = self._header["CALIB"].split("\n")
+ * all_calib_values = [calib_line.split() for calib_line in calib_lines]
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "specfile.pyx":277
+ /* "silx/io/specfile.pyx":276
* else:
* # in the absence of #@calib, use default
* self.calibration.append([0., 1., 0.]) # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calibration); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_calibration); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyList_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_float_0_);
- PyList_SET_ITEM(__pyx_t_8, 0, __pyx_float_0_);
__Pyx_GIVEREF(__pyx_float_0_);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_float_0_);
__Pyx_INCREF(__pyx_float_1_);
- PyList_SET_ITEM(__pyx_t_8, 1, __pyx_float_1_);
__Pyx_GIVEREF(__pyx_float_1_);
+ PyList_SET_ITEM(__pyx_t_7, 1, __pyx_float_1_);
__Pyx_INCREF(__pyx_float_0_);
- PyList_SET_ITEM(__pyx_t_8, 2, __pyx_float_0_);
__Pyx_GIVEREF(__pyx_float_0_);
- __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_7, 2, __pyx_float_0_);
+ __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_7); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
__pyx_L3:;
- /* "specfile.pyx":267
+ /* "silx/io/specfile.pyx":266
* self.channels.append(list(range(start, stop + 1, increment)))
*
* def _parse_calibration(self): # <<<<<<<<<<<<<<
@@ -2907,7 +3307,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("specfile.MCA._parse_calibration", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA._parse_calibration", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_calib_lines);
@@ -2919,7 +3319,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
return __pyx_r;
}
-/* "specfile.pyx":279
+/* "silx/io/specfile.pyx":278
* self.calibration.append([0., 1., 0.])
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -2928,21 +3328,21 @@ static PyObject *__pyx_pf_8specfile_3MCA_4_parse_calibration(CYTHON_UNUSED PyObj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_7__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_3MCA_6__len__[] = "MCA.__len__(self)\n\n\n :return: Number of mca in Scan\n :rtype: int\n ";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_7__len__ = {"__len__", (PyCFunction)__pyx_pw_8specfile_3MCA_7__len__, METH_O, __pyx_doc_8specfile_3MCA_6__len__};
-static PyObject *__pyx_pw_8specfile_3MCA_7__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_7__len__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA_6__len__[] = "MCA.__len__(self)\n\n\n :return: Number of mca in Scan\n :rtype: int\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_7__len__ = {"__len__", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_7__len__, METH_O, __pyx_doc_4silx_2io_8specfile_3MCA_6__len__};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_7__len__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_3MCA_6__len__(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA_6__len__(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -2950,12 +3350,9 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
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("__len__", 0);
- /* "specfile.pyx":285
+ /* "silx/io/specfile.pyx":284
* :rtype: int
* """
* return self._scan._specfile.number_of_mca(self._scan.index) # <<<<<<<<<<<<<<
@@ -2963,21 +3360,21 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
* def __getitem__(self, key):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_specfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_specfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_number_of_mca); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_number_of_mca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2987,26 +3384,46 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __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[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 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_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":279
+ /* "silx/io/specfile.pyx":278
* self.calibration.append([0., 1., 0.])
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -3021,7 +3438,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("specfile.MCA.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3029,7 +3446,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "specfile.pyx":287
+/* "silx/io/specfile.pyx":286
* return self._scan._specfile.number_of_mca(self._scan.index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
@@ -3038,15 +3455,12 @@ static PyObject *__pyx_pf_8specfile_3MCA_6__len__(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_3MCA_8__getitem__[] = "MCA.__getitem__(self, key)\nReturn a single MCA data line\n\n :param key: 0-based index of MCA within Scan\n :type key: int\n\n :return: Single MCA\n :rtype: 1D numpy array\n ";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_9__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_8specfile_3MCA_9__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_3MCA_8__getitem__};
-static PyObject *__pyx_pw_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA_8__getitem__[] = "MCA.__getitem__(self, key)\nReturn a single MCA data line\n\n :param key: 0-based index of MCA within Scan\n :type key: int\n\n :return: Single MCA\n :rtype: 1D numpy array\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_9__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_9__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_3MCA_8__getitem__};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_key = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
@@ -3070,11 +3484,11 @@ static PyObject *__pyx_pw_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyOb
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 286, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 286, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -3087,20 +3501,20 @@ static PyObject *__pyx_pw_8specfile_3MCA_9__getitem__(PyObject *__pyx_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 286, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.MCA.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_3MCA_8__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA_8__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_v_mca_index = NULL;
PyObject *__pyx_v_msg = NULL;
PyObject *__pyx_r = NULL;
@@ -3109,54 +3523,71 @@ static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "specfile.pyx":296
+ /* "silx/io/specfile.pyx":295
* :rtype: 1D numpy array
* """
* if not len(self): # <<<<<<<<<<<<<<
* raise IndexError("No MCA spectrum found in this scan")
*
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 295, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "specfile.pyx":297
+ /* "silx/io/specfile.pyx":296
* """
* if not len(self):
* raise IndexError("No MCA spectrum found in this scan") # <<<<<<<<<<<<<<
*
- * if isinstance(key, int):
+ * if isinstance(key, (int, long)):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 296, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":295
+ * :rtype: 1D numpy array
+ * """
+ * if not len(self): # <<<<<<<<<<<<<<
+ * raise IndexError("No MCA spectrum found in this scan")
+ *
+ */
}
- /* "specfile.pyx":299
+ /* "silx/io/specfile.pyx":298
* raise IndexError("No MCA spectrum found in this scan")
*
- * if isinstance(key, int): # <<<<<<<<<<<<<<
+ * if isinstance(key, (int, long)): # <<<<<<<<<<<<<<
* mca_index = key
* # allow negative index, like lists
*/
- __pyx_t_2 = PyInt_Check(__pyx_v_key);
+ __pyx_t_4 = PyInt_Check(__pyx_v_key);
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_2 = __pyx_t_5;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_5 = PyLong_Check(__pyx_v_key);
+ __pyx_t_4 = (__pyx_t_5 != 0);
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_L5_bool_binop_done:;
__pyx_t_4 = (__pyx_t_2 != 0);
if (__pyx_t_4) {
- /* "specfile.pyx":300
+ /* "silx/io/specfile.pyx":299
*
- * if isinstance(key, int):
+ * if isinstance(key, (int, long)):
* mca_index = key # <<<<<<<<<<<<<<
* # allow negative index, like lists
* if mca_index < 0:
@@ -3164,121 +3595,159 @@ static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_v_key);
__pyx_v_mca_index = __pyx_v_key;
- /* "specfile.pyx":302
+ /* "silx/io/specfile.pyx":301
* mca_index = key
* # allow negative index, like lists
* if mca_index < 0: # <<<<<<<<<<<<<<
* mca_index = len(self) + mca_index
* else:
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_mca_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_mca_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "specfile.pyx":303
+ /* "silx/io/specfile.pyx":302
* # allow negative index, like lists
* if mca_index < 0:
* mca_index = len(self) + mca_index # <<<<<<<<<<<<<<
* else:
* raise TypeError("MCA index should be an integer (%s provided)" %
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_mca_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_mca_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF_SET(__pyx_v_mca_index, __pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L5;
+ __Pyx_DECREF_SET(__pyx_v_mca_index, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "silx/io/specfile.pyx":301
+ * mca_index = key
+ * # allow negative index, like lists
+ * if mca_index < 0: # <<<<<<<<<<<<<<
+ * mca_index = len(self) + mca_index
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "silx/io/specfile.pyx":298
+ * raise IndexError("No MCA spectrum found in this scan")
+ *
+ * if isinstance(key, (int, long)): # <<<<<<<<<<<<<<
+ * mca_index = key
+ * # allow negative index, like lists
+ */
goto __pyx_L4;
}
+
+ /* "silx/io/specfile.pyx":304
+ * mca_index = len(self) + mca_index
+ * else:
+ * raise TypeError("MCA index should be an integer (%s provided)" % # <<<<<<<<<<<<<<
+ * (type(key)))
+ *
+ */
/*else*/ {
- /* "specfile.pyx":305
+ /* "silx/io/specfile.pyx":305
+ * else:
+ * raise TypeError("MCA index should be an integer (%s provided)" %
+ * (type(key))) # <<<<<<<<<<<<<<
+ *
+ * if not 0 <= mca_index < len(self):
+ */
+ __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_MCA_index_should_be_an_integer_s, ((PyObject *)Py_TYPE(__pyx_v_key))); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "silx/io/specfile.pyx":304
* mca_index = len(self) + mca_index
* else:
* raise TypeError("MCA index should be an integer (%s provided)" % # <<<<<<<<<<<<<<
* (type(key)))
*
*/
- __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_MCA_index_should_be_an_integer_s, ((PyObject *)Py_TYPE(__pyx_v_key))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 304, __pyx_L1_error)
}
__pyx_L4:;
- /* "specfile.pyx":308
+ /* "silx/io/specfile.pyx":307
* (type(key)))
*
* if not 0 <= mca_index < len(self): # <<<<<<<<<<<<<<
* msg = "MCA index must be in range 0-%d" % (len(self) - 1)
* raise IndexError(msg)
*/
- __pyx_t_5 = PyObject_RichCompare(__pyx_int_0, __pyx_v_mca_index, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_PyObject_IsTrue(__pyx_t_5)) {
- __Pyx_DECREF(__pyx_t_5);
- __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_int_0, __pyx_v_mca_index, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
+ if (__Pyx_PyObject_IsTrue(__pyx_t_6)) {
+ __Pyx_DECREF(__pyx_t_6);
+ __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_mca_index, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_mca_index, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = ((!__pyx_t_4) != 0);
if (__pyx_t_2) {
- /* "specfile.pyx":309
+ /* "silx/io/specfile.pyx":308
*
* if not 0 <= mca_index < len(self):
* msg = "MCA index must be in range 0-%d" % (len(self) - 1) # <<<<<<<<<<<<<<
* raise IndexError(msg)
*
*/
- __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_1 - 1)); 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_3 = __Pyx_PyString_Format(__pyx_kp_s_MCA_index_must_be_in_range_0_d, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_1 - 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MCA_index_must_be_in_range_0_d, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_msg = __pyx_t_3;
__pyx_t_3 = 0;
- /* "specfile.pyx":310
+ /* "silx/io/specfile.pyx":309
* if not 0 <= mca_index < len(self):
* msg = "MCA index must be in range 0-%d" % (len(self) - 1)
* raise IndexError(msg) # <<<<<<<<<<<<<<
*
* return self._scan._specfile.get_mca(self._scan.index,
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
__Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_msg);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 309, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":307
+ * (type(key)))
+ *
+ * if not 0 <= mca_index < len(self): # <<<<<<<<<<<<<<
+ * msg = "MCA index must be in range 0-%d" % (len(self) - 1)
+ * raise IndexError(msg)
+ */
}
- /* "specfile.pyx":312
+ /* "silx/io/specfile.pyx":311
* raise IndexError(msg)
*
* return self._scan._specfile.get_mca(self._scan.index, # <<<<<<<<<<<<<<
@@ -3286,59 +3755,79 @@ static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_specfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_specfile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get_mca); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_get_mca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_index); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "specfile.pyx":313
+ /* "silx/io/specfile.pyx":312
*
* return self._scan._specfile.get_mca(self._scan.index,
* mca_index) # <<<<<<<<<<<<<<
*
* def __iter__(self):
*/
- __pyx_t_6 = NULL;
- __pyx_t_1 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_6)) {
+ __pyx_t_7 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_1 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_6) {
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_v_mca_index};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_8, __pyx_v_mca_index};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_8);
+ __Pyx_INCREF(__pyx_v_mca_index);
+ __Pyx_GIVEREF(__pyx_v_mca_index);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_mca_index);
+ __pyx_t_8 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __Pyx_INCREF(__pyx_v_mca_index);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_1, __pyx_v_mca_index);
- __Pyx_GIVEREF(__pyx_v_mca_index);
- __pyx_t_7 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "specfile.pyx":287
+ /* "silx/io/specfile.pyx":286
* return self._scan._specfile.number_of_mca(self._scan.index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
@@ -3349,11 +3838,11 @@ static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.MCA.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_mca_index);
@@ -3362,9 +3851,9 @@ static PyObject *__pyx_pf_8specfile_3MCA_8__getitem__(CYTHON_UNUSED PyObject *__
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4silx_2io_8specfile_3MCA_12generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "specfile.pyx":315
+/* "silx/io/specfile.pyx":314
* mca_index)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -3373,39 +3862,38 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3MCA_11__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_3MCA_10__iter__[] = "MCA.__iter__(self)\nReturn the next MCA data line each time this method is called.\n\n :return: Single MCA\n :rtype: 1D numpy array\n ";
-static PyMethodDef __pyx_mdef_8specfile_3MCA_11__iter__ = {"__iter__", (PyCFunction)__pyx_pw_8specfile_3MCA_11__iter__, METH_O, __pyx_doc_8specfile_3MCA_10__iter__};
-static PyObject *__pyx_pw_8specfile_3MCA_11__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_11__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_3MCA_10__iter__[] = "MCA.__iter__(self)\nReturn the next MCA data line each time this method is called.\n\n :return: Single MCA\n :rtype: 1D numpy array\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3MCA_11__iter__ = {"__iter__", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3MCA_11__iter__, METH_O, __pyx_doc_4silx_2io_8specfile_3MCA_10__iter__};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3MCA_11__iter__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_3MCA_10__iter__(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_3MCA_10__iter__(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
- struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *__pyx_cur_scope;
+static PyObject *__pyx_pf_4silx_2io_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)__pyx_tp_new_8specfile___pyx_scope_struct____iter__(__pyx_ptype_8specfile___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct____iter__(__pyx_ptype_4silx_2io_8specfile___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
- __Pyx_RefNannyFinishContext();
- return NULL;
+ __pyx_cur_scope = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 314, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
}
- __Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_self = __pyx_v_self;
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8specfile_3MCA_12generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MCA___iter); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4silx_2io_8specfile_3MCA_12generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_MCA___iter, __pyx_n_s_silx_io_specfile); if (unlikely(!gen)) __PYX_ERR(0, 314, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -3413,7 +3901,7 @@ static PyObject *__pyx_pf_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__py
/* function exit code */
__pyx_L1_error:;
- __Pyx_AddTraceback("specfile.MCA.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.MCA.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
__Pyx_XGIVEREF(__pyx_r);
@@ -3421,9 +3909,9 @@ static PyObject *__pyx_pf_8specfile_3MCA_10__iter__(CYTHON_UNUSED PyObject *__py
return __pyx_r;
}
-static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4silx_2io_8specfile_3MCA_12generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -3432,11 +3920,8 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("None", 0);
switch (__pyx_generator->resume_label) {
@@ -3447,44 +3932,44 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 314, __pyx_L1_error)
- /* "specfile.pyx":321
+ /* "silx/io/specfile.pyx":320
* :rtype: 1D numpy array
* """
* for mca_index in range(len(self)): # <<<<<<<<<<<<<<
* yield self._scan._specfile.get_mca(self._scan.index, mca_index)
*
*/
- __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(__pyx_cur_scope->__pyx_v_self); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 320, __pyx_L1_error)
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_mca_index = __pyx_t_2;
- /* "specfile.pyx":322
+ /* "silx/io/specfile.pyx":321
* """
* for mca_index in range(len(self)):
* yield self._scan._specfile.get_mca(self._scan.index, mca_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_mca); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get_mca); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_scan_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_index); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_mca_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_mca_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = NULL;
__pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -3494,20 +3979,42 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
+ __pyx_t_6 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_6 = 0;
- __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -3521,10 +4028,11 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 321, __pyx_L1_error)
}
+ CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
- /* "specfile.pyx":315
+ /* "silx/io/specfile.pyx":314
* mca_index)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -3544,14 +4052,14 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
__Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
- __Pyx_XDECREF(__pyx_r);
+ __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
__pyx_generator->resume_label = -1;
- __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
__Pyx_RefNannyFinishContext();
- return NULL;
+ return __pyx_r;
}
-/* "specfile.pyx":325
+/* "silx/io/specfile.pyx":324
*
*
* def _add_or_concatenate(dictionary, key, value): # <<<<<<<<<<<<<<
@@ -3560,16 +4068,13 @@ static PyObject *__pyx_gb_8specfile_3MCA_12generator(__pyx_GeneratorObject *__py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_1_add_or_concatenate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile__add_or_concatenate[] = "_add_or_concatenate(dictionary, key, value)\nIf key doesn't exist in dictionary, create a new ``key: value`` pair.\n Else append/concatenate the new value to the existing one\n ";
-static PyMethodDef __pyx_mdef_8specfile_1_add_or_concatenate = {"_add_or_concatenate", (PyCFunction)__pyx_pw_8specfile_1_add_or_concatenate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile__add_or_concatenate};
-static PyObject *__pyx_pw_8specfile_1_add_or_concatenate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_1_add_or_concatenate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile__add_or_concatenate[] = "_add_or_concatenate(dictionary, key, value)\nIf key doesn't exist in dictionary, create a new ``key: value`` pair.\n Else append/concatenate the new value to the existing one\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_1_add_or_concatenate = {"_add_or_concatenate", (PyCFunction)__pyx_pw_4silx_2io_8specfile_1_add_or_concatenate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile__add_or_concatenate};
+static PyObject *__pyx_pw_4silx_2io_8specfile_1_add_or_concatenate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_dictionary = 0;
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_value = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_add_or_concatenate (wrapper)", 0);
@@ -3594,16 +4099,16 @@ static PyObject *__pyx_pw_8specfile_1_add_or_concatenate(PyObject *__pyx_self, P
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, 1); __PYX_ERR(0, 324, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, 2); __PYX_ERR(0, 324, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_add_or_concatenate") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_add_or_concatenate") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -3618,20 +4123,20 @@ static PyObject *__pyx_pw_8specfile_1_add_or_concatenate(PyObject *__pyx_self, P
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_add_or_concatenate", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile__add_or_concatenate(__pyx_self, __pyx_v_dictionary, __pyx_v_key, __pyx_v_value);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile__add_or_concatenate(__pyx_self, __pyx_v_dictionary, __pyx_v_key, __pyx_v_value);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
+static PyObject *__pyx_pf_4silx_2io_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_dictionary, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -3644,111 +4149,136 @@ static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_add_or_concatenate", 0);
- /* "specfile.pyx":329
+ /* "silx/io/specfile.pyx":328
* Else append/concatenate the new value to the existing one
* """
* try: # <<<<<<<<<<<<<<
- * if not key in dictionary:
+ * if key not in dictionary:
* dictionary[key] = value
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "specfile.pyx":330
+ /* "silx/io/specfile.pyx":329
* """
* try:
- * if not key in dictionary: # <<<<<<<<<<<<<<
+ * if key not in dictionary: # <<<<<<<<<<<<<<
* dictionary[key] = value
* else:
*/
- __pyx_t_4 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_v_dictionary, Py_NE)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_v_dictionary, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 329, __pyx_L3_error)
__pyx_t_5 = (__pyx_t_4 != 0);
if (__pyx_t_5) {
- /* "specfile.pyx":331
+ /* "silx/io/specfile.pyx":330
* try:
- * if not key in dictionary:
+ * if key not in dictionary:
* dictionary[key] = value # <<<<<<<<<<<<<<
* else:
* dictionary[key] += "\n" + value
*/
- if (unlikely(PyObject_SetItem(__pyx_v_dictionary, __pyx_v_key, __pyx_v_value) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(PyObject_SetItem(__pyx_v_dictionary, __pyx_v_key, __pyx_v_value) < 0)) __PYX_ERR(0, 330, __pyx_L3_error)
+
+ /* "silx/io/specfile.pyx":329
+ * """
+ * try:
+ * if key not in dictionary: # <<<<<<<<<<<<<<
+ * dictionary[key] = value
+ * else:
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "specfile.pyx":333
+ /* "silx/io/specfile.pyx":332
* dictionary[key] = value
* else:
* dictionary[key] += "\n" + value # <<<<<<<<<<<<<<
* except TypeError:
* raise TypeError("Parameter value must be a string.")
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_key);
__pyx_t_6 = __pyx_v_key;
- __pyx_t_7 = PyObject_GetItem(__pyx_v_dictionary, __pyx_t_6); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;};
+ __pyx_t_7 = PyObject_GetItem(__pyx_v_dictionary, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyNumber_Add(__pyx_kp_s_, __pyx_v_value); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_8 = PyNumber_Add(__pyx_kp_s_, __pyx_v_value); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_9 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (unlikely(PyObject_SetItem(__pyx_v_dictionary, __pyx_t_6, __pyx_t_9) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(PyObject_SetItem(__pyx_v_dictionary, __pyx_t_6, __pyx_t_9) < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
__pyx_L11:;
+
+ /* "silx/io/specfile.pyx":328
+ * Else append/concatenate the new value to the existing one
+ * """
+ * try: # <<<<<<<<<<<<<<
+ * if key not in dictionary:
+ * dictionary[key] = value
+ */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L10_try_end;
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "specfile.pyx":334
+ /* "silx/io/specfile.pyx":333
* else:
* dictionary[key] += "\n" + value
* except TypeError: # <<<<<<<<<<<<<<
* raise TypeError("Parameter value must be a string.")
*
*/
- __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_10) {
- __Pyx_AddTraceback("specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __Pyx_AddTraceback("silx.io.specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_9, &__pyx_t_8) < 0) __PYX_ERR(0, 333, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_8);
- /* "specfile.pyx":335
+ /* "silx/io/specfile.pyx":334
* dictionary[key] += "\n" + value
* except TypeError:
* raise TypeError("Parameter value must be a string.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_Raise(__pyx_t_7, 0, 0, 0);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(0, 334, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "silx/io/specfile.pyx":328
+ * Else append/concatenate the new value to the existing one
+ * """
+ * try: # <<<<<<<<<<<<<<
+ * if key not in dictionary:
+ * dictionary[key] = value
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
@@ -3757,7 +4287,7 @@ static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *
__pyx_L10_try_end:;
}
- /* "specfile.pyx":325
+ /* "silx/io/specfile.pyx":324
*
*
* def _add_or_concatenate(dictionary, key, value): # <<<<<<<<<<<<<<
@@ -3773,7 +4303,7 @@ static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile._add_or_concatenate", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3781,7 +4311,7 @@ static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "specfile.pyx":363
+/* "silx/io/specfile.pyx":362
* scan2 = sf["3.1"]
* """
* def __init__(self, specfile, scan_index): # <<<<<<<<<<<<<<
@@ -3790,16 +4320,13 @@ static PyObject *__pyx_pf_8specfile__add_or_concatenate(CYTHON_UNUSED PyObject *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_4Scan___init__[] = "Scan.__init__(self, specfile, scan_index)";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_1__init__ = {"__init__", (PyCFunction)__pyx_pw_8specfile_4Scan_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_4Scan___init__};
-static PyObject *__pyx_pw_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan___init__[] = "Scan.__init__(self, specfile, scan_index)";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_1__init__ = {"__init__", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_4Scan___init__};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_specfile = 0;
PyObject *__pyx_v_scan_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
@@ -3824,16 +4351,16 @@ static PyObject *__pyx_pw_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObje
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_specfile_2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 362, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scan_index)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 362, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 362, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
goto __pyx_L5_argtuple_error;
@@ -3848,20 +4375,20 @@ static PyObject *__pyx_pw_8specfile_4Scan_1__init__(PyObject *__pyx_self, PyObje
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 362, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_4Scan___init__(__pyx_self, __pyx_v_self, __pyx_v_specfile, __pyx_v_scan_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan___init__(__pyx_self, __pyx_v_self, __pyx_v_specfile, __pyx_v_scan_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_specfile, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_specfile, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_v_line = NULL;
PyObject *__pyx_v_match = NULL;
PyObject *__pyx_v_match_mca = NULL;
@@ -3878,48 +4405,44 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
int __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
- Py_ssize_t __pyx_t_9;
+ int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
- int __pyx_t_14;
+ PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "specfile.pyx":364
+ /* "silx/io/specfile.pyx":363
* """
* def __init__(self, specfile, scan_index):
* self._specfile = specfile # <<<<<<<<<<<<<<
*
* self._index = scan_index
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_specfile, __pyx_v_specfile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_specfile, __pyx_v_specfile) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
- /* "specfile.pyx":366
+ /* "silx/io/specfile.pyx":365
* self._specfile = specfile
*
* self._index = scan_index # <<<<<<<<<<<<<<
* self._number = specfile.number(scan_index)
* self._order = specfile.order(scan_index)
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index_2, __pyx_v_scan_index) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_index_2, __pyx_v_scan_index) < 0) __PYX_ERR(0, 365, __pyx_L1_error)
- /* "specfile.pyx":367
+ /* "silx/io/specfile.pyx":366
*
* self._index = scan_index
* self._number = specfile.number(scan_index) # <<<<<<<<<<<<<<
* self._order = specfile.order(scan_index)
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_specfile, __pyx_n_s_number); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_specfile, __pyx_n_s_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3929,34 +4452,52 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_scan_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_scan_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __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 = NULL;
- __Pyx_INCREF(__pyx_v_scan_index);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_scan_index);
- __Pyx_GIVEREF(__pyx_v_scan_index);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_scan_index);
+ __Pyx_GIVEREF(__pyx_v_scan_index);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_scan_index);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_number_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_number_2, __pyx_t_1) < 0) __PYX_ERR(0, 366, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":368
+ /* "silx/io/specfile.pyx":367
* self._index = scan_index
* self._number = specfile.number(scan_index)
* self._order = specfile.order(scan_index) # <<<<<<<<<<<<<<
*
* self._scan_header_lines = self._specfile.scan_header(self._index)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_specfile, __pyx_n_s_order); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_specfile, __pyx_n_s_order); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3966,39 +4507,57 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_scan_index); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_scan_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __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;
- __Pyx_INCREF(__pyx_v_scan_index);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_scan_index);
- __Pyx_GIVEREF(__pyx_v_scan_index);
- __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 = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_scan_index);
+ __Pyx_GIVEREF(__pyx_v_scan_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_scan_index);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __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;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_2, __pyx_t_1) < 0) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":370
+ /* "silx/io/specfile.pyx":369
* self._order = specfile.order(scan_index)
*
* self._scan_header_lines = self._specfile.scan_header(self._index) # <<<<<<<<<<<<<<
* self._file_header_lines = self._specfile.file_header(self._index)
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scan_header); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_scan_header); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -4008,40 +4567,60 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
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 = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __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 = 370; __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 = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __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 (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines, __pyx_t_1) < 0) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":371
+ /* "silx/io/specfile.pyx":370
*
* self._scan_header_lines = self._specfile.scan_header(self._index)
* self._file_header_lines = self._specfile.file_header(self._index) # <<<<<<<<<<<<<<
*
* if self._file_header_lines == self._scan_header_lines:
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_header); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_header); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -4051,132 +4630,160 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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 = 371; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_3};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines, __pyx_t_1) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":373
+ /* "silx/io/specfile.pyx":372
* self._file_header_lines = self._specfile.file_header(self._index)
*
* if self._file_header_lines == self._scan_header_lines: # <<<<<<<<<<<<<<
* self._file_header_lines = []
* self._header = self._file_header_lines + self._scan_header_lines
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "specfile.pyx":374
+ /* "silx/io/specfile.pyx":373
*
* if self._file_header_lines == self._scan_header_lines:
* self._file_header_lines = [] # <<<<<<<<<<<<<<
* self._header = self._file_header_lines + self._scan_header_lines
*
*/
- __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 373, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines, __pyx_t_4) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":372
+ * self._file_header_lines = self._specfile.file_header(self._index)
+ *
+ * if self._file_header_lines == self._scan_header_lines: # <<<<<<<<<<<<<<
+ * self._file_header_lines = []
+ * self._header = self._file_header_lines + self._scan_header_lines
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":375
+ /* "silx/io/specfile.pyx":374
* if self._file_header_lines == self._scan_header_lines:
* self._file_header_lines = []
* self._header = self._file_header_lines + self._scan_header_lines # <<<<<<<<<<<<<<
*
* self._scan_header_dict = {}
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_header, __pyx_t_1) < 0) __PYX_ERR(0, 374, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":377
+ /* "silx/io/specfile.pyx":376
* self._header = self._file_header_lines + self._scan_header_lines
*
* self._scan_header_dict = {} # <<<<<<<<<<<<<<
* self._mca_header_dict = {}
* for line in self._scan_header_lines:
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict, __pyx_t_1) < 0) __PYX_ERR(0, 376, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":378
+ /* "silx/io/specfile.pyx":377
*
* self._scan_header_dict = {}
* self._mca_header_dict = {} # <<<<<<<<<<<<<<
* for line in self._scan_header_lines:
* match = re.search(r"#(\w+) *(.*)", line)
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2, __pyx_t_1) < 0) __PYX_ERR(0, 377, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":379
+ /* "silx/io/specfile.pyx":378
* self._scan_header_dict = {}
* self._mca_header_dict = {}
* for line in self._scan_header_lines: # <<<<<<<<<<<<<<
* match = re.search(r"#(\w+) *(.*)", line)
* match_mca = re.search(r"#@(\w+) *(.*)", line)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 378, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
@@ -4185,7 +4792,7 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
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 = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 378, __pyx_L1_error)
}
break;
}
@@ -4194,21 +4801,21 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":380
+ /* "silx/io/specfile.pyx":379
* self._mca_header_dict = {}
* for line in self._scan_header_lines:
* match = re.search(r"#(\w+) *(.*)", line) # <<<<<<<<<<<<<<
* match_mca = re.search(r"#@(\w+) *(.*)", line)
* if match:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -4218,39 +4825,57 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_INCREF(__pyx_kp_s_w);
- PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_kp_s_w);
- __Pyx_GIVEREF(__pyx_kp_s_w);
- __Pyx_INCREF(__pyx_v_line);
- PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_v_line);
- __Pyx_GIVEREF(__pyx_v_line);
- __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 = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_w, __pyx_v_line};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s_w, __pyx_v_line};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_w);
+ __Pyx_GIVEREF(__pyx_kp_s_w);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_9, __pyx_kp_s_w);
+ __Pyx_INCREF(__pyx_v_line);
+ __Pyx_GIVEREF(__pyx_v_line);
+ PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_9, __pyx_v_line);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __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_XDECREF_SET(__pyx_v_match, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":381
+ /* "silx/io/specfile.pyx":380
* for line in self._scan_header_lines:
* match = re.search(r"#(\w+) *(.*)", line)
* match_mca = re.search(r"#@(\w+) *(.*)", line) # <<<<<<<<<<<<<<
* if match:
* hkey = match.group(1).lstrip("#").strip()
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4260,57 +4885,75 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_kp_s_w_2);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_kp_s_w_2);
- __Pyx_GIVEREF(__pyx_kp_s_w_2);
- __Pyx_INCREF(__pyx_v_line);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_line);
- __Pyx_GIVEREF(__pyx_v_line);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s_w_2, __pyx_v_line};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s_w_2, __pyx_v_line};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_w_2);
+ __Pyx_GIVEREF(__pyx_kp_s_w_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_kp_s_w_2);
+ __Pyx_INCREF(__pyx_v_line);
+ __Pyx_GIVEREF(__pyx_v_line);
+ PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_line);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_match_mca, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":382
+ /* "silx/io/specfile.pyx":381
* match = re.search(r"#(\w+) *(.*)", line)
* match_mca = re.search(r"#@(\w+) *(.*)", line)
* if match: # <<<<<<<<<<<<<<
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip()
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
if (__pyx_t_6) {
- /* "specfile.pyx":383
+ /* "silx/io/specfile.pyx":382
* match_mca = re.search(r"#@(\w+) *(.*)", line)
* if match:
* hkey = match.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4320,33 +4963,33 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_hkey, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":384
+ /* "silx/io/specfile.pyx":383
* if match:
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
* elif match_mca:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4356,30 +4999,30 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_hvalue, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":385
+ /* "silx/io/specfile.pyx":384
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue) # <<<<<<<<<<<<<<
* elif match_mca:
* hkey = match_mca.group(1).lstrip("#").strip()
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4389,61 +5032,89 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_4, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_hkey);
+ __Pyx_GIVEREF(__pyx_v_hkey);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_hkey);
+ __Pyx_INCREF(__pyx_v_hvalue);
+ __Pyx_GIVEREF(__pyx_v_hvalue);
+ PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_hvalue);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_hkey);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_hkey);
- __Pyx_GIVEREF(__pyx_v_hkey);
- __Pyx_INCREF(__pyx_v_hvalue);
- PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_hvalue);
- __Pyx_GIVEREF(__pyx_v_hvalue);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/io/specfile.pyx":381
+ * match = re.search(r"#(\w+) *(.*)", line)
+ * match_mca = re.search(r"#@(\w+) *(.*)", line)
+ * if match: # <<<<<<<<<<<<<<
+ * hkey = match.group(1).lstrip("#").strip()
+ * hvalue = match.group(2).strip()
+ */
goto __pyx_L6;
}
- /* "specfile.pyx":386
+ /* "silx/io/specfile.pyx":385
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
* elif match_mca: # <<<<<<<<<<<<<<
* hkey = match_mca.group(1).lstrip("#").strip()
* hvalue = match_mca.group(2).strip()
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match_mca); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match_mca); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 385, __pyx_L1_error)
if (__pyx_t_6) {
- /* "specfile.pyx":387
+ /* "silx/io/specfile.pyx":386
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
* elif match_mca:
* hkey = match_mca.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match_mca.group(2).strip()
* _add_or_concatenate(self._mca_header_dict, hkey, hvalue)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_mca, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_mca, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4453,33 +5124,33 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_10) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_hkey, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":388
+ /* "silx/io/specfile.pyx":387
* elif match_mca:
* hkey = match_mca.group(1).lstrip("#").strip()
* hvalue = match_mca.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._mca_header_dict, hkey, hvalue)
* else:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_mca, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_match_mca, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4489,30 +5160,30 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_10) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF_SET(__pyx_v_hvalue, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":389
+ /* "silx/io/specfile.pyx":388
* hkey = match_mca.group(1).lstrip("#").strip()
* hvalue = match_mca.group(2).strip()
* _add_or_concatenate(self._mca_header_dict, hkey, hvalue) # <<<<<<<<<<<<<<
* else:
* # this shouldn't happen
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_4 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4522,45 +5193,73 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_3 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_10, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_10, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_t_10);
+ __Pyx_INCREF(__pyx_v_hkey);
+ __Pyx_GIVEREF(__pyx_v_hkey);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_v_hkey);
+ __Pyx_INCREF(__pyx_v_hvalue);
+ __Pyx_GIVEREF(__pyx_v_hvalue);
+ PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_9, __pyx_v_hvalue);
+ __pyx_t_10 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_v_hkey);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_v_hkey);
- __Pyx_GIVEREF(__pyx_v_hkey);
- __Pyx_INCREF(__pyx_v_hvalue);
- PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_9, __pyx_v_hvalue);
- __Pyx_GIVEREF(__pyx_v_hvalue);
- __pyx_t_10 = 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 = 389; __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;
+
+ /* "silx/io/specfile.pyx":385
+ * hvalue = match.group(2).strip()
+ * _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
+ * elif match_mca: # <<<<<<<<<<<<<<
+ * hkey = match_mca.group(1).lstrip("#").strip()
+ * hvalue = match_mca.group(2).strip()
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "specfile.pyx":392
+ /* "silx/io/specfile.pyx":391
* else:
* # this shouldn't happen
* _logger.warning("Unable to parse scan header line " + line) # <<<<<<<<<<<<<<
*
* self._labels = []
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Unable_to_parse_scan_header_line, __pyx_v_line); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Unable_to_parse_scan_header_line, __pyx_v_line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -4570,26 +5269,46 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_10) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = 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 = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __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_ERR(0, 391, __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;
}
__pyx_L6:;
- /* "specfile.pyx":379
+ /* "silx/io/specfile.pyx":378
* self._scan_header_dict = {}
* self._mca_header_dict = {}
* for line in self._scan_header_lines: # <<<<<<<<<<<<<<
@@ -4599,35 +5318,35 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "specfile.pyx":394
+ /* "silx/io/specfile.pyx":393
* _logger.warning("Unable to parse scan header line " + line)
*
* self._labels = [] # <<<<<<<<<<<<<<
* if self.record_exists_in_hdr('L'):
* try:
*/
- __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_5) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "specfile.pyx":395
+ /* "silx/io/specfile.pyx":394
*
* self._labels = []
* if self.record_exists_in_hdr('L'): # <<<<<<<<<<<<<<
* try:
* self._labels = self._specfile.labels(self._index)
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_record_exists_in_hdr); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_record_exists_in_hdr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "specfile.pyx":396
+ /* "silx/io/specfile.pyx":395
* self._labels = []
* if self.record_exists_in_hdr('L'):
* try: # <<<<<<<<<<<<<<
@@ -4635,28 +5354,30 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
* except SfErrLineNotFound:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_11);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
/*try:*/ {
- /* "specfile.pyx":397
+ /* "silx/io/specfile.pyx":396
* if self.record_exists_in_hdr('L'):
* try:
* self._labels = self._specfile.labels(self._index) # <<<<<<<<<<<<<<
* except SfErrLineNotFound:
* # SpecFile.labels raises an IndexError when encountering
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_labels_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_labels_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L8_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -4666,29 +5387,58 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L8_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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 = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 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 = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L8_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L8_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L8_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 396, __pyx_L8_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L8_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_1) < 0) __PYX_ERR(0, 396, __pyx_L8_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/io/specfile.pyx":395
+ * self._labels = []
+ * if self.record_exists_in_hdr('L'):
+ * try: # <<<<<<<<<<<<<<
+ * self._labels = self._specfile.labels(self._index)
+ * except SfErrLineNotFound:
+ */
}
__Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
goto __pyx_L15_try_end;
__pyx_L8_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -4696,95 +5446,115 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":398
+ /* "silx/io/specfile.pyx":397
* try:
* self._labels = self._specfile.labels(self._index)
* except SfErrLineNotFound: # <<<<<<<<<<<<<<
* # SpecFile.labels raises an IndexError when encountering
* # a Scan with no data, even if the header exists.
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 397, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_14 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_14) {
- __Pyx_AddTraceback("specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("silx.io.specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 397, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":401
+ /* "silx/io/specfile.pyx":400
* # SpecFile.labels raises an IndexError when encountering
* # a Scan with no data, even if the header exists.
* L_header = re.sub(r" {2,}", " ", # max. 2 spaces # <<<<<<<<<<<<<<
* self._scan_header_dict["L"])
* self._labels = L_header.split(" ")
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sub); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sub); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":402
+ /* "silx/io/specfile.pyx":401
* # a Scan with no data, even if the header exists.
* L_header = re.sub(r" {2,}", " ", # max. 2 spaces
* self._scan_header_dict["L"]) # <<<<<<<<<<<<<<
* self._labels = L_header.split(" ")
*
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_15 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_L); if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;};
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_14 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_L); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 401, __pyx_L10_except_error)
+ __Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- __pyx_t_7 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_7 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_16 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
- __Pyx_GOTREF(__pyx_t_16);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_kp_s_2, __pyx_kp_s__14, __pyx_t_14};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L10_except_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_kp_s_2, __pyx_kp_s__14, __pyx_t_14};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L10_except_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 400, __pyx_L10_except_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_2);
+ __Pyx_GIVEREF(__pyx_kp_s_2);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_kp_s_2);
+ __Pyx_INCREF(__pyx_kp_s__14);
+ __Pyx_GIVEREF(__pyx_kp_s__14);
+ PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_kp_s__14);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_9, __pyx_t_14);
+ __pyx_t_14 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L10_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
- __Pyx_INCREF(__pyx_kp_s_2);
- PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_7, __pyx_kp_s_2);
- __Pyx_GIVEREF(__pyx_kp_s_2);
- __Pyx_INCREF(__pyx_kp_s__14);
- PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_7, __pyx_kp_s__14);
- __Pyx_GIVEREF(__pyx_kp_s__14);
- PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_7, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_t_15 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_L_header = __pyx_t_5;
__pyx_t_5 = 0;
- /* "specfile.pyx":403
+ /* "silx/io/specfile.pyx":402
* L_header = re.sub(r" {2,}", " ", # max. 2 spaces
* self._scan_header_dict["L"])
* self._labels = L_header.split(" ") # <<<<<<<<<<<<<<
*
- *
+ * self._file_header_dict = {}
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_L_header, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_L_header, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 402, __pyx_L10_except_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L10_except_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_labels, __pyx_t_10) < 0) __PYX_ERR(0, 402, __pyx_L10_except_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -4793,67 +5563,85 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
goto __pyx_L10_except_error;
__pyx_L10_except_error:;
+
+ /* "silx/io/specfile.pyx":395
+ * self._labels = []
+ * if self.record_exists_in_hdr('L'):
+ * try: # <<<<<<<<<<<<<<
+ * self._labels = self._specfile.labels(self._index)
+ * except SfErrLineNotFound:
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
goto __pyx_L1_error;
__pyx_L9_exception_handled:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_11);
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
__pyx_L15_try_end:;
}
- goto __pyx_L7;
- }
- __pyx_L7:;
- /* "specfile.pyx":406
+ /* "silx/io/specfile.pyx":394
*
+ * self._labels = []
+ * if self.record_exists_in_hdr('L'): # <<<<<<<<<<<<<<
+ * try:
+ * self._labels = self._specfile.labels(self._index)
+ */
+ }
+
+ /* "silx/io/specfile.pyx":404
+ * self._labels = L_header.split(" ")
*
* self._file_header_dict = {} # <<<<<<<<<<<<<<
* for line in self._file_header_lines:
* match = re.search(r"#(\w+) *(.*)", line)
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict, __pyx_t_2) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":407
+ /* "silx/io/specfile.pyx":405
*
* self._file_header_dict = {}
* for line in self._file_header_lines: # <<<<<<<<<<<<<<
* match = re.search(r"#(\w+) *(.*)", line)
* if match:
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
__pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __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[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
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_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
@@ -4862,7 +5650,7 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
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 = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 405, __pyx_L1_error)
}
break;
}
@@ -4871,21 +5659,21 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_2);
__pyx_t_2 = 0;
- /* "specfile.pyx":408
+ /* "silx/io/specfile.pyx":406
* self._file_header_dict = {}
* for line in self._file_header_lines:
* match = re.search(r"#(\w+) *(.*)", line) # <<<<<<<<<<<<<<
* if match:
* # header type
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -4895,57 +5683,75 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_1) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- }
- __Pyx_INCREF(__pyx_kp_s_w);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_kp_s_w);
- __Pyx_GIVEREF(__pyx_kp_s_w);
- __Pyx_INCREF(__pyx_v_line);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_line);
- __Pyx_GIVEREF(__pyx_v_line);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_w, __pyx_v_line};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_w, __pyx_v_line};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_1) {
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_w);
+ __Pyx_GIVEREF(__pyx_kp_s_w);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_kp_s_w);
+ __Pyx_INCREF(__pyx_v_line);
+ __Pyx_GIVEREF(__pyx_v_line);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_v_line);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_2);
__pyx_t_2 = 0;
- /* "specfile.pyx":409
+ /* "silx/io/specfile.pyx":407
* for line in self._file_header_lines:
* match = re.search(r"#(\w+) *(.*)", line)
* if match: # <<<<<<<<<<<<<<
* # header type
* hkey = match.group(1).lstrip("#").strip()
*/
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_match); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 407, __pyx_L1_error)
if (__pyx_t_6) {
- /* "specfile.pyx":411
+ /* "silx/io/specfile.pyx":409
* if match:
* # header type
* hkey = match.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._file_header_dict, hkey, hvalue)
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_lstrip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -4955,33 +5761,33 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF_SET(__pyx_v_hkey, __pyx_t_2);
__pyx_t_2 = 0;
- /* "specfile.pyx":412
+ /* "silx/io/specfile.pyx":410
* # header type
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._file_header_dict, hkey, hvalue)
* else:
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_strip); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -4991,30 +5797,30 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF_SET(__pyx_v_hvalue, __pyx_t_2);
__pyx_t_2 = 0;
- /* "specfile.pyx":413
+ /* "silx/io/specfile.pyx":411
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._file_header_dict, hkey, hvalue) # <<<<<<<<<<<<<<
* else:
* _logger.warning("Unable to parse file header line " + line)
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_add_or_concatenate); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_1 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -5024,74 +5830,122 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__pyx_t_9 = 1;
}
}
- __pyx_t_16 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- if (__pyx_t_1) {
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_5, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_5, __pyx_v_hkey, __pyx_v_hvalue};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ if (__pyx_t_1) {
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_9, __pyx_t_5);
+ __Pyx_INCREF(__pyx_v_hkey);
+ __Pyx_GIVEREF(__pyx_v_hkey);
+ PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_9, __pyx_v_hkey);
+ __Pyx_INCREF(__pyx_v_hvalue);
+ __Pyx_GIVEREF(__pyx_v_hvalue);
+ PyTuple_SET_ITEM(__pyx_t_15, 2+__pyx_t_9, __pyx_v_hvalue);
+ __pyx_t_5 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_9, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_hkey);
- PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_9, __pyx_v_hkey);
- __Pyx_GIVEREF(__pyx_v_hkey);
- __Pyx_INCREF(__pyx_v_hvalue);
- PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_9, __pyx_v_hvalue);
- __Pyx_GIVEREF(__pyx_v_hvalue);
- __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "silx/io/specfile.pyx":407
+ * for line in self._file_header_lines:
+ * match = re.search(r"#(\w+) *(.*)", line)
+ * if match: # <<<<<<<<<<<<<<
+ * # header type
+ * hkey = match.group(1).lstrip("#").strip()
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "specfile.pyx":415
+ /* "silx/io/specfile.pyx":413
* _add_or_concatenate(self._file_header_dict, hkey, hvalue)
* else:
* _logger.warning("Unable to parse file header line " + line) # <<<<<<<<<<<<<<
*
* self._motor_names = self._specfile.motor_names(self._index)
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_warning); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_warning); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Unable_to_parse_file_header_line, __pyx_v_line); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyNumber_Add(__pyx_kp_s_Unable_to_parse_file_header_line, __pyx_v_line); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 413, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_16);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_15))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_15);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
+ __Pyx_DECREF_SET(__pyx_t_15, function);
}
}
if (!__pyx_t_5) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_15)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_10};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_10};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L20:;
- /* "specfile.pyx":407
+ /* "silx/io/specfile.pyx":405
*
* self._file_header_dict = {}
* for line in self._file_header_lines: # <<<<<<<<<<<<<<
@@ -5101,65 +5955,85 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":417
+ /* "silx/io/specfile.pyx":415
* _logger.warning("Unable to parse file header line " + line)
*
* self._motor_names = self._specfile.motor_names(self._index) # <<<<<<<<<<<<<<
* self._motor_positions = self._specfile.motor_positions(self._index)
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_motor_names); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_motor_names); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_16))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_16);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_15))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15);
if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_16, function);
+ __Pyx_DECREF_SET(__pyx_t_15, function);
}
}
if (!__pyx_t_1) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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 = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_16, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_15)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_15)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_15, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_motor_names_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_motor_names_2, __pyx_t_3) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":418
+ /* "silx/io/specfile.pyx":416
*
* self._motor_names = self._specfile.motor_names(self._index)
* self._motor_positions = self._specfile.motor_positions(self._index) # <<<<<<<<<<<<<<
*
* self._data = None
*/
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_n_s_motor_positions); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_motor_positions); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
- __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -5169,43 +6043,63 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_2) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_16); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- 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+1, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_16 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_15};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_15};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_15);
+ __pyx_t_15 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 416, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_motor_positions_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_motor_positions_2, __pyx_t_3) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":420
+ /* "silx/io/specfile.pyx":418
* self._motor_positions = self._specfile.motor_positions(self._index)
*
* self._data = None # <<<<<<<<<<<<<<
* self._mca = None
*
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, Py_None) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
- /* "specfile.pyx":421
+ /* "silx/io/specfile.pyx":419
*
* self._data = None
* self._mca = None # <<<<<<<<<<<<<<
*
* @cython.embedsignature(False)
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca, Py_None) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
- /* "specfile.pyx":363
+ /* "silx/io/specfile.pyx":362
* scan2 = sf["3.1"]
* """
* def __init__(self, specfile, scan_index): # <<<<<<<<<<<<<<
@@ -5223,9 +6117,9 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_line);
@@ -5239,7 +6133,7 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "specfile.pyx":425
+/* "silx/io/specfile.pyx":423
* @cython.embedsignature(False)
* @property
* def index(self): # <<<<<<<<<<<<<<
@@ -5248,30 +6142,27 @@ static PyObject *__pyx_pf_8specfile_4Scan___init__(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_3index(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_2index[] = "Unique scan index 0 - len(specfile)-1\n\n This attribute is implemented as a read-only property as changing\n its value may cause nasty side-effects (such as loading data from a\n different scan without updating the header accordingly.";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_3index = {"index", (PyCFunction)__pyx_pw_8specfile_4Scan_3index, METH_O, __pyx_doc_8specfile_4Scan_2index};
-static PyObject *__pyx_pw_8specfile_4Scan_3index(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_3index(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_2index[] = "Unique scan index 0 - len(specfile)-1\n\n This attribute is implemented as a read-only property as changing\n its value may cause nasty side-effects (such as loading data from a\n different scan without updating the header accordingly.";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_3index = {"index", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_3index, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_2index};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_3index(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("index (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_2index(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_2index(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("index", 0);
- /* "specfile.pyx":431
+ /* "silx/io/specfile.pyx":429
* its value may cause nasty side-effects (such as loading data from a
* different scan without updating the header accordingly."""
* return self._index # <<<<<<<<<<<<<<
@@ -5279,13 +6170,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_s
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":425
+ /* "silx/io/specfile.pyx":423
* @cython.embedsignature(False)
* @property
* def index(self): # <<<<<<<<<<<<<<
@@ -5296,7 +6187,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_s
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5304,7 +6195,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_s
return __pyx_r;
}
-/* "specfile.pyx":435
+/* "silx/io/specfile.pyx":433
* @cython.embedsignature(False)
* @property
* def number(self): # <<<<<<<<<<<<<<
@@ -5313,30 +6204,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_2index(CYTHON_UNUSED PyObject *__pyx_s
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_5number(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_4number[] = "First value on #S line (as int)";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_5number = {"number", (PyCFunction)__pyx_pw_8specfile_4Scan_5number, METH_O, __pyx_doc_8specfile_4Scan_4number};
-static PyObject *__pyx_pw_8specfile_4Scan_5number(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_5number(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_4number[] = "First value on #S line (as int)";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_5number = {"number", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_5number, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_4number};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_5number(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("number (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_4number(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_4number(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("number", 0);
- /* "specfile.pyx":437
+ /* "silx/io/specfile.pyx":435
* def number(self):
* """First value on #S line (as int)"""
* return self._number # <<<<<<<<<<<<<<
@@ -5344,13 +6232,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_number_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_number_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":435
+ /* "silx/io/specfile.pyx":433
* @cython.embedsignature(False)
* @property
* def number(self): # <<<<<<<<<<<<<<
@@ -5361,7 +6249,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.number", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.number", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5369,7 +6257,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "specfile.pyx":441
+/* "silx/io/specfile.pyx":439
* @cython.embedsignature(False)
* @property
* def order(self): # <<<<<<<<<<<<<<
@@ -5378,30 +6266,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_4number(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_7order(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_6order[] = "Order can be > 1 if the same number is repeated in a specfile";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_7order = {"order", (PyCFunction)__pyx_pw_8specfile_4Scan_7order, METH_O, __pyx_doc_8specfile_4Scan_6order};
-static PyObject *__pyx_pw_8specfile_4Scan_7order(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_7order(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_6order[] = "Order can be > 1 if the same number is repeated in a specfile";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_7order = {"order", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_7order, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_6order};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_7order(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("order (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_6order(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_6order(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("order", 0);
- /* "specfile.pyx":443
+ /* "silx/io/specfile.pyx":441
* def order(self):
* """Order can be > 1 if the same number is repeated in a specfile"""
* return self._order # <<<<<<<<<<<<<<
@@ -5409,13 +6294,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_s
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":441
+ /* "silx/io/specfile.pyx":439
* @cython.embedsignature(False)
* @property
* def order(self): # <<<<<<<<<<<<<<
@@ -5426,7 +6311,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_s
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5434,7 +6319,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_s
return __pyx_r;
}
-/* "specfile.pyx":447
+/* "silx/io/specfile.pyx":445
* @cython.embedsignature(False)
* @property
* def header(self): # <<<<<<<<<<<<<<
@@ -5443,30 +6328,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_6order(CYTHON_UNUSED PyObject *__pyx_s
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_9header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_8header[] = "List of raw header lines (as a list of strings).\n\n This includes the file header, the scan header and possibly a MCA\n header.\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_9header = {"header", (PyCFunction)__pyx_pw_8specfile_4Scan_9header, METH_O, __pyx_doc_8specfile_4Scan_8header};
-static PyObject *__pyx_pw_8specfile_4Scan_9header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_9header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_8header[] = "List of raw header lines (as a list of strings).\n\n This includes the file header, the scan header and possibly a MCA\n header.\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_9header = {"header", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_9header, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_8header};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_9header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("header (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_8header(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_8header(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("header", 0);
- /* "specfile.pyx":453
+ /* "silx/io/specfile.pyx":451
* header.
* """
* return self._header # <<<<<<<<<<<<<<
@@ -5474,13 +6356,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":447
+ /* "silx/io/specfile.pyx":445
* @cython.embedsignature(False)
* @property
* def header(self): # <<<<<<<<<<<<<<
@@ -5491,7 +6373,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5499,7 +6381,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "specfile.pyx":457
+/* "silx/io/specfile.pyx":455
* @cython.embedsignature(False)
* @property
* def scan_header(self): # <<<<<<<<<<<<<<
@@ -5508,30 +6390,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_8header(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_11scan_header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_10scan_header[] = "List of raw scan header lines (as a list of strings).\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_11scan_header = {"scan_header", (PyCFunction)__pyx_pw_8specfile_4Scan_11scan_header, METH_O, __pyx_doc_8specfile_4Scan_10scan_header};
-static PyObject *__pyx_pw_8specfile_4Scan_11scan_header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_11scan_header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_10scan_header[] = "List of raw scan header lines (as a list of strings).\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_11scan_header = {"scan_header", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_11scan_header, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_10scan_header};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_11scan_header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("scan_header (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_10scan_header(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_10scan_header(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("scan_header", 0);
- /* "specfile.pyx":460
+ /* "silx/io/specfile.pyx":458
* """List of raw scan header lines (as a list of strings).
* """
* return self._scan_header_lines # <<<<<<<<<<<<<<
@@ -5539,13 +6418,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":457
+ /* "silx/io/specfile.pyx":455
* @cython.embedsignature(False)
* @property
* def scan_header(self): # <<<<<<<<<<<<<<
@@ -5556,7 +6435,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.scan_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.scan_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5564,7 +6443,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "specfile.pyx":464
+/* "silx/io/specfile.pyx":462
* @cython.embedsignature(False)
* @property
* def file_header(self): # <<<<<<<<<<<<<<
@@ -5573,30 +6452,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_10scan_header(CYTHON_UNUSED PyObject *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_13file_header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_12file_header[] = "List of raw file header lines (as a list of strings).\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_13file_header = {"file_header", (PyCFunction)__pyx_pw_8specfile_4Scan_13file_header, METH_O, __pyx_doc_8specfile_4Scan_12file_header};
-static PyObject *__pyx_pw_8specfile_4Scan_13file_header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_13file_header(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_12file_header[] = "List of raw file header lines (as a list of strings).\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_13file_header = {"file_header", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_13file_header, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_12file_header};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_13file_header(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("file_header (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_12file_header(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_12file_header(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("file_header", 0);
- /* "specfile.pyx":467
+ /* "silx/io/specfile.pyx":465
* """List of raw file header lines (as a list of strings).
* """
* return self._file_header_lines # <<<<<<<<<<<<<<
@@ -5604,13 +6480,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_lines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":464
+ /* "silx/io/specfile.pyx":462
* @cython.embedsignature(False)
* @property
* def file_header(self): # <<<<<<<<<<<<<<
@@ -5621,7 +6497,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5629,7 +6505,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "specfile.pyx":471
+/* "silx/io/specfile.pyx":469
* @cython.embedsignature(False)
* @property
* def scan_header_dict(self): # <<<<<<<<<<<<<<
@@ -5638,30 +6514,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_12file_header(CYTHON_UNUSED PyObject *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_15scan_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_14scan_header_dict[] = "\n Dictionary of scan header strings, keys without the leading``#``\n (e.g. ``scan_header_dict[\"S\"]``).\n Note: this does not include MCA header lines starting with ``#@``.\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_15scan_header_dict = {"scan_header_dict", (PyCFunction)__pyx_pw_8specfile_4Scan_15scan_header_dict, METH_O, __pyx_doc_8specfile_4Scan_14scan_header_dict};
-static PyObject *__pyx_pw_8specfile_4Scan_15scan_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_15scan_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_14scan_header_dict[] = "\n Dictionary of scan header strings, keys without the leading``#``\n (e.g. ``scan_header_dict[\"S\"]``).\n Note: this does not include MCA header lines starting with ``#@``.\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_15scan_header_dict = {"scan_header_dict", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_15scan_header_dict, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_14scan_header_dict};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_15scan_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("scan_header_dict (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_14scan_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_14scan_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("scan_header_dict", 0);
- /* "specfile.pyx":477
+ /* "silx/io/specfile.pyx":475
* Note: this does not include MCA header lines starting with ``#@``.
* """
* return self._scan_header_dict # <<<<<<<<<<<<<<
@@ -5669,13 +6542,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObj
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scan_header_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":471
+ /* "silx/io/specfile.pyx":469
* @cython.embedsignature(False)
* @property
* def scan_header_dict(self): # <<<<<<<<<<<<<<
@@ -5686,7 +6559,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObj
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.scan_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.scan_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5694,7 +6567,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObj
return __pyx_r;
}
-/* "specfile.pyx":481
+/* "silx/io/specfile.pyx":479
* @cython.embedsignature(False)
* @property
* def mca_header_dict(self): # <<<<<<<<<<<<<<
@@ -5703,30 +6576,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_14scan_header_dict(CYTHON_UNUSED PyObj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_17mca_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_16mca_header_dict[] = "\n Dictionary of MCA header strings, keys without the leading ``#@``\n (e.g. ``mca_header_dict[\"CALIB\"]``).\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_17mca_header_dict = {"mca_header_dict", (PyCFunction)__pyx_pw_8specfile_4Scan_17mca_header_dict, METH_O, __pyx_doc_8specfile_4Scan_16mca_header_dict};
-static PyObject *__pyx_pw_8specfile_4Scan_17mca_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_17mca_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_16mca_header_dict[] = "\n Dictionary of MCA header strings, keys without the leading ``#@``\n (e.g. ``mca_header_dict[\"CALIB\"]``).\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_17mca_header_dict = {"mca_header_dict", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_17mca_header_dict, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_16mca_header_dict};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_17mca_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mca_header_dict (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_16mca_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_16mca_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("mca_header_dict", 0);
- /* "specfile.pyx":486
+ /* "silx/io/specfile.pyx":484
* (e.g. ``mca_header_dict["CALIB"]``).
* """
* return self._mca_header_dict # <<<<<<<<<<<<<<
@@ -5734,13 +6604,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObje
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca_header_dict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":481
+ /* "silx/io/specfile.pyx":479
* @cython.embedsignature(False)
* @property
* def mca_header_dict(self): # <<<<<<<<<<<<<<
@@ -5751,7 +6621,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObje
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.mca_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.mca_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5759,7 +6629,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObje
return __pyx_r;
}
-/* "specfile.pyx":490
+/* "silx/io/specfile.pyx":488
* @cython.embedsignature(False)
* @property
* def file_header_dict(self): # <<<<<<<<<<<<<<
@@ -5768,30 +6638,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_16mca_header_dict(CYTHON_UNUSED PyObje
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_19file_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_18file_header_dict[] = "\n Dictionary of file header strings, keys without the leading ``#``\n (e.g. ``file_header_dict[\"F\"]``).\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_19file_header_dict = {"file_header_dict", (PyCFunction)__pyx_pw_8specfile_4Scan_19file_header_dict, METH_O, __pyx_doc_8specfile_4Scan_18file_header_dict};
-static PyObject *__pyx_pw_8specfile_4Scan_19file_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_19file_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_18file_header_dict[] = "\n Dictionary of file header strings, keys without the leading ``#``\n (e.g. ``file_header_dict[\"F\"]``).\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_19file_header_dict = {"file_header_dict", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_19file_header_dict, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_18file_header_dict};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_19file_header_dict(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("file_header_dict (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_18file_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_18file_header_dict(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("file_header_dict", 0);
- /* "specfile.pyx":495
+ /* "silx/io/specfile.pyx":493
* (e.g. ``file_header_dict["F"]``).
* """
* return self._file_header_dict # <<<<<<<<<<<<<<
@@ -5799,13 +6666,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObj
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_file_header_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":490
+ /* "silx/io/specfile.pyx":488
* @cython.embedsignature(False)
* @property
* def file_header_dict(self): # <<<<<<<<<<<<<<
@@ -5816,7 +6683,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObj
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.file_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.file_header_dict", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5824,7 +6691,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObj
return __pyx_r;
}
-/* "specfile.pyx":499
+/* "silx/io/specfile.pyx":497
* @cython.embedsignature(False)
* @property
* def labels(self): # <<<<<<<<<<<<<<
@@ -5833,30 +6700,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_18file_header_dict(CYTHON_UNUSED PyObj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_21labels(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_20labels[] = "\n List of data column headers from ``#L`` scan header\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_21labels = {"labels", (PyCFunction)__pyx_pw_8specfile_4Scan_21labels, METH_O, __pyx_doc_8specfile_4Scan_20labels};
-static PyObject *__pyx_pw_8specfile_4Scan_21labels(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_21labels(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_20labels[] = "\n List of data column headers from ``#L`` scan header\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_21labels = {"labels", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_21labels, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_20labels};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_21labels(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("labels (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_20labels(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_20labels(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("labels", 0);
- /* "specfile.pyx":503
+ /* "silx/io/specfile.pyx":501
* List of data column headers from ``#L`` scan header
* """
* return self._labels # <<<<<<<<<<<<<<
@@ -5864,13 +6728,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_labels); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":499
+ /* "silx/io/specfile.pyx":497
* @cython.embedsignature(False)
* @property
* def labels(self): # <<<<<<<<<<<<<<
@@ -5881,7 +6745,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5889,7 +6753,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "specfile.pyx":507
+/* "silx/io/specfile.pyx":505
* @cython.embedsignature(False)
* @property
* def data(self): # <<<<<<<<<<<<<<
@@ -5898,21 +6762,21 @@ static PyObject *__pyx_pf_8specfile_4Scan_20labels(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_23data(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_22data[] = "Scan data as a 2D numpy.ndarray with the usual attributes\n (e.g. data.shape).\n\n The first index is the detector, the second index is the sample index.\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_23data = {"data", (PyCFunction)__pyx_pw_8specfile_4Scan_23data, METH_O, __pyx_doc_8specfile_4Scan_22data};
-static PyObject *__pyx_pw_8specfile_4Scan_23data(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_23data(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_22data[] = "Scan data as a 2D numpy.ndarray with the usual attributes\n (e.g. data.shape).\n\n The first index is the detector, the second index is the sample index.\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_23data = {"data", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_23data, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_22data};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_23data(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("data (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_22data(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_22data(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -5924,46 +6788,43 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("data", 0);
- /* "specfile.pyx":513
+ /* "silx/io/specfile.pyx":511
* The first index is the detector, the second index is the sample index.
* """
* if self._data is None: # <<<<<<<<<<<<<<
* self._data = numpy.transpose(self._specfile.data(self._index))
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__pyx_t_1 == Py_None);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":514
+ /* "silx/io/specfile.pyx":512
* """
* if self._data is None:
* self._data = numpy.transpose(self._specfile.data(self._index)) # <<<<<<<<<<<<<<
*
* return self._data
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_transpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_data_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_data_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
@@ -5973,23 +6834,43 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (!__pyx_t_8) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -5999,28 +6880,54 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (!__pyx_t_7) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- 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+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":511
+ * The first index is the detector, the second index is the sample index.
+ * """
+ * if self._data is None: # <<<<<<<<<<<<<<
+ * self._data = numpy.transpose(self._specfile.data(self._index))
+ *
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":516
+ /* "silx/io/specfile.pyx":514
* self._data = numpy.transpose(self._specfile.data(self._index))
*
* return self._data # <<<<<<<<<<<<<<
@@ -6028,13 +6935,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":507
+ /* "silx/io/specfile.pyx":505
* @cython.embedsignature(False)
* @property
* def data(self): # <<<<<<<<<<<<<<
@@ -6051,7 +6958,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("specfile.Scan.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6059,7 +6966,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
return __pyx_r;
}
-/* "specfile.pyx":520
+/* "silx/io/specfile.pyx":518
* @cython.embedsignature(False)
* @property
* def mca(self): # <<<<<<<<<<<<<<
@@ -6068,21 +6975,21 @@ static PyObject *__pyx_pf_8specfile_4Scan_22data(CYTHON_UNUSED PyObject *__pyx_s
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_25mca(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_24mca[] = "MCA data in this scan.\n\n Each multichannel analysis is a 1D numpy array. Metadata about\n MCA data is to be found in :py:attr:`mca_header`.\n\n :rtype: :class:`MCA`\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_25mca = {"mca", (PyCFunction)__pyx_pw_8specfile_4Scan_25mca, METH_O, __pyx_doc_8specfile_4Scan_24mca};
-static PyObject *__pyx_pw_8specfile_4Scan_25mca(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_25mca(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_24mca[] = "MCA data in this scan.\n\n Each multichannel analysis is a 1D numpy array. Metadata about\n MCA data is to be found in :py:attr:`mca_header`.\n\n :rtype: :class:`MCA`\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_25mca = {"mca", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_25mca, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_24mca};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_25mca(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mca (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_24mca(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_24mca(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -6091,36 +6998,33 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
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("mca", 0);
- /* "specfile.pyx":528
+ /* "silx/io/specfile.pyx":526
* :rtype: :class:`MCA`
* """
* if self._mca is None: # <<<<<<<<<<<<<<
* self._mca = MCA(self)
* return self._mca
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = (__pyx_t_1 == Py_None);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":529
+ /* "silx/io/specfile.pyx":527
* """
* if self._mca is None:
* self._mca = MCA(self) # <<<<<<<<<<<<<<
* return self._mca
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_MCA); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_MCA); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -6130,27 +7034,51 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __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;
- __Pyx_INCREF(__pyx_v_self);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
- __Pyx_GIVEREF(__pyx_v_self);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_self};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_self);
+ __Pyx_GIVEREF(__pyx_v_self);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_self);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_mca, __pyx_t_1) < 0) __PYX_ERR(0, 527, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":526
+ * :rtype: :class:`MCA`
+ * """
+ * if self._mca is None: # <<<<<<<<<<<<<<
+ * self._mca = MCA(self)
+ * return self._mca
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":530
+ /* "silx/io/specfile.pyx":528
* if self._mca is None:
* self._mca = MCA(self)
* return self._mca # <<<<<<<<<<<<<<
@@ -6158,13 +7086,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_mca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":520
+ /* "silx/io/specfile.pyx":518
* @cython.embedsignature(False)
* @property
* def mca(self): # <<<<<<<<<<<<<<
@@ -6178,7 +7106,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("specfile.Scan.mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6186,7 +7114,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
return __pyx_r;
}
-/* "specfile.pyx":534
+/* "silx/io/specfile.pyx":532
* @cython.embedsignature(False)
* @property
* def motor_names(self): # <<<<<<<<<<<<<<
@@ -6195,30 +7123,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_24mca(CYTHON_UNUSED PyObject *__pyx_se
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_27motor_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_26motor_names[] = "List of motor names from the ``#O`` file header line.\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_27motor_names = {"motor_names", (PyCFunction)__pyx_pw_8specfile_4Scan_27motor_names, METH_O, __pyx_doc_8specfile_4Scan_26motor_names};
-static PyObject *__pyx_pw_8specfile_4Scan_27motor_names(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_27motor_names(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_26motor_names[] = "List of motor names from the ``#O`` file header line.\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_27motor_names = {"motor_names", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_27motor_names, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_26motor_names};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_27motor_names(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_names (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_26motor_names(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_26motor_names(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("motor_names", 0);
- /* "specfile.pyx":537
+ /* "silx/io/specfile.pyx":535
* """List of motor names from the ``#O`` file header line.
* """
* return self._motor_names # <<<<<<<<<<<<<<
@@ -6226,13 +7151,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_motor_names_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_motor_names_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":534
+ /* "silx/io/specfile.pyx":532
* @cython.embedsignature(False)
* @property
* def motor_names(self): # <<<<<<<<<<<<<<
@@ -6243,7 +7168,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6251,7 +7176,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "specfile.pyx":541
+/* "silx/io/specfile.pyx":539
* @cython.embedsignature(False)
* @property
* def motor_positions(self): # <<<<<<<<<<<<<<
@@ -6260,30 +7185,27 @@ static PyObject *__pyx_pf_8specfile_4Scan_26motor_names(CYTHON_UNUSED PyObject *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_29motor_positions(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_4Scan_28motor_positions[] = "List of motor positions as floats from the ``#P`` scan header line.\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_29motor_positions = {"motor_positions", (PyCFunction)__pyx_pw_8specfile_4Scan_29motor_positions, METH_O, __pyx_doc_8specfile_4Scan_28motor_positions};
-static PyObject *__pyx_pw_8specfile_4Scan_29motor_positions(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_29motor_positions(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_28motor_positions[] = "List of motor positions as floats from the ``#P`` scan header line.\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_29motor_positions = {"motor_positions", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_29motor_positions, METH_O, __pyx_doc_4silx_2io_8specfile_4Scan_28motor_positions};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_29motor_positions(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_positions (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4Scan_28motor_positions(__pyx_self, ((PyObject *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_28motor_positions(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("motor_positions", 0);
- /* "specfile.pyx":544
+ /* "silx/io/specfile.pyx":542
* """List of motor positions as floats from the ``#P`` scan header line.
* """
* return self._motor_positions # <<<<<<<<<<<<<<
@@ -6291,13 +7213,13 @@ static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObje
* def record_exists_in_hdr(self, record):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_motor_positions_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_motor_positions_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":541
+ /* "silx/io/specfile.pyx":539
* @cython.embedsignature(False)
* @property
* def motor_positions(self): # <<<<<<<<<<<<<<
@@ -6308,7 +7230,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObje
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.Scan.motor_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.motor_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6316,7 +7238,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObje
return __pyx_r;
}
-/* "specfile.pyx":546
+/* "silx/io/specfile.pyx":544
* return self._motor_positions
*
* def record_exists_in_hdr(self, record): # <<<<<<<<<<<<<<
@@ -6325,15 +7247,12 @@ static PyObject *__pyx_pf_8specfile_4Scan_28motor_positions(CYTHON_UNUSED PyObje
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_4Scan_30record_exists_in_hdr[] = "Scan.record_exists_in_hdr(self, record)\nCheck whether a scan header line exists.\n \n This should be used before attempting to retrieve header information \n using a C function that may crash with a *segmentation fault* if the\n header isn't defined in the SpecFile.\n \n :param record: single upper case letter corresponding to the\n header you want to test (e.g. ``L`` for labels)\n :type record: str\n\n :return: True or False\n :rtype: boolean\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_31record_exists_in_hdr = {"record_exists_in_hdr", (PyCFunction)__pyx_pw_8specfile_4Scan_31record_exists_in_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_4Scan_30record_exists_in_hdr};
-static PyObject *__pyx_pw_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_30record_exists_in_hdr[] = "Scan.record_exists_in_hdr(self, record)\nCheck whether a scan header line exists.\n\n This should be used before attempting to retrieve header information\n using a C function that may crash with a *segmentation fault* if the\n header isn't defined in the SpecFile.\n\n :param record: single upper case letter corresponding to the\n header you want to test (e.g. ``L`` for labels)\n :type record: str\n\n :return: True or False\n :rtype: boolean\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_31record_exists_in_hdr = {"record_exists_in_hdr", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_31record_exists_in_hdr, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_4Scan_30record_exists_in_hdr};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_record = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("record_exists_in_hdr (wrapper)", 0);
@@ -6357,11 +7276,11 @@ static PyObject *__pyx_pw_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_record)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("record_exists_in_hdr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("record_exists_in_hdr", 1, 2, 2, 1); __PYX_ERR(0, 544, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "record_exists_in_hdr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "record_exists_in_hdr") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -6374,20 +7293,20 @@ static PyObject *__pyx_pw_8specfile_4Scan_31record_exists_in_hdr(PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("record_exists_in_hdr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("record_exists_in_hdr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.Scan.record_exists_in_hdr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.record_exists_in_hdr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_4Scan_30record_exists_in_hdr(__pyx_self, __pyx_v_self, __pyx_v_record);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_30record_exists_in_hdr(__pyx_self, __pyx_v_self, __pyx_v_record);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_record) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_record) {
PyObject *__pyx_v_line = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -6400,44 +7319,43 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
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("record_exists_in_hdr", 0);
- /* "specfile.pyx":560
+ /* "silx/io/specfile.pyx":558
* :rtype: boolean
* """
* for line in self._header: # <<<<<<<<<<<<<<
* if line.startswith("#" + record):
* return True
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_header); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
__pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
__pyx_t_4 = NULL;
} else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __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[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
if (likely(!__pyx_t_4)) {
if (likely(PyList_CheckExact(__pyx_t_2))) {
if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 558, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
} else {
if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 558, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
@@ -6446,7 +7364,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
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 = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 558, __pyx_L1_error)
}
break;
}
@@ -6455,19 +7373,19 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
__Pyx_XDECREF_SET(__pyx_v_line, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":561
+ /* "silx/io/specfile.pyx":559
* """
* for line in self._header:
* if line.startswith("#" + record): # <<<<<<<<<<<<<<
* return True
* return False
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyNumber_Add(__pyx_kp_s__7, __pyx_v_record); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_kp_s__7, __pyx_v_record); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -6477,26 +7395,46 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
}
}
if (!__pyx_t_7) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 559, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_9) {
- /* "specfile.pyx":562
+ /* "silx/io/specfile.pyx":560
* for line in self._header:
* if line.startswith("#" + record):
* return True # <<<<<<<<<<<<<<
@@ -6508,9 +7446,17 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
__pyx_r = Py_True;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "silx/io/specfile.pyx":559
+ * """
+ * for line in self._header:
+ * if line.startswith("#" + record): # <<<<<<<<<<<<<<
+ * return True
+ * return False
+ */
}
- /* "specfile.pyx":560
+ /* "silx/io/specfile.pyx":558
* :rtype: boolean
* """
* for line in self._header: # <<<<<<<<<<<<<<
@@ -6520,7 +7466,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":563
+ /* "silx/io/specfile.pyx":561
* if line.startswith("#" + record):
* return True
* return False # <<<<<<<<<<<<<<
@@ -6532,7 +7478,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
__pyx_r = Py_False;
goto __pyx_L0;
- /* "specfile.pyx":546
+ /* "silx/io/specfile.pyx":544
* return self._motor_positions
*
* def record_exists_in_hdr(self, record): # <<<<<<<<<<<<<<
@@ -6548,7 +7494,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.Scan.record_exists_in_hdr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.record_exists_in_hdr", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_line);
@@ -6557,7 +7503,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
return __pyx_r;
}
-/* "specfile.pyx":565
+/* "silx/io/specfile.pyx":563
* return False
*
* def data_line(self, line_index): # <<<<<<<<<<<<<<
@@ -6566,15 +7512,12 @@ static PyObject *__pyx_pf_8specfile_4Scan_30record_exists_in_hdr(CYTHON_UNUSED P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_4Scan_32data_line[] = "Scan.data_line(self, line_index)\nReturns data for a given line of this scan.\n\n .. note::\n\n A data line returned by this method, corresponds to a data line\n in the original specfile (a series of data points, one per\n detector). In the :attr:`data` array, this line index corresponds\n to the index in the second dimension (~ column) of the array.\n \n :param line_index: Index of data line to retrieve (starting with 0)\n :type line_index: int\n\n :return: Line data as a 1D array of doubles\n :rtype: numpy.ndarray \n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_33data_line = {"data_line", (PyCFunction)__pyx_pw_8specfile_4Scan_33data_line, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_4Scan_32data_line};
-static PyObject *__pyx_pw_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_32data_line[] = "Scan.data_line(self, line_index)\nReturns data for a given line of this scan.\n\n .. note::\n\n A data line returned by this method, corresponds to a data line\n in the original specfile (a series of data points, one per\n detector). In the :attr:`data` array, this line index corresponds\n to the index in the second dimension (~ column) of the array.\n\n :param line_index: Index of data line to retrieve (starting with 0)\n :type line_index: int\n\n :return: Line data as a 1D array of doubles\n :rtype: numpy.ndarray\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_33data_line = {"data_line", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_33data_line, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_4Scan_32data_line};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_line_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("data_line (wrapper)", 0);
@@ -6598,11 +7541,11 @@ static PyObject *__pyx_pw_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyOb
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_line_index)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("data_line", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_line", 1, 2, 2, 1); __PYX_ERR(0, 563, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_line") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_line") < 0)) __PYX_ERR(0, 563, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -6615,31 +7558,28 @@ static PyObject *__pyx_pw_8specfile_4Scan_33data_line(PyObject *__pyx_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("data_line", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_line", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 563, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.Scan.data_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_4Scan_32data_line(__pyx_self, __pyx_v_self, __pyx_v_line_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_32data_line(__pyx_self, __pyx_v_self, __pyx_v_line_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_line_index) {
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("data_line", 0);
- /* "specfile.pyx":583
+ /* "silx/io/specfile.pyx":581
* # attribute data corresponds to a transposed version of the original
* # specfile data (where detectors correspond to columns)
* return self.data[:, line_index] # <<<<<<<<<<<<<<
@@ -6647,17 +7587,17 @@ static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__
* def data_column_by_name(self, label):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __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 = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_slice__19);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__19);
__Pyx_GIVEREF(__pyx_slice__19);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__19);
__Pyx_INCREF(__pyx_v_line_index);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_line_index);
__Pyx_GIVEREF(__pyx_v_line_index);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_line_index);
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __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;
@@ -6665,7 +7605,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "specfile.pyx":565
+ /* "silx/io/specfile.pyx":563
* return False
*
* def data_line(self, line_index): # <<<<<<<<<<<<<<
@@ -6678,7 +7618,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile.Scan.data_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data_line", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6686,7 +7626,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__
return __pyx_r;
}
-/* "specfile.pyx":585
+/* "silx/io/specfile.pyx":583
* return self.data[:, line_index]
*
* def data_column_by_name(self, label): # <<<<<<<<<<<<<<
@@ -6695,15 +7635,12 @@ static PyObject *__pyx_pf_8specfile_4Scan_32data_line(CYTHON_UNUSED PyObject *__
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_4Scan_34data_column_by_name[] = "Scan.data_column_by_name(self, label)\nReturns a data column\n\n :param label: Label of data column to retrieve, as defined on the\n ``#L`` line of the scan header.\n :type label: str\n\n :return: Line data as a 1D array of doubles\n :rtype: numpy.ndarray\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_35data_column_by_name = {"data_column_by_name", (PyCFunction)__pyx_pw_8specfile_4Scan_35data_column_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_4Scan_34data_column_by_name};
-static PyObject *__pyx_pw_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_34data_column_by_name[] = "Scan.data_column_by_name(self, label)\nReturns a data column\n\n :param label: Label of data column to retrieve, as defined on the\n ``#L`` line of the scan header.\n :type label: str\n\n :return: Line data as a 1D array of doubles\n :rtype: numpy.ndarray\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_35data_column_by_name = {"data_column_by_name", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_35data_column_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_4Scan_34data_column_by_name};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_label = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("data_column_by_name (wrapper)", 0);
@@ -6727,11 +7664,11 @@ static PyObject *__pyx_pw_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, 1); __PYX_ERR(0, 583, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_column_by_name") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_column_by_name") < 0)) __PYX_ERR(0, 583, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -6744,20 +7681,20 @@ static PyObject *__pyx_pw_8specfile_4Scan_35data_column_by_name(PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 583, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_4Scan_34data_column_by_name(__pyx_self, __pyx_v_self, __pyx_v_label);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_34data_column_by_name(__pyx_self, __pyx_v_self, __pyx_v_label);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_label) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_label) {
PyObject *__pyx_v_ret = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -6768,19 +7705,15 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
- int __pyx_t_10;
+ PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("data_column_by_name", 0);
- /* "specfile.pyx":595
+ /* "silx/io/specfile.pyx":593
* :rtype: numpy.ndarray
* """
* try: # <<<<<<<<<<<<<<
@@ -6788,29 +7721,31 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
* except SfErrLineNotFound:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_1);
__Pyx_XGOTREF(__pyx_t_2);
__Pyx_XGOTREF(__pyx_t_3);
/*try:*/ {
- /* "specfile.pyx":596
+ /* "silx/io/specfile.pyx":594
* """
* try:
* ret = self._specfile.data_column_by_name(self._index, label) # <<<<<<<<<<<<<<
* except SfErrLineNotFound:
* # Could be a "#C Scan aborted after 0 points"
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_data_column_by_name); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_data_column_by_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 594, __pyx_L3_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_7 = NULL;
__pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
@@ -6820,156 +7755,227 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_label};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_v_label};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 594, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
+ __Pyx_INCREF(__pyx_v_label);
+ __Pyx_GIVEREF(__pyx_v_label);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_label);
+ __pyx_t_5 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 594, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_label);
- PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_label);
- __Pyx_GIVEREF(__pyx_v_label);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_v_ret = __pyx_t_4;
__pyx_t_4 = 0;
+
+ /* "silx/io/specfile.pyx":593
+ * :rtype: numpy.ndarray
+ * """
+ * try: # <<<<<<<<<<<<<<
+ * ret = self._specfile.data_column_by_name(self._index, label)
+ * except SfErrLineNotFound:
+ */
}
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
goto __pyx_L10_try_end;
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":597
+ /* "silx/io/specfile.pyx":595
* try:
* ret = self._specfile.data_column_by_name(self._index, label)
* except SfErrLineNotFound: # <<<<<<<<<<<<<<
* # Could be a "#C Scan aborted after 0 points"
* _logger.warning("Cannot get data column %s in scan %d.%d",
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 595, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = PyErr_ExceptionMatches(__pyx_t_4);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_4);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_10) {
- __Pyx_AddTraceback("specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__pyx_t_8) {
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 595, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GOTREF(__pyx_t_9);
- /* "specfile.pyx":599
+ /* "silx/io/specfile.pyx":597
* except SfErrLineNotFound:
* # Could be a "#C Scan aborted after 0 points"
* _logger.warning("Cannot get data column %s in scan %d.%d", # <<<<<<<<<<<<<<
* label, self.number, self.order)
* ret = numpy.empty((0, ), numpy.double)
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warning); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_warning); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 597, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "specfile.pyx":600
+ /* "silx/io/specfile.pyx":598
* # Could be a "#C Scan aborted after 0 points"
* _logger.warning("Cannot get data column %s in scan %d.%d",
* label, self.number, self.order) # <<<<<<<<<<<<<<
* ret = numpy.empty((0, ), numpy.double)
* return ret
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_number); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_number); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_13 = NULL;
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 598, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = NULL;
__pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_13)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_13);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
+ if (likely(__pyx_t_12)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
__pyx_t_8 = 1;
}
}
- __pyx_t_14 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_14);
- if (__pyx_t_13) {
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __Pyx_GIVEREF(__pyx_t_13); __pyx_t_13 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_12, __pyx_kp_s_Cannot_get_data_column_s_in_scan, __pyx_v_label, __pyx_t_7, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L5_except_error)
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_12, __pyx_kp_s_Cannot_get_data_column_s_in_scan, __pyx_v_label, __pyx_t_7, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_8, 4+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L5_except_error)
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 597, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ if (__pyx_t_12) {
+ __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_s_Cannot_get_data_column_s_in_scan);
+ __Pyx_GIVEREF(__pyx_kp_s_Cannot_get_data_column_s_in_scan);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_8, __pyx_kp_s_Cannot_get_data_column_s_in_scan);
+ __Pyx_INCREF(__pyx_v_label);
+ __Pyx_GIVEREF(__pyx_v_label);
+ PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_8, __pyx_v_label);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_8, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_13, 3+__pyx_t_8, __pyx_t_11);
+ __pyx_t_7 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- __Pyx_INCREF(__pyx_kp_s_Cannot_get_data_column_s_in_scan);
- PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_8, __pyx_kp_s_Cannot_get_data_column_s_in_scan);
- __Pyx_GIVEREF(__pyx_kp_s_Cannot_get_data_column_s_in_scan);
- __Pyx_INCREF(__pyx_v_label);
- PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_8, __pyx_v_label);
- __Pyx_GIVEREF(__pyx_v_label);
- PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_8, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_8, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- __pyx_t_7 = 0;
- __pyx_t_12 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_14, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "specfile.pyx":601
+ /* "silx/io/specfile.pyx":599
* _logger.warning("Cannot get data column %s in scan %d.%d",
* label, self.number, self.order)
* ret = numpy.empty((0, ), numpy.double) # <<<<<<<<<<<<<<
* return ret
*
*/
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_empty); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_double); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 599, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_double); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = NULL;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = NULL;
__pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_14);
- if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
- __Pyx_INCREF(__pyx_t_11);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+ __Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_14, function);
+ __Pyx_DECREF_SET(__pyx_t_13, function);
__pyx_t_8 = 1;
}
}
- __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_11) {
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_13)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_tuple__20, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_tuple__20, __pyx_t_11};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_10) {
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ }
+ __Pyx_INCREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
- __Pyx_INCREF(__pyx_tuple__20);
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF_SET(__pyx_v_ret, __pyx_t_5);
__pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -6979,12 +7985,22 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "silx/io/specfile.pyx":593
+ * :rtype: numpy.ndarray
+ * """
+ * try: # <<<<<<<<<<<<<<
+ * ret = self._specfile.data_column_by_name(self._index, label)
+ * except SfErrLineNotFound:
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
goto __pyx_L1_error;
__pyx_L4_exception_handled:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_1);
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
@@ -6992,19 +8008,19 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
__pyx_L10_try_end:;
}
- /* "specfile.pyx":602
+ /* "silx/io/specfile.pyx":600
* label, self.number, self.order)
* ret = numpy.empty((0, ), numpy.double)
* return ret # <<<<<<<<<<<<<<
*
- *
+ * def motor_position_by_name(self, name):
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_ret);
__pyx_r = __pyx_v_ret;
goto __pyx_L0;
- /* "specfile.pyx":585
+ /* "silx/io/specfile.pyx":583
* return self.data[:, line_index]
*
* def data_column_by_name(self, label): # <<<<<<<<<<<<<<
@@ -7019,11 +8035,11 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_AddTraceback("specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret);
@@ -7032,8 +8048,8 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
return __pyx_r;
}
-/* "specfile.pyx":605
- *
+/* "silx/io/specfile.pyx":602
+ * return ret
*
* def motor_position_by_name(self, name): # <<<<<<<<<<<<<<
* """Returns the position for a given motor
@@ -7041,15 +8057,12 @@ static PyObject *__pyx_pf_8specfile_4Scan_34data_column_by_name(CYTHON_UNUSED Py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_4Scan_37motor_position_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_4Scan_36motor_position_by_name[] = "Scan.motor_position_by_name(self, name)\nReturns the position for a given motor\n\n :param name: Name of motor, as defined on the ``#O`` line of the\n file header.\n :type name: str\n\n :return: Motor position\n :rtype: float\n ";
-static PyMethodDef __pyx_mdef_8specfile_4Scan_37motor_position_by_name = {"motor_position_by_name", (PyCFunction)__pyx_pw_8specfile_4Scan_37motor_position_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_4Scan_36motor_position_by_name};
-static PyObject *__pyx_pw_8specfile_4Scan_37motor_position_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_37motor_position_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4Scan_36motor_position_by_name[] = "Scan.motor_position_by_name(self, name)\nReturns the position for a given motor\n\n :param name: Name of motor, as defined on the ``#O`` line of the\n file header.\n :type name: str\n\n :return: Motor position\n :rtype: float\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_4Scan_37motor_position_by_name = {"motor_position_by_name", (PyCFunction)__pyx_pw_4silx_2io_8specfile_4Scan_37motor_position_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_4Scan_36motor_position_by_name};
+static PyObject *__pyx_pw_4silx_2io_8specfile_4Scan_37motor_position_by_name(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_name = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_position_by_name (wrapper)", 0);
@@ -7073,11 +8086,11 @@ static PyObject *__pyx_pw_8specfile_4Scan_37motor_position_by_name(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, 1); __PYX_ERR(0, 602, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_position_by_name") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_position_by_name") < 0)) __PYX_ERR(0, 602, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -7090,34 +8103,31 @@ static PyObject *__pyx_pw_8specfile_4Scan_37motor_position_by_name(PyObject *__p
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 602, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.Scan.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_4Scan_36motor_position_by_name(__pyx_self, __pyx_v_self, __pyx_v_name);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4Scan_36motor_position_by_name(__pyx_self, __pyx_v_self, __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
+ int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("motor_position_by_name", 0);
- /* "specfile.pyx":615
+ /* "silx/io/specfile.pyx":612
* :rtype: float
* """
* return self._specfile.motor_position_by_name(self._index, name) # <<<<<<<<<<<<<<
@@ -7125,16 +8135,16 @@ static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_specfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_motor_position_by_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_motor_position_by_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_index_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -7144,27 +8154,47 @@ static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED
__pyx_t_5 = 1;
}
}
- __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_name};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_v_name};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 612, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_name);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":605
- *
+ /* "silx/io/specfile.pyx":602
+ * return ret
*
* def motor_position_by_name(self, name): # <<<<<<<<<<<<<<
* """Returns the position for a given motor
@@ -7178,7 +8208,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("specfile.Scan.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.Scan.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -7186,7 +8216,7 @@ static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED
return __pyx_r;
}
-/* "specfile.pyx":618
+/* "silx/io/specfile.pyx":615
*
*
* def _string_to_char_star(string_): # <<<<<<<<<<<<<<
@@ -7195,21 +8225,21 @@ static PyObject *__pyx_pf_8specfile_4Scan_36motor_position_by_name(CYTHON_UNUSED
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_3_string_to_char_star(PyObject *__pyx_self, PyObject *__pyx_v_string_); /*proto*/
-static char __pyx_doc_8specfile_2_string_to_char_star[] = "_string_to_char_star(string_)\nConvert a string to ASCII encoded bytes when using python3";
-static PyMethodDef __pyx_mdef_8specfile_3_string_to_char_star = {"_string_to_char_star", (PyCFunction)__pyx_pw_8specfile_3_string_to_char_star, METH_O, __pyx_doc_8specfile_2_string_to_char_star};
-static PyObject *__pyx_pw_8specfile_3_string_to_char_star(PyObject *__pyx_self, PyObject *__pyx_v_string_) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_3_string_to_char_star(PyObject *__pyx_self, PyObject *__pyx_v_string_); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_2_string_to_char_star[] = "_string_to_char_star(string_)\nConvert a string to ASCII encoded bytes when using python3";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_3_string_to_char_star = {"_string_to_char_star", (PyCFunction)__pyx_pw_4silx_2io_8specfile_3_string_to_char_star, METH_O, __pyx_doc_4silx_2io_8specfile_2_string_to_char_star};
+static PyObject *__pyx_pw_4silx_2io_8specfile_3_string_to_char_star(PyObject *__pyx_self, PyObject *__pyx_v_string_) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_string_to_char_star (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_2_string_to_char_star(__pyx_self, ((PyObject *)__pyx_v_string_));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_2_string_to_char_star(__pyx_self, ((PyObject *)__pyx_v_string_));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string_) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -7217,30 +8247,27 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
PyObject *__pyx_t_3 = NULL;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_string_to_char_star", 0);
- /* "specfile.pyx":620
+ /* "silx/io/specfile.pyx":617
* def _string_to_char_star(string_):
* """Convert a string to ASCII encoded bytes when using python3"""
* if sys.version.startswith("3") and not isinstance(string_, bytes): # <<<<<<<<<<<<<<
* return bytes(string_, "ascii")
* return string_
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_version); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
} else {
@@ -7253,7 +8280,7 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "specfile.pyx":621
+ /* "silx/io/specfile.pyx":618
* """Convert a string to ASCII encoded bytes when using python3"""
* if sys.version.startswith("3") and not isinstance(string_, bytes):
* return bytes(string_, "ascii") # <<<<<<<<<<<<<<
@@ -7261,23 +8288,31 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_string_);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_string_);
__Pyx_GIVEREF(__pyx_v_string_);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_string_);
__Pyx_INCREF(__pyx_n_s_ascii);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ascii);
__Pyx_GIVEREF(__pyx_n_s_ascii);
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_ascii);
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyBytes_Type)), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __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;
+
+ /* "silx/io/specfile.pyx":617
+ * def _string_to_char_star(string_):
+ * """Convert a string to ASCII encoded bytes when using python3"""
+ * if sys.version.startswith("3") and not isinstance(string_, bytes): # <<<<<<<<<<<<<<
+ * return bytes(string_, "ascii")
+ * return string_
+ */
}
- /* "specfile.pyx":622
+ /* "silx/io/specfile.pyx":619
* if sys.version.startswith("3") and not isinstance(string_, bytes):
* return bytes(string_, "ascii")
* return string_ # <<<<<<<<<<<<<<
@@ -7289,7 +8324,7 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
__pyx_r = __pyx_v_string_;
goto __pyx_L0;
- /* "specfile.pyx":618
+ /* "silx/io/specfile.pyx":615
*
*
* def _string_to_char_star(string_): # <<<<<<<<<<<<<<
@@ -7301,7 +8336,7 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile._string_to_char_star", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile._string_to_char_star", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -7309,7 +8344,7 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
return __pyx_r;
}
-/* "specfile.pyx":625
+/* "silx/io/specfile.pyx":622
*
*
* def is_specfile(filename): # <<<<<<<<<<<<<<
@@ -7318,21 +8353,21 @@ static PyObject *__pyx_pf_8specfile_2_string_to_char_star(CYTHON_UNUSED PyObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_5is_specfile(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
-static char __pyx_doc_8specfile_4is_specfile[] = "is_specfile(filename)\nTest if a file is a SPEC file, by checking if one of the first two\n lines starts with *#F* (SPEC file header) or *#S* (scan header).\n\n :param str filename: File path\n :return: *True* if file is a SPEC file, *False* if it is not a SPEC file\n :rtype: bool\n ";
-static PyMethodDef __pyx_mdef_8specfile_5is_specfile = {"is_specfile", (PyCFunction)__pyx_pw_8specfile_5is_specfile, METH_O, __pyx_doc_8specfile_4is_specfile};
-static PyObject *__pyx_pw_8specfile_5is_specfile(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_5is_specfile(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_4is_specfile[] = "is_specfile(filename)\nTest if a file is a SPEC file, by checking if one of the first two\n lines starts with *#F* (SPEC file header) or *#S* (scan header).\n\n :param str filename: File path\n :return: *True* if file is a SPEC file, *False* if it is not a SPEC file\n :rtype: bool\n ";
+static PyMethodDef __pyx_mdef_4silx_2io_8specfile_5is_specfile = {"is_specfile", (PyCFunction)__pyx_pw_4silx_2io_8specfile_5is_specfile, METH_O, __pyx_doc_4silx_2io_8specfile_4is_specfile};
+static PyObject *__pyx_pw_4silx_2io_8specfile_5is_specfile(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("is_specfile (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_4is_specfile(__pyx_self, ((PyObject *)__pyx_v_filename));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_4is_specfile(__pyx_self, ((PyObject *)__pyx_v_filename));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_filename) {
PyObject *__pyx_v_f = NULL;
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_v_line = NULL;
@@ -7347,28 +8382,25 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("is_specfile", 0);
- /* "specfile.pyx":633
+ /* "silx/io/specfile.pyx":630
* :rtype: bool
* """
* if not os.path.isfile(filename): # <<<<<<<<<<<<<<
* return False
* # test for presence of #S or #F in first two lines
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_isfile); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -7378,26 +8410,44 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __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 = NULL;
- __Pyx_INCREF(__pyx_v_filename);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
- __Pyx_GIVEREF(__pyx_v_filename);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_filename);
+ __Pyx_GIVEREF(__pyx_v_filename);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 630, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = ((!__pyx_t_5) != 0);
if (__pyx_t_6) {
- /* "specfile.pyx":634
+ /* "silx/io/specfile.pyx":631
* """
* if not os.path.isfile(filename):
* return False # <<<<<<<<<<<<<<
@@ -7408,27 +8458,35 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_INCREF(Py_False);
__pyx_r = Py_False;
goto __pyx_L0;
+
+ /* "silx/io/specfile.pyx":630
+ * :rtype: bool
+ * """
+ * if not os.path.isfile(filename): # <<<<<<<<<<<<<<
+ * return False
+ * # test for presence of #S or #F in first two lines
+ */
}
- /* "specfile.pyx":636
+ /* "silx/io/specfile.pyx":633
* return False
* # test for presence of #S or #F in first two lines
* f = open(filename) # <<<<<<<<<<<<<<
* for i, line in enumerate(f):
* if line.startswith("#S ") or line.startswith("#F "):
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_filename);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
__Pyx_GIVEREF(__pyx_v_filename);
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 633, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_f = __pyx_t_2;
__pyx_t_2 = 0;
- /* "specfile.pyx":637
+ /* "silx/io/specfile.pyx":634
* # test for presence of #S or #F in first two lines
* f = open(filename)
* for i, line in enumerate(f): # <<<<<<<<<<<<<<
@@ -7441,25 +8499,27 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__pyx_t_1 = __pyx_v_f; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_f); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 634, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
#else
- __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
#endif
}
} else {
@@ -7468,7 +8528,7 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
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 = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 634, __pyx_L1_error)
}
break;
}
@@ -7478,53 +8538,53 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__pyx_t_4 = 0;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
- __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 634, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2);
__pyx_t_2 = __pyx_t_4;
__pyx_t_4 = 0;
- /* "specfile.pyx":638
+ /* "silx/io/specfile.pyx":635
* f = open(filename)
* for i, line in enumerate(f):
* if line.startswith("#S ") or line.startswith("#F "): # <<<<<<<<<<<<<<
* f.close()
* return True
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_5) {
} else {
__pyx_t_6 = __pyx_t_5;
goto __pyx_L7_bool_binop_done;
}
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_line, __pyx_n_s_startswith); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_6 = __pyx_t_5;
__pyx_L7_bool_binop_done:;
if (__pyx_t_6) {
- /* "specfile.pyx":639
+ /* "silx/io/specfile.pyx":636
* for i, line in enumerate(f):
* if line.startswith("#S ") or line.startswith("#F "):
* f.close() # <<<<<<<<<<<<<<
* return True
* if i >= 10:
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 636, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -7534,16 +8594,16 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (__pyx_t_9) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
} else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":640
+ /* "silx/io/specfile.pyx":637
* if line.startswith("#S ") or line.startswith("#F "):
* f.close()
* return True # <<<<<<<<<<<<<<
@@ -7556,21 +8616,29 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "silx/io/specfile.pyx":635
+ * f = open(filename)
+ * for i, line in enumerate(f):
+ * if line.startswith("#S ") or line.startswith("#F "): # <<<<<<<<<<<<<<
+ * f.close()
+ * return True
+ */
}
- /* "specfile.pyx":641
+ /* "silx/io/specfile.pyx":638
* f.close()
* return True
* if i >= 10: # <<<<<<<<<<<<<<
* break
* f.close()
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_10, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_10, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 638, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- /* "specfile.pyx":642
+ /* "silx/io/specfile.pyx":639
* return True
* if i >= 10:
* break # <<<<<<<<<<<<<<
@@ -7578,9 +8646,17 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
* return False
*/
goto __pyx_L5_break;
+
+ /* "silx/io/specfile.pyx":638
+ * f.close()
+ * return True
+ * if i >= 10: # <<<<<<<<<<<<<<
+ * break
+ * f.close()
+ */
}
- /* "specfile.pyx":637
+ /* "silx/io/specfile.pyx":634
* # test for presence of #S or #F in first two lines
* f = open(filename)
* for i, line in enumerate(f): # <<<<<<<<<<<<<<
@@ -7592,17 +8668,17 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":643
+ /* "silx/io/specfile.pyx":640
* if i >= 10:
* break
* f.close() # <<<<<<<<<<<<<<
* return False
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -7612,16 +8688,16 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
} else {
- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":644
+ /* "silx/io/specfile.pyx":641
* break
* f.close()
* return False # <<<<<<<<<<<<<<
@@ -7633,7 +8709,7 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__pyx_r = Py_False;
goto __pyx_L0;
- /* "specfile.pyx":625
+ /* "silx/io/specfile.pyx":622
*
*
* def is_specfile(filename): # <<<<<<<<<<<<<<
@@ -7648,7 +8724,7 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("specfile.is_specfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.is_specfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_f);
@@ -7659,21 +8735,18 @@ static PyObject *__pyx_pf_8specfile_4is_specfile(CYTHON_UNUSED PyObject *__pyx_s
return __pyx_r;
}
-/* "specfile.pyx":661
- * int __open_failed
+/* "silx/io/specfile.pyx":657
+ * str filename
*
* def __cinit__(self, filename): # <<<<<<<<<<<<<<
* cdef int error = SF_ERR_NO_ERRORS
- * self.__open_failed = 0
+ * self.handle = NULL
*/
/* Python wrapper */
-static int __pyx_pw_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filename = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
@@ -7695,7 +8768,7 @@ static int __pyx_pw_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObj
else goto __pyx_L5_argtuple_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 = 661; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 657, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -7706,20 +8779,20 @@ static int __pyx_pw_8specfile_8SpecFile_1__cinit__(PyObject *__pyx_v_self, PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 657, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile___cinit__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_filename);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile___cinit__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_filename);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename) {
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile___cinit__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename) {
int __pyx_v_error;
int __pyx_r;
__Pyx_RefNannyDeclarations
@@ -7731,45 +8804,42 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
int __pyx_t_6;
char *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
__Pyx_INCREF(__pyx_v_filename);
- /* "specfile.pyx":662
+ /* "silx/io/specfile.pyx":658
*
* def __cinit__(self, filename):
* cdef int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
- * self.__open_failed = 0
+ * self.handle = NULL
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":663
+ /* "silx/io/specfile.pyx":659
* def __cinit__(self, filename):
* cdef int error = SF_ERR_NO_ERRORS
- * self.__open_failed = 0 # <<<<<<<<<<<<<<
+ * self.handle = NULL # <<<<<<<<<<<<<<
*
* if is_specfile(filename):
*/
- __pyx_v_self->__pyx___open_failed = 0;
+ __pyx_v_self->handle = NULL;
- /* "specfile.pyx":665
- * self.__open_failed = 0
+ /* "silx/io/specfile.pyx":661
+ * self.handle = NULL
*
* if is_specfile(filename): # <<<<<<<<<<<<<<
* filename = _string_to_char_star(filename)
- * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_specfile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_is_specfile); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -7779,35 +8849,53 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __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;
- __Pyx_INCREF(__pyx_v_filename);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
- __Pyx_GIVEREF(__pyx_v_filename);
- __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 = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_filename);
+ __Pyx_GIVEREF(__pyx_v_filename);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_filename);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "specfile.pyx":666
+ /* "silx/io/specfile.pyx":662
*
* if is_specfile(filename):
* filename = _string_to_char_star(filename) # <<<<<<<<<<<<<<
- * self.handle = specfile_wrapper.SfOpen(filename, &error)
- * else:
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ * if error:
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -7817,118 +8905,153 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
}
}
if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_filename); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_filename);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
- __Pyx_GIVEREF(__pyx_v_filename);
- __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 = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_filename};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_filename);
+ __Pyx_GIVEREF(__pyx_v_filename);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_filename);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":667
+ /* "silx/io/specfile.pyx":663
* if is_specfile(filename):
* filename = _string_to_char_star(filename)
- * self.handle = specfile_wrapper.SfOpen(filename, &error) # <<<<<<<<<<<<<<
- * else:
- * self.__open_failed = 1
+ * self.handle = specfile_wrapper.SfOpen(filename, &error) # <<<<<<<<<<<<<<
+ * if error:
+ * self._handle_error(error)
*/
- __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_filename); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 663, __pyx_L1_error)
__pyx_v_self->handle = SfOpen(__pyx_t_7, (&__pyx_v_error));
- goto __pyx_L3;
- }
- /*else*/ {
- /* "specfile.pyx":669
- * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ /* "silx/io/specfile.pyx":664
+ * filename = _string_to_char_star(filename)
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ * if error: # <<<<<<<<<<<<<<
+ * self._handle_error(error)
* else:
- * self.__open_failed = 1 # <<<<<<<<<<<<<<
- * self._handle_error(SF_ERR_FILE_OPEN)
- * if error:
*/
- __pyx_v_self->__pyx___open_failed = 1;
+ __pyx_t_6 = (__pyx_v_error != 0);
+ if (__pyx_t_6) {
- /* "specfile.pyx":670
+ /* "silx/io/specfile.pyx":665
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ * if error:
+ * self._handle_error(error) # <<<<<<<<<<<<<<
* else:
- * self.__open_failed = 1
- * self._handle_error(SF_ERR_FILE_OPEN) # <<<<<<<<<<<<<<
- * if error:
- * self.__open_failed = 1
+ * # handle_error takes care of raising the correct error,
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_FILE_OPEN); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
}
- }
- if (!__pyx_t_5) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_1);
- } else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- 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+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L3:;
+ if (!__pyx_t_5) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":671
- * self.__open_failed = 1
- * self._handle_error(SF_ERR_FILE_OPEN)
- * if error: # <<<<<<<<<<<<<<
- * self.__open_failed = 1
- * self._handle_error(error)
+ /* "silx/io/specfile.pyx":664
+ * filename = _string_to_char_star(filename)
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
+ * if error: # <<<<<<<<<<<<<<
+ * self._handle_error(error)
+ * else:
*/
- __pyx_t_6 = (__pyx_v_error != 0);
- if (__pyx_t_6) {
+ }
- /* "specfile.pyx":672
- * self._handle_error(SF_ERR_FILE_OPEN)
- * if error:
- * self.__open_failed = 1 # <<<<<<<<<<<<<<
- * self._handle_error(error)
+ /* "silx/io/specfile.pyx":661
+ * self.handle = NULL
*
+ * if is_specfile(filename): # <<<<<<<<<<<<<<
+ * filename = _string_to_char_star(filename)
+ * self.handle = specfile_wrapper.SfOpen(filename, &error)
*/
- __pyx_v_self->__pyx___open_failed = 1;
+ goto __pyx_L3;
+ }
- /* "specfile.pyx":673
- * if error:
- * self.__open_failed = 1
- * self._handle_error(error) # <<<<<<<<<<<<<<
+ /* "silx/io/specfile.pyx":669
+ * # handle_error takes care of raising the correct error,
+ * # this causes the destructor to be called
+ * self._handle_error(SF_ERR_FILE_OPEN) # <<<<<<<<<<<<<<
*
* def __init__(self, filename):
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_FILE_OPEN); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 669, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -7938,32 +9061,51 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 673; __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_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 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 = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L4;
}
- __pyx_L4:;
+ __pyx_L3:;
- /* "specfile.pyx":661
- * int __open_failed
+ /* "silx/io/specfile.pyx":657
+ * str filename
*
* def __cinit__(self, filename): # <<<<<<<<<<<<<<
* cdef int error = SF_ERR_NO_ERRORS
- * self.__open_failed = 0
+ * self.handle = NULL
*/
/* function exit code */
@@ -7975,7 +9117,7 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_filename);
@@ -7983,8 +9125,8 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
return __pyx_r;
}
-/* "specfile.pyx":675
- * self._handle_error(error)
+/* "silx/io/specfile.pyx":671
+ * self._handle_error(SF_ERR_FILE_OPEN)
*
* def __init__(self, filename): # <<<<<<<<<<<<<<
* if not isinstance(filename, str):
@@ -7992,12 +9134,9 @@ static int __pyx_pf_8specfile_8SpecFile___cinit__(struct __pyx_obj_8specfile_Spe
*/
/* Python wrapper */
-static int __pyx_pw_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filename = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
@@ -8019,7 +9158,7 @@ static int __pyx_pw_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObje
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[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 671, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -8030,20 +9169,20 @@ static int __pyx_pw_8specfile_8SpecFile_3__init__(PyObject *__pyx_v_self, PyObje
}
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[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 671, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_2__init__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_filename);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_2__init__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_filename);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename) {
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile_2__init__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_filename) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -8051,12 +9190,9 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
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("__init__", 0);
- /* "specfile.pyx":676
+ /* "silx/io/specfile.pyx":672
*
* def __init__(self, filename):
* if not isinstance(filename, str): # <<<<<<<<<<<<<<
@@ -8067,38 +9203,38 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "specfile.pyx":678
+ /* "silx/io/specfile.pyx":674
* if not isinstance(filename, str):
* # encode unicode to str in python 2
* if sys.version_info[0] < 3: # <<<<<<<<<<<<<<
* self.filename = filename.encode()
* # decode bytes to str in python 3
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_version_info); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_version_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 674, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_2) {
- /* "specfile.pyx":679
+ /* "silx/io/specfile.pyx":675
* # encode unicode to str in python 2
* if sys.version_info[0] < 3:
* self.filename = filename.encode() # <<<<<<<<<<<<<<
* # decode bytes to str in python 3
* elif sys.version_info[0] >= 3:
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -8108,54 +9244,62 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
}
}
if (__pyx_t_5) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 675, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 675, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_GOTREF(__pyx_v_self->filename);
__Pyx_DECREF(__pyx_v_self->filename);
__pyx_v_self->filename = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "silx/io/specfile.pyx":674
+ * if not isinstance(filename, str):
+ * # encode unicode to str in python 2
+ * if sys.version_info[0] < 3: # <<<<<<<<<<<<<<
+ * self.filename = filename.encode()
+ * # decode bytes to str in python 3
+ */
goto __pyx_L4;
}
- /* "specfile.pyx":681
+ /* "silx/io/specfile.pyx":677
* self.filename = filename.encode()
* # decode bytes to str in python 3
* elif sys.version_info[0] >= 3: # <<<<<<<<<<<<<<
* self.filename = filename.decode()
* else:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 677, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
- /* "specfile.pyx":682
+ /* "silx/io/specfile.pyx":678
* # decode bytes to str in python 3
* elif sys.version_info[0] >= 3:
* self.filename = filename.decode() # <<<<<<<<<<<<<<
* else:
* self.filename = filename
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_filename, __pyx_n_s_decode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 678, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -8165,34 +9309,49 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
}
}
if (__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(PyString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 678, __pyx_L1_error)
__Pyx_GIVEREF(__pyx_t_3);
__Pyx_GOTREF(__pyx_v_self->filename);
__Pyx_DECREF(__pyx_v_self->filename);
__pyx_v_self->filename = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L4;
+
+ /* "silx/io/specfile.pyx":677
+ * self.filename = filename.encode()
+ * # decode bytes to str in python 3
+ * elif sys.version_info[0] >= 3: # <<<<<<<<<<<<<<
+ * self.filename = filename.decode()
+ * else:
+ */
}
__pyx_L4:;
+
+ /* "silx/io/specfile.pyx":672
+ *
+ * def __init__(self, filename):
+ * if not isinstance(filename, str): # <<<<<<<<<<<<<<
+ * # encode unicode to str in python 2
+ * if sys.version_info[0] < 3:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "specfile.pyx":684
+ /* "silx/io/specfile.pyx":680
* self.filename = filename.decode()
* else:
* self.filename = filename # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
- if (!(likely(PyString_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_filename)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ if (!(likely(PyString_CheckExact(__pyx_v_filename))||((__pyx_v_filename) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_filename)->tp_name), 0))) __PYX_ERR(0, 680, __pyx_L1_error)
__pyx_t_3 = __pyx_v_filename;
__Pyx_INCREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
@@ -8203,8 +9362,8 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
}
__pyx_L3:;
- /* "specfile.pyx":675
- * self._handle_error(error)
+ /* "silx/io/specfile.pyx":671
+ * self._handle_error(SF_ERR_FILE_OPEN)
*
* def __init__(self, filename): # <<<<<<<<<<<<<<
* if not isinstance(filename, str):
@@ -8218,55 +9377,52 @@ static int __pyx_pf_8specfile_8SpecFile_2__init__(struct __pyx_obj_8specfile_Spe
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("specfile.SpecFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "specfile.pyx":686
+/* "silx/io/specfile.pyx":682
* self.filename = filename
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* """Destructor: Calls SfClose(self.handle)"""
- * #SfClose makes a segmentation fault if file failed to open
+ * # handle is NULL if SfOpen failed
*/
/* Python wrapper */
-static void __pyx_pw_8specfile_8SpecFile_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_8specfile_8SpecFile_5__dealloc__(PyObject *__pyx_v_self) {
+static void __pyx_pw_4silx_2io_8specfile_8SpecFile_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_4silx_2io_8specfile_8SpecFile_5__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_pf_8specfile_8SpecFile_4__dealloc__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_pf_4silx_2io_8specfile_8SpecFile_4__dealloc__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
-static void __pyx_pf_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
+static void __pyx_pf_4silx_2io_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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("__dealloc__", 0);
- /* "specfile.pyx":689
+ /* "silx/io/specfile.pyx":685
* """Destructor: Calls SfClose(self.handle)"""
- * #SfClose makes a segmentation fault if file failed to open
- * if not self.__open_failed: # <<<<<<<<<<<<<<
+ * # handle is NULL if SfOpen failed
+ * if self.handle: # <<<<<<<<<<<<<<
* if specfile_wrapper.SfClose(self.handle):
* _logger.warning("Error while closing SpecFile")
*/
- __pyx_t_1 = ((!(__pyx_v_self->__pyx___open_failed != 0)) != 0);
+ __pyx_t_1 = (__pyx_v_self->handle != 0);
if (__pyx_t_1) {
- /* "specfile.pyx":690
- * #SfClose makes a segmentation fault if file failed to open
- * if not self.__open_failed:
+ /* "silx/io/specfile.pyx":686
+ * # handle is NULL if SfOpen failed
+ * if self.handle:
* if specfile_wrapper.SfClose(self.handle): # <<<<<<<<<<<<<<
* _logger.warning("Error while closing SpecFile")
*
@@ -8274,35 +9430,47 @@ static void __pyx_pf_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_8specfile
__pyx_t_1 = (SfClose(__pyx_v_self->handle) != 0);
if (__pyx_t_1) {
- /* "specfile.pyx":691
- * if not self.__open_failed:
+ /* "silx/io/specfile.pyx":687
+ * if self.handle:
* if specfile_wrapper.SfClose(self.handle):
* _logger.warning("Error while closing SpecFile") # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_warning); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L4;
+
+ /* "silx/io/specfile.pyx":686
+ * # handle is NULL if SfOpen failed
+ * if self.handle:
+ * if specfile_wrapper.SfClose(self.handle): # <<<<<<<<<<<<<<
+ * _logger.warning("Error while closing SpecFile")
+ *
+ */
}
- __pyx_L4:;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":685
+ * """Destructor: Calls SfClose(self.handle)"""
+ * # handle is NULL if SfOpen failed
+ * if self.handle: # <<<<<<<<<<<<<<
+ * if specfile_wrapper.SfClose(self.handle):
+ * _logger.warning("Error while closing SpecFile")
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":686
+ /* "silx/io/specfile.pyx":682
* self.filename = filename
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
* """Destructor: Calls SfClose(self.handle)"""
- * #SfClose makes a segmentation fault if file failed to open
+ * # handle is NULL if SfOpen failed
*/
/* function exit code */
@@ -8310,12 +9478,12 @@ static void __pyx_pf_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_8specfile
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_WriteUnraisable("specfile.SpecFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0);
+ __Pyx_WriteUnraisable("silx.io.specfile.SpecFile.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_L0:;
__Pyx_RefNannyFinishContext();
}
-/* "specfile.pyx":693
+/* "silx/io/specfile.pyx":689
* _logger.warning("Error while closing SpecFile")
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -8324,28 +9492,28 @@ static void __pyx_pf_8specfile_8SpecFile_4__dealloc__(struct __pyx_obj_8specfile
*/
/* Python wrapper */
-static Py_ssize_t __pyx_pw_8specfile_8SpecFile_7__len__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_6__len__[] = "Return the number of scans in the SpecFile\n ";
+static Py_ssize_t __pyx_pw_4silx_2io_8specfile_8SpecFile_7__len__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_6__len__[] = "Return the number of scans in the SpecFile\n ";
#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_8specfile_8SpecFile_6__len__;
+struct wrapperbase __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_6__len__;
#endif
-static Py_ssize_t __pyx_pw_8specfile_8SpecFile_7__len__(PyObject *__pyx_v_self) {
+static Py_ssize_t __pyx_pw_4silx_2io_8specfile_8SpecFile_7__len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_6__len__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_6__len__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static Py_ssize_t __pyx_pf_8specfile_8SpecFile_6__len__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
+static Py_ssize_t __pyx_pf_4silx_2io_8specfile_8SpecFile_6__len__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self) {
Py_ssize_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__len__", 0);
- /* "specfile.pyx":696
+ /* "silx/io/specfile.pyx":692
* """Return the number of scans in the SpecFile
* """
* return specfile_wrapper.SfScanNo(self.handle) # <<<<<<<<<<<<<<
@@ -8355,7 +9523,7 @@ static Py_ssize_t __pyx_pf_8specfile_8SpecFile_6__len__(struct __pyx_obj_8specfi
__pyx_r = SfScanNo(__pyx_v_self->handle);
goto __pyx_L0;
- /* "specfile.pyx":693
+ /* "silx/io/specfile.pyx":689
* _logger.warning("Error while closing SpecFile")
*
* def __len__(self): # <<<<<<<<<<<<<<
@@ -8368,9 +9536,9 @@ static Py_ssize_t __pyx_pf_8specfile_8SpecFile_6__len__(struct __pyx_obj_8specfi
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
+static PyObject *__pyx_gb_4silx_2io_8specfile_8SpecFile_10generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */
-/* "specfile.pyx":698
+/* "silx/io/specfile.pyx":694
* return specfile_wrapper.SfScanNo(self.handle)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -8379,41 +9547,40 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_9__iter__(PyObject *__pyx_v_self); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_8__iter__[] = "Return the next :class:`Scan` in a SpecFile each time this method\n is called.\n\n This usually happens when the python built-in function ``next()`` is\n called with a :class:`SpecFile` instance as a parameter, or when a\n :class:`SpecFile` instance is used as an iterator (e.g. in a ``for``\n loop).\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_9__iter__(PyObject *__pyx_v_self); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_8__iter__[] = "Return the next :class:`Scan` in a SpecFile each time this method\n is called.\n\n This usually happens when the python built-in function ``next()`` is\n called with a :class:`SpecFile` instance as a parameter, or when a\n :class:`SpecFile` instance is used as an iterator (e.g. in a ``for``\n loop).\n ";
#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_8specfile_8SpecFile_8__iter__;
+struct wrapperbase __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_8__iter__;
#endif
-static PyObject *__pyx_pw_8specfile_8SpecFile_9__iter__(PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_9__iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_8__iter__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_8__iter__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_8__iter__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
- struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_8__iter__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self) {
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__iter__", 0);
- __pyx_cur_scope = (struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)__pyx_tp_new_8specfile___pyx_scope_struct_1___iter__(__pyx_ptype_8specfile___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct_1___iter__(__pyx_ptype_4silx_2io_8specfile___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
- __Pyx_RefNannyFinishContext();
- return NULL;
+ __pyx_cur_scope = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 694, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
}
- __Pyx_GOTREF(__pyx_cur_scope);
__pyx_cur_scope->__pyx_v_self = __pyx_v_self;
__Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
__Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
{
- __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_8specfile_8SpecFile_10generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_SpecFile___iter); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_4silx_2io_8specfile_8SpecFile_10generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_SpecFile___iter, __pyx_n_s_silx_io_specfile); if (unlikely(!gen)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_DECREF(__pyx_cur_scope);
__Pyx_RefNannyFinishContext();
return (PyObject *) gen;
@@ -8421,7 +9588,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_8__iter__(struct __pyx_obj_8specfi
/* function exit code */
__pyx_L1_error:;
- __Pyx_AddTraceback("specfile.SpecFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
__Pyx_XGIVEREF(__pyx_r);
@@ -8429,9 +9596,9 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_8__iter__(struct __pyx_obj_8specfi
return __pyx_r;
}
-static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
+static PyObject *__pyx_gb_4silx_2io_8specfile_8SpecFile_10generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
- struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
PyObject *__pyx_r = NULL;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8439,11 +9606,8 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("None", 0);
switch (__pyx_generator->resume_label) {
@@ -8454,33 +9618,33 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
return NULL;
}
__pyx_L3_first_run:;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 694, __pyx_L1_error)
- /* "specfile.pyx":707
+ /* "silx/io/specfile.pyx":703
* loop).
* """
* for scan_index in range(len(self)): # <<<<<<<<<<<<<<
* yield Scan(self, scan_index)
*
*/
- __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_Length(((PyObject *)__pyx_cur_scope->__pyx_v_self)); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 703, __pyx_L1_error)
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_cur_scope->__pyx_v_scan_index = __pyx_t_2;
- /* "specfile.pyx":708
+ /* "silx/io/specfile.pyx":704
* """
* for scan_index in range(len(self)):
* yield Scan(self, scan_index) # <<<<<<<<<<<<<<
*
* def __getitem__(self, key):
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Scan); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Scan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 704, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_scan_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_cur_scope->__pyx_v_scan_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 704, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
__pyx_t_7 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -8490,20 +9654,40 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_6) {
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- }
- __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_cur_scope->__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_6) {
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ }
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_cur_scope->__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_cur_scope->__pyx_v_self));
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 704, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
@@ -8517,10 +9701,11 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
__pyx_L6_resume_from_yield:;
__pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
__pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
- if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 704, __pyx_L1_error)
}
+ CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
- /* "specfile.pyx":698
+ /* "silx/io/specfile.pyx":694
* return specfile_wrapper.SfScanNo(self.handle)
*
* def __iter__(self): # <<<<<<<<<<<<<<
@@ -8539,14 +9724,14 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
__Pyx_XDECREF(__pyx_t_8);
__Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_L0:;
- __Pyx_XDECREF(__pyx_r);
+ __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
__pyx_generator->resume_label = -1;
- __Pyx_Generator_clear((PyObject*)__pyx_generator);
+ __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
__Pyx_RefNannyFinishContext();
- return NULL;
+ return __pyx_r;
}
-/* "specfile.pyx":710
+/* "silx/io/specfile.pyx":706
* yield Scan(self, scan_index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
@@ -8555,23 +9740,23 @@ static PyObject *__pyx_gb_8specfile_8SpecFile_10generator1(__pyx_GeneratorObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_12__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_11__getitem__[] = "Return a :class:`Scan` object.\n\n This special method is called when a :class:`SpecFile` instance is\n accessed as a dictionary (e.g. ``sf[key]``).\n\n :param key: 0-based scan index or ``\"n.m\"`` key, where ``n`` is the scan\n number defined on the ``#S`` header line and ``m`` is the order\n :type key: int or str\n\n :return: Scan defined by its 0-based index or its ``\"n.m\"`` key\n :rtype: :class:`Scan`\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_12__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_11__getitem__[] = "Return a :class:`Scan` object.\n\n This special method is called when a :class:`SpecFile` instance is\n accessed as a dictionary (e.g. ``sf[key]``).\n\n :param key: 0-based scan index or ``\"n.m\"`` key, where ``n`` is the scan\n number defined on the ``#S`` header line and ``m`` is the order\n :type key: int or str\n\n :return: Scan defined by its 0-based index or its ``\"n.m\"`` key\n :rtype: :class:`Scan`\n ";
#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_8specfile_8SpecFile_11__getitem__;
+struct wrapperbase __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_11__getitem__;
#endif
-static PyObject *__pyx_pw_8specfile_8SpecFile_12__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_12__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_11__getitem__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_11__getitem__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_key));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_v_msg = NULL;
PyObject *__pyx_v_scan_index = NULL;
PyObject *__pyx_v_number = NULL;
@@ -8593,12 +9778,9 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
PyObject *__pyx_t_15 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "specfile.pyx":723
+ /* "silx/io/specfile.pyx":719
* :rtype: :class:`Scan`
* """
* msg = "The scan identification key can be an integer representing " # <<<<<<<<<<<<<<
@@ -8608,31 +9790,31 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_INCREF(__pyx_kp_s_The_scan_identification_key_can);
__pyx_v_msg = __pyx_kp_s_The_scan_identification_key_can;
- /* "specfile.pyx":724
+ /* "silx/io/specfile.pyx":720
* """
* msg = "The scan identification key can be an integer representing "
* msg += "the unique scan index or a string 'N.M' with N being the scan" # <<<<<<<<<<<<<<
* msg += " number and M the order (eg '2.3')."
*
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_the_unique_scan_index_or_a_strin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_the_unique_scan_index_or_a_strin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":725
+ /* "silx/io/specfile.pyx":721
* msg = "The scan identification key can be an integer representing "
* msg += "the unique scan index or a string 'N.M' with N being the scan"
* msg += " number and M the order (eg '2.3')." # <<<<<<<<<<<<<<
*
* if isinstance(key, int):
*/
- __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_number_and_M_the_order_eg_2_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_number_and_M_the_order_eg_2_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":727
+ /* "silx/io/specfile.pyx":723
* msg += " number and M the order (eg '2.3')."
*
* if isinstance(key, int): # <<<<<<<<<<<<<<
@@ -8643,7 +9825,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":728
+ /* "silx/io/specfile.pyx":724
*
* if isinstance(key, int):
* scan_index = key # <<<<<<<<<<<<<<
@@ -8653,80 +9835,96 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_INCREF(__pyx_v_key);
__pyx_v_scan_index = __pyx_v_key;
- /* "specfile.pyx":730
+ /* "silx/io/specfile.pyx":726
* scan_index = key
* # allow negative index, like lists
* if scan_index < 0: # <<<<<<<<<<<<<<
* scan_index = len(self) + scan_index
* else:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_scan_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __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 = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_scan_index, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_3) {
- /* "specfile.pyx":731
+ /* "silx/io/specfile.pyx":727
* # allow negative index, like lists
* if scan_index < 0:
* scan_index = len(self) + scan_index # <<<<<<<<<<<<<<
* else:
* try:
*/
- __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 727, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_scan_index); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_v_scan_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 727, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_scan_index, __pyx_t_5);
__pyx_t_5 = 0;
- goto __pyx_L4;
+
+ /* "silx/io/specfile.pyx":726
+ * scan_index = key
+ * # allow negative index, like lists
+ * if scan_index < 0: # <<<<<<<<<<<<<<
+ * scan_index = len(self) + scan_index
+ * else:
+ */
}
- __pyx_L4:;
+
+ /* "silx/io/specfile.pyx":723
+ * msg += " number and M the order (eg '2.3')."
+ *
+ * if isinstance(key, int): # <<<<<<<<<<<<<<
+ * scan_index = key
+ * # allow negative index, like lists
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "specfile.pyx":733
+ /* "silx/io/specfile.pyx":729
* scan_index = len(self) + scan_index
* else:
* try: # <<<<<<<<<<<<<<
* (number, order) = map(int, key.split("."))
* scan_index = self.index(number, order)
*/
+ /*else*/ {
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
__Pyx_XGOTREF(__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_7);
__Pyx_XGOTREF(__pyx_t_8);
/*try:*/ {
- /* "specfile.pyx":734
+ /* "silx/io/specfile.pyx":730
* else:
* try:
* (number, order) = map(int, key.split(".")) # <<<<<<<<<<<<<<
* scan_index = self.index(number, order)
* except (ValueError, SfErrScanNotFound, KeyError):
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+ __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
+ __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
+ PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&PyInt_Type)));
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_map, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -8734,9 +9932,9 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __PYX_ERR(0, 730, __pyx_L5_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
@@ -8747,15 +9945,15 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(__pyx_t_9);
#else
- __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_9);
#endif
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
} else {
Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 730, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -8763,7 +9961,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_GOTREF(__pyx_t_5);
index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(0, 730, __pyx_L5_error)
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L14_unpacking_done;
@@ -8771,7 +9969,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __PYX_ERR(0, 730, __pyx_L5_error)
__pyx_L14_unpacking_done:;
}
__pyx_v_number = __pyx_t_5;
@@ -8779,94 +9977,121 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__pyx_v_order = __pyx_t_9;
__pyx_t_9 = 0;
- /* "specfile.pyx":735
+ /* "silx/io/specfile.pyx":731
* try:
* (number, order) = map(int, key.split("."))
* scan_index = self.index(number, order) # <<<<<<<<<<<<<<
* except (ValueError, SfErrScanNotFound, KeyError):
* # int() can raise a value error
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 731, __pyx_L5_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_5 = NULL;
- __pyx_t_4 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_12 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_4 = 1;
+ __pyx_t_12 = 1;
}
}
- __pyx_t_10 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_number, __pyx_v_order};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L5_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_number, __pyx_v_order};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L5_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 731, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_number);
+ __Pyx_GIVEREF(__pyx_v_number);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_12, __pyx_v_number);
+ __Pyx_INCREF(__pyx_v_order);
+ __Pyx_GIVEREF(__pyx_v_order);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_12, __pyx_v_order);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- __Pyx_INCREF(__pyx_v_number);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_number);
- __Pyx_GIVEREF(__pyx_v_number);
- __Pyx_INCREF(__pyx_v_order);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_v_order);
- __Pyx_GIVEREF(__pyx_v_order);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_scan_index = __pyx_t_1;
__pyx_t_1 = 0;
+
+ /* "silx/io/specfile.pyx":729
+ * scan_index = len(self) + scan_index
+ * else:
+ * try: # <<<<<<<<<<<<<<
+ * (number, order) = map(int, key.split("."))
+ * scan_index = self.index(number, order)
+ */
}
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
goto __pyx_L12_try_end;
__pyx_L5_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":736
+ /* "silx/io/specfile.pyx":732
* (number, order) = map(int, key.split("."))
* scan_index = self.index(number, order)
* except (ValueError, SfErrScanNotFound, KeyError): # <<<<<<<<<<<<<<
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrScanNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrScanNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 732, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_ValueError) || PyErr_ExceptionMatches(__pyx_t_1) || PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError) || __Pyx_PyErr_ExceptionMatches(__pyx_t_1) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_12) {
- __Pyx_AddTraceback("specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 732, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_10);
- /* "specfile.pyx":738
+ /* "silx/io/specfile.pyx":734
* except (ValueError, SfErrScanNotFound, KeyError):
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" + # <<<<<<<<<<<<<<
- * "', '".join( self.keys()) + "'")
+ * "', '".join(self.keys()) + "'")
* except AttributeError:
*/
- __pyx_t_5 = PyNumber_Add(__pyx_v_msg, __pyx_kp_s_Valid_keys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_5 = PyNumber_Add(__pyx_v_msg, __pyx_kp_s_Valid_keys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 734, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "specfile.pyx":739
+ /* "silx/io/specfile.pyx":735
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" +
- * "', '".join( self.keys()) + "'") # <<<<<<<<<<<<<<
+ * "', '".join(self.keys()) + "'") # <<<<<<<<<<<<<<
* except AttributeError:
* # e.g. "AttrErr: 'float' object has no attribute 'split'"
*/
- __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 735, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_15 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
__pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
@@ -8876,96 +10101,105 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
}
}
if (__pyx_t_15) {
- __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 735, __pyx_L7_except_error)
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
} else {
- __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 735, __pyx_L7_except_error)
}
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyString_Join(__pyx_kp_s__27, __pyx_t_13); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_14 = __Pyx_PyString_Join(__pyx_kp_s__27, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 735, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "specfile.pyx":738
+ /* "silx/io/specfile.pyx":734
* except (ValueError, SfErrScanNotFound, KeyError):
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" + # <<<<<<<<<<<<<<
- * "', '".join( self.keys()) + "'")
+ * "', '".join(self.keys()) + "'")
* except AttributeError:
*/
- __pyx_t_13 = PyNumber_Add(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_13 = PyNumber_Add(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 734, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- /* "specfile.pyx":739
+ /* "silx/io/specfile.pyx":735
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" +
- * "', '".join( self.keys()) + "'") # <<<<<<<<<<<<<<
+ * "', '".join(self.keys()) + "'") # <<<<<<<<<<<<<<
* except AttributeError:
* # e.g. "AttrErr: 'float' object has no attribute 'split'"
*/
- __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__28); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_14 = PyNumber_Add(__pyx_t_13, __pyx_kp_s__28); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 735, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- /* "specfile.pyx":738
+ /* "silx/io/specfile.pyx":734
* except (ValueError, SfErrScanNotFound, KeyError):
* # int() can raise a value error
* raise KeyError(msg + "\nValid keys: '" + # <<<<<<<<<<<<<<
- * "', '".join( self.keys()) + "'")
+ * "', '".join(self.keys()) + "'")
* except AttributeError:
*/
- __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_13 = PyTuple_New(1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 734, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
__Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14);
__pyx_t_14 = 0;
- __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_t_13, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 734, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_Raise(__pyx_t_14, 0, 0, 0);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __PYX_ERR(0, 734, __pyx_L7_except_error)
}
- /* "specfile.pyx":740
+ /* "silx/io/specfile.pyx":736
* raise KeyError(msg + "\nValid keys: '" +
- * "', '".join( self.keys()) + "'")
+ * "', '".join(self.keys()) + "'")
* except AttributeError: # <<<<<<<<<<<<<<
* # e.g. "AttrErr: 'float' object has no attribute 'split'"
* raise TypeError(msg)
*/
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_t_12) {
- __Pyx_AddTraceback("specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_9, &__pyx_t_1) < 0) __PYX_ERR(0, 736, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_9);
__Pyx_GOTREF(__pyx_t_1);
- /* "specfile.pyx":742
+ /* "silx/io/specfile.pyx":738
* except AttributeError:
* # e.g. "AttrErr: 'float' object has no attribute 'split'"
* raise TypeError(msg) # <<<<<<<<<<<<<<
*
* if not 0 <= scan_index < len(self):
*/
- __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __pyx_t_14 = PyTuple_New(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 738, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_14);
__Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_msg);
__Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_v_msg);
+ __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_14, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 738, __pyx_L7_except_error)
__Pyx_GOTREF(__pyx_t_13);
__Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
__Pyx_Raise(__pyx_t_13, 0, 0, 0);
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
+ __PYX_ERR(0, 738, __pyx_L7_except_error)
}
goto __pyx_L7_except_error;
__pyx_L7_except_error:;
+
+ /* "silx/io/specfile.pyx":729
+ * scan_index = len(self) + scan_index
+ * else:
+ * try: # <<<<<<<<<<<<<<
+ * (number, order) = map(int, key.split("."))
+ * scan_index = self.index(number, order)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_XGIVEREF(__pyx_t_7);
__Pyx_XGIVEREF(__pyx_t_8);
@@ -8976,64 +10210,72 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
}
__pyx_L3:;
- /* "specfile.pyx":744
+ /* "silx/io/specfile.pyx":740
* raise TypeError(msg)
*
* if not 0 <= scan_index < len(self): # <<<<<<<<<<<<<<
* msg = "Scan index must be in range 0-%d" % (len(self) - 1)
* raise IndexError(msg)
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_scan_index, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_scan_index, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
if (__Pyx_PyObject_IsTrue(__pyx_t_1)) {
__Pyx_DECREF(__pyx_t_1);
- __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 740, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_scan_index, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_scan_index, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_2 = ((!__pyx_t_3) != 0);
if (__pyx_t_2) {
- /* "specfile.pyx":745
+ /* "silx/io/specfile.pyx":741
*
* if not 0 <= scan_index < len(self):
* msg = "Scan index must be in range 0-%d" % (len(self) - 1) # <<<<<<<<<<<<<<
* raise IndexError(msg)
*
*/
- __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 741, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_4 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Scan_index_must_be_in_range_0_d, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Scan_index_must_be_in_range_0_d, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_9);
__pyx_t_9 = 0;
- /* "specfile.pyx":746
+ /* "silx/io/specfile.pyx":742
* if not 0 <= scan_index < len(self):
* msg = "Scan index must be in range 0-%d" % (len(self) - 1)
* raise IndexError(msg) # <<<<<<<<<<<<<<
*
* return Scan(self, scan_index)
*/
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 742, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_msg);
__Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_msg);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 742, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":740
+ * raise TypeError(msg)
+ *
+ * if not 0 <= scan_index < len(self): # <<<<<<<<<<<<<<
+ * msg = "Scan index must be in range 0-%d" % (len(self) - 1)
+ * raise IndexError(msg)
+ */
}
- /* "specfile.pyx":748
+ /* "silx/io/specfile.pyx":744
* raise IndexError(msg)
*
* return Scan(self, scan_index) # <<<<<<<<<<<<<<
@@ -9041,40 +10283,58 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
* def keys(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Scan); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Scan); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_t_10 = NULL;
- __pyx_t_4 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_12 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
__pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_4 = 1;
+ __pyx_t_12 = 1;
}
}
- __pyx_t_13 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- if (__pyx_t_10) {
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_self), __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_self), __pyx_v_scan_index};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_12, 2+__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(2+__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ if (__pyx_t_10) {
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ }
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_12, ((PyObject *)__pyx_v_self));
+ __Pyx_INCREF(__pyx_v_scan_index);
+ __Pyx_GIVEREF(__pyx_v_scan_index);
+ PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_12, __pyx_v_scan_index);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
}
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_INCREF(__pyx_v_scan_index);
- PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_4, __pyx_v_scan_index);
- __Pyx_GIVEREF(__pyx_v_scan_index);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":710
+ /* "silx/io/specfile.pyx":706
* yield Scan(self, scan_index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
@@ -9091,7 +10351,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
__Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_msg);
@@ -9103,7 +10363,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
return __pyx_r;
}
-/* "specfile.pyx":750
+/* "silx/io/specfile.pyx":746
* return Scan(self, scan_index)
*
* def keys(self): # <<<<<<<<<<<<<<
@@ -9112,20 +10372,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_11__getitem__(struct __pyx_obj_8sp
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_14keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_13keys[] = "SpecFile.keys(self)\nReturns list of scan keys (eg ``['1.1', '2.1',...]``).\n\n :return: list of scan keys\n :rtype: list of strings\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_14keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_14keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_13keys[] = "SpecFile.keys(self)\nReturns list of scan keys (eg ``['1.1', '2.1',...]``).\n\n :return: list of scan keys\n :rtype: list of strings\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_14keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("keys (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_13keys(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_13keys(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_13keys(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self) {
PyObject *__pyx_v_ret_list = NULL;
PyObject *__pyx_v_list_of_numbers = NULL;
PyObject *__pyx_v_count = NULL;
@@ -9141,34 +10401,31 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("keys", 0);
- /* "specfile.pyx":756
+ /* "silx/io/specfile.pyx":752
* :rtype: list of strings
* """
* ret_list = [] # <<<<<<<<<<<<<<
* list_of_numbers = self._list()
* count = {}
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":757
+ /* "silx/io/specfile.pyx":753
* """
* ret_list = []
* list_of_numbers = self._list() # <<<<<<<<<<<<<<
* count = {}
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -9178,58 +10435,60 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_list_of_numbers = __pyx_t_1;
__pyx_t_1 = 0;
- /* "specfile.pyx":758
+ /* "silx/io/specfile.pyx":754
* ret_list = []
* list_of_numbers = self._list()
* count = {} # <<<<<<<<<<<<<<
*
* for number in list_of_numbers:
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_count = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":760
+ /* "silx/io/specfile.pyx":756
* count = {}
*
* for number in list_of_numbers: # <<<<<<<<<<<<<<
- * if not number in count:
+ * if number not in count:
* count[number] = 1
*/
if (likely(PyList_CheckExact(__pyx_v_list_of_numbers)) || PyTuple_CheckExact(__pyx_v_list_of_numbers)) {
__pyx_t_1 = __pyx_v_list_of_numbers; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
__pyx_t_5 = NULL;
} else {
- __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_numbers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_numbers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
}
for (;;) {
if (likely(!__pyx_t_5)) {
if (likely(PyList_CheckExact(__pyx_t_1))) {
if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
#endif
} else {
if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
#else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
#endif
}
} else {
@@ -9238,7 +10497,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
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 = 760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 756, __pyx_L1_error)
}
break;
}
@@ -9247,83 +10506,91 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
__Pyx_XDECREF_SET(__pyx_v_number, __pyx_t_2);
__pyx_t_2 = 0;
- /* "specfile.pyx":761
+ /* "silx/io/specfile.pyx":757
*
* for number in list_of_numbers:
- * if not number in count: # <<<<<<<<<<<<<<
+ * if number not in count: # <<<<<<<<<<<<<<
* count[number] = 1
* else:
*/
- __pyx_t_6 = (__Pyx_PyDict_Contains(__pyx_v_number, __pyx_v_count, Py_NE)); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = (__Pyx_PyDict_ContainsTF(__pyx_v_number, __pyx_v_count, Py_NE)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
__pyx_t_7 = (__pyx_t_6 != 0);
if (__pyx_t_7) {
- /* "specfile.pyx":762
+ /* "silx/io/specfile.pyx":758
* for number in list_of_numbers:
- * if not number in count:
+ * if number not in count:
* count[number] = 1 # <<<<<<<<<<<<<<
* else:
* count[number] += 1
*/
- if (unlikely(PyDict_SetItem(__pyx_v_count, __pyx_v_number, __pyx_int_1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyDict_SetItem(__pyx_v_count, __pyx_v_number, __pyx_int_1) < 0)) __PYX_ERR(0, 758, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":757
+ *
+ * for number in list_of_numbers:
+ * if number not in count: # <<<<<<<<<<<<<<
+ * count[number] = 1
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "specfile.pyx":764
+ /* "silx/io/specfile.pyx":760
* count[number] = 1
* else:
* count[number] += 1 # <<<<<<<<<<<<<<
* ret_list.append(u'%d.%d' % (number, count[number]))
*
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_number);
__pyx_t_2 = __pyx_v_number;
- __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_count, __pyx_t_2); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_count, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 760, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (unlikely(PyDict_SetItem(__pyx_v_count, __pyx_t_2, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyDict_SetItem(__pyx_v_count, __pyx_t_2, __pyx_t_8) < 0)) __PYX_ERR(0, 760, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L5:;
- /* "specfile.pyx":765
+ /* "silx/io/specfile.pyx":761
* else:
* count[number] += 1
* ret_list.append(u'%d.%d' % (number, count[number])) # <<<<<<<<<<<<<<
*
* return ret_list
*/
- __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_count, __pyx_v_number); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_count, __pyx_v_number); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_INCREF(__pyx_v_number);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_number);
__Pyx_GIVEREF(__pyx_v_number);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_number);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_d_d, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyUnicode_Format(__pyx_kp_u_d_d, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 761, __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_ret_list, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ret_list, __pyx_t_2); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 761, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":760
+ /* "silx/io/specfile.pyx":756
* count = {}
*
* for number in list_of_numbers: # <<<<<<<<<<<<<<
- * if not number in count:
+ * if number not in count:
* count[number] = 1
*/
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":767
+ /* "silx/io/specfile.pyx":763
* ret_list.append(u'%d.%d' % (number, count[number]))
*
* return ret_list # <<<<<<<<<<<<<<
@@ -9335,7 +10602,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
__pyx_r = __pyx_v_ret_list;
goto __pyx_L0;
- /* "specfile.pyx":750
+ /* "silx/io/specfile.pyx":746
* return Scan(self, scan_index)
*
* def keys(self): # <<<<<<<<<<<<<<
@@ -9349,7 +10616,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret_list);
@@ -9361,7 +10628,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
return __pyx_r;
}
-/* "specfile.pyx":769
+/* "silx/io/specfile.pyx":765
* return ret_list
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
@@ -9370,23 +10637,23 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_13keys(struct __pyx_obj_8specfile_
*/
/* Python wrapper */
-static int __pyx_pw_8specfile_8SpecFile_16__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_15__contains__[] = "Return ``True`` if ``key`` is a valid scan key.\n Valid keys can be a string such as ``\"1.1\"`` or a 0-based scan index.\n ";
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_16__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_15__contains__[] = "Return ``True`` if ``key`` is a valid scan key.\n Valid keys can be a string such as ``\"1.1\"`` or a 0-based scan index.\n ";
#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_8specfile_8SpecFile_15__contains__;
+struct wrapperbase __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_15__contains__;
#endif
-static int __pyx_pw_8specfile_8SpecFile_16__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static int __pyx_pw_4silx_2io_8specfile_8SpecFile_16__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_15__contains__(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_15__contains__(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_key));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key) {
+static int __pyx_pf_4silx_2io_8specfile_8SpecFile_15__contains__(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_key) {
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -9394,22 +10661,19 @@ static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfil
PyObject *__pyx_t_3 = NULL;
Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__contains__", 0);
- /* "specfile.pyx":773
+ /* "silx/io/specfile.pyx":769
* Valid keys can be a string such as ``"1.1"`` or a 0-based scan index.
* """
* return key in (self.keys() + list(range(len(self)))) # <<<<<<<<<<<<<<
*
* def _get_error_string(self, error_code):
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -9419,42 +10683,37 @@ static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfil
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 769, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 769, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __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 = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 769, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_key, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_key, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 769, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
goto __pyx_L0;
- /* "specfile.pyx":769
+ /* "silx/io/specfile.pyx":765
* return ret_list
*
* def __contains__(self, key): # <<<<<<<<<<<<<<
@@ -9467,14 +10726,14 @@ static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfil
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile.SpecFile.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "specfile.pyx":775
+/* "silx/io/specfile.pyx":771
* return key in (self.keys() + list(range(len(self))))
*
* def _get_error_string(self, error_code): # <<<<<<<<<<<<<<
@@ -9483,31 +10742,28 @@ static int __pyx_pf_8specfile_8SpecFile_15__contains__(struct __pyx_obj_8specfil
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_18_get_error_string(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_17_get_error_string[] = "SpecFile._get_error_string(self, error_code)\nReturns the error message corresponding to the error code.\n \n :param code: Error code\n :type code: int\n :return: Human readable error message\n :rtype: str\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_18_get_error_string(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_18_get_error_string(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_17_get_error_string[] = "SpecFile._get_error_string(self, error_code)\nReturns the error message corresponding to the error code.\n\n :param code: Error code\n :type code: int\n :return: Human readable error message\n :rtype: str\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_18_get_error_string(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_get_error_string (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_17_get_error_string(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_error_code));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_17_get_error_string(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_error_code));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
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_error_string", 0);
- /* "specfile.pyx":783
+ /* "silx/io/specfile.pyx":779
* :rtype: str
* """
* return (<bytes> specfile_wrapper.SfError(error_code)).decode() # <<<<<<<<<<<<<<
@@ -9515,21 +10771,21 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED
* def _handle_error(self, error_code):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_error_code); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyBytes_FromString(SfError(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_error_code); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyBytes_FromString(SfError(__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
if (unlikely(__pyx_t_2 == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 779, __pyx_L1_error)
}
- __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_t_2), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_decode_bytes(((PyObject*)__pyx_t_2), 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __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;
- /* "specfile.pyx":775
+ /* "silx/io/specfile.pyx":771
* return key in (self.keys() + list(range(len(self))))
*
* def _get_error_string(self, error_code): # <<<<<<<<<<<<<<
@@ -9541,7 +10797,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile.SpecFile._get_error_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile._get_error_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -9549,7 +10805,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED
return __pyx_r;
}
-/* "specfile.pyx":785
+/* "silx/io/specfile.pyx":781
* return (<bytes> specfile_wrapper.SfError(error_code)).decode()
*
* def _handle_error(self, error_code): # <<<<<<<<<<<<<<
@@ -9558,20 +10814,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_17_get_error_string(CYTHON_UNUSED
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_20_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_19_handle_error[] = "SpecFile._handle_error(self, error_code)\nInspect error code, raise adequate error type if necessary.\n \n :param code: Error code\n :type code: int\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_20_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_20_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_19_handle_error[] = "SpecFile._handle_error(self, error_code)\nInspect error code, raise adequate error type if necessary.\n\n :param code: Error code\n :type code: int\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_20_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_v_error_code) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_handle_error (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_19_handle_error(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_error_code));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_19_handle_error(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_error_code));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_error_code) {
PyObject *__pyx_v_error_message = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -9581,22 +10837,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
PyObject *__pyx_t_4 = NULL;
int __pyx_t_5;
int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_handle_error", 0);
- /* "specfile.pyx":791
+ /* "silx/io/specfile.pyx":787
* :type code: int
* """
* error_message = self._get_error_string(error_code) # <<<<<<<<<<<<<<
* if error_code in ERRORS:
* raise ERRORS[error_code](error_message)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_error_string); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_error_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -9606,51 +10859,69 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_error_code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __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 = NULL;
- __Pyx_INCREF(__pyx_v_error_code);
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_error_code);
- __Pyx_GIVEREF(__pyx_v_error_code);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_error_code};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_error_code};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_error_code);
+ __Pyx_GIVEREF(__pyx_v_error_code);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_error_code);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_error_message = __pyx_t_1;
__pyx_t_1 = 0;
- /* "specfile.pyx":792
+ /* "silx/io/specfile.pyx":788
* """
* error_message = self._get_error_string(error_code)
* if error_code in ERRORS: # <<<<<<<<<<<<<<
* raise ERRORS[error_code](error_message)
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = (__Pyx_PySequence_Contains(__pyx_v_error_code, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_error_code, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 788, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_6 = (__pyx_t_5 != 0);
if (__pyx_t_6) {
- /* "specfile.pyx":793
+ /* "silx/io/specfile.pyx":789
* error_message = self._get_error_string(error_code)
* if error_code in ERRORS:
* raise ERRORS[error_code](error_message) # <<<<<<<<<<<<<<
*
* def index(self, scan_number, scan_order=1):
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ERRORS); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ERRORS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_v_error_code); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_v_error_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -9660,26 +10931,52 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_error_message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_error_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_INCREF(__pyx_v_error_message);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_error_message);
- __Pyx_GIVEREF(__pyx_v_error_message);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_error_message};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_error_message};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 789, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(__pyx_v_error_message);
+ __Pyx_GIVEREF(__pyx_v_error_message);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_error_message);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 789, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":788
+ * """
+ * error_message = self._get_error_string(error_code)
+ * if error_code in ERRORS: # <<<<<<<<<<<<<<
+ * raise ERRORS[error_code](error_message)
+ *
+ */
}
- /* "specfile.pyx":785
+ /* "silx/io/specfile.pyx":781
* return (<bytes> specfile_wrapper.SfError(error_code)).decode()
*
* def _handle_error(self, error_code): # <<<<<<<<<<<<<<
@@ -9695,7 +10992,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("specfile.SpecFile._handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile._handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_error_message);
@@ -9704,7 +11001,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
return __pyx_r;
}
-/* "specfile.pyx":795
+/* "silx/io/specfile.pyx":791
* raise ERRORS[error_code](error_message)
*
* def index(self, scan_number, scan_order=1): # <<<<<<<<<<<<<<
@@ -9713,14 +11010,11 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_19_handle_error(struct __pyx_obj_8
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_21index[] = "SpecFile.index(self, scan_number, scan_order=1)\nReturns scan index from scan number and order.\n \n :param scan_number: Scan number (possibly non-unique). \n :type scan_number: int\n :param scan_order: Scan order. \n :type scan_order: int default 1\n\n :return: Unique scan index\n :rtype: int\n \n \n Scan indices are increasing from ``0`` to ``len(self)-1`` in the\n order in which they appear in the file.\n Scan numbers are defined by users and are not necessarily unique.\n The scan order for a given scan number increments each time the scan \n number appers in a given file.\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_21index[] = "SpecFile.index(self, scan_number, scan_order=1)\nReturns scan index from scan number and order.\n\n :param scan_number: Scan number (possibly non-unique).\n :type scan_number: int\n :param scan_order: Scan order.\n :type scan_order: int default 1\n\n :return: Unique scan index\n :rtype: int\n\n\n Scan indices are increasing from ``0`` to ``len(self)-1`` in the\n order in which they appear in the file.\n Scan numbers are defined by users and are not necessarily unique.\n The scan order for a given scan number increments each time the scan\n number appears in a given file.\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_number = 0;
PyObject *__pyx_v_scan_order = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("index (wrapper)", 0);
@@ -9749,7 +11043,7 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "index") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "index") < 0)) __PYX_ERR(0, 791, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9764,20 +11058,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_22index(PyObject *__pyx_v_self, Py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("index", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("index", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 791, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_21index(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_number, __pyx_v_scan_order);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_21index(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_number, __pyx_v_scan_order);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_number, PyObject *__pyx_v_scan_order) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_21index(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_number, PyObject *__pyx_v_scan_order) {
PyObject *__pyx_v_idx = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -9789,50 +11083,48 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("index", 0);
- /* "specfile.pyx":813
- * number appers in a given file.
+ /* "silx/io/specfile.pyx":809
+ * number appears in a given file.
* """
* idx = specfile_wrapper.SfIndex(self.handle, scan_number, scan_order) # <<<<<<<<<<<<<<
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
*/
- __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_scan_number); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_scan_order); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyInt_From_long(SfIndex(__pyx_v_self->handle, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_scan_number); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_scan_order); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 809, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyInt_From_long(SfIndex(__pyx_v_self->handle, __pyx_t_1, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_idx = __pyx_t_3;
__pyx_t_3 = 0;
- /* "specfile.pyx":814
+ /* "silx/io/specfile.pyx":810
* """
* idx = specfile_wrapper.SfIndex(self.handle, scan_number, scan_order)
* if idx == -1: # <<<<<<<<<<<<<<
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return idx - 1
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_idx, __pyx_int_neg_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_idx, __pyx_int_neg_1, -1L, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 810, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 810, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_4) {
- /* "specfile.pyx":815
+ /* "silx/io/specfile.pyx":811
* idx = specfile_wrapper.SfIndex(self.handle, scan_number, scan_order)
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND) # <<<<<<<<<<<<<<
* return idx - 1
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 811, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -9842,27 +11134,53 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
}
}
if (!__pyx_t_7) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 811, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":810
+ * """
+ * idx = specfile_wrapper.SfIndex(self.handle, scan_number, scan_order)
+ * if idx == -1: # <<<<<<<<<<<<<<
+ * self._handle_error(SF_ERR_SCAN_NOT_FOUND)
+ * return idx - 1
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":816
+ /* "silx/io/specfile.pyx":812
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return idx - 1 # <<<<<<<<<<<<<<
@@ -9870,13 +11188,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
* def number(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_idx, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_idx, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "specfile.pyx":795
+ /* "silx/io/specfile.pyx":791
* raise ERRORS[error_code](error_message)
*
* def index(self, scan_number, scan_order=1): # <<<<<<<<<<<<<<
@@ -9891,7 +11209,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_idx);
@@ -9900,7 +11218,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
return __pyx_r;
}
-/* "specfile.pyx":818
+/* "silx/io/specfile.pyx":814
* return idx - 1
*
* def number(self, scan_index): # <<<<<<<<<<<<<<
@@ -9909,20 +11227,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_21index(struct __pyx_obj_8specfile
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_24number(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_23number[] = "SpecFile.number(self, scan_index)\nReturns scan number from scan index.\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: User defined scan number.\n :rtype: int\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_24number(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_24number(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_23number[] = "SpecFile.number(self, scan_index)\nReturns scan number from scan index.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: User defined scan number.\n :rtype: int\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_24number(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("number (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_23number(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_23number(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_23number(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
long __pyx_v_idx;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -9933,47 +11251,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("number", 0);
- /* "specfile.pyx":828
+ /* "silx/io/specfile.pyx":824
* :rtype: int
* """
* idx = specfile_wrapper.SfNumber(self.handle, scan_index + 1) # <<<<<<<<<<<<<<
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_idx = SfNumber(__pyx_v_self->handle, __pyx_t_2);
- /* "specfile.pyx":829
+ /* "silx/io/specfile.pyx":825
* """
* idx = specfile_wrapper.SfNumber(self.handle, scan_index + 1)
* if idx == -1: # <<<<<<<<<<<<<<
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return idx
*/
- __pyx_t_3 = ((__pyx_v_idx == -1) != 0);
+ __pyx_t_3 = ((__pyx_v_idx == -1L) != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":830
+ /* "silx/io/specfile.pyx":826
* idx = specfile_wrapper.SfNumber(self.handle, scan_index + 1)
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND) # <<<<<<<<<<<<<<
* return idx
*
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -9983,27 +11298,53 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":825
+ * """
+ * idx = specfile_wrapper.SfNumber(self.handle, scan_index + 1)
+ * if idx == -1: # <<<<<<<<<<<<<<
+ * self._handle_error(SF_ERR_SCAN_NOT_FOUND)
+ * return idx
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":831
+ /* "silx/io/specfile.pyx":827
* if idx == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return idx # <<<<<<<<<<<<<<
@@ -10011,13 +11352,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
* def order(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_idx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_idx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":818
+ /* "silx/io/specfile.pyx":814
* return idx - 1
*
* def number(self, scan_index): # <<<<<<<<<<<<<<
@@ -10032,7 +11373,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.number", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.number", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -10040,7 +11381,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
return __pyx_r;
}
-/* "specfile.pyx":833
+/* "silx/io/specfile.pyx":829
* return idx
*
* def order(self, scan_index): # <<<<<<<<<<<<<<
@@ -10049,20 +11390,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_23number(struct __pyx_obj_8specfil
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_26order(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_25order[] = "SpecFile.order(self, scan_index)\nReturns scan order from scan index.\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Scan order (sequential number incrementing each time a\n non-unique occurrence of a scan number is encountered).\n :rtype: int\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_26order(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_26order(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_25order[] = "SpecFile.order(self, scan_index)\nReturns scan order from scan index.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Scan order (sequential number incrementing each time a\n non-unique occurrence of a scan number is encountered).\n :rtype: int\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_26order(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("order (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_25order(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_25order(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_25order(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
long __pyx_v_ordr;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
@@ -10073,47 +11414,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("order", 0);
- /* "specfile.pyx":844
+ /* "silx/io/specfile.pyx":840
* :rtype: int
* """
* ordr = specfile_wrapper.SfOrder(self.handle, scan_index + 1) # <<<<<<<<<<<<<<
* if ordr == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 840, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_ordr = SfOrder(__pyx_v_self->handle, __pyx_t_2);
- /* "specfile.pyx":845
+ /* "silx/io/specfile.pyx":841
* """
* ordr = specfile_wrapper.SfOrder(self.handle, scan_index + 1)
* if ordr == -1: # <<<<<<<<<<<<<<
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return ordr
*/
- __pyx_t_3 = ((__pyx_v_ordr == -1) != 0);
+ __pyx_t_3 = ((__pyx_v_ordr == -1L) != 0);
if (__pyx_t_3) {
- /* "specfile.pyx":846
+ /* "silx/io/specfile.pyx":842
* ordr = specfile_wrapper.SfOrder(self.handle, scan_index + 1)
* if ordr == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND) # <<<<<<<<<<<<<<
* return ordr
*
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_SCAN_NOT_FOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -10123,27 +11461,53 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 842, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 842, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L3;
+
+ /* "silx/io/specfile.pyx":841
+ * """
+ * ordr = specfile_wrapper.SfOrder(self.handle, scan_index + 1)
+ * if ordr == -1: # <<<<<<<<<<<<<<
+ * self._handle_error(SF_ERR_SCAN_NOT_FOUND)
+ * return ordr
+ */
}
- __pyx_L3:;
- /* "specfile.pyx":847
+ /* "silx/io/specfile.pyx":843
* if ordr == -1:
* self._handle_error(SF_ERR_SCAN_NOT_FOUND)
* return ordr # <<<<<<<<<<<<<<
@@ -10151,13 +11515,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
* def _list(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_ordr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_ordr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":833
+ /* "silx/io/specfile.pyx":829
* return idx
*
* def order(self, scan_index): # <<<<<<<<<<<<<<
@@ -10172,7 +11536,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.order", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -10180,7 +11544,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
return __pyx_r;
}
-/* "specfile.pyx":849
+/* "silx/io/specfile.pyx":845
* return ordr
*
* def _list(self): # <<<<<<<<<<<<<<
@@ -10189,20 +11553,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_25order(struct __pyx_obj_8specfile
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_28_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_27_list[] = "SpecFile._list(self)\nsee documentation of :meth:`list`\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_28_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_28_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_27_list[] = "SpecFile._list(self)\nsee documentation of :meth:`list`\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_28_list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_list (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_27_list(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_27_list(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_27_list(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self) {
long *__pyx_v_scan_numbers;
int __pyx_v_error;
PyObject *__pyx_v_ret_list = NULL;
@@ -10218,25 +11582,22 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
Py_ssize_t __pyx_t_7;
Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("_list", 0);
- /* "specfile.pyx":854
+ /* "silx/io/specfile.pyx":850
* cdef:
* long *scan_numbers
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* scan_numbers = specfile_wrapper.SfList(self.handle, &error)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 850, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":856
+ /* "silx/io/specfile.pyx":852
* int error = SF_ERR_NO_ERRORS
*
* scan_numbers = specfile_wrapper.SfList(self.handle, &error) # <<<<<<<<<<<<<<
@@ -10245,19 +11606,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
*/
__pyx_v_scan_numbers = SfList(__pyx_v_self->handle, (&__pyx_v_error));
- /* "specfile.pyx":857
+ /* "silx/io/specfile.pyx":853
*
* scan_numbers = specfile_wrapper.SfList(self.handle, &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* ret_list = []
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 853, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -10267,60 +11628,80 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
}
}
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 = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __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_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":859
+ /* "silx/io/specfile.pyx":855
* self._handle_error(error)
*
* ret_list = [] # <<<<<<<<<<<<<<
* for i in range(len(self)):
* ret_list.append(scan_numbers[i])
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ret_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":860
+ /* "silx/io/specfile.pyx":856
*
* ret_list = []
* for i in range(len(self)): # <<<<<<<<<<<<<<
* ret_list.append(scan_numbers[i])
*
*/
- __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_Length(((PyObject *)__pyx_v_self)); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 856, __pyx_L1_error)
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":861
+ /* "silx/io/specfile.pyx":857
* ret_list = []
* for i in range(len(self)):
* ret_list.append(scan_numbers[i]) # <<<<<<<<<<<<<<
*
* free(scan_numbers)
*/
- __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_scan_numbers[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_scan_numbers[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ret_list, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_ret_list, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 857, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "specfile.pyx":863
+ /* "silx/io/specfile.pyx":859
* ret_list.append(scan_numbers[i])
*
* free(scan_numbers) # <<<<<<<<<<<<<<
@@ -10329,7 +11710,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
*/
free(__pyx_v_scan_numbers);
- /* "specfile.pyx":864
+ /* "silx/io/specfile.pyx":860
*
* free(scan_numbers)
* return ret_list # <<<<<<<<<<<<<<
@@ -10341,7 +11722,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
__pyx_r = __pyx_v_ret_list;
goto __pyx_L0;
- /* "specfile.pyx":849
+ /* "silx/io/specfile.pyx":845
* return ordr
*
* def _list(self): # <<<<<<<<<<<<<<
@@ -10356,7 +11737,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("specfile.SpecFile._list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile._list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_ret_list);
@@ -10365,7 +11746,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
return __pyx_r;
}
-/* "specfile.pyx":866
+/* "silx/io/specfile.pyx":862
* return ret_list
*
* def list(self): # <<<<<<<<<<<<<<
@@ -10374,31 +11755,28 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_27_list(struct __pyx_obj_8specfile
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_30list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_29list[] = "SpecFile.list(self)\nReturns list (1D numpy array) of scan numbers in SpecFile.\n\n :return: list of scan numbers (from `` #S`` lines) in the same order\n as in the original SpecFile (e.g ``[1, 1, 2, 3, \342\200\246]``).\n :rtype: numpy array\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_30list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_30list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_29list[] = "SpecFile.list(self)\nReturns list (1D numpy array) of scan numbers in SpecFile.\n\n :return: list of scan numbers (from `` #S`` lines) in the same order\n as in the original SpecFile (e.g ``[1, 1, 2, 3, \342\200\246]``).\n :rtype: numpy array\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_30list(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("list (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_29list(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_29list(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_29list(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__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("list", 0);
- /* "specfile.pyx":875
+ /* "silx/io/specfile.pyx":871
* # this method is overloaded in specfilewrapper to output a string
* # representation of the list
* return self._list() # <<<<<<<<<<<<<<
@@ -10406,10 +11784,10 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
* def data(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -10419,10 +11797,10 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
}
}
if (__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
} else {
- __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -10430,7 +11808,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":866
+ /* "silx/io/specfile.pyx":862
* return ret_list
*
* def list(self): # <<<<<<<<<<<<<<
@@ -10443,7 +11821,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("specfile.SpecFile.list", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.list", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -10451,7 +11829,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
return __pyx_r;
}
-/* "specfile.pyx":877
+/* "silx/io/specfile.pyx":873
* return self._list()
*
* def data(self, scan_index): # <<<<<<<<<<<<<<
@@ -10460,20 +11838,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_29list(struct __pyx_obj_8specfile_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_32data(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_31data[] = "SpecFile.data(self, scan_index)\nReturns data for the specified scan index.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Complete scan data as a 2D array of doubles\n :rtype: numpy.ndarray\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_32data(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_32data(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_31data[] = "SpecFile.data(self, scan_index)\nReturns data for the specified scan index.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Complete scan data as a 2D array of doubles\n :rtype: numpy.ndarray\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_32data(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("data (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_31data(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_31data(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_31data(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
double **__pyx_v_mydata;
long *__pyx_v_data_info;
int __pyx_v_i;
@@ -10496,37 +11874,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
int __pyx_t_8;
long __pyx_t_9;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("data", 0);
- /* "specfile.pyx":891
+ /* "silx/io/specfile.pyx":887
* long* data_info
* int i, j
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
* long nlines, ncolumns, regular
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":895
+ /* "silx/io/specfile.pyx":891
*
* sfdata_error = specfile_wrapper.SfData(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &mydata,
* &data_info,
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 891, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":894
+ /* "silx/io/specfile.pyx":890
* long nlines, ncolumns, regular
*
* sfdata_error = specfile_wrapper.SfData(self.handle, # <<<<<<<<<<<<<<
@@ -10535,19 +11910,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
__pyx_v_sfdata_error = SfData(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_mydata), (&__pyx_v_data_info), (&__pyx_v_error));
- /* "specfile.pyx":899
+ /* "silx/io/specfile.pyx":895
* &data_info,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* if <long>data_info != 0:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -10557,24 +11932,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":901
+ /* "silx/io/specfile.pyx":897
* self._handle_error(error)
*
* if <long>data_info != 0: # <<<<<<<<<<<<<<
@@ -10584,7 +11979,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
__pyx_t_8 = ((((long)__pyx_v_data_info) != 0) != 0);
if (__pyx_t_8) {
- /* "specfile.pyx":902
+ /* "silx/io/specfile.pyx":898
*
* if <long>data_info != 0:
* nlines = data_info[0] # <<<<<<<<<<<<<<
@@ -10593,7 +11988,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
__pyx_v_nlines = (__pyx_v_data_info[0]);
- /* "specfile.pyx":903
+ /* "silx/io/specfile.pyx":899
* if <long>data_info != 0:
* nlines = data_info[0]
* ncolumns = data_info[1] # <<<<<<<<<<<<<<
@@ -10602,7 +11997,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
__pyx_v_ncolumns = (__pyx_v_data_info[1]);
- /* "specfile.pyx":904
+ /* "silx/io/specfile.pyx":900
* nlines = data_info[0]
* ncolumns = data_info[1]
* regular = data_info[2] # <<<<<<<<<<<<<<
@@ -10610,20 +12005,28 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
* nlines = 0
*/
__pyx_v_regular = (__pyx_v_data_info[2]);
+
+ /* "silx/io/specfile.pyx":897
+ * self._handle_error(error)
+ *
+ * if <long>data_info != 0: # <<<<<<<<<<<<<<
+ * nlines = data_info[0]
+ * ncolumns = data_info[1]
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "specfile.pyx":906
+ /* "silx/io/specfile.pyx":902
* regular = data_info[2]
* else:
* nlines = 0 # <<<<<<<<<<<<<<
* ncolumns = 0
* regular = 0
*/
+ /*else*/ {
__pyx_v_nlines = 0;
- /* "specfile.pyx":907
+ /* "silx/io/specfile.pyx":903
* else:
* nlines = 0
* ncolumns = 0 # <<<<<<<<<<<<<<
@@ -10632,7 +12035,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
__pyx_v_ncolumns = 0;
- /* "specfile.pyx":908
+ /* "silx/io/specfile.pyx":904
* nlines = 0
* ncolumns = 0
* regular = 0 # <<<<<<<<<<<<<<
@@ -10643,70 +12046,70 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
}
__pyx_L3:;
- /* "specfile.pyx":910
+ /* "silx/io/specfile.pyx":906
* regular = 0
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines, ncolumns), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(nlines):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_nlines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_nlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_ncolumns); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_ncolumns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
__pyx_t_1 = 0;
__pyx_t_7 = 0;
- __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- /* "specfile.pyx":911
+ /* "silx/io/specfile.pyx":907
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines, ncolumns),
* dtype=numpy.double) # <<<<<<<<<<<<<<
* for i in range(nlines):
* for j in range(ncolumns):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 907, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "specfile.pyx":910
+ /* "silx/io/specfile.pyx":906
* regular = 0
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines, ncolumns), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(nlines):
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 906, __pyx_L1_error)
__pyx_v_ret_array = ((PyArrayObject *)__pyx_t_6);
__pyx_t_6 = 0;
- /* "specfile.pyx":912
+ /* "silx/io/specfile.pyx":908
* cdef numpy.ndarray ret_array = numpy.empty((nlines, ncolumns),
* dtype=numpy.double)
* for i in range(nlines): # <<<<<<<<<<<<<<
@@ -10717,7 +12120,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "specfile.pyx":913
+ /* "silx/io/specfile.pyx":909
* dtype=numpy.double)
* for i in range(nlines):
* for j in range(ncolumns): # <<<<<<<<<<<<<<
@@ -10728,34 +12131,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
__pyx_v_j = __pyx_t_10;
- /* "specfile.pyx":914
+ /* "silx/io/specfile.pyx":910
* for i in range(nlines):
* for j in range(ncolumns):
* ret_array[i, j] = mydata[i][j] # <<<<<<<<<<<<<<
*
* specfile_wrapper.freeArrNZ(<void ***>&mydata, nlines)
*/
- __pyx_t_6 = PyFloat_FromDouble(((__pyx_v_mydata[__pyx_v_i])[__pyx_v_j])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyFloat_FromDouble(((__pyx_v_mydata[__pyx_v_i])[__pyx_v_j])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7);
__pyx_t_5 = 0;
__pyx_t_7 = 0;
- if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ret_array), __pyx_t_4, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ret_array), __pyx_t_4, __pyx_t_6) < 0)) __PYX_ERR(0, 910, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
}
- /* "specfile.pyx":916
+ /* "silx/io/specfile.pyx":912
* ret_array[i, j] = mydata[i][j]
*
* specfile_wrapper.freeArrNZ(<void ***>&mydata, nlines) # <<<<<<<<<<<<<<
@@ -10764,7 +12167,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
freeArrNZ(((void ***)(&__pyx_v_mydata)), __pyx_v_nlines);
- /* "specfile.pyx":917
+ /* "silx/io/specfile.pyx":913
*
* specfile_wrapper.freeArrNZ(<void ***>&mydata, nlines)
* free(data_info) # <<<<<<<<<<<<<<
@@ -10773,7 +12176,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
free(__pyx_v_data_info);
- /* "specfile.pyx":918
+ /* "silx/io/specfile.pyx":914
* specfile_wrapper.freeArrNZ(<void ***>&mydata, nlines)
* free(data_info)
* return ret_array # <<<<<<<<<<<<<<
@@ -10785,7 +12188,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
__pyx_r = ((PyObject *)__pyx_v_ret_array);
goto __pyx_L0;
- /* "specfile.pyx":877
+ /* "silx/io/specfile.pyx":873
* return self._list()
*
* def data(self, scan_index): # <<<<<<<<<<<<<<
@@ -10800,7 +12203,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.data", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret_array);
@@ -10809,7 +12212,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
return __pyx_r;
}
-/* "specfile.pyx":920
+/* "silx/io/specfile.pyx":916
* return ret_array
*
* def data_column_by_name(self, scan_index, label): # <<<<<<<<<<<<<<
@@ -10818,14 +12221,11 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_31data(struct __pyx_obj_8specfile_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_34data_column_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_33data_column_by_name[] = "SpecFile.data_column_by_name(self, scan_index, label)\nReturns data column for the specified scan index and column label.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n :param label: Label of data column, as defined in the ``#L`` line\n of the scan header.\n :type label: str\n\n :return: Data column as a 1D array of doubles\n :rtype: numpy.ndarray\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_34data_column_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_34data_column_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_33data_column_by_name[] = "SpecFile.data_column_by_name(self, scan_index, label)\nReturns data column for the specified scan index and column label.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n :param label: Label of data column, as defined in the ``#L`` line\n of the scan header.\n :type label: str\n\n :return: Data column as a 1D array of doubles\n :rtype: numpy.ndarray\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_34data_column_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
PyObject *__pyx_v_label = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("data_column_by_name (wrapper)", 0);
@@ -10849,11 +12249,11 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_34data_column_by_name(PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_label)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, 1); __PYX_ERR(0, 916, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_column_by_name") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "data_column_by_name") < 0)) __PYX_ERR(0, 916, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -10866,20 +12266,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_34data_column_by_name(PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("data_column_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 916, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_33data_column_by_name(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_label);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_33data_column_by_name(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_label);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_label) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_33data_column_by_name(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_label) {
double *__pyx_v_data_column;
long __pyx_v_i;
long __pyx_v_nlines;
@@ -10896,36 +12296,33 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
char *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
long __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("data_column_by_name", 0);
__Pyx_INCREF(__pyx_v_label);
- /* "specfile.pyx":936
+ /* "silx/io/specfile.pyx":932
* double* data_column
* long i, nlines
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* label = _string_to_char_star(label)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":938
+ /* "silx/io/specfile.pyx":934
* int error = SF_ERR_NO_ERRORS
*
* label = _string_to_char_star(label) # <<<<<<<<<<<<<<
*
* nlines = specfile_wrapper.SfDataColByName(self.handle,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -10935,45 +12332,63 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_label); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_label); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; __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;
- __Pyx_INCREF(__pyx_v_label);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_label);
- __Pyx_GIVEREF(__pyx_v_label);
- __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 = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_label};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_label};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 934, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_label);
+ __Pyx_GIVEREF(__pyx_v_label);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_label);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 934, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_label, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":941
+ /* "silx/io/specfile.pyx":937
*
* nlines = specfile_wrapper.SfDataColByName(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* label,
* &data_column,
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":942
+ /* "silx/io/specfile.pyx":938
* nlines = specfile_wrapper.SfDataColByName(self.handle,
* scan_index + 1,
* label, # <<<<<<<<<<<<<<
* &data_column,
* &error)
*/
- __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_label); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_label); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 938, __pyx_L1_error)
- /* "specfile.pyx":940
+ /* "silx/io/specfile.pyx":936
* label = _string_to_char_star(label)
*
* nlines = specfile_wrapper.SfDataColByName(self.handle, # <<<<<<<<<<<<<<
@@ -10982,19 +12397,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
*/
__pyx_v_nlines = SfDataColByName(__pyx_v_self->handle, __pyx_t_6, __pyx_t_7, (&__pyx_v_data_column), (&__pyx_v_error));
- /* "specfile.pyx":945
+ /* "silx/io/specfile.pyx":941
* &data_column,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines,),
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 941, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -11004,82 +12419,102 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 941, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":947
+ /* "silx/io/specfile.pyx":943
* self._handle_error(error)
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines,), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(nlines):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_nlines); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_nlines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- /* "specfile.pyx":948
+ /* "silx/io/specfile.pyx":944
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines,),
* dtype=numpy.double) # <<<<<<<<<<<<<<
* for i in range(nlines):
* ret_array[i] = data_column[i]
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 944, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":947
+ /* "silx/io/specfile.pyx":943
* self._handle_error(error)
*
* cdef numpy.ndarray ret_array = numpy.empty((nlines,), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(nlines):
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 943, __pyx_L1_error)
__pyx_v_ret_array = ((PyArrayObject *)__pyx_t_4);
__pyx_t_4 = 0;
- /* "specfile.pyx":949
+ /* "silx/io/specfile.pyx":945
* cdef numpy.ndarray ret_array = numpy.empty((nlines,),
* dtype=numpy.double)
* for i in range(nlines): # <<<<<<<<<<<<<<
@@ -11090,20 +12525,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_6; __pyx_t_9+=1) {
__pyx_v_i = __pyx_t_9;
- /* "specfile.pyx":950
+ /* "silx/io/specfile.pyx":946
* dtype=numpy.double)
* for i in range(nlines):
* ret_array[i] = data_column[i] # <<<<<<<<<<<<<<
*
* free(data_column)
*/
- __pyx_t_4 = PyFloat_FromDouble((__pyx_v_data_column[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyFloat_FromDouble((__pyx_v_data_column[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ret_array), __pyx_v_i, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ret_array), __pyx_v_i, __pyx_t_4, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 946, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- /* "specfile.pyx":952
+ /* "silx/io/specfile.pyx":948
* ret_array[i] = data_column[i]
*
* free(data_column) # <<<<<<<<<<<<<<
@@ -11112,7 +12547,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
*/
free(__pyx_v_data_column);
- /* "specfile.pyx":953
+ /* "silx/io/specfile.pyx":949
*
* free(data_column)
* return ret_array # <<<<<<<<<<<<<<
@@ -11124,7 +12559,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
__pyx_r = ((PyObject *)__pyx_v_ret_array);
goto __pyx_L0;
- /* "specfile.pyx":920
+ /* "silx/io/specfile.pyx":916
* return ret_array
*
* def data_column_by_name(self, scan_index, label): # <<<<<<<<<<<<<<
@@ -11139,7 +12574,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.data_column_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret_array);
@@ -11149,7 +12584,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
return __pyx_r;
}
-/* "specfile.pyx":955
+/* "silx/io/specfile.pyx":951
* return ret_array
*
* def scan_header(self, scan_index): # <<<<<<<<<<<<<<
@@ -11158,20 +12593,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_33data_column_by_name(struct __pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_36scan_header(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_35scan_header[] = "SpecFile.scan_header(self, scan_index)\nReturn list of scan header lines.\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: List of raw scan header lines\n :rtype: list of str\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_36scan_header(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_36scan_header(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_35scan_header[] = "SpecFile.scan_header(self, scan_index)\nReturn list of scan header lines.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: List of raw scan header lines\n :rtype: list of str\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_36scan_header(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("scan_header (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_35scan_header(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_35scan_header(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_35scan_header(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
char **__pyx_v_lines;
int __pyx_v_error;
long __pyx_v_nlines;
@@ -11190,58 +12625,55 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
long __pyx_t_8;
char *__pyx_t_9;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("scan_header", 0);
- /* "specfile.pyx":967
+ /* "silx/io/specfile.pyx":963
* cdef:
* char** lines
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* nlines = specfile_wrapper.SfHeader(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":970
+ /* "silx/io/specfile.pyx":966
*
* nlines = specfile_wrapper.SfHeader(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* "", # no pattern matching
* &lines,
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 966, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":969
+ /* "silx/io/specfile.pyx":965
* int error = SF_ERR_NO_ERRORS
*
* nlines = specfile_wrapper.SfHeader(self.handle, # <<<<<<<<<<<<<<
* scan_index + 1,
* "", # no pattern matching
*/
- __pyx_v_nlines = SfHeader(__pyx_v_self->handle, __pyx_t_3, __pyx_k__29, (&__pyx_v_lines), (&__pyx_v_error));
+ __pyx_v_nlines = SfHeader(__pyx_v_self->handle, __pyx_t_3, ((char *)""), (&__pyx_v_lines), (&__pyx_v_error));
- /* "specfile.pyx":975
+ /* "silx/io/specfile.pyx":971
* &error)
*
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* lines_list = []
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -11251,36 +12683,56 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 971, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":977
+ /* "silx/io/specfile.pyx":973
* self._handle_error(error)
*
* lines_list = [] # <<<<<<<<<<<<<<
* for i in range(nlines):
* line = <bytes>lines[i].decode()
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_lines_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":978
+ /* "silx/io/specfile.pyx":974
*
* lines_list = []
* for i in range(nlines): # <<<<<<<<<<<<<<
@@ -11291,7 +12743,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":979
+ /* "silx/io/specfile.pyx":975
* lines_list = []
* for i in range(nlines):
* line = <bytes>lines[i].decode() # <<<<<<<<<<<<<<
@@ -11299,7 +12751,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
*
*/
__pyx_t_9 = (__pyx_v_lines[__pyx_v_i]);
- __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 979; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_4);
@@ -11307,17 +12759,17 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
__Pyx_XDECREF_SET(__pyx_v_line, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
- /* "specfile.pyx":980
+ /* "silx/io/specfile.pyx":976
* for i in range(nlines):
* line = <bytes>lines[i].decode()
* lines_list.append(line) # <<<<<<<<<<<<<<
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
*/
- __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lines_list, __pyx_v_line); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lines_list, __pyx_v_line); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 976, __pyx_L1_error)
}
- /* "specfile.pyx":982
+ /* "silx/io/specfile.pyx":978
* lines_list.append(line)
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines) # <<<<<<<<<<<<<<
@@ -11326,7 +12778,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
*/
freeArrNZ(((void ***)(&__pyx_v_lines)), __pyx_v_nlines);
- /* "specfile.pyx":983
+ /* "silx/io/specfile.pyx":979
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
* return lines_list # <<<<<<<<<<<<<<
@@ -11338,7 +12790,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
__pyx_r = __pyx_v_lines_list;
goto __pyx_L0;
- /* "specfile.pyx":955
+ /* "silx/io/specfile.pyx":951
* return ret_array
*
* def scan_header(self, scan_index): # <<<<<<<<<<<<<<
@@ -11353,7 +12805,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.scan_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.scan_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_lines_list);
@@ -11363,7 +12815,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
return __pyx_r;
}
-/* "specfile.pyx":985
+/* "silx/io/specfile.pyx":981
* return lines_list
*
* def file_header(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -11372,13 +12824,10 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_35scan_header(struct __pyx_obj_8sp
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_37file_header[] = "SpecFile.file_header(self, scan_index=0)\nReturn list of file header lines.\n \n A file header contains all lines between a ``#F`` header line and\n a ``#S`` header line (start of scan). We need to specify a scan\n number because there can be more than one file header in a given file.\n A file header applies to all subsequent scans, until a new file\n header is defined.\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: List of raw file header lines\n :rtype: list of str\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_37file_header[] = "SpecFile.file_header(self, scan_index=0)\nReturn list of file header lines.\n\n A file header contains all lines between a ``#F`` header line and\n a ``#S`` header line (start of scan). We need to specify a scan\n number because there can be more than one file header in a given file.\n A file header applies to all subsequent scans, until a new file\n header is defined.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: List of raw file header lines\n :rtype: list of str\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("file_header (wrapper)", 0);
@@ -11403,7 +12852,7 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_se
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_header") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "file_header") < 0)) __PYX_ERR(0, 981, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11416,20 +12865,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_38file_header(PyObject *__pyx_v_se
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("file_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("file_header", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 981, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_37file_header(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_37file_header(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_37file_header(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
char **__pyx_v_lines;
int __pyx_v_error;
long __pyx_v_nlines;
@@ -11448,58 +12897,55 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
long __pyx_t_8;
char *__pyx_t_9;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("file_header", 0);
- /* "specfile.pyx":1003
+ /* "silx/io/specfile.pyx":999
* cdef:
* char** lines
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* nlines = specfile_wrapper.SfFileHeader(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 999, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1006
+ /* "silx/io/specfile.pyx":1002
*
* nlines = specfile_wrapper.SfFileHeader(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* "", # no pattern matching
* &lines,
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1005
+ /* "silx/io/specfile.pyx":1001
* int error = SF_ERR_NO_ERRORS
*
* nlines = specfile_wrapper.SfFileHeader(self.handle, # <<<<<<<<<<<<<<
* scan_index + 1,
* "", # no pattern matching
*/
- __pyx_v_nlines = SfFileHeader(__pyx_v_self->handle, __pyx_t_3, __pyx_k__29, (&__pyx_v_lines), (&__pyx_v_error));
+ __pyx_v_nlines = SfFileHeader(__pyx_v_self->handle, __pyx_t_3, ((char *)""), (&__pyx_v_lines), (&__pyx_v_error));
- /* "specfile.pyx":1010
+ /* "silx/io/specfile.pyx":1006
* &lines,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* lines_list = []
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1006, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -11509,55 +12955,75 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1006, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1012
+ /* "silx/io/specfile.pyx":1008
* self._handle_error(error)
*
* lines_list = [] # <<<<<<<<<<<<<<
* for i in range(nlines):
- * line = <bytes>lines[i].decode()
+ * line = <bytes>lines[i].decode()
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_lines_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1013
+ /* "silx/io/specfile.pyx":1009
*
* lines_list = []
* for i in range(nlines): # <<<<<<<<<<<<<<
- * line = <bytes>lines[i].decode()
+ * line = <bytes>lines[i].decode()
* lines_list.append(line)
*/
__pyx_t_3 = __pyx_v_nlines;
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":1014
+ /* "silx/io/specfile.pyx":1010
* lines_list = []
* for i in range(nlines):
- * line = <bytes>lines[i].decode() # <<<<<<<<<<<<<<
+ * line = <bytes>lines[i].decode() # <<<<<<<<<<<<<<
* lines_list.append(line)
*
*/
__pyx_t_9 = (__pyx_v_lines[__pyx_v_i]);
- __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_4);
@@ -11565,17 +13031,17 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
__Pyx_XDECREF_SET(__pyx_v_line, ((PyObject*)__pyx_t_4));
__pyx_t_4 = 0;
- /* "specfile.pyx":1015
+ /* "silx/io/specfile.pyx":1011
* for i in range(nlines):
- * line = <bytes>lines[i].decode()
+ * line = <bytes>lines[i].decode()
* lines_list.append(line) # <<<<<<<<<<<<<<
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
*/
- __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lines_list, __pyx_v_line); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_lines_list, __pyx_v_line); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1011, __pyx_L1_error)
}
- /* "specfile.pyx":1017
+ /* "silx/io/specfile.pyx":1013
* lines_list.append(line)
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines) # <<<<<<<<<<<<<<
@@ -11584,7 +13050,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
*/
freeArrNZ(((void ***)(&__pyx_v_lines)), __pyx_v_nlines);
- /* "specfile.pyx":1018
+ /* "silx/io/specfile.pyx":1014
*
* specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
* return lines_list # <<<<<<<<<<<<<<
@@ -11596,7 +13062,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
__pyx_r = __pyx_v_lines_list;
goto __pyx_L0;
- /* "specfile.pyx":985
+ /* "silx/io/specfile.pyx":981
* return lines_list
*
* def file_header(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -11611,7 +13077,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.file_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_lines_list);
@@ -11621,7 +13087,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
return __pyx_r;
}
-/* "specfile.pyx":1020
+/* "silx/io/specfile.pyx":1016
* return lines_list
*
* def columns(self, scan_index): # <<<<<<<<<<<<<<
@@ -11630,20 +13096,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_37file_header(struct __pyx_obj_8sp
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_40columns(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_39columns[] = "SpecFile.columns(self, scan_index)\nReturn number of columns in a scan from the ``#N`` header line\n (without ``#N`` and scan number)\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Number of columns in scan from ``#N`` line\n :rtype: int\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_40columns(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_40columns(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_39columns[] = "SpecFile.columns(self, scan_index)\nReturn number of columns in a scan from the ``#N`` header line\n (without ``#N`` and scan number)\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Number of columns in scan from ``#N`` line\n :rtype: int\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_40columns(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("columns (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_39columns(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_39columns(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_39columns(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
int __pyx_v_error;
long __pyx_v_ncolumns;
PyObject *__pyx_r = NULL;
@@ -11655,37 +13121,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("columns", 0);
- /* "specfile.pyx":1032
+ /* "silx/io/specfile.pyx":1028
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* ncolumns = specfile_wrapper.SfNoColumns(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1028, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1028, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1035
+ /* "silx/io/specfile.pyx":1031
*
* ncolumns = specfile_wrapper.SfNoColumns(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &error)
* self._handle_error(error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1034
+ /* "silx/io/specfile.pyx":1030
* int error = SF_ERR_NO_ERRORS
*
* ncolumns = specfile_wrapper.SfNoColumns(self.handle, # <<<<<<<<<<<<<<
@@ -11694,19 +13157,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
*/
__pyx_v_ncolumns = SfNoColumns(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error));
- /* "specfile.pyx":1037
+ /* "silx/io/specfile.pyx":1033
* scan_index + 1,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* return ncolumns
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1033, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -11716,24 +13179,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1039
+ /* "silx/io/specfile.pyx":1035
* self._handle_error(error)
*
* return ncolumns # <<<<<<<<<<<<<<
@@ -11741,13 +13224,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
* def command(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_ncolumns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_ncolumns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":1020
+ /* "silx/io/specfile.pyx":1016
* return lines_list
*
* def columns(self, scan_index): # <<<<<<<<<<<<<<
@@ -11762,7 +13245,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -11770,7 +13253,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
return __pyx_r;
}
-/* "specfile.pyx":1041
+/* "silx/io/specfile.pyx":1037
* return ncolumns
*
* def command(self, scan_index): # <<<<<<<<<<<<<<
@@ -11779,20 +13262,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_39columns(struct __pyx_obj_8specfi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_42command(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_41command[] = "SpecFile.command(self, scan_index)\nReturn ``#S`` line (without ``#S`` and scan number)\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: S line\n :rtype: str\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_42command(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_42command(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_41command[] = "SpecFile.command(self, scan_index)\nReturn ``#S`` line (without ``#S`` and scan number)\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: S line\n :rtype: str\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_42command(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("command (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_41command(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_41command(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_41command(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
int __pyx_v_error;
PyObject *__pyx_v_s_record = NULL;
PyObject *__pyx_r = NULL;
@@ -11804,44 +13287,41 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("command", 0);
- /* "specfile.pyx":1052
+ /* "silx/io/specfile.pyx":1048
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* s_record = <bytes> specfile_wrapper.SfCommand(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1048, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1055
+ /* "silx/io/specfile.pyx":1051
*
* s_record = <bytes> specfile_wrapper.SfCommand(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &error)
* self._handle_error(error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1051, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1051, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1054
+ /* "silx/io/specfile.pyx":1050
* int error = SF_ERR_NO_ERRORS
*
* s_record = <bytes> specfile_wrapper.SfCommand(self.handle, # <<<<<<<<<<<<<<
* scan_index + 1,
* &error)
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(SfCommand(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(SfCommand(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_4);
@@ -11849,19 +13329,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
__pyx_v_s_record = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "specfile.pyx":1057
+ /* "silx/io/specfile.pyx":1053
* scan_index + 1,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* return s_record.decode()
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1053, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -11871,24 +13351,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
}
}
if (!__pyx_t_6) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__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 = 1057; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1053, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":1059
+ /* "silx/io/specfile.pyx":1055
* self._handle_error(error)
*
* return s_record.decode() # <<<<<<<<<<<<<<
@@ -11898,15 +13398,15 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_s_record == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 1055, __pyx_L1_error)
}
- __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_s_record, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_s_record, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1055, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "specfile.pyx":1041
+ /* "silx/io/specfile.pyx":1037
* return ncolumns
*
* def command(self, scan_index): # <<<<<<<<<<<<<<
@@ -11921,7 +13421,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.command", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.command", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s_record);
@@ -11930,7 +13430,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
return __pyx_r;
}
-/* "specfile.pyx":1061
+/* "silx/io/specfile.pyx":1057
* return s_record.decode()
*
* def date(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -11939,13 +13439,10 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_41command(struct __pyx_obj_8specfi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_43date[] = "SpecFile.date(self, scan_index=0)\nReturn date from ``#D`` line\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Date from ``#D`` line\n :rtype: str\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_43date[] = "SpecFile.date(self, scan_index=0)\nReturn date from ``#D`` line\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Date from ``#D`` line\n :rtype: str\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("date (wrapper)", 0);
@@ -11970,7 +13467,7 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "date") < 0)) __PYX_ERR(0, 1057, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11983,20 +13480,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_44date(PyObject *__pyx_v_self, PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("date", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("date", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1057, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_43date(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_43date(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_43date(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
int __pyx_v_error;
PyObject *__pyx_v_d_line = NULL;
PyObject *__pyx_r = NULL;
@@ -12008,44 +13505,41 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("date", 0);
- /* "specfile.pyx":1072
+ /* "silx/io/specfile.pyx":1068
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* d_line = <bytes> specfile_wrapper.SfDate(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1075
+ /* "silx/io/specfile.pyx":1071
*
* d_line = <bytes> specfile_wrapper.SfDate(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &error)
* self._handle_error(error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1074
+ /* "silx/io/specfile.pyx":1070
* int error = SF_ERR_NO_ERRORS
*
* d_line = <bytes> specfile_wrapper.SfDate(self.handle, # <<<<<<<<<<<<<<
* scan_index + 1,
* &error)
*/
- __pyx_t_1 = __Pyx_PyBytes_FromString(SfDate(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(SfDate(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1070, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = __pyx_t_1;
__Pyx_INCREF(__pyx_t_4);
@@ -12053,19 +13547,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
__pyx_v_d_line = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
- /* "specfile.pyx":1077
+ /* "silx/io/specfile.pyx":1073
* scan_index + 1,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* return d_line.decode()
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1073, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -12075,24 +13569,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
}
}
if (!__pyx_t_6) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__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 = 1077; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "specfile.pyx":1079
+ /* "silx/io/specfile.pyx":1075
* self._handle_error(error)
*
* return d_line.decode() # <<<<<<<<<<<<<<
@@ -12102,15 +13616,15 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
__Pyx_XDECREF(__pyx_r);
if (unlikely(__pyx_v_d_line == Py_None)) {
PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "decode");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 1075, __pyx_L1_error)
}
- __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_d_line, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_d_line, 0, PY_SSIZE_T_MAX, NULL, NULL, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_r = __pyx_t_4;
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "specfile.pyx":1061
+ /* "silx/io/specfile.pyx":1057
* return s_record.decode()
*
* def date(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -12125,7 +13639,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.date", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_d_line);
@@ -12134,7 +13648,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
return __pyx_r;
}
-/* "specfile.pyx":1081
+/* "silx/io/specfile.pyx":1077
* return d_line.decode()
*
* def labels(self, scan_index): # <<<<<<<<<<<<<<
@@ -12143,20 +13657,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_43date(struct __pyx_obj_8specfile_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_46labels(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_45labels[] = "SpecFile.labels(self, scan_index)\nReturn all labels from ``#L`` line\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: All labels from ``#L`` line\n :rtype: list of strings\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_46labels(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_46labels(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_45labels[] = "SpecFile.labels(self, scan_index)\nReturn all labels from ``#L`` line\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: All labels from ``#L`` line\n :rtype: list of strings\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_46labels(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("labels (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_45labels(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_45labels(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_45labels(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
char **__pyx_v_all_labels;
int __pyx_v_error;
long __pyx_v_nlabels;
@@ -12174,37 +13688,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
long __pyx_t_8;
char *__pyx_t_9;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("labels", 0);
- /* "specfile.pyx":1093
+ /* "silx/io/specfile.pyx":1089
* cdef:
* char** all_labels
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* nlabels = specfile_wrapper.SfAllLabels(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1089, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1096
+ /* "silx/io/specfile.pyx":1092
*
* nlabels = specfile_wrapper.SfAllLabels(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &all_labels,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1092, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1092, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1095
+ /* "silx/io/specfile.pyx":1091
* int error = SF_ERR_NO_ERRORS
*
* nlabels = specfile_wrapper.SfAllLabels(self.handle, # <<<<<<<<<<<<<<
@@ -12213,19 +13724,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
*/
__pyx_v_nlabels = SfAllLabels(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_all_labels), (&__pyx_v_error));
- /* "specfile.pyx":1099
+ /* "silx/io/specfile.pyx":1095
* &all_labels,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* labels_list = []
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1095, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1095, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -12235,36 +13746,56 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1095, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1095, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1101
+ /* "silx/io/specfile.pyx":1097
* self._handle_error(error)
*
* labels_list = [] # <<<<<<<<<<<<<<
* for i in range(nlabels):
* labels_list.append(<bytes>all_labels[i].decode())
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1097, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_labels_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1102
+ /* "silx/io/specfile.pyx":1098
*
* labels_list = []
* for i in range(nlabels): # <<<<<<<<<<<<<<
@@ -12275,7 +13806,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":1103
+ /* "silx/io/specfile.pyx":1099
* labels_list = []
* for i in range(nlabels):
* labels_list.append(<bytes>all_labels[i].decode()) # <<<<<<<<<<<<<<
@@ -12283,13 +13814,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
* specfile_wrapper.freeArrNZ(<void***>&all_labels, nlabels)
*/
__pyx_t_9 = (__pyx_v_all_labels[__pyx_v_i]);
- __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_labels_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_labels_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1099, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "specfile.pyx":1105
+ /* "silx/io/specfile.pyx":1101
* labels_list.append(<bytes>all_labels[i].decode())
*
* specfile_wrapper.freeArrNZ(<void***>&all_labels, nlabels) # <<<<<<<<<<<<<<
@@ -12298,7 +13829,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
*/
freeArrNZ(((void ***)(&__pyx_v_all_labels)), __pyx_v_nlabels);
- /* "specfile.pyx":1106
+ /* "silx/io/specfile.pyx":1102
*
* specfile_wrapper.freeArrNZ(<void***>&all_labels, nlabels)
* return labels_list # <<<<<<<<<<<<<<
@@ -12310,7 +13841,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
__pyx_r = __pyx_v_labels_list;
goto __pyx_L0;
- /* "specfile.pyx":1081
+ /* "silx/io/specfile.pyx":1077
* return d_line.decode()
*
* def labels(self, scan_index): # <<<<<<<<<<<<<<
@@ -12325,7 +13856,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_labels_list);
@@ -12334,7 +13865,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
return __pyx_r;
}
-/* "specfile.pyx":1108
+/* "silx/io/specfile.pyx":1104
* return labels_list
*
* def motor_names(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -12343,13 +13874,10 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_45labels(struct __pyx_obj_8specfil
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_47motor_names[] = "SpecFile.motor_names(self, scan_index=0)\nReturn all motor names from ``#O`` lines\n \n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.If not specified, defaults to 0 (meaning the\n function returns motors names associated with the first scan).\n This parameter makes a difference only if there are more than\n on file header in the file, in which case the file header applies\n to all following scans until a new file header appears.\n :type scan_index: int\n\n :return: All motor names\n :rtype: list of strings\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_47motor_names[] = "SpecFile.motor_names(self, scan_index=0)\nReturn all motor names from ``#O`` lines\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.If not specified, defaults to 0 (meaning the\n function returns motors names associated with the first scan).\n This parameter makes a difference only if there are more than\n on file header in the file, in which case the file header applies\n to all following scans until a new file header appears.\n :type scan_index: int\n\n :return: All motor names\n :rtype: list of strings\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_names (wrapper)", 0);
@@ -12374,7 +13902,7 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_se
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_names") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_names") < 0)) __PYX_ERR(0, 1104, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -12387,20 +13915,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_48motor_names(PyObject *__pyx_v_se
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("motor_names", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("motor_names", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1104, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_47motor_names(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_47motor_names(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_47motor_names(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
char **__pyx_v_all_motors;
int __pyx_v_error;
long __pyx_v_nmotors;
@@ -12418,37 +13946,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
long __pyx_t_8;
char *__pyx_t_9;
int __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("motor_names", 0);
- /* "specfile.pyx":1124
+ /* "silx/io/specfile.pyx":1120
* cdef:
* char** all_motors
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* nmotors = specfile_wrapper.SfAllMotors(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1127
+ /* "silx/io/specfile.pyx":1123
*
* nmotors = specfile_wrapper.SfAllMotors(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &all_motors,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1126
+ /* "silx/io/specfile.pyx":1122
* int error = SF_ERR_NO_ERRORS
*
* nmotors = specfile_wrapper.SfAllMotors(self.handle, # <<<<<<<<<<<<<<
@@ -12457,19 +13982,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
*/
__pyx_v_nmotors = SfAllMotors(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_all_motors), (&__pyx_v_error));
- /* "specfile.pyx":1130
+ /* "silx/io/specfile.pyx":1126
* &all_motors,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* motors_list = []
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -12479,36 +14004,56 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1126, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1126, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1132
+ /* "silx/io/specfile.pyx":1128
* self._handle_error(error)
*
* motors_list = [] # <<<<<<<<<<<<<<
* for i in range(nmotors):
* motors_list.append(<bytes>all_motors[i].decode())
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_motors_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1133
+ /* "silx/io/specfile.pyx":1129
*
* motors_list = []
* for i in range(nmotors): # <<<<<<<<<<<<<<
@@ -12519,7 +14064,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":1134
+ /* "silx/io/specfile.pyx":1130
* motors_list = []
* for i in range(nmotors):
* motors_list.append(<bytes>all_motors[i].decode()) # <<<<<<<<<<<<<<
@@ -12527,13 +14072,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
* specfile_wrapper.freeArrNZ(<void***>&all_motors, nmotors)
*/
__pyx_t_9 = (__pyx_v_all_motors[__pyx_v_i]);
- __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_9, 0, strlen(__pyx_t_9), NULL, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1130, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_motors_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_motors_list, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1130, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "specfile.pyx":1136
+ /* "silx/io/specfile.pyx":1132
* motors_list.append(<bytes>all_motors[i].decode())
*
* specfile_wrapper.freeArrNZ(<void***>&all_motors, nmotors) # <<<<<<<<<<<<<<
@@ -12542,7 +14087,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
*/
freeArrNZ(((void ***)(&__pyx_v_all_motors)), __pyx_v_nmotors);
- /* "specfile.pyx":1137
+ /* "silx/io/specfile.pyx":1133
*
* specfile_wrapper.freeArrNZ(<void***>&all_motors, nmotors)
* return motors_list # <<<<<<<<<<<<<<
@@ -12554,7 +14099,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
__pyx_r = __pyx_v_motors_list;
goto __pyx_L0;
- /* "specfile.pyx":1108
+ /* "silx/io/specfile.pyx":1104
* return labels_list
*
* def motor_names(self, scan_index=0): # <<<<<<<<<<<<<<
@@ -12569,7 +14114,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.motor_names", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_motors_list);
@@ -12578,7 +14123,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
return __pyx_r;
}
-/* "specfile.pyx":1139
+/* "silx/io/specfile.pyx":1135
* return motors_list
*
* def motor_positions(self, scan_index): # <<<<<<<<<<<<<<
@@ -12587,20 +14132,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_47motor_names(struct __pyx_obj_8sp
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_50motor_positions(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_49motor_positions[] = "SpecFile.motor_positions(self, scan_index)\nReturn all motor positions\n \n :param scan_index: Unique scan index between ``0``\n and ``len(self)-1``.\n :type scan_index: int\n\n :return: All motor positions\n :rtype: list of double\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_50motor_positions(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_50motor_positions(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_49motor_positions[] = "SpecFile.motor_positions(self, scan_index)\nReturn all motor positions\n\n :param scan_index: Unique scan index between ``0``\n and ``len(self)-1``.\n :type scan_index: int\n\n :return: All motor positions\n :rtype: list of double\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_50motor_positions(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_positions (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_49motor_positions(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_49motor_positions(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_49motor_positions(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
double *__pyx_v_motor_positions;
int __pyx_v_error;
long __pyx_v_nmotors;
@@ -12617,37 +14162,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
PyObject *__pyx_t_7 = NULL;
long __pyx_t_8;
int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("motor_positions", 0);
- /* "specfile.pyx":1151
+ /* "silx/io/specfile.pyx":1147
* cdef:
* double* motor_positions
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* nmotors = specfile_wrapper.SfAllMotorPos(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1147, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1147, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1154
+ /* "silx/io/specfile.pyx":1150
*
* nmotors = specfile_wrapper.SfAllMotorPos(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &motor_positions,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1150, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1153
+ /* "silx/io/specfile.pyx":1149
* int error = SF_ERR_NO_ERRORS
*
* nmotors = specfile_wrapper.SfAllMotorPos(self.handle, # <<<<<<<<<<<<<<
@@ -12656,19 +14198,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
*/
__pyx_v_nmotors = SfAllMotorPos(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_motor_positions), (&__pyx_v_error));
- /* "specfile.pyx":1157
+ /* "silx/io/specfile.pyx":1153
* &motor_positions,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* motor_positions_list = []
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -12678,36 +14220,56 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
}
}
if (!__pyx_t_6) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __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;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1153, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1159
+ /* "silx/io/specfile.pyx":1155
* self._handle_error(error)
*
* motor_positions_list = [] # <<<<<<<<<<<<<<
* for i in range(nmotors):
* motor_positions_list.append(motor_positions[i])
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_motor_positions_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1160
+ /* "silx/io/specfile.pyx":1156
*
* motor_positions_list = []
* for i in range(nmotors): # <<<<<<<<<<<<<<
@@ -12718,20 +14280,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_3; __pyx_t_8+=1) {
__pyx_v_i = __pyx_t_8;
- /* "specfile.pyx":1161
+ /* "silx/io/specfile.pyx":1157
* motor_positions_list = []
* for i in range(nmotors):
* motor_positions_list.append(motor_positions[i]) # <<<<<<<<<<<<<<
*
* free(motor_positions)
*/
- __pyx_t_1 = PyFloat_FromDouble((__pyx_v_motor_positions[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_motor_positions[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_motor_positions_list, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_motor_positions_list, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 1157, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "specfile.pyx":1163
+ /* "silx/io/specfile.pyx":1159
* motor_positions_list.append(motor_positions[i])
*
* free(motor_positions) # <<<<<<<<<<<<<<
@@ -12740,7 +14302,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
*/
free(__pyx_v_motor_positions);
- /* "specfile.pyx":1164
+ /* "silx/io/specfile.pyx":1160
*
* free(motor_positions)
* return motor_positions_list # <<<<<<<<<<<<<<
@@ -12752,7 +14314,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
__pyx_r = __pyx_v_motor_positions_list;
goto __pyx_L0;
- /* "specfile.pyx":1139
+ /* "silx/io/specfile.pyx":1135
* return motors_list
*
* def motor_positions(self, scan_index): # <<<<<<<<<<<<<<
@@ -12767,7 +14329,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("specfile.SpecFile.motor_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.motor_positions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_motor_positions_list);
@@ -12776,7 +14338,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
return __pyx_r;
}
-/* "specfile.pyx":1166
+/* "silx/io/specfile.pyx":1162
* return motor_positions_list
*
* def motor_position_by_name(self, scan_index, name): # <<<<<<<<<<<<<<
@@ -12785,14 +14347,11 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_49motor_positions(struct __pyx_obj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_52motor_position_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_51motor_position_by_name[] = "SpecFile.motor_position_by_name(self, scan_index, name)\nReturn motor position\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Specified motor position\n :rtype: double\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_52motor_position_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_52motor_position_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_51motor_position_by_name[] = "SpecFile.motor_position_by_name(self, scan_index, name)\nReturn motor position\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Specified motor position\n :rtype: double\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_52motor_position_by_name(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
PyObject *__pyx_v_name = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("motor_position_by_name (wrapper)", 0);
@@ -12816,11 +14375,11 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_52motor_position_by_name(PyObject
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, 1); __PYX_ERR(0, 1162, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_position_by_name") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "motor_position_by_name") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -12833,20 +14392,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_52motor_position_by_name(PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("motor_position_by_name", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1162, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_51motor_position_by_name(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_name);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_51motor_position_by_name(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_name);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_name) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_51motor_position_by_name(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_name) {
int __pyx_v_error;
double __pyx_v_motor_position;
PyObject *__pyx_r = NULL;
@@ -12859,36 +14418,33 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
long __pyx_t_6;
char *__pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("motor_position_by_name", 0);
__Pyx_INCREF(__pyx_v_name);
- /* "specfile.pyx":1177
+ /* "silx/io/specfile.pyx":1173
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* name = _string_to_char_star(name)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1179
+ /* "silx/io/specfile.pyx":1175
* int error = SF_ERR_NO_ERRORS
*
* name = _string_to_char_star(name) # <<<<<<<<<<<<<<
*
* motor_position = specfile_wrapper.SfMotorPosByName(self.handle,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_string_to_char_star); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -12898,45 +14454,63 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; __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;
- __Pyx_INCREF(__pyx_v_name);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- __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 = 1179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_name};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_name};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_name);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_name, __pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1182
+ /* "silx/io/specfile.pyx":1178
*
* motor_position = specfile_wrapper.SfMotorPosByName(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* name,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_6 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1183
+ /* "silx/io/specfile.pyx":1179
* motor_position = specfile_wrapper.SfMotorPosByName(self.handle,
* scan_index + 1,
* name, # <<<<<<<<<<<<<<
* &error)
* self._handle_error(error)
*/
- __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error)
- /* "specfile.pyx":1181
+ /* "silx/io/specfile.pyx":1177
* name = _string_to_char_star(name)
*
* motor_position = specfile_wrapper.SfMotorPosByName(self.handle, # <<<<<<<<<<<<<<
@@ -12945,19 +14519,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
*/
__pyx_v_motor_position = SfMotorPosByName(__pyx_v_self->handle, __pyx_t_6, __pyx_t_7, (&__pyx_v_error));
- /* "specfile.pyx":1185
+ /* "silx/io/specfile.pyx":1181
* name,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
* return motor_position
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -12967,24 +14541,44 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1181, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1187
+ /* "silx/io/specfile.pyx":1183
* self._handle_error(error)
*
* return motor_position # <<<<<<<<<<<<<<
@@ -12992,13 +14586,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
* def number_of_mca(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_motor_position); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_motor_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":1166
+ /* "silx/io/specfile.pyx":1162
* return motor_positions_list
*
* def motor_position_by_name(self, scan_index, name): # <<<<<<<<<<<<<<
@@ -13013,7 +14607,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.motor_position_by_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_name);
@@ -13022,7 +14616,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
return __pyx_r;
}
-/* "specfile.pyx":1189
+/* "silx/io/specfile.pyx":1185
* return motor_position
*
* def number_of_mca(self, scan_index): # <<<<<<<<<<<<<<
@@ -13031,20 +14625,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_51motor_position_by_name(struct __
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_54number_of_mca(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_53number_of_mca[] = "SpecFile.number_of_mca(self, scan_index)\nReturn number of mca spectra in a scan.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Number of mca spectra.\n :rtype: int\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_54number_of_mca(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_54number_of_mca(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_53number_of_mca[] = "SpecFile.number_of_mca(self, scan_index)\nReturn number of mca spectra in a scan.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: Number of mca spectra.\n :rtype: int\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_54number_of_mca(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("number_of_mca (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_53number_of_mca(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_53number_of_mca(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
int __pyx_v_error;
long __pyx_v_num_mca;
PyObject *__pyx_r = NULL;
@@ -13057,37 +14651,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("number_of_mca", 0);
- /* "specfile.pyx":1200
+ /* "silx/io/specfile.pyx":1196
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
*
* num_mca = specfile_wrapper.SfNoMca(self.handle,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1203
+ /* "silx/io/specfile.pyx":1199
*
* num_mca = specfile_wrapper.SfNoMca(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &error)
* # error code updating isn't implemented in SfNoMCA
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1199, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1202
+ /* "silx/io/specfile.pyx":1198
* int error = SF_ERR_NO_ERRORS
*
* num_mca = specfile_wrapper.SfNoMca(self.handle, # <<<<<<<<<<<<<<
@@ -13096,29 +14687,29 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
*/
__pyx_v_num_mca = SfNoMca(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_error));
- /* "specfile.pyx":1206
+ /* "silx/io/specfile.pyx":1202
* &error)
* # error code updating isn't implemented in SfNoMCA
* if num_mca == -1: # <<<<<<<<<<<<<<
* raise SfNoMcaError("Failed to retrieve number of MCA " +
* "(SfNoMca returned -1)")
*/
- __pyx_t_4 = ((__pyx_v_num_mca == -1) != 0);
+ __pyx_t_4 = ((__pyx_v_num_mca == -1L) != 0);
if (__pyx_t_4) {
- /* "specfile.pyx":1207
+ /* "silx/io/specfile.pyx":1203
* # error code updating isn't implemented in SfNoMCA
* if num_mca == -1:
* raise SfNoMcaError("Failed to retrieve number of MCA " + # <<<<<<<<<<<<<<
* "(SfNoMca returned -1)")
* return num_mca
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfNoMcaError); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfNoMcaError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyNumber_Add(__pyx_kp_s_Failed_to_retrieve_number_of_MCA, __pyx_kp_s_SfNoMca_returned_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_kp_s_Failed_to_retrieve_number_of_MCA, __pyx_kp_s_SfNoMca_returned_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -13128,27 +14719,55 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
}
}
if (!__pyx_t_7) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 1203, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":1202
+ * &error)
+ * # error code updating isn't implemented in SfNoMCA
+ * if num_mca == -1: # <<<<<<<<<<<<<<
+ * raise SfNoMcaError("Failed to retrieve number of MCA " +
+ * "(SfNoMca returned -1)")
+ */
}
- /* "specfile.pyx":1209
+ /* "silx/io/specfile.pyx":1205
* raise SfNoMcaError("Failed to retrieve number of MCA " +
* "(SfNoMca returned -1)")
* return num_mca # <<<<<<<<<<<<<<
@@ -13156,13 +14775,13 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
* def mca_calibration(self, scan_index):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_mca); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_num_mca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "specfile.pyx":1189
+ /* "silx/io/specfile.pyx":1185
* return motor_position
*
* def number_of_mca(self, scan_index): # <<<<<<<<<<<<<<
@@ -13177,7 +14796,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.number_of_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.number_of_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -13185,7 +14804,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
return __pyx_r;
}
-/* "specfile.pyx":1211
+/* "silx/io/specfile.pyx":1207
* return num_mca
*
* def mca_calibration(self, scan_index): # <<<<<<<<<<<<<<
@@ -13194,20 +14813,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_53number_of_mca(struct __pyx_obj_8
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_56mca_calibration(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_55mca_calibration[] = "SpecFile.mca_calibration(self, scan_index)\nReturn MCA calibration in the form :math:`a + b x + c x\302\262`\n\n Raise a KeyError if there is no ``@CALIB`` line in the scan header.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: MCA calibration as a list of 3 values :math:`(a, b, c)`\n :rtype: list of floats\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_56mca_calibration(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_56mca_calibration(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_55mca_calibration[] = "SpecFile.mca_calibration(self, scan_index)\nReturn MCA calibration in the form :math:`a + b x + c x\302\262`\n\n Raise a KeyError if there is no ``@CALIB`` line in the scan header.\n\n :param scan_index: Unique scan index between ``0`` and\n ``len(self)-1``.\n :type scan_index: int\n\n :return: MCA calibration as a list of 3 values :math:`(a, b, c)`\n :rtype: list of floats\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_56mca_calibration(PyObject *__pyx_v_self, PyObject *__pyx_v_scan_index) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("mca_calibration (wrapper)", 0);
- __pyx_r = __pyx_pf_8specfile_8SpecFile_55mca_calibration(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_55mca_calibration(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), ((PyObject *)__pyx_v_scan_index));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index) {
int __pyx_v_error;
double *__pyx_v_mca_calib;
long __pyx_v_mca_calib_error;
@@ -13220,37 +14839,34 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
long __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("mca_calibration", 0);
- /* "specfile.pyx":1224
+ /* "silx/io/specfile.pyx":1220
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
* double* mca_calib
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1228
+ /* "silx/io/specfile.pyx":1224
*
* mca_calib_error = specfile_wrapper.SfMcaCalib(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* &mca_calib,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1224, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1227
+ /* "silx/io/specfile.pyx":1223
* double* mca_calib
*
* mca_calib_error = specfile_wrapper.SfMcaCalib(self.handle, # <<<<<<<<<<<<<<
@@ -13259,7 +14875,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
*/
__pyx_v_mca_calib_error = SfMcaCalib(__pyx_v_self->handle, __pyx_t_3, (&__pyx_v_mca_calib), (&__pyx_v_error));
- /* "specfile.pyx":1233
+ /* "silx/io/specfile.pyx":1229
*
* # error code updating isn't implemented in SfMcaCalib
* if mca_calib_error: # <<<<<<<<<<<<<<
@@ -13269,33 +14885,41 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
__pyx_t_4 = (__pyx_v_mca_calib_error != 0);
if (__pyx_t_4) {
- /* "specfile.pyx":1234
+ /* "silx/io/specfile.pyx":1230
* # error code updating isn't implemented in SfMcaCalib
* if mca_calib_error:
* raise KeyError("MCA calibration line (@CALIB) not found") # <<<<<<<<<<<<<<
*
* mca_calib_list = []
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_KeyError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 1230, __pyx_L1_error)
+
+ /* "silx/io/specfile.pyx":1229
+ *
+ * # error code updating isn't implemented in SfMcaCalib
+ * if mca_calib_error: # <<<<<<<<<<<<<<
+ * raise KeyError("MCA calibration line (@CALIB) not found")
+ *
+ */
}
- /* "specfile.pyx":1236
+ /* "silx/io/specfile.pyx":1232
* raise KeyError("MCA calibration line (@CALIB) not found")
*
* mca_calib_list = [] # <<<<<<<<<<<<<<
* for i in range(3):
* mca_calib_list.append(mca_calib[i])
*/
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_mca_calib_list = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "specfile.pyx":1237
+ /* "silx/io/specfile.pyx":1233
*
* mca_calib_list = []
* for i in range(3): # <<<<<<<<<<<<<<
@@ -13305,20 +14929,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
for (__pyx_t_3 = 0; __pyx_t_3 < 3; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "specfile.pyx":1238
+ /* "silx/io/specfile.pyx":1234
* mca_calib_list = []
* for i in range(3):
* mca_calib_list.append(mca_calib[i]) # <<<<<<<<<<<<<<
*
* free(mca_calib)
*/
- __pyx_t_1 = PyFloat_FromDouble((__pyx_v_mca_calib[__pyx_v_i])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_mca_calib[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_mca_calib_list, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_mca_calib_list, __pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 1234, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- /* "specfile.pyx":1240
+ /* "silx/io/specfile.pyx":1236
* mca_calib_list.append(mca_calib[i])
*
* free(mca_calib) # <<<<<<<<<<<<<<
@@ -13327,7 +14951,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
*/
free(__pyx_v_mca_calib);
- /* "specfile.pyx":1241
+ /* "silx/io/specfile.pyx":1237
*
* free(mca_calib)
* return mca_calib_list # <<<<<<<<<<<<<<
@@ -13339,7 +14963,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
__pyx_r = __pyx_v_mca_calib_list;
goto __pyx_L0;
- /* "specfile.pyx":1211
+ /* "silx/io/specfile.pyx":1207
* return num_mca
*
* def mca_calibration(self, scan_index): # <<<<<<<<<<<<<<
@@ -13350,7 +14974,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("specfile.SpecFile.mca_calibration", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.mca_calibration", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_mca_calib_list);
@@ -13359,7 +14983,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
return __pyx_r;
}
-/* "specfile.pyx":1243
+/* "silx/io/specfile.pyx":1239
* return mca_calib_list
*
* def get_mca(self, scan_index, mca_index): # <<<<<<<<<<<<<<
@@ -13368,14 +14992,11 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_55mca_calibration(struct __pyx_obj
*/
/* Python wrapper */
-static PyObject *__pyx_pw_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_8specfile_8SpecFile_57get_mca[] = "SpecFile.get_mca(self, scan_index, mca_index)\nReturn one MCA spectrum\n\n :param scan_index: Unique scan index between ``0`` and ``len(self)-1``.\n :type scan_index: int\n :param mca_index: Index of MCA in the scan\n :type mca_index: int\n\n :return: MCA spectrum\n :rtype: 1D numpy array\n ";
-static PyObject *__pyx_pw_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_2io_8specfile_8SpecFile_57get_mca[] = "SpecFile.get_mca(self, scan_index, mca_index)\nReturn one MCA spectrum\n\n :param scan_index: Unique scan index between ``0`` and ``len(self)-1``.\n :type scan_index: int\n :param mca_index: Index of MCA in the scan\n :type mca_index: int\n\n :return: MCA spectrum\n :rtype: 1D numpy array\n ";
+static PyObject *__pyx_pw_4silx_2io_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_scan_index = 0;
PyObject *__pyx_v_mca_index = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_mca (wrapper)", 0);
@@ -13399,11 +15020,11 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self,
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mca_index)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("get_mca", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_mca", 1, 2, 2, 1); __PYX_ERR(0, 1239, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_mca") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_mca") < 0)) __PYX_ERR(0, 1239, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -13416,20 +15037,20 @@ static PyObject *__pyx_pw_8specfile_8SpecFile_58get_mca(PyObject *__pyx_v_self,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("get_mca", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("get_mca", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1239, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("specfile.SpecFile.get_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.get_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_8specfile_8SpecFile_57get_mca(((struct __pyx_obj_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_mca_index);
+ __pyx_r = __pyx_pf_4silx_2io_8specfile_8SpecFile_57get_mca(((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)__pyx_v_self), __pyx_v_scan_index, __pyx_v_mca_index);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_mca_index) {
+static PyObject *__pyx_pf_4silx_2io_8specfile_8SpecFile_57get_mca(struct __pyx_obj_4silx_2io_8specfile_SpecFile *__pyx_v_self, PyObject *__pyx_v_scan_index, PyObject *__pyx_v_mca_index) {
int __pyx_v_error;
double *__pyx_v_mca_data;
long __pyx_v_len_mca;
@@ -13445,49 +15066,46 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_mca", 0);
- /* "specfile.pyx":1255
+ /* "silx/io/specfile.pyx":1251
* """
* cdef:
* int error = SF_ERR_NO_ERRORS # <<<<<<<<<<<<<<
* double* mca_data
* long len_mca
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SF_ERR_NO_ERRORS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_error = __pyx_t_2;
- /* "specfile.pyx":1260
+ /* "silx/io/specfile.pyx":1256
*
* len_mca = specfile_wrapper.SfGetMca(self.handle,
* scan_index + 1, # <<<<<<<<<<<<<<
* mca_index + 1,
* &mca_data,
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_scan_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_scan_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_3 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1261
+ /* "silx/io/specfile.pyx":1257
* len_mca = specfile_wrapper.SfGetMca(self.handle,
* scan_index + 1,
* mca_index + 1, # <<<<<<<<<<<<<<
* &mca_data,
* &error)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_v_mca_index, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_mca_index, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1259
+ /* "silx/io/specfile.pyx":1255
* long len_mca
*
* len_mca = specfile_wrapper.SfGetMca(self.handle, # <<<<<<<<<<<<<<
@@ -13496,19 +15114,19 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
*/
__pyx_v_len_mca = SfGetMca(__pyx_v_self->handle, __pyx_t_3, __pyx_t_4, (&__pyx_v_mca_data), (&__pyx_v_error));
- /* "specfile.pyx":1264
+ /* "silx/io/specfile.pyx":1260
* &mca_data,
* &error)
* self._handle_error(error) # <<<<<<<<<<<<<<
*
- *
+ * cdef numpy.ndarray ret_array = numpy.empty((len_mca,),
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -13518,82 +15136,102 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
}
}
if (!__pyx_t_7) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1260, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1267
- *
+ /* "silx/io/specfile.pyx":1262
+ * self._handle_error(error)
*
* cdef numpy.ndarray ret_array = numpy.empty((len_mca,), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(len_mca):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1262, __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_len_mca); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_len_mca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- /* "specfile.pyx":1268
+ /* "silx/io/specfile.pyx":1263
*
* cdef numpy.ndarray ret_array = numpy.empty((len_mca,),
* dtype=numpy.double) # <<<<<<<<<<<<<<
* for i in range(len_mca):
* ret_array[i] = mca_data[i]
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_double); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 1263, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "specfile.pyx":1267
- *
+ /* "silx/io/specfile.pyx":1262
+ * self._handle_error(error)
*
* cdef numpy.ndarray ret_array = numpy.empty((len_mca,), # <<<<<<<<<<<<<<
* dtype=numpy.double)
* for i in range(len_mca):
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 1262, __pyx_L1_error)
__pyx_v_ret_array = ((PyArrayObject *)__pyx_t_7);
__pyx_t_7 = 0;
- /* "specfile.pyx":1269
+ /* "silx/io/specfile.pyx":1264
* cdef numpy.ndarray ret_array = numpy.empty((len_mca,),
* dtype=numpy.double)
* for i in range(len_mca): # <<<<<<<<<<<<<<
@@ -13604,20 +15242,20 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_4; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "specfile.pyx":1270
+ /* "silx/io/specfile.pyx":1265
* dtype=numpy.double)
* for i in range(len_mca):
* ret_array[i] = mca_data[i] # <<<<<<<<<<<<<<
*
* free(mca_data)
*/
- __pyx_t_7 = PyFloat_FromDouble((__pyx_v_mca_data[__pyx_v_i])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyFloat_FromDouble((__pyx_v_mca_data[__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ret_array), __pyx_v_i, __pyx_t_7, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_SetItemInt(((PyObject *)__pyx_v_ret_array), __pyx_v_i, __pyx_t_7, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 1265, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
}
- /* "specfile.pyx":1272
+ /* "silx/io/specfile.pyx":1267
* ret_array[i] = mca_data[i]
*
* free(mca_data) # <<<<<<<<<<<<<<
@@ -13625,7 +15263,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
*/
free(__pyx_v_mca_data);
- /* "specfile.pyx":1273
+ /* "silx/io/specfile.pyx":1268
*
* free(mca_data)
* return ret_array # <<<<<<<<<<<<<<
@@ -13635,7 +15273,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
__pyx_r = ((PyObject *)__pyx_v_ret_array);
goto __pyx_L0;
- /* "specfile.pyx":1243
+ /* "silx/io/specfile.pyx":1239
* return mca_calib_list
*
* def get_mca(self, scan_index, mca_index): # <<<<<<<<<<<<<<
@@ -13650,7 +15288,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("specfile.SpecFile.get_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.io.specfile.SpecFile.get_mca", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_ret_array);
@@ -13659,7 +15297,7 @@ static PyObject *__pyx_pf_8specfile_8SpecFile_57get_mca(struct __pyx_obj_8specfi
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -13700,16 +15338,13 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
@@ -13722,7 +15357,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L0;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -13731,7 +15366,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_endian_detector = 1;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -13740,7 +15375,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -13749,7 +15384,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -13759,7 +15394,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -13767,22 +15402,30 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
+ /*else*/ {
__pyx_v_copy_shape = 0;
}
__pyx_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -13796,7 +15439,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L6_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -13806,23 +15449,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__31, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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;}
+ __PYX_ERR(1, 218, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -13836,7 +15495,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L9_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -13846,23 +15505,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__32, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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;}
+ __PYX_ERR(1, 222, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -13871,7 +15546,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -13880,7 +15555,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
@@ -13890,7 +15565,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = (__pyx_v_copy_shape != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
* # 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) # <<<<<<<<<<<<<<
@@ -13899,7 +15574,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
* # 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 # <<<<<<<<<<<<<<
@@ -13908,7 +15583,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231
* 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): # <<<<<<<<<<<<<<
@@ -13919,7 +15594,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -13928,7 +15603,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -13937,20 +15612,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ * 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.
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
* 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
*/
+ /*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
* else:
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -13961,7 +15644,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L11:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -13970,7 +15653,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->suboffsets = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -13979,7 +15662,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -13988,28 +15671,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
- * cdef list stack
+ * cdef int offset
*/
__pyx_v_f = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -14018,7 +15701,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
@@ -14036,7 +15719,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -14048,17 +15731,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
+ /*else*/ {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -14067,7 +15758,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L14:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -14077,7 +15768,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -14087,7 +15778,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
@@ -14107,7 +15798,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L20_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
@@ -14123,43 +15814,51 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__33, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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;}
- }
+ __PYX_ERR(1, 259, __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)
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
*/
- switch (__pyx_v_t) {
+ }
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
* (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"
*/
+ switch (__pyx_v_t) {
case NPY_BYTE:
- __pyx_v_f = __pyx_k_b;
+ __pyx_v_f = ((char *)"b");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -14167,10 +15866,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_USHORT: f = "H"
*/
case NPY_UBYTE:
- __pyx_v_f = __pyx_k_B;
+ __pyx_v_f = ((char *)"B");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -14178,10 +15877,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_INT: f = "i"
*/
case NPY_SHORT:
- __pyx_v_f = __pyx_k_h;
+ __pyx_v_f = ((char *)"h");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -14189,10 +15888,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_UINT: f = "I"
*/
case NPY_USHORT:
- __pyx_v_f = __pyx_k_H;
+ __pyx_v_f = ((char *)"H");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -14200,10 +15899,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONG: f = "l"
*/
case NPY_INT:
- __pyx_v_f = __pyx_k_i;
+ __pyx_v_f = ((char *)"i");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -14211,10 +15910,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONG: f = "L"
*/
case NPY_UINT:
- __pyx_v_f = __pyx_k_I;
+ __pyx_v_f = ((char *)"I");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -14222,10 +15921,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGLONG: f = "q"
*/
case NPY_LONG:
- __pyx_v_f = __pyx_k_l;
+ __pyx_v_f = ((char *)"l");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -14233,10 +15932,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONGLONG: f = "Q"
*/
case NPY_ULONG:
- __pyx_v_f = __pyx_k_L;
+ __pyx_v_f = ((char *)"L");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -14244,10 +15943,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_FLOAT: f = "f"
*/
case NPY_LONGLONG:
- __pyx_v_f = __pyx_k_q;
+ __pyx_v_f = ((char *)"q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -14255,10 +15954,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_DOUBLE: f = "d"
*/
case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k_Q;
+ __pyx_v_f = ((char *)"Q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -14266,10 +15965,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGDOUBLE: f = "g"
*/
case NPY_FLOAT:
- __pyx_v_f = __pyx_k_f;
+ __pyx_v_f = ((char *)"f");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -14277,10 +15976,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CFLOAT: f = "Zf"
*/
case NPY_DOUBLE:
- __pyx_v_f = __pyx_k_d;
+ __pyx_v_f = ((char *)"d");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -14288,10 +15987,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CDOUBLE: f = "Zd"
*/
case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k_g;
+ __pyx_v_f = ((char *)"g");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -14299,10 +15998,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
case NPY_CFLOAT:
- __pyx_v_f = __pyx_k_Zf;
+ __pyx_v_f = ((char *)"Zf");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -14310,10 +16009,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_OBJECT: f = "O"
*/
case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k_Zd;
+ __pyx_v_f = ((char *)"Zd");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -14321,10 +16020,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* else:
*/
case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k_Zg;
+ __pyx_v_f = ((char *)"Zg");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -14332,37 +16031,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
case NPY_OBJECT:
- __pyx_v_f = __pyx_k_O;
+ __pyx_v_f = ((char *)"O");
break;
default:
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __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_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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;}
+ __PYX_ERR(1, 278, __pyx_L1_error)
break;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -14371,7 +16070,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->format = __pyx_v_f;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -14380,19 +16079,27 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
* 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));
+ /*else*/ {
+ __pyx_v_info->format = ((char *)malloc(0xFF));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
* else:
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -14401,7 +16108,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->format[0]) = '^';
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -14410,17 +16117,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_offset = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285
* 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
__pyx_v_f = __pyx_t_7;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
@@ -14430,7 +16137,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
(__pyx_v_f[0]) = '\x00';
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -14462,7 +16169,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -14486,7 +16193,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -14496,7 +16203,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -14504,11 +16211,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
- goto __pyx_L3;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
}
- __pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -14518,7 +16231,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -14526,11 +16239,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
*
*/
free(__pyx_v_info->strides);
- goto __pyx_L4;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
+ * 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_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -14542,7 +16261,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -14554,12 +16273,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -14567,13 +16283,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -14592,7 +16308,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -14604,12 +16320,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -14617,13 +16330,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -14642,7 +16355,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -14654,12 +16367,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -14667,13 +16377,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -14692,7 +16402,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -14704,12 +16414,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -14717,13 +16424,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
* 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_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_ERR(1, 780, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -14742,7 +16449,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -14754,12 +16461,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -14767,13 +16471,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
* 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_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_ERR(1, 783, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -14792,7 +16496,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -14819,22 +16523,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ *
+ * cdef dtype child
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
@@ -14842,7 +16543,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -14851,33 +16552,38 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
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_ERR(1, 794, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 794, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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
+ /* "../../../../../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;};
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 795, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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;}
+ 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_ERR(1, 795, __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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -14886,7 +16592,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14894,60 +16600,68 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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;}
+ __PYX_ERR(1, 796, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __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_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __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;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __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_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __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
+ /* "../../../../../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__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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;}
+ __PYX_ERR(1, 799, __pyx_L1_error)
+
+ /* "../../../../../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")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -14967,7 +16681,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__pyx_L8_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
+ /* "../../../../../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)): # <<<<<<<<<<<<<<
@@ -14983,23 +16697,39 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
+
+ /* "../../../../../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")
+ */
if (__pyx_t_6) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__35, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 803, __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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -15007,24 +16737,24 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* 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_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __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
+ /* "../../../../../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;
+ (__pyx_v_f[0]) = 0x78;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -15033,7 +16763,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_f = (__pyx_v_f + 1);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -15044,7 +16774,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
(__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -15054,7 +16784,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -15064,19 +16794,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __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
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -15086,357 +16816,365 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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__36, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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;}
+ __PYX_ERR(1, 823, __pyx_L1_error)
+
+ /* "../../../../../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.")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __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
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 104;
+ (__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 105;
+ (__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 108;
+ (__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 113;
+ (__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 102;
+ (__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 100;
+ (__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 103;
+ (__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __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[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __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[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __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
+ /* "../../../../../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;}
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_ERR(1, 844, __pyx_L1_error)
}
__pyx_L15:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -15444,23 +17182,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../../../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:
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
+ /* "../../../../../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;}
+ /*else*/ {
+ __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_ERR(1, 849, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -15470,7 +17216,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -15480,7 +17226,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_r = __pyx_v_f;
goto __pyx_L0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -15505,7 +17251,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -15520,7 +17266,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
int __pyx_t_2;
__Pyx_RefNannySetupContext("set_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -15531,7 +17277,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
@@ -15539,20 +17285,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
+
+ /* "../../../../../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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ /* "../../../../../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)
*/
+ /*else*/ {
Py_INCREF(__pyx_v_base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -15563,7 +17317,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
}
__pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ /* "../../../../../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) # <<<<<<<<<<<<<<
@@ -15572,7 +17326,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
Py_XDECREF(__pyx_v_arr->base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
* baseptr = <PyObject*>base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
@@ -15581,7 +17335,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
__pyx_v_arr->base = __pyx_v_baseptr;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -15593,7 +17347,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -15607,7 +17361,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -15617,7 +17371,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -15628,21 +17382,31 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "../../../../../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:
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
* return None
* else:
* return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
*/
+ /*else*/ {
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -15657,8 +17421,398 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
return __pyx_r;
}
-static PyObject *__pyx_tp_new_8specfile_SpecFile(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_obj_8specfile_SpecFile *p;
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":987
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":988
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 989, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":993
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":994
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 995, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":999
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_tp_new_4silx_2io_8specfile_SpecFile(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_4silx_2io_8specfile_SpecFile *p;
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
@@ -15666,16 +17820,17 @@ static PyObject *__pyx_tp_new_8specfile_SpecFile(PyTypeObject *t, PyObject *a, P
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
- p = ((struct __pyx_obj_8specfile_SpecFile *)o);
+ p = ((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)o);
p->filename = ((PyObject*)Py_None); Py_INCREF(Py_None);
- if (unlikely(__pyx_pw_8specfile_8SpecFile_1__cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
+ if (unlikely(__pyx_pw_4silx_2io_8specfile_8SpecFile_1__cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
-static void __pyx_tp_dealloc_8specfile_SpecFile(PyObject *o) {
- struct __pyx_obj_8specfile_SpecFile *p = (struct __pyx_obj_8specfile_SpecFile *)o;
+static void __pyx_tp_dealloc_4silx_2io_8specfile_SpecFile(PyObject *o) {
+ struct __pyx_obj_4silx_2io_8specfile_SpecFile *p = (struct __pyx_obj_4silx_2io_8specfile_SpecFile *)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;
@@ -15685,14 +17840,14 @@ static void __pyx_tp_dealloc_8specfile_SpecFile(PyObject *o) {
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++Py_REFCNT(o);
- __pyx_pw_8specfile_8SpecFile_5__dealloc__(o);
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_5__dealloc__(o);
--Py_REFCNT(o);
PyErr_Restore(etype, eval, etb);
}
Py_CLEAR(p->filename);
(*Py_TYPE(o)->tp_free)(o);
}
-static PyObject *__pyx_sq_item_8specfile_SpecFile(PyObject *o, Py_ssize_t i) {
+static PyObject *__pyx_sq_item_4silx_2io_8specfile_SpecFile(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);
@@ -15700,64 +17855,65 @@ static PyObject *__pyx_sq_item_8specfile_SpecFile(PyObject *o, Py_ssize_t i) {
return r;
}
-static PyMethodDef __pyx_methods_8specfile_SpecFile[] = {
- {"keys", (PyCFunction)__pyx_pw_8specfile_8SpecFile_14keys, METH_NOARGS, __pyx_doc_8specfile_8SpecFile_13keys},
- {"_get_error_string", (PyCFunction)__pyx_pw_8specfile_8SpecFile_18_get_error_string, METH_O, __pyx_doc_8specfile_8SpecFile_17_get_error_string},
- {"_handle_error", (PyCFunction)__pyx_pw_8specfile_8SpecFile_20_handle_error, METH_O, __pyx_doc_8specfile_8SpecFile_19_handle_error},
- {"index", (PyCFunction)__pyx_pw_8specfile_8SpecFile_22index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_21index},
- {"number", (PyCFunction)__pyx_pw_8specfile_8SpecFile_24number, METH_O, __pyx_doc_8specfile_8SpecFile_23number},
- {"order", (PyCFunction)__pyx_pw_8specfile_8SpecFile_26order, METH_O, __pyx_doc_8specfile_8SpecFile_25order},
- {"_list", (PyCFunction)__pyx_pw_8specfile_8SpecFile_28_list, METH_NOARGS, __pyx_doc_8specfile_8SpecFile_27_list},
- {"list", (PyCFunction)__pyx_pw_8specfile_8SpecFile_30list, METH_NOARGS, __pyx_doc_8specfile_8SpecFile_29list},
- {"data", (PyCFunction)__pyx_pw_8specfile_8SpecFile_32data, METH_O, __pyx_doc_8specfile_8SpecFile_31data},
- {"data_column_by_name", (PyCFunction)__pyx_pw_8specfile_8SpecFile_34data_column_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_33data_column_by_name},
- {"scan_header", (PyCFunction)__pyx_pw_8specfile_8SpecFile_36scan_header, METH_O, __pyx_doc_8specfile_8SpecFile_35scan_header},
- {"file_header", (PyCFunction)__pyx_pw_8specfile_8SpecFile_38file_header, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_37file_header},
- {"columns", (PyCFunction)__pyx_pw_8specfile_8SpecFile_40columns, METH_O, __pyx_doc_8specfile_8SpecFile_39columns},
- {"command", (PyCFunction)__pyx_pw_8specfile_8SpecFile_42command, METH_O, __pyx_doc_8specfile_8SpecFile_41command},
- {"date", (PyCFunction)__pyx_pw_8specfile_8SpecFile_44date, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_43date},
- {"labels", (PyCFunction)__pyx_pw_8specfile_8SpecFile_46labels, METH_O, __pyx_doc_8specfile_8SpecFile_45labels},
- {"motor_names", (PyCFunction)__pyx_pw_8specfile_8SpecFile_48motor_names, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_47motor_names},
- {"motor_positions", (PyCFunction)__pyx_pw_8specfile_8SpecFile_50motor_positions, METH_O, __pyx_doc_8specfile_8SpecFile_49motor_positions},
- {"motor_position_by_name", (PyCFunction)__pyx_pw_8specfile_8SpecFile_52motor_position_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_51motor_position_by_name},
- {"number_of_mca", (PyCFunction)__pyx_pw_8specfile_8SpecFile_54number_of_mca, METH_O, __pyx_doc_8specfile_8SpecFile_53number_of_mca},
- {"mca_calibration", (PyCFunction)__pyx_pw_8specfile_8SpecFile_56mca_calibration, METH_O, __pyx_doc_8specfile_8SpecFile_55mca_calibration},
- {"get_mca", (PyCFunction)__pyx_pw_8specfile_8SpecFile_58get_mca, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8specfile_8SpecFile_57get_mca},
+static PyMethodDef __pyx_methods_4silx_2io_8specfile_SpecFile[] = {
+ {"keys", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_14keys, METH_NOARGS, __pyx_doc_4silx_2io_8specfile_8SpecFile_13keys},
+ {"_get_error_string", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_18_get_error_string, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_17_get_error_string},
+ {"_handle_error", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_20_handle_error, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_19_handle_error},
+ {"index", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_22index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_21index},
+ {"number", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_24number, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_23number},
+ {"order", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_26order, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_25order},
+ {"_list", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_28_list, METH_NOARGS, __pyx_doc_4silx_2io_8specfile_8SpecFile_27_list},
+ {"list", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_30list, METH_NOARGS, __pyx_doc_4silx_2io_8specfile_8SpecFile_29list},
+ {"data", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_32data, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_31data},
+ {"data_column_by_name", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_34data_column_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_33data_column_by_name},
+ {"scan_header", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_36scan_header, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_35scan_header},
+ {"file_header", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_38file_header, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_37file_header},
+ {"columns", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_40columns, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_39columns},
+ {"command", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_42command, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_41command},
+ {"date", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_44date, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_43date},
+ {"labels", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_46labels, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_45labels},
+ {"motor_names", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_48motor_names, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_47motor_names},
+ {"motor_positions", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_50motor_positions, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_49motor_positions},
+ {"motor_position_by_name", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_52motor_position_by_name, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_51motor_position_by_name},
+ {"number_of_mca", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_54number_of_mca, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_53number_of_mca},
+ {"mca_calibration", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_56mca_calibration, METH_O, __pyx_doc_4silx_2io_8specfile_8SpecFile_55mca_calibration},
+ {"get_mca", (PyCFunction)__pyx_pw_4silx_2io_8specfile_8SpecFile_58get_mca, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_2io_8specfile_8SpecFile_57get_mca},
{0, 0, 0, 0}
};
static PySequenceMethods __pyx_tp_as_sequence_SpecFile = {
- __pyx_pw_8specfile_8SpecFile_7__len__, /*sq_length*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_7__len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
- __pyx_sq_item_8specfile_SpecFile, /*sq_item*/
+ __pyx_sq_item_4silx_2io_8specfile_SpecFile, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
- __pyx_pw_8specfile_8SpecFile_16__contains__, /*sq_contains*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_16__contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_SpecFile = {
- __pyx_pw_8specfile_8SpecFile_7__len__, /*mp_length*/
- __pyx_pw_8specfile_8SpecFile_12__getitem__, /*mp_subscript*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_7__len__, /*mp_length*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_12__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyTypeObject __pyx_type_8specfile_SpecFile = {
+static PyTypeObject __pyx_type_4silx_2io_8specfile_SpecFile = {
PyVarObject_HEAD_INIT(0, 0)
- "specfile.SpecFile", /*tp_name*/
- sizeof(struct __pyx_obj_8specfile_SpecFile), /*tp_basicsize*/
+ "silx.io.specfile.SpecFile", /*tp_name*/
+ sizeof(struct __pyx_obj_4silx_2io_8specfile_SpecFile), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_8specfile_SpecFile, /*tp_dealloc*/
+ __pyx_tp_dealloc_4silx_2io_8specfile_SpecFile, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15775,9 +17931,9 @@ static PyTypeObject __pyx_type_8specfile_SpecFile = {
0, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
- __pyx_pw_8specfile_8SpecFile_9__iter__, /*tp_iter*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_9__iter__, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_8specfile_SpecFile, /*tp_methods*/
+ __pyx_methods_4silx_2io_8specfile_SpecFile, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
@@ -15785,9 +17941,9 @@ static PyTypeObject __pyx_type_8specfile_SpecFile = {
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
- __pyx_pw_8specfile_8SpecFile_3__init__, /*tp_init*/
+ __pyx_pw_4silx_2io_8specfile_8SpecFile_3__init__, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_8specfile_SpecFile, /*tp_new*/
+ __pyx_tp_new_4silx_2io_8specfile_SpecFile, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -15802,14 +17958,14 @@ static PyTypeObject __pyx_type_8specfile_SpecFile = {
#endif
};
-static struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *__pyx_freelist_8specfile___pyx_scope_struct____iter__[8];
-static int __pyx_freecount_8specfile___pyx_scope_struct____iter__ = 0;
+static struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *__pyx_freelist_4silx_2io_8specfile___pyx_scope_struct____iter__[8];
+static int __pyx_freecount_4silx_2io_8specfile___pyx_scope_struct____iter__ = 0;
-static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8specfile___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8specfile___pyx_scope_struct____iter__)))) {
- o = (PyObject*)__pyx_freelist_8specfile___pyx_scope_struct____iter__[--__pyx_freecount_8specfile___pyx_scope_struct____iter__];
- memset(o, 0, sizeof(struct __pyx_obj_8specfile___pyx_scope_struct____iter__));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__)))) {
+ o = (PyObject*)__pyx_freelist_4silx_2io_8specfile___pyx_scope_struct____iter__[--__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct____iter__];
+ memset(o, 0, sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -15819,48 +17975,49 @@ static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct____iter__(PyTypeObjec
return o;
}
-static void __pyx_tp_dealloc_8specfile___pyx_scope_struct____iter__(PyObject *o) {
- struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)o;
+static void __pyx_tp_dealloc_4silx_2io_8specfile___pyx_scope_struct____iter__(PyObject *o) {
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8specfile___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8specfile___pyx_scope_struct____iter__)))) {
- __pyx_freelist_8specfile___pyx_scope_struct____iter__[__pyx_freecount_8specfile___pyx_scope_struct____iter__++] = ((struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__)))) {
+ __pyx_freelist_4silx_2io_8specfile___pyx_scope_struct____iter__[__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct____iter__++] = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_8specfile___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4silx_2io_8specfile___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)o;
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)o;
if (p->__pyx_v_self) {
e = (*v)(p->__pyx_v_self, a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_8specfile___pyx_scope_struct____iter__(PyObject *o) {
+static int __pyx_tp_clear_4silx_2io_8specfile___pyx_scope_struct____iter__(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct____iter__ *)o;
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__ *)o;
tmp = ((PyObject*)p->__pyx_v_self);
p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyTypeObject __pyx_type_8specfile___pyx_scope_struct____iter__ = {
+static PyTypeObject __pyx_type_4silx_2io_8specfile___pyx_scope_struct____iter__ = {
PyVarObject_HEAD_INIT(0, 0)
- "specfile.__pyx_scope_struct____iter__", /*tp_name*/
- sizeof(struct __pyx_obj_8specfile___pyx_scope_struct____iter__), /*tp_basicsize*/
+ "silx.io.specfile.__pyx_scope_struct____iter__", /*tp_name*/
+ sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct____iter__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_8specfile___pyx_scope_struct____iter__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4silx_2io_8specfile___pyx_scope_struct____iter__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15874,8 +18031,8 @@ static PyTypeObject __pyx_type_8specfile___pyx_scope_struct____iter__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_8specfile___pyx_scope_struct____iter__, /*tp_traverse*/
- __pyx_tp_clear_8specfile___pyx_scope_struct____iter__, /*tp_clear*/
+ __pyx_tp_traverse_4silx_2io_8specfile___pyx_scope_struct____iter__, /*tp_traverse*/
+ __pyx_tp_clear_4silx_2io_8specfile___pyx_scope_struct____iter__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -15890,7 +18047,7 @@ static PyTypeObject __pyx_type_8specfile___pyx_scope_struct____iter__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_8specfile___pyx_scope_struct____iter__, /*tp_new*/
+ __pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct____iter__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -15905,14 +18062,14 @@ static PyTypeObject __pyx_type_8specfile___pyx_scope_struct____iter__ = {
#endif
};
-static struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *__pyx_freelist_8specfile___pyx_scope_struct_1___iter__[8];
-static int __pyx_freecount_8specfile___pyx_scope_struct_1___iter__ = 0;
+static struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *__pyx_freelist_4silx_2io_8specfile___pyx_scope_struct_1___iter__[8];
+static int __pyx_freecount_4silx_2io_8specfile___pyx_scope_struct_1___iter__ = 0;
-static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8specfile___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__)))) {
- o = (PyObject*)__pyx_freelist_8specfile___pyx_scope_struct_1___iter__[--__pyx_freecount_8specfile___pyx_scope_struct_1___iter__];
- memset(o, 0, sizeof(struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__)))) {
+ o = (PyObject*)__pyx_freelist_4silx_2io_8specfile___pyx_scope_struct_1___iter__[--__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct_1___iter__];
+ memset(o, 0, sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -15922,48 +18079,49 @@ static PyObject *__pyx_tp_new_8specfile___pyx_scope_struct_1___iter__(PyTypeObje
return o;
}
-static void __pyx_tp_dealloc_8specfile___pyx_scope_struct_1___iter__(PyObject *o) {
- struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)o;
+static void __pyx_tp_dealloc_4silx_2io_8specfile___pyx_scope_struct_1___iter__(PyObject *o) {
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_self);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8specfile___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__)))) {
- __pyx_freelist_8specfile___pyx_scope_struct_1___iter__[__pyx_freecount_8specfile___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__)))) {
+ __pyx_freelist_4silx_2io_8specfile___pyx_scope_struct_1___iter__[__pyx_freecount_4silx_2io_8specfile___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_8specfile___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4silx_2io_8specfile___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)o;
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)o;
if (p->__pyx_v_self) {
e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
}
return 0;
}
-static int __pyx_tp_clear_8specfile___pyx_scope_struct_1___iter__(PyObject *o) {
+static int __pyx_tp_clear_4silx_2io_8specfile___pyx_scope_struct_1___iter__(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__ *)o;
+ struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__ *)o;
tmp = ((PyObject*)p->__pyx_v_self);
- p->__pyx_v_self = ((struct __pyx_obj_8specfile_SpecFile *)Py_None); Py_INCREF(Py_None);
+ p->__pyx_v_self = ((struct __pyx_obj_4silx_2io_8specfile_SpecFile *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(tmp);
return 0;
}
-static PyTypeObject __pyx_type_8specfile___pyx_scope_struct_1___iter__ = {
+static PyTypeObject __pyx_type_4silx_2io_8specfile___pyx_scope_struct_1___iter__ = {
PyVarObject_HEAD_INIT(0, 0)
- "specfile.__pyx_scope_struct_1___iter__", /*tp_name*/
- sizeof(struct __pyx_obj_8specfile___pyx_scope_struct_1___iter__), /*tp_basicsize*/
+ "silx.io.specfile.__pyx_scope_struct_1___iter__", /*tp_name*/
+ sizeof(struct __pyx_obj_4silx_2io_8specfile___pyx_scope_struct_1___iter__), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_8specfile___pyx_scope_struct_1___iter__, /*tp_dealloc*/
+ __pyx_tp_dealloc_4silx_2io_8specfile___pyx_scope_struct_1___iter__, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -15977,8 +18135,8 @@ static PyTypeObject __pyx_type_8specfile___pyx_scope_struct_1___iter__ = {
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_8specfile___pyx_scope_struct_1___iter__, /*tp_traverse*/
- __pyx_tp_clear_8specfile___pyx_scope_struct_1___iter__, /*tp_clear*/
+ __pyx_tp_traverse_4silx_2io_8specfile___pyx_scope_struct_1___iter__, /*tp_traverse*/
+ __pyx_tp_clear_4silx_2io_8specfile___pyx_scope_struct_1___iter__, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -15993,7 +18151,7 @@ static PyTypeObject __pyx_type_8specfile___pyx_scope_struct_1___iter__ = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_8specfile___pyx_scope_struct_1___iter__, /*tp_new*/
+ __pyx_tp_new_4silx_2io_8specfile___pyx_scope_struct_1___iter__, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -16032,8 +18190,8 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
+ {&__pyx_kp_s_11_08_2017, __pyx_k_11_08_2017, sizeof(__pyx_k_11_08_2017), 0, 0, 1, 0},
{&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
- {&__pyx_kp_s_27_09_2016, __pyx_k_27_09_2016, sizeof(__pyx_k_27_09_2016), 0, 0, 1, 0},
{&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
{&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
{&__pyx_kp_s_Base_exception_inherited_by_all, __pyx_k_Base_exception_inherited_by_all, sizeof(__pyx_k_Base_exception_inherited_by_all), 0, 0, 1, 0},
@@ -16043,11 +18201,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Custom_exception_raised_when_SfN, __pyx_k_Custom_exception_raised_when_SfN, sizeof(__pyx_k_Custom_exception_raised_when_SfN), 0, 0, 1, 0},
{&__pyx_n_s_ERRORS, __pyx_k_ERRORS, sizeof(__pyx_k_ERRORS), 0, 0, 1, 1},
{&__pyx_kp_s_Error_while_closing_SpecFile, __pyx_k_Error_while_closing_SpecFile, sizeof(__pyx_k_Error_while_closing_SpecFile), 0, 0, 1, 0},
- {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
{&__pyx_kp_s_F, __pyx_k_F, sizeof(__pyx_k_F), 0, 0, 1, 0},
{&__pyx_kp_s_Failed_to_retrieve_number_of_MCA, __pyx_k_Failed_to_retrieve_number_of_MCA, sizeof(__pyx_k_Failed_to_retrieve_number_of_MCA), 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_IOError, __pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 0, 1, 1},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
{&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
{&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
@@ -16063,6 +18222,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_MCA_index_must_be_in_range_0_d, __pyx_k_MCA_index_must_be_in_range_0_d, sizeof(__pyx_k_MCA_index_must_be_in_range_0_d), 0, 0, 1, 0},
{&__pyx_kp_s_MCA_index_should_be_an_integer_s, __pyx_k_MCA_index_should_be_an_integer_s, sizeof(__pyx_k_MCA_index_should_be_an_integer_s), 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_No_MCA_spectrum_found_in_this_sc, __pyx_k_No_MCA_spectrum_found_in_this_sc, sizeof(__pyx_k_No_MCA_spectrum_found_in_this_sc), 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_kp_s_P_Knobel, __pyx_k_P_Knobel, sizeof(__pyx_k_P_Knobel), 0, 0, 1, 0},
@@ -16130,7 +18290,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
{&__pyx_n_s_ascii, __pyx_k_ascii, sizeof(__pyx_k_ascii), 0, 0, 1, 1},
{&__pyx_n_s_authors, __pyx_k_authors, sizeof(__pyx_k_authors), 0, 0, 1, 1},
- {&__pyx_n_s_basicConfig, __pyx_k_basicConfig, sizeof(__pyx_k_basicConfig), 0, 0, 1, 1},
{&__pyx_n_s_calib_line, __pyx_k_calib_line, sizeof(__pyx_k_calib_line), 0, 0, 1, 1},
{&__pyx_n_s_calib_lines, __pyx_k_calib_lines, sizeof(__pyx_k_calib_lines), 0, 0, 1, 1},
{&__pyx_n_s_calibration, __pyx_k_calibration, sizeof(__pyx_k_calibration), 0, 0, 1, 1},
@@ -16218,6 +18377,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_number_and_M_the_order_eg_2_3, __pyx_k_number_and_M_the_order_eg_2_3, sizeof(__pyx_k_number_and_M_the_order_eg_2_3), 0, 0, 1, 0},
{&__pyx_n_s_number_of_mca, __pyx_k_number_of_mca, sizeof(__pyx_k_number_of_mca), 0, 0, 1, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
+ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
{&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
{&__pyx_n_s_one_line_calib_values, __pyx_k_one_line_calib_values, sizeof(__pyx_k_one_line_calib_values), 0, 0, 1, 1},
{&__pyx_n_s_one_line_chann_values, __pyx_k_one_line_chann_values, sizeof(__pyx_k_one_line_chann_values), 0, 0, 1, 1},
@@ -16252,6 +18413,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
{&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_io_specfile, __pyx_k_silx_io_specfile, sizeof(__pyx_k_silx_io_specfile), 0, 0, 1, 1},
{&__pyx_n_s_specfile, __pyx_k_specfile, sizeof(__pyx_k_specfile), 0, 0, 1, 1},
{&__pyx_n_s_specfile_2, __pyx_k_specfile_2, sizeof(__pyx_k_specfile_2), 0, 0, 1, 1},
{&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
@@ -16268,7 +18430,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
{&__pyx_n_s_transpose, __pyx_k_transpose, sizeof(__pyx_k_transpose), 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_kp_s_users_payno_Documents_dev_esrf, __pyx_k_users_payno_Documents_dev_esrf, sizeof(__pyx_k_users_payno_Documents_dev_esrf), 0, 0, 1, 0},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
{&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
{&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
@@ -16278,19 +18440,21 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __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 = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __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 = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; __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 = 740; __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_ERR(0, 151, __pyx_L1_error)
+ __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 152, __pyx_L1_error)
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 156, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 157, __pyx_L1_error)
+ __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 193, __pyx_L1_error)
+ __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 422, __pyx_L1_error)
+ __pyx_builtin_map = __Pyx_GetBuiltinName(__pyx_n_s_map); if (!__pyx_builtin_map) __PYX_ERR(0, 258, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 259, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 304, __pyx_L1_error)
+ __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 633, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 634, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 732, __pyx_L1_error)
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 736, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16300,628 +18464,659 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "specfile.pyx":256
+ /* "silx/io/specfile.pyx":255
* # Channels list
* if "CHANN" in self._header:
* chann_lines = self._header["CHANN"].split("\n") # <<<<<<<<<<<<<<
* all_chann_values = [chann_line.split() for chann_line in chann_lines]
* for one_line_chann_values in all_chann_values:
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "specfile.pyx":271
+ /* "silx/io/specfile.pyx":270
* # Channels list
* if "CALIB" in self._header:
* calib_lines = self._header["CALIB"].split("\n") # <<<<<<<<<<<<<<
* all_calib_values = [calib_line.split() for calib_line in calib_lines]
* for one_line_calib_values in all_calib_values:
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "specfile.pyx":297
+ /* "silx/io/specfile.pyx":296
* """
* if not len(self):
* raise IndexError("No MCA spectrum found in this scan") # <<<<<<<<<<<<<<
*
- * if isinstance(key, int):
+ * if isinstance(key, (int, long)):
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_MCA_spectrum_found_in_this_sc); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_No_MCA_spectrum_found_in_this_sc); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 296, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "specfile.pyx":335
+ /* "silx/io/specfile.pyx":334
* dictionary[key] += "\n" + value
* except TypeError:
* raise TypeError("Parameter value must be a string.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Parameter_value_must_be_a_string); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Parameter_value_must_be_a_string); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "specfile.pyx":383
+ /* "silx/io/specfile.pyx":382
* match_mca = re.search(r"#@(\w+) *(.*)", line)
* if match:
* hkey = match.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "specfile.pyx":384
+ /* "silx/io/specfile.pyx":383
* if match:
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
* elif match_mca:
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 383, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "specfile.pyx":387
+ /* "silx/io/specfile.pyx":386
* _add_or_concatenate(self._scan_header_dict, hkey, hvalue)
* elif match_mca:
* hkey = match_mca.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match_mca.group(2).strip()
* _add_or_concatenate(self._mca_header_dict, hkey, hvalue)
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "specfile.pyx":388
+ /* "silx/io/specfile.pyx":387
* elif match_mca:
* hkey = match_mca.group(1).lstrip("#").strip()
* hvalue = match_mca.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._mca_header_dict, hkey, hvalue)
* else:
*/
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- /* "specfile.pyx":395
+ /* "silx/io/specfile.pyx":394
*
* self._labels = []
* if self.record_exists_in_hdr('L'): # <<<<<<<<<<<<<<
* try:
* self._labels = self._specfile.labels(self._index)
*/
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_L); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_L); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 394, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- /* "specfile.pyx":403
+ /* "silx/io/specfile.pyx":402
* L_header = re.sub(r" {2,}", " ", # max. 2 spaces
* self._scan_header_dict["L"])
* self._labels = L_header.split(" ") # <<<<<<<<<<<<<<
*
- *
+ * self._file_header_dict = {}
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
- /* "specfile.pyx":411
+ /* "silx/io/specfile.pyx":409
* if match:
* # header type
* hkey = match.group(1).lstrip("#").strip() # <<<<<<<<<<<<<<
* hvalue = match.group(2).strip()
* _add_or_concatenate(self._file_header_dict, hkey, hvalue)
*/
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__16);
__Pyx_GIVEREF(__pyx_tuple__16);
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__7); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
- /* "specfile.pyx":412
+ /* "silx/io/specfile.pyx":410
* # header type
* hkey = match.group(1).lstrip("#").strip()
* hvalue = match.group(2).strip() # <<<<<<<<<<<<<<
* _add_or_concatenate(self._file_header_dict, hkey, hvalue)
* else:
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 410, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
- /* "specfile.pyx":583
+ /* "silx/io/specfile.pyx":581
* # attribute data corresponds to a transposed version of the original
* # specfile data (where detectors correspond to columns)
* return self.data[:, line_index] # <<<<<<<<<<<<<<
*
* def data_column_by_name(self, label):
*/
- __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) __PYX_ERR(0, 581, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__19);
__Pyx_GIVEREF(__pyx_slice__19);
- /* "specfile.pyx":601
+ /* "silx/io/specfile.pyx":599
* _logger.warning("Cannot get data column %s in scan %d.%d",
* label, self.number, self.order)
* ret = numpy.empty((0, ), numpy.double) # <<<<<<<<<<<<<<
* return ret
*
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__20);
__Pyx_GIVEREF(__pyx_tuple__20);
- /* "specfile.pyx":620
+ /* "silx/io/specfile.pyx":617
* def _string_to_char_star(string_):
* """Convert a string to ASCII encoded bytes when using python3"""
* if sys.version.startswith("3") and not isinstance(string_, bytes): # <<<<<<<<<<<<<<
* return bytes(string_, "ascii")
* return string_
*/
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_3); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_3); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 617, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__21);
__Pyx_GIVEREF(__pyx_tuple__21);
- /* "specfile.pyx":638
+ /* "silx/io/specfile.pyx":635
* f = open(filename)
* for i, line in enumerate(f):
* if line.startswith("#S ") or line.startswith("#F "): # <<<<<<<<<<<<<<
* f.close()
* return True
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_S); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_S); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__22);
__Pyx_GIVEREF(__pyx_tuple__22);
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_F); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_F); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 635, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__23);
__Pyx_GIVEREF(__pyx_tuple__23);
- /* "specfile.pyx":691
- * if not self.__open_failed:
+ /* "silx/io/specfile.pyx":687
+ * if self.handle:
* if specfile_wrapper.SfClose(self.handle):
* _logger.warning("Error while closing SpecFile") # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Error_while_closing_SpecFile); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Error_while_closing_SpecFile); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 687, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__24);
__Pyx_GIVEREF(__pyx_tuple__24);
- /* "specfile.pyx":734
+ /* "silx/io/specfile.pyx":730
* else:
* try:
* (number, order) = map(int, key.split(".")) # <<<<<<<<<<<<<<
* scan_index = self.index(number, order)
* except (ValueError, SfErrScanNotFound, KeyError):
*/
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__25); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__25); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 730, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__26);
__Pyx_GIVEREF(__pyx_tuple__26);
- /* "specfile.pyx":1234
+ /* "silx/io/specfile.pyx":1230
* # error code updating isn't implemented in SfMcaCalib
* if mca_calib_error:
* raise KeyError("MCA calibration line (@CALIB) not found") # <<<<<<<<<<<<<<
*
* mca_calib_list = []
*/
- __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_MCA_calibration_line_CALIB_not_f); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_MCA_calibration_line_CALIB_not_f); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1230, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__31 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__32 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__33 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ /* "../../../../../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__34 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 799, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__35 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 803, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
+ /* "../../../../../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__36 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 823, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 989, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__36);
__Pyx_GIVEREF(__pyx_tuple__36);
- /* "specfile.pyx":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 1001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
+
+ /* "silx/io/specfile.pyx":233
*
* """
* def __init__(self, scan): # <<<<<<<<<<<<<<
* self._scan = scan
*
*/
- __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_scan); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__37);
- __Pyx_GIVEREF(__pyx_tuple__37);
- __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_init, 234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_scan); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
+ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_init, 233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 233, __pyx_L1_error)
- /* "specfile.pyx":252
+ /* "silx/io/specfile.pyx":251
* self._parse_channels()
*
* def _parse_channels(self): # <<<<<<<<<<<<<<
* """Fill :attr:`channels`"""
* # Channels list
*/
- __pyx_tuple__39 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_chann_lines, __pyx_n_s_all_chann_values, __pyx_n_s_one_line_chann_values, __pyx_n_s_length, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_increment, __pyx_n_s_chann_line); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__39);
- __Pyx_GIVEREF(__pyx_tuple__39);
- __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_parse_channels, 252, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_chann_lines, __pyx_n_s_all_chann_values, __pyx_n_s_one_line_chann_values, __pyx_n_s_length, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_increment, __pyx_n_s_chann_line); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 251, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_parse_channels, 251, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 251, __pyx_L1_error)
- /* "specfile.pyx":267
+ /* "silx/io/specfile.pyx":266
* self.channels.append(list(range(start, stop + 1, increment)))
*
* def _parse_calibration(self): # <<<<<<<<<<<<<<
* """Fill :attr:`calibration`"""
* # Channels list
*/
- __pyx_tuple__41 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_calib_lines, __pyx_n_s_all_calib_values, __pyx_n_s_one_line_calib_values, __pyx_n_s_calib_line); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
- __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_parse_calibration, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__43 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_calib_lines, __pyx_n_s_all_calib_values, __pyx_n_s_one_line_calib_values, __pyx_n_s_calib_line); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
+ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_parse_calibration, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 266, __pyx_L1_error)
- /* "specfile.pyx":279
+ /* "silx/io/specfile.pyx":278
* self.calibration.append([0., 1., 0.])
*
* def __len__(self): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_tuple__43 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
- __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_len, 279, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
+ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_len, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 278, __pyx_L1_error)
- /* "specfile.pyx":287
+ /* "silx/io/specfile.pyx":286
* return self._scan._specfile.number_of_mca(self._scan.index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* """Return a single MCA data line
*
*/
- __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_mca_index, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
- __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_getitem, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__47 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_mca_index, __pyx_n_s_msg); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
+ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_getitem, 286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 286, __pyx_L1_error)
- /* "specfile.pyx":315
+ /* "silx/io/specfile.pyx":314
* mca_index)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* """Return the next MCA data line each time this method is called.
*
*/
- __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_mca_index); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__47);
- __Pyx_GIVEREF(__pyx_tuple__47);
- __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_iter, 315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_mca_index); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__49);
+ __Pyx_GIVEREF(__pyx_tuple__49);
+ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_iter, 314, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 314, __pyx_L1_error)
- /* "specfile.pyx":325
+ /* "silx/io/specfile.pyx":324
*
*
* def _add_or_concatenate(dictionary, key, value): # <<<<<<<<<<<<<<
* """If key doesn't exist in dictionary, create a new ``key: value`` pair.
* Else append/concatenate the new value to the existing one
*/
- __pyx_tuple__49 = PyTuple_Pack(3, __pyx_n_s_dictionary, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
- __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_add_or_concatenate, 325, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__51 = PyTuple_Pack(3, __pyx_n_s_dictionary, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__51);
+ __Pyx_GIVEREF(__pyx_tuple__51);
+ __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_add_or_concatenate, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 324, __pyx_L1_error)
- /* "specfile.pyx":363
+ /* "silx/io/specfile.pyx":362
* scan2 = sf["3.1"]
* """
* def __init__(self, specfile, scan_index): # <<<<<<<<<<<<<<
* self._specfile = specfile
*
*/
- __pyx_tuple__51 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_specfile_2, __pyx_n_s_scan_index, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_match_mca, __pyx_n_s_hkey, __pyx_n_s_hvalue, __pyx_n_s_L_header); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__51);
- __Pyx_GIVEREF(__pyx_tuple__51);
- __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_init, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__53 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_specfile_2, __pyx_n_s_scan_index, __pyx_n_s_line, __pyx_n_s_match, __pyx_n_s_match_mca, __pyx_n_s_hkey, __pyx_n_s_hvalue, __pyx_n_s_L_header); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__53);
+ __Pyx_GIVEREF(__pyx_tuple__53);
+ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_init, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 362, __pyx_L1_error)
- /* "specfile.pyx":425
+ /* "silx/io/specfile.pyx":423
* @cython.embedsignature(False)
* @property
* def index(self): # <<<<<<<<<<<<<<
* """Unique scan index 0 - len(specfile)-1
*
*/
- __pyx_tuple__53 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
- __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_index, 425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 423, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__55);
+ __Pyx_GIVEREF(__pyx_tuple__55);
+ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_index, 423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 423, __pyx_L1_error)
- /* "specfile.pyx":435
+ /* "silx/io/specfile.pyx":433
* @cython.embedsignature(False)
* @property
* def number(self): # <<<<<<<<<<<<<<
* """First value on #S line (as int)"""
* return self._number
*/
- __pyx_tuple__55 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__55);
- __Pyx_GIVEREF(__pyx_tuple__55);
- __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_number, 435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__57);
+ __Pyx_GIVEREF(__pyx_tuple__57);
+ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_number, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 433, __pyx_L1_error)
- /* "specfile.pyx":441
+ /* "silx/io/specfile.pyx":439
* @cython.embedsignature(False)
* @property
* def order(self): # <<<<<<<<<<<<<<
* """Order can be > 1 if the same number is repeated in a specfile"""
* return self._order
*/
- __pyx_tuple__57 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__57);
- __Pyx_GIVEREF(__pyx_tuple__57);
- __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_order, 441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 439, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__59);
+ __Pyx_GIVEREF(__pyx_tuple__59);
+ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_order, 439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 439, __pyx_L1_error)
- /* "specfile.pyx":447
+ /* "silx/io/specfile.pyx":445
* @cython.embedsignature(False)
* @property
* def header(self): # <<<<<<<<<<<<<<
* """List of raw header lines (as a list of strings).
*
*/
- __pyx_tuple__59 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__59);
- __Pyx_GIVEREF(__pyx_tuple__59);
- __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_header_2, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 445, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__61);
+ __Pyx_GIVEREF(__pyx_tuple__61);
+ __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_header_2, 445, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 445, __pyx_L1_error)
- /* "specfile.pyx":457
+ /* "silx/io/specfile.pyx":455
* @cython.embedsignature(False)
* @property
* def scan_header(self): # <<<<<<<<<<<<<<
* """List of raw scan header lines (as a list of strings).
* """
*/
- __pyx_tuple__61 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__61);
- __Pyx_GIVEREF(__pyx_tuple__61);
- __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_scan_header, 457, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__63);
+ __Pyx_GIVEREF(__pyx_tuple__63);
+ __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_scan_header, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 455, __pyx_L1_error)
- /* "specfile.pyx":464
+ /* "silx/io/specfile.pyx":462
* @cython.embedsignature(False)
* @property
* def file_header(self): # <<<<<<<<<<<<<<
* """List of raw file header lines (as a list of strings).
* """
*/
- __pyx_tuple__63 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__63);
- __Pyx_GIVEREF(__pyx_tuple__63);
- __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_file_header, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 462, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__65);
+ __Pyx_GIVEREF(__pyx_tuple__65);
+ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_file_header, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 462, __pyx_L1_error)
- /* "specfile.pyx":471
+ /* "silx/io/specfile.pyx":469
* @cython.embedsignature(False)
* @property
* def scan_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of scan header strings, keys without the leading``#``
*/
- __pyx_tuple__65 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__65);
- __Pyx_GIVEREF(__pyx_tuple__65);
- __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_scan_header_dict_2, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__67);
+ __Pyx_GIVEREF(__pyx_tuple__67);
+ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_scan_header_dict_2, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 469, __pyx_L1_error)
- /* "specfile.pyx":481
+ /* "silx/io/specfile.pyx":479
* @cython.embedsignature(False)
* @property
* def mca_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of MCA header strings, keys without the leading ``#@``
*/
- __pyx_tuple__67 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__67);
- __Pyx_GIVEREF(__pyx_tuple__67);
- __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_mca_header_dict, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 479, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__69);
+ __Pyx_GIVEREF(__pyx_tuple__69);
+ __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_mca_header_dict, 479, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 479, __pyx_L1_error)
- /* "specfile.pyx":490
+ /* "silx/io/specfile.pyx":488
* @cython.embedsignature(False)
* @property
* def file_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of file header strings, keys without the leading ``#``
*/
- __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__69);
- __Pyx_GIVEREF(__pyx_tuple__69);
- __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_file_header_dict_2, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__71);
+ __Pyx_GIVEREF(__pyx_tuple__71);
+ __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_file_header_dict_2, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 488, __pyx_L1_error)
- /* "specfile.pyx":499
+ /* "silx/io/specfile.pyx":497
* @cython.embedsignature(False)
* @property
* def labels(self): # <<<<<<<<<<<<<<
* """
* List of data column headers from ``#L`` scan header
*/
- __pyx_tuple__71 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__71);
- __Pyx_GIVEREF(__pyx_tuple__71);
- __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_labels_2, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 497, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__73);
+ __Pyx_GIVEREF(__pyx_tuple__73);
+ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_labels_2, 497, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 497, __pyx_L1_error)
- /* "specfile.pyx":507
+ /* "silx/io/specfile.pyx":505
* @cython.embedsignature(False)
* @property
* def data(self): # <<<<<<<<<<<<<<
* """Scan data as a 2D numpy.ndarray with the usual attributes
* (e.g. data.shape).
*/
- __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__73);
- __Pyx_GIVEREF(__pyx_tuple__73);
- __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_data_2, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__75);
+ __Pyx_GIVEREF(__pyx_tuple__75);
+ __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_data_2, 505, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 505, __pyx_L1_error)
- /* "specfile.pyx":520
+ /* "silx/io/specfile.pyx":518
* @cython.embedsignature(False)
* @property
* def mca(self): # <<<<<<<<<<<<<<
* """MCA data in this scan.
*
*/
- __pyx_tuple__75 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__75);
- __Pyx_GIVEREF(__pyx_tuple__75);
- __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_mca_2, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__77);
+ __Pyx_GIVEREF(__pyx_tuple__77);
+ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_mca_2, 518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 518, __pyx_L1_error)
- /* "specfile.pyx":534
+ /* "silx/io/specfile.pyx":532
* @cython.embedsignature(False)
* @property
* def motor_names(self): # <<<<<<<<<<<<<<
* """List of motor names from the ``#O`` file header line.
* """
*/
- __pyx_tuple__77 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__77);
- __Pyx_GIVEREF(__pyx_tuple__77);
- __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_motor_names, 534, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__79);
+ __Pyx_GIVEREF(__pyx_tuple__79);
+ __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_motor_names, 532, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 532, __pyx_L1_error)
- /* "specfile.pyx":541
+ /* "silx/io/specfile.pyx":539
* @cython.embedsignature(False)
* @property
* def motor_positions(self): # <<<<<<<<<<<<<<
* """List of motor positions as floats from the ``#P`` scan header line.
* """
*/
- __pyx_tuple__79 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__79);
- __Pyx_GIVEREF(__pyx_tuple__79);
- __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_motor_positions, 541, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__81 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 539, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__81);
+ __Pyx_GIVEREF(__pyx_tuple__81);
+ __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_motor_positions, 539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 539, __pyx_L1_error)
- /* "specfile.pyx":546
+ /* "silx/io/specfile.pyx":544
* return self._motor_positions
*
* def record_exists_in_hdr(self, record): # <<<<<<<<<<<<<<
* """Check whether a scan header line exists.
*
*/
- __pyx_tuple__81 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_record, __pyx_n_s_line); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__81);
- __Pyx_GIVEREF(__pyx_tuple__81);
- __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_record_exists_in_hdr, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__83 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_record, __pyx_n_s_line); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 544, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__83);
+ __Pyx_GIVEREF(__pyx_tuple__83);
+ __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_record_exists_in_hdr, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 544, __pyx_L1_error)
- /* "specfile.pyx":565
+ /* "silx/io/specfile.pyx":563
* return False
*
* def data_line(self, line_index): # <<<<<<<<<<<<<<
* """Returns data for a given line of this scan.
*
*/
- __pyx_tuple__83 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_line_index); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__83);
- __Pyx_GIVEREF(__pyx_tuple__83);
- __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_data_line, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__85 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_line_index); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__85);
+ __Pyx_GIVEREF(__pyx_tuple__85);
+ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_data_line, 563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 563, __pyx_L1_error)
- /* "specfile.pyx":585
+ /* "silx/io/specfile.pyx":583
* return self.data[:, line_index]
*
* def data_column_by_name(self, label): # <<<<<<<<<<<<<<
* """Returns a data column
*
*/
- __pyx_tuple__85 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_label, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__85);
- __Pyx_GIVEREF(__pyx_tuple__85);
- __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_data_column_by_name, 585, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__87 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_label, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 583, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__87);
+ __Pyx_GIVEREF(__pyx_tuple__87);
+ __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_data_column_by_name, 583, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 583, __pyx_L1_error)
- /* "specfile.pyx":605
- *
+ /* "silx/io/specfile.pyx":602
+ * return ret
*
* def motor_position_by_name(self, name): # <<<<<<<<<<<<<<
* """Returns the position for a given motor
*
*/
- __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__87);
- __Pyx_GIVEREF(__pyx_tuple__87);
- __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_motor_position_by_name, 605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 602, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__89);
+ __Pyx_GIVEREF(__pyx_tuple__89);
+ __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_motor_position_by_name, 602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 602, __pyx_L1_error)
- /* "specfile.pyx":618
+ /* "silx/io/specfile.pyx":615
*
*
* def _string_to_char_star(string_): # <<<<<<<<<<<<<<
* """Convert a string to ASCII encoded bytes when using python3"""
* if sys.version.startswith("3") and not isinstance(string_, bytes):
*/
- __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_string); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__89);
- __Pyx_GIVEREF(__pyx_tuple__89);
- __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_string_to_char_star, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_string); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__91);
+ __Pyx_GIVEREF(__pyx_tuple__91);
+ __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_string_to_char_star, 615, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 615, __pyx_L1_error)
- /* "specfile.pyx":625
+ /* "silx/io/specfile.pyx":622
*
*
* def is_specfile(filename): # <<<<<<<<<<<<<<
* """Test if a file is a SPEC file, by checking if one of the first two
* lines starts with *#F* (SPEC file header) or *#S* (scan header).
*/
- __pyx_tuple__91 = PyTuple_Pack(4, __pyx_n_s_filename, __pyx_n_s_f, __pyx_n_s_i, __pyx_n_s_line); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__91);
- __Pyx_GIVEREF(__pyx_tuple__91);
- __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_is_specfile, 625, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__93 = PyTuple_Pack(4, __pyx_n_s_filename, __pyx_n_s_f, __pyx_n_s_i, __pyx_n_s_line); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 622, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__93);
+ __Pyx_GIVEREF(__pyx_tuple__93);
+ __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_is_specfile, 622, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -16930,26 +19125,26 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) {__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_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_9 = PyInt_FromLong(9); if (unlikely(!__pyx_int_9)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_13 = PyInt_FromLong(13); if (unlikely(!__pyx_int_13)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_14 = PyInt_FromLong(14); if (unlikely(!__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16969,9 +19164,7 @@ PyMODINIT_FUNC PyInit_specfile(void)
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_7;
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -16983,17 +19176,24 @@ PyMODINIT_FUNC PyInit_specfile(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_specfile(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -17008,88 +19208,88 @@ PyMODINIT_FUNC PyInit_specfile(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_specfile) {
- 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 (__pyx_module_is_main_silx__io__specfile) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "specfile")) {
- if (unlikely(PyDict_SetItemString(modules, "specfile", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.io.specfile")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.io.specfile", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_8specfile_SpecFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_8specfile_SpecFile.tp_print = 0;
+ if (PyType_Ready(&__pyx_type_4silx_2io_8specfile_SpecFile) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
+ __pyx_type_4silx_2io_8specfile_SpecFile.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8specfile_SpecFile, "__len__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_2io_8specfile_SpecFile, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(0, 644, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_8specfile_8SpecFile_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_8specfile_8SpecFile_6__len__.doc = __pyx_doc_8specfile_8SpecFile_6__len__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8specfile_8SpecFile_6__len__;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_6__len__.doc = __pyx_doc_4silx_2io_8specfile_8SpecFile_6__len__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_6__len__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8specfile_SpecFile, "__iter__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_2io_8specfile_SpecFile, "__iter__"); if (unlikely(!wrapper)) __PYX_ERR(0, 644, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_8specfile_8SpecFile_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_8specfile_8SpecFile_8__iter__.doc = __pyx_doc_8specfile_8SpecFile_8__iter__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8specfile_8SpecFile_8__iter__;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_8__iter__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_8__iter__.doc = __pyx_doc_4silx_2io_8specfile_8SpecFile_8__iter__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_8__iter__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8specfile_SpecFile, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_2io_8specfile_SpecFile, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 644, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_8specfile_8SpecFile_11__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_8specfile_8SpecFile_11__getitem__.doc = __pyx_doc_8specfile_8SpecFile_11__getitem__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8specfile_8SpecFile_11__getitem__;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_11__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_11__getitem__.doc = __pyx_doc_4silx_2io_8specfile_8SpecFile_11__getitem__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_11__getitem__;
}
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8specfile_SpecFile, "__contains__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_2io_8specfile_SpecFile, "__contains__"); if (unlikely(!wrapper)) __PYX_ERR(0, 644, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_8specfile_8SpecFile_15__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_8specfile_8SpecFile_15__contains__.doc = __pyx_doc_8specfile_8SpecFile_15__contains__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8specfile_8SpecFile_15__contains__;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_15__contains__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_15__contains__.doc = __pyx_doc_4silx_2io_8specfile_8SpecFile_15__contains__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4silx_2io_8specfile_8SpecFile_15__contains__;
}
}
#endif
- if (PyObject_SetAttrString(__pyx_m, "SpecFile", (PyObject *)&__pyx_type_8specfile_SpecFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_8specfile_SpecFile = &__pyx_type_8specfile_SpecFile;
- if (PyType_Ready(&__pyx_type_8specfile___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_8specfile___pyx_scope_struct____iter__.tp_print = 0;
- __pyx_ptype_8specfile___pyx_scope_struct____iter__ = &__pyx_type_8specfile___pyx_scope_struct____iter__;
- if (PyType_Ready(&__pyx_type_8specfile___pyx_scope_struct_1___iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_8specfile___pyx_scope_struct_1___iter__.tp_print = 0;
- __pyx_ptype_8specfile___pyx_scope_struct_1___iter__ = &__pyx_type_8specfile___pyx_scope_struct_1___iter__;
+ if (PyObject_SetAttrString(__pyx_m, "SpecFile", (PyObject *)&__pyx_type_4silx_2io_8specfile_SpecFile) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
+ __pyx_ptype_4silx_2io_8specfile_SpecFile = &__pyx_type_4silx_2io_8specfile_SpecFile;
+ if (PyType_Ready(&__pyx_type_4silx_2io_8specfile___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
+ __pyx_type_4silx_2io_8specfile___pyx_scope_struct____iter__.tp_print = 0;
+ __pyx_ptype_4silx_2io_8specfile___pyx_scope_struct____iter__ = &__pyx_type_4silx_2io_8specfile___pyx_scope_struct____iter__;
+ if (PyType_Ready(&__pyx_type_4silx_2io_8specfile___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
+ __pyx_type_4silx_2io_8specfile___pyx_scope_struct_1___iter__.tp_print = 0;
+ __pyx_ptype_4silx_2io_8specfile___pyx_scope_struct_1___iter__ = &__pyx_type_4silx_2io_8specfile___pyx_scope_struct_1___iter__;
/*--- Type import code ---*/
__pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
#if CYTHON_COMPILING_IN_PYPY
@@ -17097,185 +19297,176 @@ PyMODINIT_FUNC PyInit_specfile(void)
#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;}
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "specfile.pyx":106
+ /* "silx/io/specfile.pyx":106
* """
*
* __authors__ = ["P. Knobel"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "27/09/2016"
+ * __date__ = "11/08/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_P_Knobel);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
__Pyx_GIVEREF(__pyx_kp_s_P_Knobel);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":107
+ /* "silx/io/specfile.pyx":107
*
* __authors__ = ["P. Knobel"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "27/09/2016"
+ * __date__ = "11/08/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
- /* "specfile.pyx":108
+ /* "silx/io/specfile.pyx":108
* __authors__ = ["P. Knobel"]
* __license__ = "MIT"
- * __date__ = "27/09/2016" # <<<<<<<<<<<<<<
+ * __date__ = "11/08/2017" # <<<<<<<<<<<<<<
*
* import os.path
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_27_09_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_11_08_2017) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
- /* "specfile.pyx":110
- * __date__ = "27/09/2016"
+ /* "silx/io/specfile.pyx":110
+ * __date__ = "11/08/2017"
*
* import os.path # <<<<<<<<<<<<<<
* import logging
* import numpy
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_os_path, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":111
+ /* "silx/io/specfile.pyx":111
*
* import os.path
* import logging # <<<<<<<<<<<<<<
* import numpy
* import re
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":112
+ /* "silx/io/specfile.pyx":112
* import os.path
* import logging
* import numpy # <<<<<<<<<<<<<<
* import re
* import sys
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 112, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":113
+ /* "silx/io/specfile.pyx":113
* import logging
* import numpy
* import re # <<<<<<<<<<<<<<
* import sys
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":114
+ /* "silx/io/specfile.pyx":114
* import numpy
* import re
* import sys # <<<<<<<<<<<<<<
*
- * logging.basicConfig()
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); 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 (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "specfile.pyx":116
- * import sys
- *
- * logging.basicConfig() # <<<<<<<<<<<<<<
* _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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_basicConfig); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 = 116; __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":117
+ /* "silx/io/specfile.pyx":116
+ * import sys
*
- * logging.basicConfig()
* _logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
*
* cimport numpy
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __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_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __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 = 117; __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_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":132
+ /* "silx/io/specfile.pyx":131
* void import_umath()
*
* if FALSE: # <<<<<<<<<<<<<<
@@ -17285,7 +19476,7 @@ PyMODINIT_FUNC PyInit_specfile(void)
__pyx_t_6 = (0 != 0);
if (__pyx_t_6) {
- /* "specfile.pyx":133
+ /* "silx/io/specfile.pyx":132
*
* if FALSE:
* import_array() # <<<<<<<<<<<<<<
@@ -17294,7 +19485,7 @@ PyMODINIT_FUNC PyInit_specfile(void)
*/
import_array();
- /* "specfile.pyx":134
+ /* "silx/io/specfile.pyx":133
* if FALSE:
* import_array()
* import_umath() # <<<<<<<<<<<<<<
@@ -17302,1318 +19493,1361 @@ PyMODINIT_FUNC PyInit_specfile(void)
* numpy.import_array()
*/
import_umath();
- goto __pyx_L2;
+
+ /* "silx/io/specfile.pyx":131
+ * void import_umath()
+ *
+ * if FALSE: # <<<<<<<<<<<<<<
+ * import_array()
+ * import_umath()
+ */
}
- __pyx_L2:;
- /* "specfile.pyx":136
+ /* "silx/io/specfile.pyx":135
* import_umath()
*
* numpy.import_array() # <<<<<<<<<<<<<<
*
*
*/
- import_array();
+ __pyx_t_7 = __pyx_f_5numpy_import_array(); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 135, __pyx_L1_error)
- /* "specfile.pyx":139
+ /* "silx/io/specfile.pyx":138
*
*
* SF_ERR_NO_ERRORS = 0 # <<<<<<<<<<<<<<
* SF_ERR_FILE_OPEN = 2
* SF_ERR_SCAN_NOT_FOUND = 7
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_NO_ERRORS, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_NO_ERRORS, __pyx_int_0) < 0) __PYX_ERR(0, 138, __pyx_L1_error)
- /* "specfile.pyx":140
+ /* "silx/io/specfile.pyx":139
*
* SF_ERR_NO_ERRORS = 0
* SF_ERR_FILE_OPEN = 2 # <<<<<<<<<<<<<<
* SF_ERR_SCAN_NOT_FOUND = 7
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_FILE_OPEN, __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_FILE_OPEN, __pyx_int_2) < 0) __PYX_ERR(0, 139, __pyx_L1_error)
- /* "specfile.pyx":141
+ /* "silx/io/specfile.pyx":140
* SF_ERR_NO_ERRORS = 0
* SF_ERR_FILE_OPEN = 2
* SF_ERR_SCAN_NOT_FOUND = 7 # <<<<<<<<<<<<<<
*
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_SCAN_NOT_FOUND, __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SF_ERR_SCAN_NOT_FOUND, __pyx_int_7) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
- /* "specfile.pyx":145
+ /* "silx/io/specfile.pyx":144
*
* # custom errors
* class SfError(Exception): # <<<<<<<<<<<<<<
* """Base exception inherited by all exceptions raised when a
* C function from the legacy SpecFile library returns an error
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_builtin_Exception);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
- __Pyx_GIVEREF(__pyx_builtin_Exception);
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfError, __pyx_n_s_SfError, (PyObject *) NULL, __pyx_n_s_specfile_2, __pyx_kp_s_Base_exception_inherited_by_all); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfError, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfError, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfError, __pyx_n_s_SfError, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, __pyx_kp_s_Base_exception_inherited_by_all); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfError, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfError, __pyx_t_2) < 0) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":152
+ /* "silx/io/specfile.pyx":151
* pass
*
- * class SfErrMemoryAlloc(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrFileOpen(SfError): pass
- * class SfErrFileClose(SfError): pass
+ * class SfErrMemoryAlloc(SfError, MemoryError): pass # <<<<<<<<<<<<<<
+ * class SfErrFileOpen(SfError, IOError): pass
+ * class SfErrFileClose(SfError, IOError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_MemoryError);
+ __Pyx_GIVEREF(__pyx_builtin_MemoryError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_MemoryError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrMemoryAlloc, __pyx_n_s_SfErrMemoryAlloc, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrMemoryAlloc, __pyx_n_s_SfErrMemoryAlloc, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrMemoryAlloc, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMemoryAlloc, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrMemoryAlloc, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMemoryAlloc, __pyx_t_2) < 0) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":153
+ /* "silx/io/specfile.pyx":152
*
- * class SfErrMemoryAlloc(SfError): pass
- * class SfErrFileOpen(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrFileClose(SfError): pass
- * class SfErrFileRead(SfError): pass
+ * class SfErrMemoryAlloc(SfError, MemoryError): pass
+ * class SfErrFileOpen(SfError, IOError): pass # <<<<<<<<<<<<<<
+ * class SfErrFileClose(SfError, IOError): pass
+ * class SfErrFileRead(SfError, IOError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrFileOpen, __pyx_n_s_SfErrFileOpen, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrFileOpen, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __Pyx_GIVEREF(__pyx_builtin_IOError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IOError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileOpen, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrFileOpen, __pyx_n_s_SfErrFileOpen, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrFileOpen, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileOpen, __pyx_t_2) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":154
- * class SfErrMemoryAlloc(SfError): pass
- * class SfErrFileOpen(SfError): pass
- * class SfErrFileClose(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrFileRead(SfError): pass
- * class SfErrFileWrite(SfError): pass
+ /* "silx/io/specfile.pyx":153
+ * class SfErrMemoryAlloc(SfError, MemoryError): pass
+ * class SfErrFileOpen(SfError, IOError): pass
+ * class SfErrFileClose(SfError, IOError): pass # <<<<<<<<<<<<<<
+ * class SfErrFileRead(SfError, IOError): pass
+ * class SfErrFileWrite(SfError, IOError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __Pyx_GIVEREF(__pyx_builtin_IOError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_IOError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrFileClose, __pyx_n_s_SfErrFileClose, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrFileClose, __pyx_n_s_SfErrFileClose, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrFileClose, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileClose, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrFileClose, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileClose, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":155
- * class SfErrFileOpen(SfError): pass
- * class SfErrFileClose(SfError): pass
- * class SfErrFileRead(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrFileWrite(SfError): pass
- * class SfErrLineNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":154
+ * class SfErrFileOpen(SfError, IOError): pass
+ * class SfErrFileClose(SfError, IOError): pass
+ * class SfErrFileRead(SfError, IOError): pass # <<<<<<<<<<<<<<
+ * class SfErrFileWrite(SfError, IOError): pass
+ * class SfErrLineNotFound(SfError, KeyError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrFileRead, __pyx_n_s_SfErrFileRead, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrFileRead, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __Pyx_GIVEREF(__pyx_builtin_IOError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IOError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileRead, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrFileRead, __pyx_n_s_SfErrFileRead, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrFileRead, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileRead, __pyx_t_2) < 0) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":156
- * class SfErrFileClose(SfError): pass
- * class SfErrFileRead(SfError): pass
- * class SfErrFileWrite(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrLineNotFound(SfError): pass
- * class SfErrScanNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":155
+ * class SfErrFileClose(SfError, IOError): pass
+ * class SfErrFileRead(SfError, IOError): pass
+ * class SfErrFileWrite(SfError, IOError): pass # <<<<<<<<<<<<<<
+ * class SfErrLineNotFound(SfError, KeyError): pass
+ * class SfErrScanNotFound(SfError, IndexError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __Pyx_GIVEREF(__pyx_builtin_IOError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_IOError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrFileWrite, __pyx_n_s_SfErrFileWrite, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrFileWrite, __pyx_n_s_SfErrFileWrite, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrFileWrite, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileWrite, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrFileWrite, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrFileWrite, __pyx_t_2) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":157
- * class SfErrFileRead(SfError): pass
- * class SfErrFileWrite(SfError): pass
- * class SfErrLineNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrScanNotFound(SfError): pass
- * class SfErrHeaderNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":156
+ * class SfErrFileRead(SfError, IOError): pass
+ * class SfErrFileWrite(SfError, IOError): pass
+ * class SfErrLineNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrScanNotFound(SfError, IndexError): pass
+ * class SfErrHeaderNotFound(SfError, KeyError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrLineNotFound, __pyx_n_s_SfErrLineNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrLineNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_KeyError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLineNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrLineNotFound, __pyx_n_s_SfErrLineNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrLineNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLineNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":158
- * class SfErrFileWrite(SfError): pass
- * class SfErrLineNotFound(SfError): pass
- * class SfErrScanNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrHeaderNotFound(SfError): pass
- * class SfErrLabelNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":157
+ * class SfErrFileWrite(SfError, IOError): pass
+ * class SfErrLineNotFound(SfError, KeyError): pass
+ * class SfErrScanNotFound(SfError, IndexError): pass # <<<<<<<<<<<<<<
+ * class SfErrHeaderNotFound(SfError, KeyError): pass
+ * class SfErrLabelNotFound(SfError, KeyError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_IndexError);
+ __Pyx_GIVEREF(__pyx_builtin_IndexError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_IndexError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrScanNotFound, __pyx_n_s_SfErrScanNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrScanNotFound, __pyx_n_s_SfErrScanNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrScanNotFound, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrScanNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrScanNotFound, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrScanNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":159
- * class SfErrLineNotFound(SfError): pass
- * class SfErrScanNotFound(SfError): pass
- * class SfErrHeaderNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrLabelNotFound(SfError): pass
- * class SfErrMotorNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":158
+ * class SfErrLineNotFound(SfError, KeyError): pass
+ * class SfErrScanNotFound(SfError, IndexError): pass
+ * class SfErrHeaderNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrLabelNotFound(SfError, KeyError): pass
+ * class SfErrMotorNotFound(SfError, KeyError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrHeaderNotFound, __pyx_n_s_SfErrHeaderNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); 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_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrHeaderNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_KeyError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrHeaderNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrHeaderNotFound, __pyx_n_s_SfErrHeaderNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrHeaderNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrHeaderNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":160
- * class SfErrScanNotFound(SfError): pass
- * class SfErrHeaderNotFound(SfError): pass
- * class SfErrLabelNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrMotorNotFound(SfError): pass
- * class SfErrPositionNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":159
+ * class SfErrScanNotFound(SfError, IndexError): pass
+ * class SfErrHeaderNotFound(SfError, KeyError): pass
+ * class SfErrLabelNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrMotorNotFound(SfError, KeyError): pass
+ * class SfErrPositionNotFound(SfError, KeyError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_KeyError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrLabelNotFound, __pyx_n_s_SfErrLabelNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrLabelNotFound, __pyx_n_s_SfErrLabelNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrLabelNotFound, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLabelNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrLabelNotFound, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLabelNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":161
- * class SfErrHeaderNotFound(SfError): pass
- * class SfErrLabelNotFound(SfError): pass
- * class SfErrMotorNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrPositionNotFound(SfError): pass
- * class SfErrLineEmpty(SfError): pass
+ /* "silx/io/specfile.pyx":160
+ * class SfErrHeaderNotFound(SfError, KeyError): pass
+ * class SfErrLabelNotFound(SfError, KeyError): pass
+ * class SfErrMotorNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrPositionNotFound(SfError, KeyError): pass
+ * class SfErrLineEmpty(SfError, IOError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrMotorNotFound, __pyx_n_s_SfErrMotorNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrMotorNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_KeyError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMotorNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrMotorNotFound, __pyx_n_s_SfErrMotorNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrMotorNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMotorNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":162
- * class SfErrLabelNotFound(SfError): pass
- * class SfErrMotorNotFound(SfError): pass
- * class SfErrPositionNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrLineEmpty(SfError): pass
- * class SfErrUserNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":161
+ * class SfErrLabelNotFound(SfError, KeyError): pass
+ * class SfErrMotorNotFound(SfError, KeyError): pass
+ * class SfErrPositionNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrLineEmpty(SfError, IOError): pass
+ * class SfErrUserNotFound(SfError, KeyError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_KeyError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrPositionNotFound, __pyx_n_s_SfErrPositionNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrPositionNotFound, __pyx_n_s_SfErrPositionNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrPositionNotFound, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrPositionNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrPositionNotFound, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrPositionNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":163
- * class SfErrMotorNotFound(SfError): pass
- * class SfErrPositionNotFound(SfError): pass
- * class SfErrLineEmpty(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrUserNotFound(SfError): pass
- * class SfErrColNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":162
+ * class SfErrMotorNotFound(SfError, KeyError): pass
+ * class SfErrPositionNotFound(SfError, KeyError): pass
+ * class SfErrLineEmpty(SfError, IOError): pass # <<<<<<<<<<<<<<
+ * class SfErrUserNotFound(SfError, KeyError): pass
+ * class SfErrColNotFound(SfError, KeyError): pass
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrLineEmpty, __pyx_n_s_SfErrLineEmpty, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrLineEmpty, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_IOError);
+ __Pyx_GIVEREF(__pyx_builtin_IOError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_IOError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLineEmpty, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrLineEmpty, __pyx_n_s_SfErrLineEmpty, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrLineEmpty, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrLineEmpty, __pyx_t_2) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":164
- * class SfErrPositionNotFound(SfError): pass
- * class SfErrLineEmpty(SfError): pass
- * class SfErrUserNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrColNotFound(SfError): pass
- * class SfErrMcaNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":163
+ * class SfErrPositionNotFound(SfError, KeyError): pass
+ * class SfErrLineEmpty(SfError, IOError): pass
+ * class SfErrUserNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrColNotFound(SfError, KeyError): pass
+ * class SfErrMcaNotFound(SfError, IndexError): pass
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_KeyError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrUserNotFound, __pyx_n_s_SfErrUserNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrUserNotFound, __pyx_n_s_SfErrUserNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrUserNotFound, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrUserNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrUserNotFound, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrUserNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 163, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":165
- * class SfErrLineEmpty(SfError): pass
- * class SfErrUserNotFound(SfError): pass
- * class SfErrColNotFound(SfError): pass # <<<<<<<<<<<<<<
- * class SfErrMcaNotFound(SfError): pass
+ /* "silx/io/specfile.pyx":164
+ * class SfErrLineEmpty(SfError, IOError): pass
+ * class SfErrUserNotFound(SfError, KeyError): pass
+ * class SfErrColNotFound(SfError, KeyError): pass # <<<<<<<<<<<<<<
+ * class SfErrMcaNotFound(SfError, IndexError): pass
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfErrColNotFound, __pyx_n_s_SfErrColNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfErrColNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_builtin_KeyError);
+ __Pyx_GIVEREF(__pyx_builtin_KeyError);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_builtin_KeyError);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrColNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfErrColNotFound, __pyx_n_s_SfErrColNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfErrColNotFound, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrColNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":166
- * class SfErrUserNotFound(SfError): pass
- * class SfErrColNotFound(SfError): pass
- * class SfErrMcaNotFound(SfError): pass # <<<<<<<<<<<<<<
+ /* "silx/io/specfile.pyx":165
+ * class SfErrUserNotFound(SfError, KeyError): pass
+ * class SfErrColNotFound(SfError, KeyError): pass
+ * class SfErrMcaNotFound(SfError, IndexError): pass # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_builtin_IndexError);
+ __Pyx_GIVEREF(__pyx_builtin_IndexError);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_builtin_IndexError);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SfErrMcaNotFound, __pyx_n_s_SfErrMcaNotFound, (PyObject *) NULL, __pyx_n_s_specfile_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_3, __pyx_n_s_SfErrMcaNotFound, __pyx_n_s_SfErrMcaNotFound, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrMcaNotFound, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMcaNotFound, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SfErrMcaNotFound, __pyx_t_3, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfErrMcaNotFound, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "specfile.pyx":169
- *
- *
- * ERRORS = { # <<<<<<<<<<<<<<
- * 1: SfErrMemoryAlloc,
- * 2: SfErrFileOpen,
- */
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":170
+ /* "silx/io/specfile.pyx":169
*
* ERRORS = {
* 1: SfErrMemoryAlloc, # <<<<<<<<<<<<<<
* 2: SfErrFileOpen,
* 3: SfErrFileClose,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMemoryAlloc); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMemoryAlloc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_1, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_1, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":171
+ /* "silx/io/specfile.pyx":170
* ERRORS = {
* 1: SfErrMemoryAlloc,
* 2: SfErrFileOpen, # <<<<<<<<<<<<<<
* 3: SfErrFileClose,
* 4: SfErrFileRead,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileOpen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_2, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":172
+ /* "silx/io/specfile.pyx":171
* 1: SfErrMemoryAlloc,
* 2: SfErrFileOpen,
* 3: SfErrFileClose, # <<<<<<<<<<<<<<
* 4: SfErrFileRead,
* 5: SfErrFileWrite,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileClose); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileClose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_3, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":173
+ /* "silx/io/specfile.pyx":172
* 2: SfErrFileOpen,
* 3: SfErrFileClose,
* 4: SfErrFileRead, # <<<<<<<<<<<<<<
* 5: SfErrFileWrite,
* 6: SfErrLineNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileRead); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileRead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_4, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":174
+ /* "silx/io/specfile.pyx":173
* 3: SfErrFileClose,
* 4: SfErrFileRead,
* 5: SfErrFileWrite, # <<<<<<<<<<<<<<
* 6: SfErrLineNotFound,
* 7: SfErrScanNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileWrite); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrFileWrite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_5, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_5, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":175
+ /* "silx/io/specfile.pyx":174
* 4: SfErrFileRead,
* 5: SfErrFileWrite,
* 6: SfErrLineNotFound, # <<<<<<<<<<<<<<
* 7: SfErrScanNotFound,
* 8: SfErrHeaderNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_6, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_6, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":176
+ /* "silx/io/specfile.pyx":175
* 5: SfErrFileWrite,
* 6: SfErrLineNotFound,
* 7: SfErrScanNotFound, # <<<<<<<<<<<<<<
* 8: SfErrHeaderNotFound,
* 9: SfErrLabelNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrScanNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrScanNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_7, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_7, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":177
+ /* "silx/io/specfile.pyx":176
* 6: SfErrLineNotFound,
* 7: SfErrScanNotFound,
* 8: SfErrHeaderNotFound, # <<<<<<<<<<<<<<
* 9: SfErrLabelNotFound,
* 10: SfErrMotorNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrHeaderNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrHeaderNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_8, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_8, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":178
+ /* "silx/io/specfile.pyx":177
* 7: SfErrScanNotFound,
* 8: SfErrHeaderNotFound,
* 9: SfErrLabelNotFound, # <<<<<<<<<<<<<<
* 10: SfErrMotorNotFound,
* 11: SfErrPositionNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLabelNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLabelNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_9, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_9, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":179
+ /* "silx/io/specfile.pyx":178
* 8: SfErrHeaderNotFound,
* 9: SfErrLabelNotFound,
* 10: SfErrMotorNotFound, # <<<<<<<<<<<<<<
* 11: SfErrPositionNotFound,
* 12: SfErrLineEmpty,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMotorNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMotorNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_10, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_10, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":180
+ /* "silx/io/specfile.pyx":179
* 9: SfErrLabelNotFound,
* 10: SfErrMotorNotFound,
* 11: SfErrPositionNotFound, # <<<<<<<<<<<<<<
* 12: SfErrLineEmpty,
* 13: SfErrUserNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrPositionNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrPositionNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_11, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_11, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":181
+ /* "silx/io/specfile.pyx":180
* 10: SfErrMotorNotFound,
* 11: SfErrPositionNotFound,
* 12: SfErrLineEmpty, # <<<<<<<<<<<<<<
* 13: SfErrUserNotFound,
* 14: SfErrColNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineEmpty); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrLineEmpty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_12, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_12, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":182
+ /* "silx/io/specfile.pyx":181
* 11: SfErrPositionNotFound,
* 12: SfErrLineEmpty,
* 13: SfErrUserNotFound, # <<<<<<<<<<<<<<
* 14: SfErrColNotFound,
* 15: SfErrMcaNotFound,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrUserNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrUserNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_13, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_13, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":183
+ /* "silx/io/specfile.pyx":182
* 12: SfErrLineEmpty,
* 13: SfErrUserNotFound,
* 14: SfErrColNotFound, # <<<<<<<<<<<<<<
* 15: SfErrMcaNotFound,
* }
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrColNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrColNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_14, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_14, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":184
+ /* "silx/io/specfile.pyx":183
* 13: SfErrUserNotFound,
* 14: SfErrColNotFound,
* 15: SfErrMcaNotFound, # <<<<<<<<<<<<<<
* }
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMcaNotFound); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfErrMcaNotFound); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_2, __pyx_int_15, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_int_15, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERRORS, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERRORS, __pyx_t_3) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "specfile.pyx":188
+ /* "silx/io/specfile.pyx":187
*
*
* class SfNoMcaError(SfError): # <<<<<<<<<<<<<<
* """Custom exception raised when ``SfNoMca()`` returns ``-1``
* """
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SfError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SfNoMcaError, __pyx_n_s_SfNoMcaError, (PyObject *) NULL, __pyx_n_s_specfile_2, __pyx_kp_s_Custom_exception_raised_when_SfN); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SfNoMcaError, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfNoMcaError, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_SfNoMcaError, __pyx_n_s_SfNoMcaError, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, __pyx_kp_s_Custom_exception_raised_when_SfN); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_SfNoMcaError, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_SfNoMcaError, __pyx_t_2) < 0) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":194
+ /* "silx/io/specfile.pyx":193
*
*
* class MCA(object): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
__Pyx_GIVEREF(__pyx_builtin_object);
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MCA, __pyx_n_s_MCA, (PyObject *) NULL, __pyx_n_s_specfile_2, __pyx_kp_s_param_scan_Parent_Scan_instance); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_MCA, __pyx_n_s_MCA, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, __pyx_kp_s_param_scan_Parent_Scan_instance); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "specfile.pyx":234
+ /* "silx/io/specfile.pyx":233
*
* """
* def __init__(self, scan): # <<<<<<<<<<<<<<
* self._scan = scan
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_1__init__, 0, __pyx_n_s_MCA___init, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_1__init__, 0, __pyx_n_s_MCA___init, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":252
+ /* "silx/io/specfile.pyx":251
* self._parse_channels()
*
* def _parse_channels(self): # <<<<<<<<<<<<<<
* """Fill :attr:`channels`"""
* # Channels list
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_3_parse_channels, 0, __pyx_n_s_MCA__parse_channels, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_parse_channels, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_3_parse_channels, 0, __pyx_n_s_MCA__parse_channels, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_parse_channels, __pyx_t_2) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":267
+ /* "silx/io/specfile.pyx":266
* self.channels.append(list(range(start, stop + 1, increment)))
*
* def _parse_calibration(self): # <<<<<<<<<<<<<<
* """Fill :attr:`calibration`"""
* # Channels list
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_5_parse_calibration, 0, __pyx_n_s_MCA__parse_calibration, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_parse_calibration, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_5_parse_calibration, 0, __pyx_n_s_MCA__parse_calibration, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_parse_calibration, __pyx_t_2) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":279
+ /* "silx/io/specfile.pyx":278
* self.calibration.append([0., 1., 0.])
*
* def __len__(self): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_7__len__, 0, __pyx_n_s_MCA___len, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_len, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_7__len__, 0, __pyx_n_s_MCA___len, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_len, __pyx_t_2) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":287
+ /* "silx/io/specfile.pyx":286
* return self._scan._specfile.number_of_mca(self._scan.index)
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* """Return a single MCA data line
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_9__getitem__, 0, __pyx_n_s_MCA___getitem, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_getitem, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_9__getitem__, 0, __pyx_n_s_MCA___getitem, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_getitem, __pyx_t_2) < 0) __PYX_ERR(0, 286, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":315
+ /* "silx/io/specfile.pyx":314
* mca_index)
*
* def __iter__(self): # <<<<<<<<<<<<<<
* """Return the next MCA data line each time this method is called.
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_3MCA_11__iter__, 0, __pyx_n_s_MCA___iter, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_iter, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3MCA_11__iter__, 0, __pyx_n_s_MCA___iter, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_iter, __pyx_t_2) < 0) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":194
+ /* "silx/io/specfile.pyx":193
*
*
* class MCA(object): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MCA, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCA, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MCA, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MCA, __pyx_t_2) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":325
+ /* "silx/io/specfile.pyx":324
*
*
* def _add_or_concatenate(dictionary, key, value): # <<<<<<<<<<<<<<
* """If key doesn't exist in dictionary, create a new ``key: value`` pair.
* Else append/concatenate the new value to the existing one
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8specfile_1_add_or_concatenate, NULL, __pyx_n_s_specfile_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_1_add_or_concatenate, NULL, __pyx_n_s_silx_io_specfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_or_concatenate, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_add_or_concatenate, __pyx_t_1) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":338
+ /* "silx/io/specfile.pyx":337
*
*
* class Scan(object): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
__Pyx_GIVEREF(__pyx_builtin_object);
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Scan, __pyx_n_s_Scan, (PyObject *) NULL, __pyx_n_s_specfile_2, __pyx_kp_s_param_specfile_Parent_SpecFile); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
+ __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_Scan, __pyx_n_s_Scan, (PyObject *) NULL, __pyx_n_s_silx_io_specfile, __pyx_kp_s_param_specfile_Parent_SpecFile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "specfile.pyx":363
+ /* "silx/io/specfile.pyx":362
* scan2 = sf["3.1"]
* """
* def __init__(self, specfile, scan_index): # <<<<<<<<<<<<<<
* self._specfile = specfile
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_1__init__, 0, __pyx_n_s_Scan___init, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_1__init__, 0, __pyx_n_s_Scan___init, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 362, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":425
+ /* "silx/io/specfile.pyx":423
* @cython.embedsignature(False)
* @property
* def index(self): # <<<<<<<<<<<<<<
* """Unique scan index 0 - len(specfile)-1
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_3index, 0, __pyx_n_s_Scan_index, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_3index, 0, __pyx_n_s_Scan_index, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":424
+ /* "silx/io/specfile.pyx":422
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def index(self):
* """Unique scan index 0 - len(specfile)-1
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(0, 423, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":435
+ /* "silx/io/specfile.pyx":433
* @cython.embedsignature(False)
* @property
* def number(self): # <<<<<<<<<<<<<<
* """First value on #S line (as int)"""
* return self._number
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_5number, 0, __pyx_n_s_Scan_number, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_5number, 0, __pyx_n_s_Scan_number, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":434
+ /* "silx/io/specfile.pyx":432
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def number(self):
* """First value on #S line (as int)"""
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_number, __pyx_t_2) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":441
+ /* "silx/io/specfile.pyx":439
* @cython.embedsignature(False)
* @property
* def order(self): # <<<<<<<<<<<<<<
* """Order can be > 1 if the same number is repeated in a specfile"""
* return self._order
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_7order, 0, __pyx_n_s_Scan_order, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_7order, 0, __pyx_n_s_Scan_order, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":440
+ /* "silx/io/specfile.pyx":438
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def order(self):
* """Order can be > 1 if the same number is repeated in a specfile"""
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_t_2) < 0) __PYX_ERR(0, 439, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":447
+ /* "silx/io/specfile.pyx":445
* @cython.embedsignature(False)
* @property
* def header(self): # <<<<<<<<<<<<<<
* """List of raw header lines (as a list of strings).
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_9header, 0, __pyx_n_s_Scan_header, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_9header, 0, __pyx_n_s_Scan_header, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":446
+ /* "silx/io/specfile.pyx":444
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def header(self):
* """List of raw header lines (as a list of strings).
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_header_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_header_2, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":457
+ /* "silx/io/specfile.pyx":455
* @cython.embedsignature(False)
* @property
* def scan_header(self): # <<<<<<<<<<<<<<
* """List of raw scan header lines (as a list of strings).
* """
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_11scan_header, 0, __pyx_n_s_Scan_scan_header, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_11scan_header, 0, __pyx_n_s_Scan_scan_header, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":456
+ /* "silx/io/specfile.pyx":454
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def scan_header(self):
* """List of raw scan header lines (as a list of strings).
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_scan_header, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_scan_header, __pyx_t_2) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":464
+ /* "silx/io/specfile.pyx":462
* @cython.embedsignature(False)
* @property
* def file_header(self): # <<<<<<<<<<<<<<
* """List of raw file header lines (as a list of strings).
* """
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_13file_header, 0, __pyx_n_s_Scan_file_header, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__64)); 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);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_13file_header, 0, __pyx_n_s_Scan_file_header, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":463
+ /* "silx/io/specfile.pyx":461
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def file_header(self):
* """List of raw file header lines (as a list of strings).
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 461, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_file_header, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_file_header, __pyx_t_2) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":471
+ /* "silx/io/specfile.pyx":469
* @cython.embedsignature(False)
* @property
* def scan_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of scan header strings, keys without the leading``#``
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_15scan_header_dict, 0, __pyx_n_s_Scan_scan_header_dict, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_15scan_header_dict, 0, __pyx_n_s_Scan_scan_header_dict, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":470
+ /* "silx/io/specfile.pyx":468
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def scan_header_dict(self):
* """
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_scan_header_dict_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_scan_header_dict_2, __pyx_t_2) < 0) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":481
+ /* "silx/io/specfile.pyx":479
* @cython.embedsignature(False)
* @property
* def mca_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of MCA header strings, keys without the leading ``#@``
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_17mca_header_dict, 0, __pyx_n_s_Scan_mca_header_dict, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__68)); 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_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_17mca_header_dict, 0, __pyx_n_s_Scan_mca_header_dict, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":480
+ /* "silx/io/specfile.pyx":478
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def mca_header_dict(self):
* """
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 478, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mca_header_dict, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mca_header_dict, __pyx_t_2) < 0) __PYX_ERR(0, 479, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":490
+ /* "silx/io/specfile.pyx":488
* @cython.embedsignature(False)
* @property
* def file_header_dict(self): # <<<<<<<<<<<<<<
* """
* Dictionary of file header strings, keys without the leading ``#``
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_19file_header_dict, 0, __pyx_n_s_Scan_file_header_dict, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_19file_header_dict, 0, __pyx_n_s_Scan_file_header_dict, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":489
+ /* "silx/io/specfile.pyx":487
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def file_header_dict(self):
* """
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_file_header_dict_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_file_header_dict_2, __pyx_t_2) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":499
+ /* "silx/io/specfile.pyx":497
* @cython.embedsignature(False)
* @property
* def labels(self): # <<<<<<<<<<<<<<
* """
* List of data column headers from ``#L`` scan header
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_21labels, 0, __pyx_n_s_Scan_labels, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_21labels, 0, __pyx_n_s_Scan_labels, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":498
+ /* "silx/io/specfile.pyx":496
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def labels(self):
* """
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_labels_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_labels_2, __pyx_t_2) < 0) __PYX_ERR(0, 497, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":507
+ /* "silx/io/specfile.pyx":505
* @cython.embedsignature(False)
* @property
* def data(self): # <<<<<<<<<<<<<<
* """Scan data as a 2D numpy.ndarray with the usual attributes
* (e.g. data.shape).
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_23data, 0, __pyx_n_s_Scan_data, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_23data, 0, __pyx_n_s_Scan_data, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":506
+ /* "silx/io/specfile.pyx":504
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def data(self):
* """Scan data as a 2D numpy.ndarray with the usual attributes
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_2, __pyx_t_2) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":520
+ /* "silx/io/specfile.pyx":518
* @cython.embedsignature(False)
* @property
* def mca(self): # <<<<<<<<<<<<<<
* """MCA data in this scan.
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_25mca, 0, __pyx_n_s_Scan_mca, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_25mca, 0, __pyx_n_s_Scan_mca, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":519
+ /* "silx/io/specfile.pyx":517
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def mca(self):
* """MCA data in this scan.
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mca_2, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mca_2, __pyx_t_2) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":534
+ /* "silx/io/specfile.pyx":532
* @cython.embedsignature(False)
* @property
* def motor_names(self): # <<<<<<<<<<<<<<
* """List of motor names from the ``#O`` file header line.
* """
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_27motor_names, 0, __pyx_n_s_Scan_motor_names, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_27motor_names, 0, __pyx_n_s_Scan_motor_names, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":533
+ /* "silx/io/specfile.pyx":531
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def motor_names(self):
* """List of motor names from the ``#O`` file header line.
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 531, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_names, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_names, __pyx_t_2) < 0) __PYX_ERR(0, 532, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":541
+ /* "silx/io/specfile.pyx":539
* @cython.embedsignature(False)
* @property
* def motor_positions(self): # <<<<<<<<<<<<<<
* """List of motor positions as floats from the ``#P`` scan header line.
* """
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_29motor_positions, 0, __pyx_n_s_Scan_motor_positions, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_29motor_positions, 0, __pyx_n_s_Scan_motor_positions, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
- /* "specfile.pyx":540
+ /* "silx/io/specfile.pyx":538
*
* @cython.embedsignature(False)
* @property # <<<<<<<<<<<<<<
* def motor_positions(self):
* """List of motor positions as floats from the ``#P`` scan header line.
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 538, __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_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_positions, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_positions, __pyx_t_2) < 0) __PYX_ERR(0, 539, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":546
+ /* "silx/io/specfile.pyx":544
* return self._motor_positions
*
* def record_exists_in_hdr(self, record): # <<<<<<<<<<<<<<
* """Check whether a scan header line exists.
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_31record_exists_in_hdr, 0, __pyx_n_s_Scan_record_exists_in_hdr, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_record_exists_in_hdr, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_31record_exists_in_hdr, 0, __pyx_n_s_Scan_record_exists_in_hdr, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_record_exists_in_hdr, __pyx_t_2) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":565
+ /* "silx/io/specfile.pyx":563
* return False
*
* def data_line(self, line_index): # <<<<<<<<<<<<<<
* """Returns data for a given line of this scan.
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_33data_line, 0, __pyx_n_s_Scan_data_line, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_line, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_33data_line, 0, __pyx_n_s_Scan_data_line, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_line, __pyx_t_2) < 0) __PYX_ERR(0, 563, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":585
+ /* "silx/io/specfile.pyx":583
* return self.data[:, line_index]
*
* def data_column_by_name(self, label): # <<<<<<<<<<<<<<
* """Returns a data column
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_35data_column_by_name, 0, __pyx_n_s_Scan_data_column_by_name, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_column_by_name, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_35data_column_by_name, 0, __pyx_n_s_Scan_data_column_by_name, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_data_column_by_name, __pyx_t_2) < 0) __PYX_ERR(0, 583, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":605
- *
+ /* "silx/io/specfile.pyx":602
+ * return ret
*
* def motor_position_by_name(self, name): # <<<<<<<<<<<<<<
* """Returns the position for a given motor
*
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8specfile_4Scan_37motor_position_by_name, 0, __pyx_n_s_Scan_motor_position_by_name, NULL, __pyx_n_s_specfile_2, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_position_by_name, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_4Scan_37motor_position_by_name, 0, __pyx_n_s_Scan_motor_position_by_name, NULL, __pyx_n_s_silx_io_specfile, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_motor_position_by_name, __pyx_t_2) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "specfile.pyx":338
+ /* "silx/io/specfile.pyx":337
*
*
* class Scan(object): # <<<<<<<<<<<<<<
* """
*
*/
- __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Scan, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_Scan, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Scan, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_Scan, __pyx_t_2) < 0) __PYX_ERR(0, 337, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __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;
- /* "specfile.pyx":618
+ /* "silx/io/specfile.pyx":615
*
*
* def _string_to_char_star(string_): # <<<<<<<<<<<<<<
* """Convert a string to ASCII encoded bytes when using python3"""
* if sys.version.startswith("3") and not isinstance(string_, bytes):
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8specfile_3_string_to_char_star, NULL, __pyx_n_s_specfile_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_3_string_to_char_star, NULL, __pyx_n_s_silx_io_specfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_to_char_star, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_string_to_char_star, __pyx_t_1) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":625
+ /* "silx/io/specfile.pyx":622
*
*
* def is_specfile(filename): # <<<<<<<<<<<<<<
* """Test if a file is a SPEC file, by checking if one of the first two
* lines starts with *#F* (SPEC file header) or *#S* (scan header).
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8specfile_5is_specfile, NULL, __pyx_n_s_specfile_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_2io_8specfile_5is_specfile, NULL, __pyx_n_s_silx_io_specfile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_specfile, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_specfile, __pyx_t_1) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "specfile.pyx":1
+ /* "silx/io/specfile.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* # /[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
- * arr.base = baseptr
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
*
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
- * if arr.base is NULL:
- * return None
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
*/
/*--- Wrapped vars code ---*/
@@ -18627,11 +20861,11 @@ PyMODINIT_FUNC PyInit_specfile(void)
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init specfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.io.specfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init specfile");
+ PyErr_SetString(PyExc_ImportError, "init silx.io.specfile");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -18642,7 +20876,8 @@ PyMODINIT_FUNC PyInit_specfile(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -18659,6 +20894,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -18672,6 +20908,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -18697,6 +20934,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -18710,6 +20948,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -18811,6 +21050,145 @@ bad:
return -1;
}
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
@@ -18830,6 +21208,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
+/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
@@ -18849,6 +21228,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
+/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
@@ -18861,6 +21241,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -18868,19 +21253,33 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -18894,19 +21293,22 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* IterFinish */
+ static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
@@ -18939,7 +21341,8 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
#endif
}
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+/* UnpackItemEndCheck */
+ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
@@ -18950,18 +21353,33 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
return 0;
}
-static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+/* PyObjectCallMethod1 */
+ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
PyObject *method, *result = NULL;
method = __Pyx_PyObject_GetAttrStr(obj, method_name);
- if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(!method)) goto done;
+#if CYTHON_UNPACK_METHODS
if (likely(PyMethod_Check(method))) {
PyObject *self = PyMethod_GET_SELF(method);
if (likely(self)) {
PyObject *args;
PyObject *function = PyMethod_GET_FUNCTION(method);
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(function)) {
+ PyObject *args[2] = {self, arg};
+ result = __Pyx_PyFunction_FastCall(function, args, 2);
+ goto done;
+ }
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(function)) {
+ PyObject *args[2] = {self, arg};
+ result = __Pyx_PyCFunction_FastCall(function, args, 2);
+ goto done;
+ }
+ #endif
args = PyTuple_New(2);
- if (unlikely(!args)) goto bad;
+ if (unlikely(!args)) goto done;
Py_INCREF(self);
PyTuple_SET_ITEM(args, 0, self);
Py_INCREF(arg);
@@ -18976,12 +21394,13 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name
}
#endif
result = __Pyx_PyObject_CallOneArg(method, arg);
-bad:
+done:
Py_XDECREF(method);
return result;
}
-static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
+/* append */
+ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
if (likely(PyList_CheckExact(L))) {
if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
} else {
@@ -18993,7 +21412,124 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
return 0;
}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -19001,8 +21537,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -19015,8 +21552,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -19028,9 +21566,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -19054,10 +21593,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -19071,10 +21609,126 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a - b);
+ if (likely((x^a) >= 0 || (x^~b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ }
+ x = a - b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla - llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("subtract", return NULL)
+ result = ((double)a) - (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
+}
+#endif
+
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -19084,27 +21738,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -19143,6 +21792,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -19176,10 +21826,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -19239,7 +21892,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -19259,23 +21912,18 @@ bad:
}
#endif
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -19285,16 +21933,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -19305,7 +21965,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -19323,7 +21983,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -19347,9 +22007,10 @@ bad:
return -1;
}
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+/* GetModuleGlobalName */
+ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -19364,11 +22025,22 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -19389,15 +22061,21 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-#if !CYTHON_COMPILING_IN_CPYTHON
+/* StringJoin */
+ #if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif
-static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
+/* decode_c_bytes */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
const char* cstring, Py_ssize_t length, 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)) {
@@ -19423,7 +22101,93 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
}
}
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -19435,16 +22199,17 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+/* SetItemInt */
+ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
int r;
if (!j) return -1;
r = PyObject_SetItem(o, j, v);
Py_DECREF(j);
return r;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
+ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
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)))) {
@@ -19462,10 +22227,9 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return -1;
+ PyErr_Clear();
}
}
return m->sq_ass_item(o, i, v);
@@ -19483,13 +22247,20 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -19509,11 +22280,87 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* CalculateMetaclass */
+ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
for (i=0; i < nbases; i++) {
PyTypeObject *tmptype;
@@ -19551,7 +22398,8 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas
return (PyObject*) metaclass;
}
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
+/* Py3ClassCreate */
+ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
PyObject *ns;
if (metaclass) {
@@ -19617,7 +22465,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
return result;
}
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+/* FetchCommonType */
+ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -19655,7 +22504,8 @@ bad:
goto done;
}
-static PyObject *
+/* CythonFunction */
+ static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
@@ -19808,15 +22658,25 @@ __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
+ int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
+ #else
+ op->defaults_tuple = PySequence_ITEM(res, 0);
+ if (unlikely(!op->defaults_tuple)) result = -1;
+ else {
+ op->defaults_kwdict = PySequence_ITEM(res, 1);
+ if (unlikely(!op->defaults_kwdict)) result = -1;
+ }
+ #endif
Py_DECREF(res);
- return 0;
+ return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
@@ -19926,9 +22786,6 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(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}
@@ -20003,7 +22860,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
- PyMem_Free(m->defaults);
+ PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
@@ -20064,37 +22921,40 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
+ PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
- switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
+ switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0)
+ 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) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 0)
+ if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%zd given)",
+ "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 1)
- return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+ if (likely(size == 1)) {
+ PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
+ if (unlikely(!arg0)) return NULL;
+ result = (*meth)(self, arg0);
+ Py_DECREF(arg0);
+ return result;
+ }
PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%zd given)",
+ "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
@@ -20109,11 +22969,32 @@ static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject
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);
+static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
+}
+static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
+ PyObject *result;
+ __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
+ if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
+ Py_ssize_t argc;
+ PyObject *new_args;
+ PyObject *self;
+ argc = PyTuple_GET_SIZE(args);
+ new_args = PyTuple_GetSlice(args, 1, argc);
+ if (unlikely(!new_args))
+ return NULL;
+ self = PyTuple_GetItem(args, 0);
+ if (unlikely(!self)) {
+ Py_DECREF(new_args);
+ return NULL;
+ }
+ result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
+ Py_DECREF(new_args);
+ } else {
+ result = __Pyx_CyFunction_Call(func, args, kw);
+ }
+ return result;
}
-#endif
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
@@ -20133,7 +23014,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
0,
0,
- __Pyx_CyFunction_Call,
+ __Pyx_CyFunction_CallAsMethod,
0,
0,
0,
@@ -20174,10 +23055,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
#endif
};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
- __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
+static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL) {
return -1;
@@ -20186,7 +23064,7 @@ static int __Pyx_CyFunction_init(void) {
}
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);
+ m->defaults = PyObject_Malloc(size);
if (!m->defaults)
return PyErr_NoMemory();
memset(m->defaults, 0, size);
@@ -20209,13 +23087,14 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
Py_INCREF(dict);
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -20288,7 +23167,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -20361,102 +23241,34 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}
-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_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -20467,138 +23279,49 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#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;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -20609,102 +23332,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-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;
-}
-
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -20723,60 +23352,86 @@ raise_neg_overflow:
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
}
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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) {
+ static CYTHON_INLINE float __Pyx_c_abs_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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) {
@@ -20794,24 +23449,32 @@ raise_neg_overflow:
case 1:
return a;
case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_absf(a);
+ r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
@@ -20824,7 +23487,8 @@ raise_neg_overflow:
#endif
#endif
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -20843,60 +23507,86 @@ raise_neg_overflow:
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
}
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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) {
+ static CYTHON_INLINE double __Pyx_c_abs_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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) {
@@ -20914,24 +23604,32 @@ raise_neg_overflow:
case 1:
return a;
case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_abs(a);
+ r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
@@ -20944,36 +23642,453 @@ raise_neg_overflow:
#endif
#endif
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *tmp_type, *tmp_value, *tmp_tb;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
tstate->exc_type = *type;
tstate->exc_value = *value;
tstate->exc_traceback = *tb;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static PyObject *__Pyx_Generator_Next(PyObject *self);
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
-static PyObject *__Pyx_Generator_Close(PyObject *self);
-static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
-static PyTypeObject *__pyx_GeneratorType = 0;
-#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
-#define __Pyx_Generator_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
+/* CoroutineBase */
+ #include <structmember.h>
+#include <frameobject.h>
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Coroutine_Close(PyObject *self);
+static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
+#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
PyObject *et, *ev, *tb;
PyObject *value = NULL;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&et, &ev, &tb);
if (!et) {
Py_XDECREF(tb);
@@ -20982,25 +24097,47 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
*pvalue = Py_None;
return 0;
}
- if (unlikely(et != PyExc_StopIteration) &&
- unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
- __Pyx_ErrRestore(et, ev, tb);
- return -1;
- }
if (likely(et == PyExc_StopIteration)) {
- if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
- if (!ev) {
+ if (!ev) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#if PY_VERSION_HEX >= 0x030300A0
+ else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
+ value = ((PyStopIterationObject *)ev)->value;
+ Py_INCREF(value);
+ Py_DECREF(ev);
+ }
+#endif
+ else if (unlikely(PyTuple_Check(ev))) {
+ if (PyTuple_GET_SIZE(ev) >= 1) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ value = PyTuple_GET_ITEM(ev, 0);
+ Py_INCREF(value);
+#else
+ value = PySequence_ITEM(ev, 0);
+#endif
+ } else {
Py_INCREF(Py_None);
- ev = Py_None;
+ value = Py_None;
}
+ Py_DECREF(ev);
+ }
+ else if (!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
+ value = ev;
+ }
+ if (likely(value)) {
Py_XDECREF(tb);
Py_DECREF(et);
- *pvalue = ev;
+ *pvalue = value;
return 0;
}
+ } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
+ __Pyx_ErrRestore(et, ev, tb);
+ return -1;
}
PyErr_NormalizeException(&et, &ev, &tb);
- if (unlikely(!PyObject_IsInstance(ev, PyExc_StopIteration))) {
+ if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
__Pyx_ErrRestore(et, ev, tb);
return -1;
}
@@ -21012,10 +24149,10 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
Py_DECREF(ev);
#else
{
- PyObject* args = PyObject_GetAttr(ev, __pyx_n_s_args);
+ PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
Py_DECREF(ev);
if (likely(args)) {
- value = PyObject_GetItem(args, 0);
+ value = PySequence_GetItem(args, 0);
Py_DECREF(args);
}
if (unlikely(!value)) {
@@ -21030,7 +24167,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
}
#endif
static CYTHON_INLINE
-void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
+void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
PyObject *exc_type = self->exc_type;
PyObject *exc_value = self->exc_value;
PyObject *exc_traceback = self->exc_traceback;
@@ -21042,7 +24179,7 @@ void __Pyx_Generator_ExceptionClear(__pyx_GeneratorObject *self) {
Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
-int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
+int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
if (unlikely(gen->is_running)) {
PyErr_SetString(PyExc_ValueError,
"generator already executing");
@@ -21051,8 +24188,9 @@ int __Pyx_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
return 0;
}
static CYTHON_INLINE
-PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
+PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
PyObject *retval;
+ __Pyx_PyThreadState_declare
assert(!self->is_running);
if (unlikely(self->resume_label == 0)) {
if (unlikely(value && value != Py_None)) {
@@ -21066,22 +24204,22 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
PyErr_SetNone(PyExc_StopIteration);
return NULL;
}
+ __Pyx_PyThreadState_assign
if (value) {
-#if CYTHON_COMPILING_IN_PYPY
+#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
if (self->exc_traceback) {
- PyThreadState *tstate = PyThreadState_GET();
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
PyFrameObject *f = tb->tb_frame;
- Py_XINCREF(tstate->frame);
+ Py_XINCREF(__pyx_tstate->frame);
assert(f->f_back == NULL);
- f->f_back = tstate->frame;
+ f->f_back = __pyx_tstate->frame;
}
#endif
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
&self->exc_traceback);
} else {
- __Pyx_Generator_ExceptionClear(self);
+ __Pyx_Coroutine_ExceptionClear(self);
}
self->is_running = 1;
retval = self->body((PyObject *) self, value);
@@ -21089,7 +24227,7 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
if (retval) {
__Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
&self->exc_traceback);
-#if CYTHON_COMPILING_IN_PYPY
+#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
if (self->exc_traceback) {
PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
@@ -21098,50 +24236,49 @@ PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *self, PyObject *value) {
}
#endif
} else {
- __Pyx_Generator_ExceptionClear(self);
+ __Pyx_Coroutine_ExceptionClear(self);
+ }
+ return retval;
+}
+static CYTHON_INLINE
+PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
+ if (unlikely(!retval && !PyErr_Occurred())) {
+ PyErr_SetNone(PyExc_StopIteration);
}
return retval;
}
static CYTHON_INLINE
-PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
+PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
PyObject *ret;
PyObject *val = NULL;
- __Pyx_Generator_Undelegate(gen);
+ __Pyx_Coroutine_Undelegate(gen);
__Pyx_PyGen_FetchStopIterationValue(&val);
- ret = __Pyx_Generator_SendEx(gen, val);
+ ret = __Pyx_Coroutine_SendEx(gen, val);
Py_XDECREF(val);
return ret;
}
-static PyObject *__Pyx_Generator_Next(PyObject *self) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
- PyObject *yf = gen->yieldfrom;
- if (unlikely(__Pyx_Generator_CheckRunning(gen)))
- return NULL;
- if (yf) {
- PyObject *ret;
- gen->is_running = 1;
- ret = Py_TYPE(yf)->tp_iternext(yf);
- gen->is_running = 0;
- if (likely(ret)) {
- return ret;
- }
- return __Pyx_Generator_FinishDelegation(gen);
- }
- return __Pyx_Generator_SendEx(gen, Py_None);
-}
-static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
+ PyObject *retval;
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
PyObject *yf = gen->yieldfrom;
- if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+ if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
return NULL;
if (yf) {
PyObject *ret;
gen->is_running = 1;
+ #ifdef __Pyx_Generator_USED
if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Generator_Send(yf, value);
- } else {
+ ret = __Pyx_Coroutine_Send(yf, value);
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_CheckExact(yf)) {
+ ret = __Pyx_Coroutine_Send(yf, value);
+ } else
+ #endif
+ {
if (value == Py_None)
- ret = PyIter_Next(yf);
+ ret = Py_TYPE(yf)->tp_iternext(yf);
else
ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
}
@@ -21149,21 +24286,33 @@ static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
if (likely(ret)) {
return ret;
}
- return __Pyx_Generator_FinishDelegation(gen);
+ retval = __Pyx_Coroutine_FinishDelegation(gen);
+ } else {
+ retval = __Pyx_Coroutine_SendEx(gen, value);
}
- return __Pyx_Generator_SendEx(gen, value);
+ return __Pyx_Coroutine_MethodReturn(retval);
}
-static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
+static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
PyObject *retval = NULL;
int err = 0;
+ #ifdef __Pyx_Generator_USED
if (__Pyx_Generator_CheckExact(yf)) {
- retval = __Pyx_Generator_Close(yf);
+ retval = __Pyx_Coroutine_Close(yf);
if (!retval)
return -1;
- } else {
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_CheckExact(yf)) {
+ retval = __Pyx_Coroutine_Close(yf);
+ if (!retval)
+ return -1;
+ } else
+ #endif
+ {
PyObject *meth;
gen->is_running = 1;
- meth = PyObject_GetAttr(yf, __pyx_n_s_close);
+ meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
if (unlikely(!meth)) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_WriteUnraisable(yf);
@@ -21180,22 +24329,44 @@ static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
Py_XDECREF(retval);
return err;
}
-static PyObject *__Pyx_Generator_Close(PyObject *self) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+static PyObject *__Pyx_Generator_Next(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
+ PyObject *yf = gen->yieldfrom;
+ if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
+ return NULL;
+ if (yf) {
+ PyObject *ret;
+ gen->is_running = 1;
+ #ifdef __Pyx_Generator_USED
+ if (__Pyx_Generator_CheckExact(yf)) {
+ ret = __Pyx_Generator_Next(yf);
+ } else
+ #endif
+ ret = Py_TYPE(yf)->tp_iternext(yf);
+ gen->is_running = 0;
+ if (likely(ret)) {
+ return ret;
+ }
+ return __Pyx_Coroutine_FinishDelegation(gen);
+ }
+ return __Pyx_Coroutine_SendEx(gen, Py_None);
+}
+static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
PyObject *retval, *raised_exception;
PyObject *yf = gen->yieldfrom;
int err = 0;
- if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+ if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
return NULL;
if (yf) {
Py_INCREF(yf);
- err = __Pyx_Generator_CloseIter(gen, yf);
- __Pyx_Generator_Undelegate(gen);
+ err = __Pyx_Coroutine_CloseIter(gen, yf);
+ __Pyx_Coroutine_Undelegate(gen);
Py_DECREF(yf);
}
if (err == 0)
PyErr_SetNone(PyExc_GeneratorExit);
- retval = __Pyx_Generator_SendEx(gen, NULL);
+ retval = __Pyx_Coroutine_SendEx(gen, NULL);
if (retval) {
Py_DECREF(retval);
PyErr_SetString(PyExc_RuntimeError,
@@ -21215,32 +24386,40 @@ static PyObject *__Pyx_Generator_Close(PyObject *self) {
}
return NULL;
}
-static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
PyObject *typ;
PyObject *tb = NULL;
PyObject *val = NULL;
PyObject *yf = gen->yieldfrom;
if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
return NULL;
- if (unlikely(__Pyx_Generator_CheckRunning(gen)))
+ if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
return NULL;
if (yf) {
PyObject *ret;
Py_INCREF(yf);
if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
- int err = __Pyx_Generator_CloseIter(gen, yf);
+ int err = __Pyx_Coroutine_CloseIter(gen, yf);
Py_DECREF(yf);
- __Pyx_Generator_Undelegate(gen);
+ __Pyx_Coroutine_Undelegate(gen);
if (err < 0)
- return __Pyx_Generator_SendEx(gen, NULL);
+ return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
goto throw_here;
}
gen->is_running = 1;
+ #ifdef __Pyx_Generator_USED
if (__Pyx_Generator_CheckExact(yf)) {
- ret = __Pyx_Generator_Throw(yf, args);
- } else {
- PyObject *meth = PyObject_GetAttr(yf, __pyx_n_s_throw);
+ ret = __Pyx_Coroutine_Throw(yf, args);
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_CheckExact(yf)) {
+ ret = __Pyx_Coroutine_Throw(yf, args);
+ } else
+ #endif
+ {
+ PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
if (unlikely(!meth)) {
Py_DECREF(yf);
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
@@ -21248,7 +24427,7 @@ static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
return NULL;
}
PyErr_Clear();
- __Pyx_Generator_Undelegate(gen);
+ __Pyx_Coroutine_Undelegate(gen);
gen->is_running = 0;
goto throw_here;
}
@@ -21258,16 +24437,16 @@ static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
gen->is_running = 0;
Py_DECREF(yf);
if (!ret) {
- ret = __Pyx_Generator_FinishDelegation(gen);
+ ret = __Pyx_Coroutine_FinishDelegation(gen);
}
- return ret;
+ return __Pyx_Coroutine_MethodReturn(ret);
}
throw_here:
__Pyx_Raise(typ, val, tb, NULL);
- return __Pyx_Generator_SendEx(gen, NULL);
+ return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
-static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
Py_VISIT(gen->closure);
Py_VISIT(gen->classobj);
Py_VISIT(gen->yieldfrom);
@@ -21276,8 +24455,8 @@ static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg)
Py_VISIT(gen->exc_traceback);
return 0;
}
-static int __Pyx_Generator_clear(PyObject *self) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+static int __Pyx_Coroutine_clear(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
Py_CLEAR(gen->closure);
Py_CLEAR(gen->classobj);
Py_CLEAR(gen->yieldfrom);
@@ -21288,8 +24467,8 @@ static int __Pyx_Generator_clear(PyObject *self) {
Py_CLEAR(gen->gi_qualname);
return 0;
}
-static void __Pyx_Generator_dealloc(PyObject *self) {
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+static void __Pyx_Coroutine_dealloc(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
PyObject_GC_UnTrack(gen);
if (gen->gi_weakreflist != NULL)
PyObject_ClearWeakRefs(self);
@@ -21306,21 +24485,23 @@ static void __Pyx_Generator_dealloc(PyObject *self) {
}
PyObject_GC_UnTrack(self);
}
- __Pyx_Generator_clear(self);
+ __Pyx_Coroutine_clear(self);
PyObject_GC_Del(gen);
}
-static void __Pyx_Generator_del(PyObject *self) {
+static void __Pyx_Coroutine_del(PyObject *self) {
PyObject *res;
PyObject *error_type, *error_value, *error_traceback;
- __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ __Pyx_PyThreadState_declare
if (gen->resume_label <= 0)
return ;
#if PY_VERSION_HEX < 0x030400a1
assert(self->ob_refcnt == 0);
self->ob_refcnt = 1;
#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
- res = __Pyx_Generator_Close(self);
+ res = __Pyx_Coroutine_Close(self);
if (res == NULL)
PyErr_WriteUnraisable(self);
else
@@ -21348,13 +24529,15 @@ static void __Pyx_Generator_del(PyObject *self) {
#endif
}
static PyObject *
-__Pyx_Generator_get_name(__pyx_GeneratorObject *self)
+__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
- Py_INCREF(self->gi_name);
- return self->gi_name;
+ PyObject *name = self->gi_name;
+ if (unlikely(!name)) name = Py_None;
+ Py_INCREF(name);
+ return name;
}
static int
-__Pyx_Generator_set_name(__pyx_GeneratorObject *self, PyObject *value)
+__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
@@ -21373,13 +24556,15 @@ __Pyx_Generator_set_name(__pyx_GeneratorObject *self, PyObject *value)
return 0;
}
static PyObject *
-__Pyx_Generator_get_qualname(__pyx_GeneratorObject *self)
+__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
- Py_INCREF(self->gi_qualname);
- return self->gi_qualname;
+ PyObject *name = self->gi_qualname;
+ if (unlikely(!name)) name = Py_None;
+ Py_INCREF(name);
+ return name;
}
static int
-__Pyx_Generator_set_qualname(__pyx_GeneratorObject *self, PyObject *value)
+__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
@@ -21397,37 +24582,160 @@ __Pyx_Generator_set_qualname(__pyx_GeneratorObject *self, PyObject *value)
Py_XDECREF(tmp);
return 0;
}
-static PyGetSetDef __pyx_Generator_getsets[] = {
- {(char *) "__name__", (getter)__Pyx_Generator_get_name, (setter)__Pyx_Generator_set_name,
- (char*) PyDoc_STR("name of the generator"), 0},
- {(char *) "__qualname__", (getter)__Pyx_Generator_get_qualname, (setter)__Pyx_Generator_set_qualname,
- (char*) PyDoc_STR("qualified name of the generator"), 0},
- {0, 0, 0, 0, 0}
+static __pyx_CoroutineObject *__Pyx__Coroutine_New(
+ PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name) {
+ __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
+ if (gen == NULL)
+ return NULL;
+ gen->body = body;
+ gen->closure = closure;
+ Py_XINCREF(closure);
+ gen->is_running = 0;
+ gen->resume_label = 0;
+ gen->classobj = NULL;
+ gen->yieldfrom = NULL;
+ gen->exc_type = NULL;
+ gen->exc_value = NULL;
+ gen->exc_traceback = NULL;
+ gen->gi_weakreflist = NULL;
+ Py_XINCREF(qualname);
+ gen->gi_qualname = qualname;
+ Py_XINCREF(name);
+ gen->gi_name = name;
+ Py_XINCREF(module_name);
+ gen->gi_modulename = module_name;
+ PyObject_GC_Track(gen);
+ return gen;
+}
+
+/* PatchModuleWithCoroutine */
+ static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
+#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ int result;
+ PyObject *globals, *result_obj;
+ globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
+ result = PyDict_SetItemString(globals, "_cython_coroutine_type",
+ #ifdef __Pyx_Coroutine_USED
+ (PyObject*)__pyx_CoroutineType);
+ #else
+ Py_None);
+ #endif
+ if (unlikely(result < 0)) goto ignore;
+ result = PyDict_SetItemString(globals, "_cython_generator_type",
+ #ifdef __Pyx_Generator_USED
+ (PyObject*)__pyx_GeneratorType);
+ #else
+ Py_None);
+ #endif
+ if (unlikely(result < 0)) goto ignore;
+ if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
+ if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
+ result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
+ if (unlikely(!result_obj)) goto ignore;
+ Py_DECREF(result_obj);
+ Py_DECREF(globals);
+ return module;
+ignore:
+ Py_XDECREF(globals);
+ PyErr_WriteUnraisable(module);
+ if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
+ Py_DECREF(module);
+ module = NULL;
+ }
+#else
+ py_code++;
+#endif
+ return module;
+}
+
+/* PatchGeneratorABC */
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+static PyObject* __Pyx_patch_abc_module(PyObject *module);
+static PyObject* __Pyx_patch_abc_module(PyObject *module) {
+ module = __Pyx_Coroutine_patch_module(
+ module, ""
+"if _cython_generator_type is not None:\n"
+" try: Generator = _module.Generator\n"
+" except AttributeError: pass\n"
+" else: Generator.register(_cython_generator_type)\n"
+"if _cython_coroutine_type is not None:\n"
+" try: Coroutine = _module.Coroutine\n"
+" except AttributeError: pass\n"
+" else: Coroutine.register(_cython_coroutine_type)\n"
+ );
+ return module;
+}
+#endif
+static int __Pyx_patch_abc(void) {
+#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ static int abc_patched = 0;
+ if (!abc_patched) {
+ PyObject *module;
+ module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
+ if (!module) {
+ PyErr_WriteUnraisable(NULL);
+ if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
+ ((PY_VERSION_HEX >= 0x03030000) ?
+ "Cython module failed to register with collections.abc module" :
+ "Cython module failed to register with collections module"), 1) < 0)) {
+ return -1;
+ }
+ } else {
+ module = __Pyx_patch_abc_module(module);
+ abc_patched = 1;
+ if (unlikely(!module))
+ return -1;
+ Py_DECREF(module);
+ }
+ module = PyImport_ImportModule("backports_abc");
+ if (module) {
+ module = __Pyx_patch_abc_module(module);
+ Py_XDECREF(module);
+ }
+ if (!module) {
+ PyErr_Clear();
+ }
+ }
+#else
+ if (0) __Pyx_Coroutine_patch_module(NULL, NULL);
+#endif
+ return 0;
+}
+
+/* Generator */
+ static PyMethodDef __pyx_Generator_methods[] = {
+ {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
+ (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
+ {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
+ (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
+ {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
+ (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
+ {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
- {(char *) "gi_running", T_BOOL, offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL},
+ {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
+ {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
+ (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
{0, 0, 0, 0, 0}
};
-static PyMethodDef __pyx_Generator_methods[] = {
- {"send", (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
- {"throw", (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
- {"close", (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
- {0, 0, 0, 0}
+static PyGetSetDef __pyx_Generator_getsets[] = {
+ {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
+ (char*) PyDoc_STR("name of the generator"), 0},
+ {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
+ (char*) PyDoc_STR("qualified name of the generator"), 0},
+ {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
PyVarObject_HEAD_INIT(0, 0)
"generator",
- sizeof(__pyx_GeneratorObject),
+ sizeof(__pyx_CoroutineObject),
0,
- (destructor) __Pyx_Generator_dealloc,
+ (destructor) __Pyx_Coroutine_dealloc,
0,
0,
0,
-#if PY_MAJOR_VERSION < 3
0,
-#else
- 0,
-#endif
0,
0,
0,
@@ -21440,10 +24748,10 @@ static PyTypeObject __pyx_GeneratorType_type = {
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
0,
- (traverseproc) __Pyx_Generator_traverse,
+ (traverseproc) __Pyx_Coroutine_traverse,
0,
0,
- offsetof(__pyx_GeneratorObject, gi_weakreflist),
+ offsetof(__pyx_CoroutineObject, gi_weakreflist),
0,
(iternextfunc) __Pyx_Generator_Next,
__pyx_Generator_methods,
@@ -21467,48 +24775,25 @@ static PyTypeObject __pyx_GeneratorType_type = {
#if PY_VERSION_HEX >= 0x030400a1
0,
#else
- __Pyx_Generator_del,
+ __Pyx_Coroutine_del,
#endif
0,
#if PY_VERSION_HEX >= 0x030400a1
- __Pyx_Generator_del,
+ __Pyx_Coroutine_del,
#endif
};
-static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
- PyObject *closure, PyObject *name, PyObject *qualname) {
- __pyx_GeneratorObject *gen =
- PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_type);
- if (gen == NULL)
- return NULL;
- gen->body = body;
- gen->closure = closure;
- Py_XINCREF(closure);
- gen->is_running = 0;
- gen->resume_label = 0;
- gen->classobj = NULL;
- gen->yieldfrom = NULL;
- gen->exc_type = NULL;
- gen->exc_value = NULL;
- gen->exc_traceback = NULL;
- gen->gi_weakreflist = NULL;
- Py_XINCREF(qualname);
- gen->gi_qualname = qualname;
- Py_XINCREF(name);
- gen->gi_name = name;
- PyObject_GC_Track(gen);
- return gen;
-}
static int __pyx_Generator_init(void) {
__pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
__pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
__pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
- if (__pyx_GeneratorType == NULL) {
+ if (unlikely(!__pyx_GeneratorType)) {
return -1;
}
return 0;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -21523,7 +24808,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-#ifndef __PYX_HAVE_RT_ImportModule
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
@@ -21540,7 +24826,8 @@ bad:
}
#endif
-#ifndef __PYX_HAVE_RT_ImportType
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
@@ -21586,14 +24873,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif
if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling",
- module_name, class_name);
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
goto bad;
}
return (PyTypeObject *)result;
@@ -21604,7 +24891,8 @@ bad:
}
#endif
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -21642,7 +24930,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -21683,7 +24971,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -21704,8 +24992,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -21713,9 +25003,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -21724,11 +25015,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -21753,18 +25047,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/io/specfile/specfile.pyx b/silx/io/specfile.pyx
index a465aa6..35f425b 100644
--- a/silx/io/specfile/specfile.pyx
+++ b/silx/io/specfile.pyx
@@ -105,7 +105,7 @@ Exceptions
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "27/09/2016"
+__date__ = "11/08/2017"
import os.path
import logging
@@ -113,7 +113,6 @@ import numpy
import re
import sys
-logging.basicConfig()
_logger = logging.getLogger(__name__)
cimport numpy
@@ -149,21 +148,21 @@ class SfError(Exception):
"""
pass
-class SfErrMemoryAlloc(SfError): pass
-class SfErrFileOpen(SfError): pass
-class SfErrFileClose(SfError): pass
-class SfErrFileRead(SfError): pass
-class SfErrFileWrite(SfError): pass
-class SfErrLineNotFound(SfError): pass
-class SfErrScanNotFound(SfError): pass
-class SfErrHeaderNotFound(SfError): pass
-class SfErrLabelNotFound(SfError): pass
-class SfErrMotorNotFound(SfError): pass
-class SfErrPositionNotFound(SfError): pass
-class SfErrLineEmpty(SfError): pass
-class SfErrUserNotFound(SfError): pass
-class SfErrColNotFound(SfError): pass
-class SfErrMcaNotFound(SfError): pass
+class SfErrMemoryAlloc(SfError, MemoryError): pass
+class SfErrFileOpen(SfError, IOError): pass
+class SfErrFileClose(SfError, IOError): pass
+class SfErrFileRead(SfError, IOError): pass
+class SfErrFileWrite(SfError, IOError): pass
+class SfErrLineNotFound(SfError, KeyError): pass
+class SfErrScanNotFound(SfError, IndexError): pass
+class SfErrHeaderNotFound(SfError, KeyError): pass
+class SfErrLabelNotFound(SfError, KeyError): pass
+class SfErrMotorNotFound(SfError, KeyError): pass
+class SfErrPositionNotFound(SfError, KeyError): pass
+class SfErrLineEmpty(SfError, IOError): pass
+class SfErrUserNotFound(SfError, KeyError): pass
+class SfErrColNotFound(SfError, KeyError): pass
+class SfErrMcaNotFound(SfError, IndexError): pass
ERRORS = {
@@ -207,7 +206,7 @@ class MCA(object):
:type channels: list of int
This class provides access to Multi-Channel Analysis data. A :class:`MCA`
- instance can be indexed to access 1D numpy arrays representing single
+ instance can be indexed to access 1D numpy arrays representing single
MCA spectra.
To create a :class:`MCA` instance, you must provide a parent :class:`Scan`
@@ -296,7 +295,7 @@ class MCA(object):
if not len(self):
raise IndexError("No MCA spectrum found in this scan")
- if isinstance(key, int):
+ if isinstance(key, (int, long)):
mca_index = key
# allow negative index, like lists
if mca_index < 0:
@@ -327,7 +326,7 @@ def _add_or_concatenate(dictionary, key, value):
Else append/concatenate the new value to the existing one
"""
try:
- if not key in dictionary:
+ if key not in dictionary:
dictionary[key] = value
else:
dictionary[key] += "\n" + value
@@ -402,7 +401,6 @@ class Scan(object):
self._scan_header_dict["L"])
self._labels = L_header.split(" ")
-
self._file_header_dict = {}
for line in self._file_header_lines:
match = re.search(r"#(\w+) *(.*)", line)
@@ -545,11 +543,11 @@ class Scan(object):
def record_exists_in_hdr(self, record):
"""Check whether a scan header line exists.
-
- This should be used before attempting to retrieve header information
+
+ This should be used before attempting to retrieve header information
using a C function that may crash with a *segmentation fault* if the
header isn't defined in the SpecFile.
-
+
:param record: single upper case letter corresponding to the
header you want to test (e.g. ``L`` for labels)
:type record: str
@@ -571,12 +569,12 @@ class Scan(object):
in the original specfile (a series of data points, one per
detector). In the :attr:`data` array, this line index corresponds
to the index in the second dimension (~ column) of the array.
-
+
:param line_index: Index of data line to retrieve (starting with 0)
:type line_index: int
:return: Line data as a 1D array of doubles
- :rtype: numpy.ndarray
+ :rtype: numpy.ndarray
"""
# attribute data corresponds to a transposed version of the original
# specfile data (where detectors correspond to columns)
@@ -601,7 +599,6 @@ class Scan(object):
ret = numpy.empty((0, ), numpy.double)
return ret
-
def motor_position_by_name(self, name):
"""Returns the position for a given motor
@@ -652,26 +649,25 @@ cdef class SpecFile(object):
This class wraps the main data and header access functions of the C
SpecFile library.
"""
-
+
cdef:
specfile_wrapper.SpecFileHandle *handle
str filename
- int __open_failed
-
+
def __cinit__(self, filename):
cdef int error = SF_ERR_NO_ERRORS
- self.__open_failed = 0
+ self.handle = NULL
if is_specfile(filename):
filename = _string_to_char_star(filename)
- self.handle = specfile_wrapper.SfOpen(filename, &error)
+ self.handle = specfile_wrapper.SfOpen(filename, &error)
+ if error:
+ self._handle_error(error)
else:
- self.__open_failed = 1
+ # handle_error takes care of raising the correct error,
+ # this causes the destructor to be called
self._handle_error(SF_ERR_FILE_OPEN)
- if error:
- self.__open_failed = 1
- self._handle_error(error)
-
+
def __init__(self, filename):
if not isinstance(filename, str):
# encode unicode to str in python 2
@@ -682,14 +678,14 @@ cdef class SpecFile(object):
self.filename = filename.decode()
else:
self.filename = filename
-
+
def __dealloc__(self):
"""Destructor: Calls SfClose(self.handle)"""
- #SfClose makes a segmentation fault if file failed to open
- if not self.__open_failed:
+ # handle is NULL if SfOpen failed
+ if self.handle:
if specfile_wrapper.SfClose(self.handle):
_logger.warning("Error while closing SpecFile")
-
+
def __len__(self):
"""Return the number of scans in the SpecFile
"""
@@ -736,7 +732,7 @@ cdef class SpecFile(object):
except (ValueError, SfErrScanNotFound, KeyError):
# int() can raise a value error
raise KeyError(msg + "\nValid keys: '" +
- "', '".join( self.keys()) + "'")
+ "', '".join(self.keys()) + "'")
except AttributeError:
# e.g. "AttrErr: 'float' object has no attribute 'split'"
raise TypeError(msg)
@@ -756,9 +752,9 @@ cdef class SpecFile(object):
ret_list = []
list_of_numbers = self._list()
count = {}
-
+
for number in list_of_numbers:
- if not number in count:
+ if number not in count:
count[number] = 1
else:
count[number] += 1
@@ -774,50 +770,50 @@ cdef class SpecFile(object):
def _get_error_string(self, error_code):
"""Returns the error message corresponding to the error code.
-
+
:param code: Error code
:type code: int
:return: Human readable error message
:rtype: str
"""
return (<bytes> specfile_wrapper.SfError(error_code)).decode()
-
+
def _handle_error(self, error_code):
"""Inspect error code, raise adequate error type if necessary.
-
+
:param code: Error code
:type code: int
"""
error_message = self._get_error_string(error_code)
if error_code in ERRORS:
raise ERRORS[error_code](error_message)
-
+
def index(self, scan_number, scan_order=1):
"""Returns scan index from scan number and order.
-
- :param scan_number: Scan number (possibly non-unique).
+
+ :param scan_number: Scan number (possibly non-unique).
:type scan_number: int
- :param scan_order: Scan order.
+ :param scan_order: Scan order.
:type scan_order: int default 1
:return: Unique scan index
:rtype: int
-
-
+
+
Scan indices are increasing from ``0`` to ``len(self)-1`` in the
order in which they appear in the file.
Scan numbers are defined by users and are not necessarily unique.
- The scan order for a given scan number increments each time the scan
- number appers in a given file.
+ The scan order for a given scan number increments each time the scan
+ number appears in a given file.
"""
idx = specfile_wrapper.SfIndex(self.handle, scan_number, scan_order)
if idx == -1:
self._handle_error(SF_ERR_SCAN_NOT_FOUND)
return idx - 1
-
+
def number(self, scan_index):
"""Returns scan number from scan index.
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -829,10 +825,10 @@ cdef class SpecFile(object):
if idx == -1:
self._handle_error(SF_ERR_SCAN_NOT_FOUND)
return idx
-
+
def order(self, scan_index):
"""Returns scan order from scan index.
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -852,7 +848,7 @@ cdef class SpecFile(object):
cdef:
long *scan_numbers
int error = SF_ERR_NO_ERRORS
-
+
scan_numbers = specfile_wrapper.SfList(self.handle, &error)
self._handle_error(error)
@@ -873,7 +869,7 @@ cdef class SpecFile(object):
# this method is overloaded in specfilewrapper to output a string
# representation of the list
return self._list()
-
+
def data(self, scan_index):
"""Returns data for the specified scan index.
@@ -954,7 +950,7 @@ cdef class SpecFile(object):
def scan_header(self, scan_index):
"""Return list of scan header lines.
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -962,7 +958,7 @@ cdef class SpecFile(object):
:return: List of raw scan header lines
:rtype: list of str
"""
- cdef:
+ cdef:
char** lines
int error = SF_ERR_NO_ERRORS
@@ -971,26 +967,26 @@ cdef class SpecFile(object):
"", # no pattern matching
&lines,
&error)
-
+
self._handle_error(error)
-
+
lines_list = []
for i in range(nlines):
line = <bytes>lines[i].decode()
lines_list.append(line)
-
+
specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
return lines_list
-
+
def file_header(self, scan_index=0):
"""Return list of file header lines.
-
+
A file header contains all lines between a ``#F`` header line and
a ``#S`` header line (start of scan). We need to specify a scan
number because there can be more than one file header in a given file.
A file header applies to all subsequent scans, until a new file
header is defined.
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -998,7 +994,7 @@ cdef class SpecFile(object):
:return: List of raw file header lines
:rtype: list of str
"""
- cdef:
+ cdef:
char** lines
int error = SF_ERR_NO_ERRORS
@@ -1011,16 +1007,16 @@ cdef class SpecFile(object):
lines_list = []
for i in range(nlines):
- line = <bytes>lines[i].decode()
+ line = <bytes>lines[i].decode()
lines_list.append(line)
-
+
specfile_wrapper.freeArrNZ(<void***>&lines, nlines)
- return lines_list
-
+ return lines_list
+
def columns(self, scan_index):
"""Return number of columns in a scan from the ``#N`` header line
(without ``#N`` and scan number)
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -1030,17 +1026,17 @@ cdef class SpecFile(object):
"""
cdef:
int error = SF_ERR_NO_ERRORS
-
+
ncolumns = specfile_wrapper.SfNoColumns(self.handle,
scan_index + 1,
&error)
self._handle_error(error)
-
+
return ncolumns
-
+
def command(self, scan_index):
"""Return ``#S`` line (without ``#S`` and scan number)
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -1048,16 +1044,16 @@ cdef class SpecFile(object):
:return: S line
:rtype: str
"""
- cdef:
+ cdef:
int error = SF_ERR_NO_ERRORS
-
+
s_record = <bytes> specfile_wrapper.SfCommand(self.handle,
scan_index + 1,
&error)
self._handle_error(error)
return s_record.decode()
-
+
def date(self, scan_index=0):
"""Return date from ``#D`` line
@@ -1068,19 +1064,19 @@ cdef class SpecFile(object):
:return: Date from ``#D`` line
:rtype: str
"""
- cdef:
+ cdef:
int error = SF_ERR_NO_ERRORS
-
+
d_line = <bytes> specfile_wrapper.SfDate(self.handle,
scan_index + 1,
&error)
self._handle_error(error)
-
+
return d_line.decode()
-
+
def labels(self, scan_index):
"""Return all labels from ``#L`` line
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.
:type scan_index: int
@@ -1101,13 +1097,13 @@ cdef class SpecFile(object):
labels_list = []
for i in range(nlabels):
labels_list.append(<bytes>all_labels[i].decode())
-
+
specfile_wrapper.freeArrNZ(<void***>&all_labels, nlabels)
return labels_list
-
+
def motor_names(self, scan_index=0):
"""Return all motor names from ``#O`` lines
-
+
:param scan_index: Unique scan index between ``0`` and
``len(self)-1``.If not specified, defaults to 0 (meaning the
function returns motors names associated with the first scan).
@@ -1119,26 +1115,26 @@ cdef class SpecFile(object):
:return: All motor names
:rtype: list of strings
"""
- cdef:
+ cdef:
char** all_motors
int error = SF_ERR_NO_ERRORS
-
+
nmotors = specfile_wrapper.SfAllMotors(self.handle,
scan_index + 1,
&all_motors,
&error)
self._handle_error(error)
-
+
motors_list = []
for i in range(nmotors):
motors_list.append(<bytes>all_motors[i].decode())
-
+
specfile_wrapper.freeArrNZ(<void***>&all_motors, nmotors)
return motors_list
def motor_positions(self, scan_index):
"""Return all motor positions
-
+
:param scan_index: Unique scan index between ``0``
and ``len(self)-1``.
:type scan_index: int
@@ -1146,7 +1142,7 @@ cdef class SpecFile(object):
:return: All motor positions
:rtype: list of double
"""
- cdef:
+ cdef:
double* motor_positions
int error = SF_ERR_NO_ERRORS
@@ -1159,7 +1155,7 @@ cdef class SpecFile(object):
motor_positions_list = []
for i in range(nmotors):
motor_positions_list.append(motor_positions[i])
-
+
free(motor_positions)
return motor_positions_list
@@ -1263,7 +1259,6 @@ cdef class SpecFile(object):
&error)
self._handle_error(error)
-
cdef numpy.ndarray ret_array = numpy.empty((len_mca,),
dtype=numpy.double)
for i in range(len_mca):
diff --git a/silx/io/specfile/include/Lists.h b/silx/io/specfile/include/Lists.h
index bcda100..01164fb 100644
--- a/silx/io/specfile/include/Lists.h
+++ b/silx/io/specfile/include/Lists.h
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/***************************************************************************
*
* File: Lists.h
diff --git a/silx/io/specfile/include/SpecFile.h b/silx/io/specfile/include/SpecFile.h
index fce729c..9456e3f 100644
--- a/silx/io/specfile/include/SpecFile.h
+++ b/silx/io/specfile/include/SpecFile.h
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/***************************************************************************
*
* File: SpecFile.h
@@ -72,6 +77,7 @@
#define ROW 0 /* data_info index for no. of data rows */
#define COL 1 /* data_info index for no. of data columns*/
#define REG 2 /* data_info index for regular */
+
#define H 0
#define K 1
#define L 2
diff --git a/silx/io/specfile/include/SpecFileP.h b/silx/io/specfile/include/SpecFileP.h
index de9904d..97c3db6 100644
--- a/silx/io/specfile/include/SpecFileP.h
+++ b/silx/io/specfile/include/SpecFileP.h
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/***************************************************************************
*
* File: SpecFileP.h
diff --git a/silx/io/specfile/include/locale_management.h b/silx/io/specfile/include/locale_management.h
index d3b9f51..64562c5 100644
--- a/silx/io/specfile/include/locale_management.h
+++ b/silx/io/specfile/include/locale_management.h
@@ -1,18 +1,23 @@
#/*##########################################################################
-# Copyright (C) 2012-2013 European Synchrotron Radiation Facility
+# Copyright (C) 2012-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
#############################################################################*/
#ifndef PyMca_LOCALE_MANAGEMENT_H
diff --git a/silx/io/specfile/src/locale_management.c b/silx/io/specfile/src/locale_management.c
index 1e6a196..163ed75 100644
--- a/silx/io/specfile/src/locale_management.c
+++ b/silx/io/specfile/src/locale_management.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2012-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 2012-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
#include <locale_management.h>
#include <stdlib.h>
diff --git a/silx/io/specfile/src/sfdata.c b/silx/io/specfile/src/sfdata.c
index 229f4e6..e59439a 100644
--- a/silx/io/specfile/src/sfdata.c
+++ b/silx/io/specfile/src/sfdata.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2014 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfdata.c
diff --git a/silx/io/specfile/src/sfheader.c b/silx/io/specfile/src/sfheader.c
index 424eb08..b669e33 100644
--- a/silx/io/specfile/src/sfheader.c
+++ b/silx/io/specfile/src/sfheader.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2016 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfheader.c
diff --git a/silx/io/specfile/src/sfindex.c b/silx/io/specfile/src/sfindex.c
index fd0c7c3..320b086 100644
--- a/silx/io/specfile/src/sfindex.c
+++ b/silx/io/specfile/src/sfindex.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfindex.c
diff --git a/silx/io/specfile/src/sfinit.c b/silx/io/specfile/src/sfinit.c
index 6f88078..7291427 100644
--- a/silx/io/specfile/src/sfinit.c
+++ b/silx/io/specfile/src/sfinit.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfinit.c
diff --git a/silx/io/specfile/src/sflabel.c b/silx/io/specfile/src/sflabel.c
index 70af965..70d2e95 100644
--- a/silx/io/specfile/src/sflabel.c
+++ b/silx/io/specfile/src/sflabel.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2014 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sflabel.c
diff --git a/silx/io/specfile/src/sflists.c b/silx/io/specfile/src/sflists.c
index 3fcb9a7..aca267f 100644
--- a/silx/io/specfile/src/sflists.c
+++ b/silx/io/specfile/src/sflists.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sflists.c
diff --git a/silx/io/specfile/src/sfmca.c b/silx/io/specfile/src/sfmca.c
index 22d1958..ad13bae 100644
--- a/silx/io/specfile/src/sfmca.c
+++ b/silx/io/specfile/src/sfmca.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2014 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 2000-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfmca.c
diff --git a/silx/io/specfile/src/sftools.c b/silx/io/specfile/src/sftools.c
index 74ae311..d113d05 100644
--- a/silx/io/specfile/src/sftools.c
+++ b/silx/io/specfile/src/sftools.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2016 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sftools.c
diff --git a/silx/io/specfile/src/sfwrite.c b/silx/io/specfile/src/sfwrite.c
index 4422ae0..c77f400 100644
--- a/silx/io/specfile/src/sfwrite.c
+++ b/silx/io/specfile/src/sfwrite.c
@@ -1,20 +1,25 @@
-#/*##########################################################################
-# Copyright (C) 2004-2013 European Synchrotron Radiation Facility
+# /*##########################################################################
+# Copyright (C) 1995-2017 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:
#
-# This file 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 2 of the License, or (at your option)
-# any later version.
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
#
-# This file 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.
+# 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.
#
-#############################################################################*/
+# ############################################################################*/
/************************************************************************
*
* File: sfwrite.c
diff --git a/silx/io/specfile/specfile_wrapper.pxd b/silx/io/specfile_wrapper.pxd
index 6770f7e..6770f7e 100644
--- a/silx/io/specfile/specfile_wrapper.pxd
+++ b/silx/io/specfile_wrapper.pxd
diff --git a/silx/io/spech5.py b/silx/io/spech5.py
index 58a6c6b..81a7a7e 100644
--- a/silx/io/spech5.py
+++ b/silx/io/spech5.py
@@ -24,7 +24,8 @@
"""This module provides a h5py-like API to access SpecFile data.
API description
-===============
++++++++++++++++
+
Specfile data structure exposed by this API:
::
@@ -59,6 +60,11 @@ Specfile data structure exposed by this API:
data -> /1.1/instrument/mca_0/data
info -> /1.1/instrument/mca_0/
+ sample/
+ ub_matrix = …
+ unit_cell = …
+ unit_cell_abc = …
+ unit_cell_alphabetagamma = …
2.1/
@@ -101,7 +107,7 @@ computed from the ``#@CHANN`` scan header line (if present), or computed from
the shape of the first spectrum in a scan (``[0, … len(first_spectrum] - 1]``).
Accessing data
-==============
+++++++++++++++
Data and groups are accessed in :mod:`h5py` fashion::
@@ -123,7 +129,7 @@ Data and groups are accessed in :mod:`h5py` fashion::
# accessing all mca-spectra for one MCA device
mca_0_spectra = measurement_group["mca_0/data"]
-:class:`SpecH5` and :class:`SpecH5Group` provide a :meth:`SpecH5Group.keys` method::
+:class:`SpecH5` files and groups provide a :meth:`keys` method::
>>> sfh5.keys()
['96.1', '97.1', '98.1']
@@ -134,9 +140,11 @@ They can also be treated as iterators:
.. code-block:: python
+ from silx.io import is_dataset
+
for scan_group in SpecH5("test.dat"):
dataset_names = [item.name in scan_group["measurement"] if
- isinstance(item, SpecH5Dataset)]
+ is_dataset(item)]
print("Found data columns in scan " + scan_group.name)
print(", ".join(dataset_names))
@@ -164,30 +172,23 @@ is that you should decode strings before using them in **Python 3**::
>>> sfh5["/68.1/title"].decode()
'68 ascan tx3 -28.5 -24.5 20 0.5'
-
-Classes
-=======
-
-- :class:`SpecH5`
-- :class:`SpecH5Group`
-- :class:`SpecH5Dataset`
-- :class:`SpecH5LinkToGroup`
-- :class:`SpecH5LinkToDataset`
"""
+import datetime
import logging
import numpy
-import posixpath
import re
import sys
+import io
+from silx import version as silx_version
from .specfile import SpecFile
+from . import commonh5
__authors__ = ["P. Knobel", "D. Naudet"]
__license__ = "MIT"
-__date__ = "11/05/2017"
+__date__ = "23/08/2017"
-logging.basicConfig()
logger1 = logging.getLogger(__name__)
try:
@@ -198,303 +199,22 @@ except ImportError:
string_types = (basestring,) if sys.version_info[0] == 2 else (str,) # noqa
-
-# Static subitems: all groups and datasets that are present in any
-# scan (excludes list of scans, data columns, list of mca devices,
-# optional mca headers, optional sample group)
-static_items = {
- "scan": [u"title", u"start_time", u"instrument",
- u"measurement"],
- "scan/instrument": [u"specfile", u"positioners"],
- "scan/instrument/specfile": [u"file_header", u"scan_header"],
- "scan/measurement/mca": [u"data", u"info"],
- "scan/instrument/mca": [u"data", u"calibration", u"channels"],
-}
-
-# Patterns for group keys
-root_pattern = re.compile(r"/$")
-scan_pattern = re.compile(r"/[0-9]+\.[0-9]+/?$")
-instrument_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/?$")
-sample_pattern = re.compile(r"/[0-9]+\.[0-9]+/sample/?$")
-specfile_group_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/specfile/?$")
-positioners_group_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/positioners/?$")
-measurement_group_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/?$")
-measurement_mca_group_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/mca_[0-9]+/?$")
-instrument_mca_group_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_[0-9]+/?$")
-
-
-# Link to group
-measurement_mca_info_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/mca_([0-9]+)/info/?$")
-
-# Patterns for dataset keys
-header_pattern = re.compile(r"/[0-9]+\.[0-9]+/header$")
-title_pattern = re.compile(r"/[0-9]+\.[0-9]+/title$")
-start_time_pattern = re.compile(r"/[0-9]+\.[0-9]+/start_time$")
-file_header_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/specfile/file_header$")
-scan_header_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/specfile/scan_header$")
-positioners_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/positioners/([^/]+)$")
-measurement_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/([^/]+)$")
-instrument_mca_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_([0-9]+)/data$")
-instrument_mca_calib_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_([0-9]+)/calibration$")
-instrument_mca_chann_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_([0-9])+/channels$")
-instrument_mca_preset_t_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_[0-9]+/preset_time$")
-instrument_mca_elapsed_t_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_[0-9]+/elapsed_time$")
-instrument_mca_live_t_pattern = re.compile(r"/[0-9]+\.[0-9]+/instrument/mca_[0-9]+/live_time$")
-ub_matrix_pattern = re.compile(r"/[0-9]+\.[0-9]+/sample/ub_matrix$")
-unit_cell_pattern = re.compile(r"/[0-9]+\.[0-9]+/sample/unit_cell$")
-unit_cell_abc_pattern = re.compile(r"/[0-9]+\.[0-9]+/sample/unit_cell_abc$")
-unit_cell_alphabetagamma_pattern = re.compile(r"/[0-9]+\.[0-9]+/sample/unit_cell_alphabetagamma$")
-
-# Links to dataset
-measurement_mca_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/mca_([0-9]+)/data$")
-# info/ + calibration, channel, preset_time, live_time, elapsed_time (not data)
-measurement_mca_info_dataset_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/mca_([0-9]+)/info/([^d/][^/]+)$")
-# info/data
-measurement_mca_info_data_pattern = re.compile(r"/[0-9]+\.[0-9]+/measurement/mca_([0-9]+)/info/data$")
-
-
-def _bulk_match(string_, list_of_patterns):
- """Check whether a string matches any regular expression pattern in a list
- """
- for pattern in list_of_patterns:
- if pattern.match(string_):
- return True
- return False
-
-
-def is_group(name):
- """Check if ``name`` matches a valid group name pattern in a
- :class:`SpecH5`.
-
- :param name: Full name of member
- :type name: str
-
- For example:
-
- - ``is_group("/123.456/instrument/")`` returns ``True``.
- - ``is_group("spam")`` returns ``False`` because :literal:`\"spam\"`
- is not at all a valid group name.
- - ``is_group("/1.2/instrument/positioners/xyz")`` returns ``False``
- because this key would point to a motor position, which is a
- dataset and not a group.
- """
- group_patterns = (
- root_pattern, scan_pattern, instrument_pattern,
- specfile_group_pattern, positioners_group_pattern,
- measurement_group_pattern, measurement_mca_group_pattern,
- instrument_mca_group_pattern, sample_pattern
- )
- return _bulk_match(name, group_patterns)
-
-
-def is_dataset(name):
- """Check if ``name`` matches a valid dataset name pattern in a
- :class:`SpecH5`.
-
- :param name: Full name of member
- :type name: str
-
- For example:
-
- - ``is_dataset("/1.2/instrument/positioners/xyz")`` returns ``True``
- because this name could be the key to the dataset recording motor
- positions for motor ``xyz`` in scan ``1.2``.
- - ``is_dataset("/123.456/instrument/")`` returns ``False`` because
- this name points to a group.
- - ``is_dataset("spam")`` returns ``False`` because :literal:`\"spam\"`
- is not at all a valid dataset name.
- """
- # Check groups first because /1.1/measurement/mca_0 could be interpreted
- # as a data column with label "mca_0"
- if measurement_mca_group_pattern.match(name):
- return False
-
- data_patterns = (
- header_pattern, title_pattern, start_time_pattern,
- file_header_data_pattern, scan_header_data_pattern,
- positioners_data_pattern, measurement_data_pattern,
- instrument_mca_data_pattern, instrument_mca_calib_pattern,
- instrument_mca_chann_pattern,
- instrument_mca_preset_t_pattern, instrument_mca_elapsed_t_pattern,
- instrument_mca_live_t_pattern,
- ub_matrix_pattern, unit_cell_pattern, unit_cell_abc_pattern, unit_cell_alphabetagamma_pattern
- )
- return _bulk_match(name, data_patterns)
-
-
-def is_link_to_group(name):
- """Check if ``name`` is a valid link to a group in a :class:`SpecH5`.
- Return ``True`` or ``False``
-
- :param name: Full name of member
- :type name: str
- """
- # so far we only have one type of link to a group
- if measurement_mca_info_pattern.match(name):
- return True
- return False
-
-
-def is_link_to_dataset(name):
- """Check if ``name`` is a valid link to a dataset in a :class:`SpecH5`.
- Return ``True`` or ``False``
-
- :param name: Full name of member
- :type name: str
- """
- list_of_link_patterns = (
- measurement_mca_data_pattern, measurement_mca_info_dataset_pattern,
- measurement_mca_info_data_pattern
- )
- return _bulk_match(name, list_of_link_patterns)
-
-
-def _get_attrs_dict(name):
- """Return attributes dictionary corresponding to the group or dataset
- pointed to by name.
-
- :param name: Full name/path to data or group
- :return: attributes dictionary
- """
- # Associate group and dataset patterns to their attributes
- pattern_attrs = {
- root_pattern:
- {"NX_class": "NXroot",
- },
- scan_pattern:
- {"NX_class": "NXentry", },
- title_pattern:
- {},
- start_time_pattern:
- {},
- instrument_pattern:
- {"NX_class": "NXinstrument", },
- specfile_group_pattern:
- {"NX_class": "NXcollection", },
- file_header_data_pattern:
- {},
- scan_header_data_pattern:
- {},
- positioners_group_pattern:
- {"NX_class": "NXcollection", },
- positioners_data_pattern:
- {},
- instrument_mca_group_pattern:
- {"NX_class": "NXdetector", },
- instrument_mca_data_pattern:
- {"interpretation": "spectrum", },
- instrument_mca_calib_pattern:
- {},
- instrument_mca_chann_pattern:
- {},
- instrument_mca_preset_t_pattern:
- {},
- instrument_mca_elapsed_t_pattern:
- {},
- instrument_mca_live_t_pattern:
- {},
- measurement_group_pattern:
- {"NX_class": "NXcollection", },
- measurement_data_pattern:
- {},
- measurement_mca_group_pattern:
- {},
- measurement_mca_data_pattern:
- {"interpretation": "spectrum", },
- measurement_mca_info_pattern:
- {"NX_class": "NXdetector", },
- measurement_mca_info_dataset_pattern:
- {},
- measurement_mca_info_data_pattern:
- {"interpretation": "spectrum"},
- sample_pattern:
- {"NX_class": "NXsample", },
- ub_matrix_pattern:
- {"interpretation": "scalar"},
- unit_cell_pattern:
- {"interpretation": "scalar"},
- unit_cell_abc_pattern:
- {"interpretation": "scalar"},
- unit_cell_alphabetagamma_pattern:
- {"interpretation": "scalar"},
- }
-
- for pattern in pattern_attrs:
- if pattern.match(name):
- return pattern_attrs[pattern]
-
- logger1.warning("%s not a known pattern, assigning empty dict to attrs",
- name)
- return {}
-
-
-def _get_scan_key_in_name(item_name):
- """
- :param item_name: Name of a group or dataset
- :return: Scan identification key (e.g. ``"1.1"``)
- :rtype: str on None
- """
- scan_match = re.match(r"/([0-9]+\.[0-9]+)", item_name)
- if not scan_match:
- return None
- return scan_match.group(1)
-
-
-def _get_mca_index_in_name(item_name):
- """
- :param item_name: Name of a group or dataset
- :return: MCA analyser index, ``None`` if item name does not reference
- a mca dataset
- :rtype: int or None
- """
- mca_match = re.match(r"/.*/mca_([0-9]+)[^0-9]*", item_name)
- if not mca_match:
- return None
- return int(mca_match.group(1))
-
-
-def _get_motor_in_name(item_name):
- """
- :param item_name: Name of a group or dataset
- :return: Motor name or ``None``
- :rtype: str on None
- """
- motor_match = positioners_data_pattern.match(item_name)
- if not motor_match:
- return None
- return motor_match.group(1)
-
-
-def _get_data_column_label_in_name(item_name):
- """
- :param item_name: Name of a group or dataset
- :return: Data column label or ``None``
- :rtype: str on None
- """
- # /1.1/measurement/mca_0 should not be interpreted as the label of a
- # data column (let's hope no-one ever uses mca_0 as a label)
- if measurement_mca_group_pattern.match(item_name):
- return None
- data_column_match = measurement_data_pattern.match(item_name)
- if not data_column_match:
- return None
- return data_column_match.group(1)
+integer_types = (int, long,) if sys.version_info[0] == 2 else (int,) # noqa
def _get_number_of_mca_analysers(scan):
"""
:param SpecFile sf: :class:`SpecFile` instance
- :param str scan_key: Scan identification key (e.g. ``1.1``)
"""
- number_of_MCA_spectra = len(scan.mca)
+ number_of_mca_spectra = len(scan.mca)
# Scan.data is transposed
number_of_data_lines = scan.data.shape[1]
if not number_of_data_lines == 0:
# Number of MCA spectra must be a multiple of number of data lines
- assert number_of_MCA_spectra % number_of_data_lines == 0
- return number_of_MCA_spectra // number_of_data_lines
- elif number_of_MCA_spectra:
+ assert number_of_mca_spectra % number_of_data_lines == 0
+ return number_of_mca_spectra // number_of_data_lines
+ elif number_of_mca_spectra:
# Case of a scan without data lines, only MCA.
# Our only option is to assume that the number of analysers
# is the number of #@CHANN lines
@@ -503,25 +223,6 @@ def _get_number_of_mca_analysers(scan):
return 0
-def _mca_analyser_in_scan(sf, scan_key, mca_analyser_index):
- """
- :param sf: :class:`SpecFile` instance
- :param scan_key: Scan identification key (e.g. ``1.1``)
- :param mca_analyser_index: 0-based index of MCA analyser
- :return: ``True`` if MCA analyser exists in Scan, else ``False``
- :raise: ``KeyError`` if scan_key not found in SpecFile
- :raise: ``AssertionError`` if number of MCA spectra is not a multiple
- of the number of data lines
- """
- if scan_key not in sf:
- raise KeyError("Scan key %s " % scan_key +
- "does not exist in SpecFile %s" % sf.filename)
-
- number_of_analysers = _get_number_of_mca_analysers(sf[scan_key])
-
- return 0 <= mca_analyser_index < number_of_analysers
-
-
def _motor_in_scan(sf, scan_key, motor_name):
"""
:param sf: :class:`SpecFile` instance
@@ -558,6 +259,41 @@ def _column_label_in_scan(sf, scan_key, column_label):
return ret
+def _parse_UB_matrix(header_line):
+ """Parse G3 header line and return UB matrix
+
+ :param str header_line: G3 header line
+ :return: UB matrix
+ """
+ return numpy.array(list(map(float, header_line.split()))).reshape((1, 3, 3))
+
+
+def _ub_matrix_in_scan(scan):
+ """Return True if scan header has a G3 line and all values are not 0.
+
+ :param scan: specfile.Scan instance
+ :return: True or False
+ """
+ if "G3" not in scan.scan_header_dict:
+ return False
+ return numpy.any(_parse_UB_matrix(scan.scan_header_dict["G3"]))
+
+
+def _parse_unit_cell(header_line):
+ return numpy.array(list(map(float, header_line.split()))[0:6]).reshape((1, 6))
+
+
+def _unit_cell_in_scan(scan):
+ """Return True if scan header has a G1 line and all values are not 0.
+
+ :param scan: specfile.Scan instance
+ :return: True or False
+ """
+ if "G1" not in scan.scan_header_dict:
+ return False
+ return numpy.any(_parse_unit_cell(scan.scan_header_dict["G1"]))
+
+
def _parse_ctime(ctime_lines, analyser_index=0):
"""
:param ctime_lines: e.g ``@CTIME %f %f %f``, first word ``@CTIME`` optional
@@ -670,965 +406,422 @@ def spec_date_to_iso8601(date, zone=None):
return full_date
-def _fixed_length_strings(strings, length=0):
- """Return list of fixed length strings, left-justified and right-padded
- with spaces.
+def _demultiplex_mca(scan, analyser_index):
+ """Return MCA data for a single analyser.
- :param strings: List of variable length strings
- :param length: Length of strings in returned list, defaults to the maximum
- length in the original list if set to 0.
- :type length: int or None
+ Each MCA spectrum is a 1D array. For each analyser, there is one
+ spectrum recorded per scan data line. When there are more than a single
+ MCA analyser in a scan, the data will be multiplexed. For instance if
+ there are 3 analysers, the consecutive spectra for the first analyser must
+ be accessed as ``mca[0], mca[3], mca[6]…``.
+
+ :param scan: :class:`Scan` instance containing the MCA data
+ :param analyser_index: 0-based index referencing the analyser
+ :type analyser_index: int
+ :return: 2D numpy array containing all spectra for one analyser
"""
- if length == 0 and strings:
- length = max(len(s) for s in strings)
- return [s.ljust(length) for s in strings]
+ number_of_analysers = _get_number_of_mca_analysers(scan)
+ number_of_spectra = len(scan.mca)
+ number_of_spectra_per_analyser = number_of_spectra // number_of_analysers
+ len_spectrum = len(scan.mca[analyser_index])
+ mca_array = numpy.empty((number_of_spectra_per_analyser, len_spectrum))
-class SpecH5Dataset(object):
- """Emulate :class:`h5py.Dataset` for a SpecFile object.
+ for i in range(number_of_spectra_per_analyser):
+ mca_array[i, :] = scan.mca[analyser_index + i * number_of_analysers]
- A :class:`SpecH5Dataset` instance is basically a proxy for the numpy
- array :attr:`value` attribute, with additional attributes for
- compatibility with *h5py* datasets.
+ return mca_array
- :param value: Actual dataset value
- :param name: Dataset full name (posix path format, starting with ``/``)
- :type name: str
- :param file_: Parent :class:`SpecH5`
- :param parent: Parent :class:`SpecH5Group` which contains this dataset
- """
- def __init__(self, value, name, file_, parent):
- object.__init__(self)
- self.value = None
- """Actual dataset, can be a *numpy array*, a *numpy.string_*,
- a *numpy.int_* or a *numpy.float32*
+# Node classes
+class SpecH5Dataset(object):
+ """This convenience class is to be inherited by all datasets, for
+ compatibility purpose with code that tests for
+ ``isinstance(obj, SpecH5Dataset)``.
+
+ This legacy behavior is deprecated. The correct way to test
+ if an object is a dataset is to use :meth:`silx.io.utils.is_dataset`.
+
+ Datasets must also inherit :class:`SpecH5NodeDataset` or
+ :class:`SpecH5LazyNodeDataset` which actually implement all the
+ API."""
+ pass
- All operations applied to an instance of the class use this."""
+class SpecH5NodeDataset(commonh5.Dataset, SpecH5Dataset):
+ """This class inherits :class:`commonh5.Dataset`, to which it adds
+ little extra functionality. The main additional functionality is the
+ proxy behavior that allows to mimic the numpy array stored in this
+ class.
+ """
+ def __init__(self, name, data, parent=None, attrs=None):
# get proper value types, to inherit from numpy
# attributes (dtype, shape, size)
- if isinstance(value, string_types):
+ if isinstance(data, string_types):
# use bytes for maximum compatibility
# (see http://docs.h5py.org/en/latest/strings.html)
- self.value = numpy.string_(value)
- elif isinstance(value, float):
+ value = numpy.string_(data)
+ elif isinstance(data, float):
# use 32 bits for float scalars
- self.value = numpy.float32(value)
- elif isinstance(value, int):
- self.value = numpy.int_(value)
+ value = numpy.float32(data)
+ elif isinstance(data, int):
+ value = numpy.int_(data)
else:
# Enforce numpy array
- array = numpy.array(value)
+ array = numpy.array(data)
data_kind = array.dtype.kind
if data_kind in ["S", "U"]:
- self.value = numpy.asarray(array, dtype=numpy.string_)
+ value = numpy.asarray(array, dtype=numpy.string_)
elif data_kind in ["f"]:
- self.value = numpy.asarray(array, dtype=numpy.float32)
+ value = numpy.asarray(array, dtype=numpy.float32)
else:
- self.value = array
-
- # numpy array attributes (more attributes handled in __getattribute__)
- self.shape = self.value.shape
- """Dataset shape, as a tuple with the length of each dimension
- of the dataset."""
-
- self.dtype = self.value.dtype
- """Dataset dtype"""
+ value = array
+ commonh5.Dataset.__init__(self, name, value, parent, attrs)
- self.size = self.value.size
- """Dataset size (number of elements)"""
-
- # h5py dataset specific attributes
- self.name = name
- """"Dataset name (posix path format, starting with ``/``)"""
-
- self.parent = parent
- """Parent :class:`SpecH5Group` object which contains this dataset"""
-
- self.file = file_
- """Parent :class:`SpecH5` object"""
-
- self.attrs = _get_attrs_dict(name)
- """Attributes dictionary"""
-
- self.compression = None
- """Compression attribute as provided by h5py.Dataset"""
-
- self.compression_opts = None
- """Compression options attribute as provided by h5py.Dataset"""
-
- self.chunks = None
-
- @property
- def h5py_class(self):
- """Return h5py class which is mimicked by this class:
- :class:`h5py.dataset`.
-
- Accessing this attribute if :mod:`h5py` is not installed causes
- an ``ImportError`` to be raised
+ def __getattr__(self, item):
+ """Proxy to underlying numpy array methods.
"""
- if h5py is None:
- raise ImportError("Cannot return h5py.Dataset class, " +
- "unable to import h5py module")
- return h5py.Dataset
-
- def __getattribute__(self, item):
- if item in ["value", "name", "parent", "file", "attrs",
- "shape", "dtype", "size", "h5py_class",
- "chunks", "compression", "compression_opts",
- "target"]:
- return object.__getattribute__(self, item)
-
- if hasattr(self.value, item):
- return getattr(self.value, item)
+ if hasattr(self[()], item):
+ return getattr(self[()], item)
raise AttributeError("SpecH5Dataset has no attribute %s" % item)
- def __len__(self):
- return len(self.value)
-
- def __getitem__(self, item):
- if not isinstance(self.value, numpy.ndarray):
- if item == Ellipsis:
- return numpy.array(self.value)
- elif item == tuple():
- return self.value
- else:
- raise ValueError("Scalar can only be reached with an ellipsis or an empty tuple")
- return self.value.__getitem__(item)
-
- def __getslice__(self, i, j):
- # deprecated but still in use for python 2.7
- return self.__getitem__(slice(i, j, None))
-
- def __iter__(self):
- return self.value.__iter__()
-
- def __dir__(self):
- attrs = set(dir(self.value) +
- ["value", "name", "parent", "file",
- "attrs", "shape", "dtype", "size",
- "h5py_class", "chunks", "compression",
- "compression_opts"])
- return sorted(attrs)
-
- # casting
- def __repr__(self):
- return '<SpecH5Dataset "%s": shape %s, type "%s">' % \
- (self.name, self.shape, self.dtype.str)
-
- def __float__(self):
- return float(self.value)
-
- def __int__(self):
- return int(self.value)
-
- def __str__(self):
- basename = self.name.split("/")[-1]
- return '<SPEC dataset "%s": shape %s, type "%s">' % \
- (basename, self.shape, self.dtype.str)
-
- def __bool__(self):
- if self.value:
- return True
- return False
-
- def __nonzero__(self):
- # python 2
- return self.__bool__()
-
- def __array__(self, dtype=None):
- if dtype is None:
- return numpy.array(self.value)
- else:
- return numpy.array(self.value, dtype=dtype)
-
- # comparisons
- def __eq__(self, other):
- if hasattr(other, "value"):
- return self.value == other.value
- else:
- return self.value == other
- def __ne__(self, other):
- if hasattr(other, "value"):
- return self.value != other.value
- else:
- return self.value != other
+class SpecH5LazyNodeDataset(commonh5.LazyLoadableDataset, SpecH5Dataset):
+ """This class inherits :class:`commonh5.LazyLoadableDataset`,
+ to which it adds a proxy behavior that allows to mimic the numpy
+ array stored in this class.
- def __lt__(self, other):
- if hasattr(other, "value"):
- return self.value < other.value
- else:
- return self.value < other
+ The class has to be inherited and the :meth:`_create_data` method has to be
+ implemented to return the numpy data exposed by the dataset. This factory
+ method is only called once, when the data is needed.
+ """
+ def __getattr__(self, item):
+ """Proxy to underlying numpy array methods.
+ """
+ if hasattr(self[()], item):
+ return getattr(self[()], item)
- def __le__(self, other):
- if hasattr(other, "value"):
- return self.value <= other.value
- else:
- return self.value <= other
+ raise AttributeError("SpecH5Dataset has no attribute %s" % item)
- def __gt__(self, other):
- if hasattr(other, "value"):
- return self.value > other.value
- else:
- return self.value > other
+ def _create_data(self):
+ """
+ Factory to create the data exposed by the dataset when it is needed.
- def __ge__(self, other):
- if hasattr(other, "value"):
- return self.value >= other.value
- else:
- return self.value >= other
+ It has to be implemented for the class to work.
- # operations
- def __add__(self, other):
- return self.value + other
+ :rtype: numpy.ndarray
+ """
+ raise NotImplementedError()
- def __radd__(self, other):
- return other + self.value
- def __sub__(self, other):
- return self.value - other
+class SpecH5Group(object):
+ """This convenience class is to be inherited by all groups, for
+ compatibility purposes with code that tests for
+ ``isinstance(obj, SpecH5Group)``.
- def __rsub__(self, other):
- return other - self.value
+ This legacy behavior is deprecated. The correct way to test
+ if an object is a group is to use :meth:`silx.io.utils.is_group`.
- def __mul__(self, other):
- return self.value * other
+ Groups must also inherit :class:`silx.io.commonh5.Group`, which
+ actually implements all the methods and attributes."""
+ pass
- def __rmul__(self, other):
- return other * self.value
- def __truediv__(self, other):
- return self.value / other
+class SpecH5(commonh5.File, SpecH5Group):
+ """This class opens a SPEC file and exposes it as a *h5py.File*.
- def __rtruediv__(self, other):
- return other / self.value
+ It inherits :class:`silx.io.commonh5.Group` (via :class:`commonh5.File`),
+ which implements most of its API.
+ """
- def __floordiv__(self, other):
- return self.value // other
+ def __init__(self, filename):
+ """
+ :param filename: Path to SpecFile in filesystem
+ :type filename: str
+ """
+ if isinstance(filename, io.IOBase):
+ # see https://github.com/silx-kit/silx/issues/858
+ filename = filename.name
- def __rfloordiv__(self, other):
- return other // self.value
+ self._sf = SpecFile(filename)
- # unary operations
- def __neg__(self):
- return -self.value
+ attrs = {"NX_class": "NXroot",
+ "file_time": datetime.datetime.now().isoformat(),
+ "file_name": filename,
+ "creator": "silx %s" % silx_version}
+ commonh5.File.__init__(self, filename, attrs=attrs)
+ assert self.attrs["NX_class"] == "NXroot"
- def __abs__(self):
- return abs(self.value)
+ for scan_key in self._sf.keys():
+ scan = self._sf[scan_key]
+ scan_group = ScanGroup(scan_key, parent=self, scan=scan)
+ self.add_node(scan_group)
+ def close(self):
+ # or del self._sf?
+ self._sf = None
-class SpecH5LinkToDataset(SpecH5Dataset):
- """Special :class:`SpecH5Dataset` representing a link to a dataset. It
- works like a regular dataset, but :meth:`SpecH5Group.visit`
- and :meth:`SpecH5Group.visititems` methods will recognize that it is
- a link and will ignore it.
- A special attribute contains the name of the target dataset:
- :attr:`target`
- """
- def __init__(self, value, name, file_, parent, target):
- """
- :param value: Actual dataset value
- :param name: Dataset full name (posix path format, starting with ``/``)
- :type name: str
- :param file_: Parent :class:`SpecH5`
- :param parent: Parent :class:`SpecH5Group` which contains this dataset
- :param str target: Name of linked dataset
+class ScanGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, scan_key, parent, scan):
"""
- SpecH5Dataset.__init__(self, value, name, file_, parent)
- self.target = target
- """Name of the target dataset"""
-
-def _dataset_builder(name, specfileh5, parent_group):
- """Retrieve dataset from :class:`SpecFile`, based on dataset name, as a
- subclass of :class:`numpy.ndarray`.
-
- :param name: Datatset full name (posix path format, starting with ``/``)
- :type name: str
- :param specfileh5: parent :class:`SpecH5` object
- :type specfileh5: :class:`SpecH5`
- :param parent_group: Parent :class:`SpecH5Group`
-
- :return: Array with the requested data
- :rtype: :class:`SpecH5Dataset`.
- """
- scan_key = _get_scan_key_in_name(name)
- scan = specfileh5._sf[scan_key]
-
- # get dataset in an array-like format (ndarray, str, list…)
- array_like = None
+ :param parent: parent Group
+ :param str scan_key: Scan key (e.g. "1.1")
+ :param scan: specfile.Scan object
+ """
+ commonh5.Group.__init__(self, scan_key, parent=parent,
+ attrs={"NX_class": "NXentry"})
- if title_pattern.match(name):
- array_like = scan.scan_header_dict["S"]
+ self.add_node(SpecH5NodeDataset(name="title",
+ data=scan.scan_header_dict["S"],
+ parent=self))
- elif start_time_pattern.match(name):
if "D" in scan.scan_header_dict:
try:
- array_like = spec_date_to_iso8601(scan.scan_header_dict["D"])
+ start_time_str = spec_date_to_iso8601(scan.scan_header_dict["D"])
except (IndexError, ValueError):
logger1.warn("Could not parse date format in scan %s header." +
" Using original date not converted to ISO-8601",
scan_key)
- array_like = scan.scan_header_dict["D"]
+ start_time_str = scan.scan_header_dict["D"]
elif "D" in scan.file_header_dict:
logger1.warn("No #D line in scan %s header. " +
"Using file header for start_time.",
scan_key)
try:
- array_like = spec_date_to_iso8601(scan.file_header_dict["D"])
+ start_time_str = spec_date_to_iso8601(scan.file_header_dict["D"])
except (IndexError, ValueError):
logger1.warn("Could not parse date format in scan %s header. " +
"Using original date not converted to ISO-8601",
scan_key)
- array_like = scan.file_header_dict["D"]
+ start_time_str = scan.file_header_dict["D"]
else:
logger1.warn("No #D line in %s header. Setting date to empty string.",
scan_key)
- array_like = ""
-
- elif file_header_data_pattern.match(name):
- # array_like = _fixed_length_strings(scan.file_header)
- array_like = "\n".join(scan.file_header)
-
- elif scan_header_data_pattern.match(name):
- # array_like = _fixed_length_strings(scan.scan_header)
- array_like = "\n".join(scan.scan_header)
-
- elif positioners_data_pattern.match(name):
- m = positioners_data_pattern.match(name)
- motor_name = m.group(1)
- if motor_name not in (scan.labels + scan.motor_names):
- if "%" in motor_name:
- motor_name = motor_name.replace("%", "/")
- # if a motor is recorded as a data column, ignore its position in
- # header and return the data column instead
- if motor_name in scan.labels and scan.data.shape[0] > 0:
- array_like = scan.data_column_by_name(motor_name)
- else:
- # may return float("inf") if #P line is missing from scan hdr
- array_like = scan.motor_position_by_name(motor_name)
-
- elif measurement_data_pattern.match(name):
- m = measurement_data_pattern.match(name)
- column_name = m.group(1)
- if column_name not in scan.labels:
- if "%" in column_name:
- column_name = column_name.replace("%", "/")
- array_like = scan.data_column_by_name(column_name)
-
- elif instrument_mca_data_pattern.match(name):
- m = instrument_mca_data_pattern.match(name)
-
- analyser_index = int(m.group(1))
- # retrieve 2D array of all MCA spectra from one analyser
- array_like = _demultiplex_mca(scan, analyser_index)
-
- elif instrument_mca_calib_pattern.match(name):
- m = instrument_mca_calib_pattern.match(name)
- analyser_index = int(m.group(1))
- if len(scan.mca.channels) == 1:
- # single @CALIB line applying to multiple devices
- analyser_index = 0
- array_like = scan.mca.calibration[analyser_index]
-
- elif instrument_mca_chann_pattern.match(name):
- m = instrument_mca_chann_pattern.match(name)
- analyser_index = int(m.group(1))
- if len(scan.mca.channels) == 1:
- # single @CHANN line applying to multiple devices
- analyser_index = 0
- array_like = scan.mca.channels[analyser_index]
-
- elif ub_matrix_pattern.match(name):
- if not "G3" in scan.scan_header_dict:
- raise KeyError("No UB matrix in a scan without a #G3 header line")
- array_like = numpy.array(
- list(map(float, scan.scan_header_dict["G3"].split()))).reshape((1, 3, 3))
- elif unit_cell_pattern.match(name):
- if not "G1" in scan.scan_header_dict:
- raise KeyError(
- "No unit_cell matrix in a scan without a #G1 header line")
- array_like = numpy.array(
- list(map(float, scan.scan_header_dict["G1"].split()))[0:6]).reshape((1, 6))
- elif unit_cell_abc_pattern.match(name):
- if not "G1" in scan.scan_header_dict:
- raise KeyError(
- "No unit_cell matrix in a scan without a #G1 header line")
- array_like = numpy.array(
- list(map(float, scan.scan_header_dict["G1"].split()))[0:3]).reshape((3,))
- elif unit_cell_alphabetagamma_pattern.match(name):
- if not "G1" in scan.scan_header_dict:
- raise KeyError(
- "No unit_cell matrix in a scan without a #G1 header line")
- array_like = numpy.array(
- list(map(float, scan.scan_header_dict["G1"].split()))[3:6]).reshape((3,))
- elif "CTIME" in scan.mca_header_dict and "mca_" in name:
- m = re.compile(r"/.*/mca_([0-9]+)/.*").match(name)
- analyser_index = int(m.group(1))
-
- ctime_line = scan.mca_header_dict['CTIME']
- (preset_time, live_time, elapsed_time) = _parse_ctime(ctime_line, analyser_index)
- if instrument_mca_preset_t_pattern.match(name):
- array_like = preset_time
- elif instrument_mca_live_t_pattern.match(name):
- array_like = live_time
- elif instrument_mca_elapsed_t_pattern.match(name):
- array_like = elapsed_time
-
- if array_like is None:
- raise KeyError("Name " + name + " does not match any known dataset.")
-
- return SpecH5Dataset(array_like, name,
- file_=specfileh5, parent=parent_group)
-
-
-def _link_to_dataset_builder(name, specfileh5, parent_group):
- """Same as :func:`_dataset_builder`, but returns a
- :class:`SpecH5LinkToDataset`
-
- :param name: Datatset full name (posix path format, starting with ``/``)
- :type name: str
- :param specfileh5: parent :class:`SpecH5` object
- :type specfileh5: :class:`SpecH5`
- :param parent_group: Parent :class:`SpecH5Group`
-
- :return: Array with the requested data
- :rtype: :class:`SpecH5LinkToDataset`.
- """
- scan_key = _get_scan_key_in_name(name)
- scan = specfileh5._sf[scan_key]
-
- # get dataset in an array-like format (ndarray, str, list…)
- array_like = None
-
- # /1.1/measurement/mca_0/data -> /1.1/instrument/mca_0/data
- if measurement_mca_data_pattern.match(name):
- m = measurement_mca_data_pattern.match(name)
- analyser_index = int(m.group(1))
- array_like = _demultiplex_mca(scan, analyser_index)
-
- # /1.1/measurement/mca_0/info/X -> /1.1/instrument/mca_0/X
- # X: calibration, channels, preset_time, live_time, elapsed_time
- elif measurement_mca_info_dataset_pattern.match(name):
- m = measurement_mca_info_dataset_pattern.match(name)
- analyser_index = int(m.group(1))
- mca_hdr_type = m.group(2)
-
- if mca_hdr_type == "calibration":
- if len(scan.mca.calibration) == 1:
- # single @CALIB line for multiple devices
- analyser_index = 0
- array_like = scan.mca.calibration[analyser_index]
-
- elif mca_hdr_type == "channels":
- if len(scan.mca.channels) == 1:
- # single @CHANN line for multiple devices
- analyser_index = 0
- array_like = scan.mca.channels[analyser_index]
-
- elif "CTIME" in scan.mca_header_dict:
- ctime_line = scan.mca_header_dict['CTIME']
- (preset_time, live_time, elapsed_time) = _parse_ctime(ctime_line,
- analyser_index)
- if mca_hdr_type == "preset_time":
- array_like = preset_time
- elif mca_hdr_type == "live_time":
- array_like = live_time
- elif mca_hdr_type == "elapsed_time":
- array_like = elapsed_time
-
- # /1.1/measurement/mca_0/info/data -> /1.1/instrument/mca_0/data
- elif measurement_mca_info_data_pattern.match(name):
- m = measurement_mca_info_data_pattern.match(name)
- analyser_index = int(m.group(1))
- array_like = _demultiplex_mca(scan, analyser_index)
-
- if array_like is None:
- raise KeyError("Name " + name + " does not match any known dataset.")
+ start_time_str = ""
+ self.add_node(SpecH5NodeDataset(name="start_time",
+ data=start_time_str,
+ parent=self))
- target = name.replace("measurement", "instrument")
- target = target.replace("info/", "")
+ self.add_node(InstrumentGroup(parent=self, scan=scan))
+ self.add_node(MeasurementGroup(parent=self, scan=scan))
+ if _unit_cell_in_scan(scan) or _ub_matrix_in_scan(scan):
+ self.add_node(SampleGroup(parent=self, scan=scan))
- return SpecH5LinkToDataset(array_like, name,
- file_=specfileh5, parent=parent_group,
- target=target)
-
-def _demultiplex_mca(scan, analyser_index):
- """Return MCA data for a single analyser.
-
- Each MCA spectrum is a 1D array. For each analyser, there is one
- spectrum recorded per scan data line. When there are more than a single
- MCA analyser in a scan, the data will be multiplexed. For instance if
- there are 3 analysers, the consecutive spectra for the first analyser must
- be accessed as ``mca[0], mca[3], mca[6]…``.
-
- :param scan: :class:`Scan` instance containing the MCA data
- :param analyser_index: 0-based index referencing the analyser
- :type analyser_index: int
- :return: 2D numpy array containing all spectra for one analyser
- """
- number_of_analysers = _get_number_of_mca_analysers(scan)
-
- number_of_MCA_spectra = len(scan.mca)
-
- list_of_1D_arrays = []
- for i in range(analyser_index,
- number_of_MCA_spectra,
- number_of_analysers):
- list_of_1D_arrays.append(scan.mca[i])
- # convert list to 2D array
- return numpy.array(list_of_1D_arrays)
-
-
-class SpecH5Group(object):
- """Emulate :class:`h5py.Group` for a SpecFile object
-
- :param name: Group full name (posix path format, starting with ``/``)
- :type name: str
- :param specfileh5: parent :class:`SpecH5` instance
-
- """
- def __init__(self, name, specfileh5):
- self.name = name
- """Full name/path of group"""
-
- self.file = specfileh5
- """Parent SpecH5 object"""
-
- self.attrs = _get_attrs_dict(name)
- """Attributes dictionary"""
-
- if name != "/":
- if name not in specfileh5:
- raise KeyError("File %s does not contain group %s" %
- (specfileh5, name))
- scan_key = _get_scan_key_in_name(name)
- self._scan = self.file._sf[scan_key]
-
- @property
- def h5py_class(self):
- """Return h5py class which is mimicked by this class:
- :class:`h5py.Group`.
-
- Accessing this attribute if :mod:`h5py` is not installed causes
- an ``ImportError`` to be raised
- """
- if h5py is None:
- raise ImportError("Cannot return h5py.Group class, " +
- "unable to import h5py module")
- return h5py.Group
-
- @property
- def parent(self):
- """Parent group (group that contains this group)"""
- if not self.name.strip("/"):
- return None
-
- parent_name = posixpath.dirname(self.name.rstrip("/"))
- return SpecH5Group(parent_name, self.file)
-
- def __contains__(self, key):
+class InstrumentGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, scan):
"""
- :param key: Path to child element (e.g. ``"mca_0/info"``) or full name
- of group or dataset (e.g. ``"/2.1/instrument/positioners"``)
- :return: True if key refers to a valid member of this group,
- else False
- """
- # Absolute path to an item outside this group
- if key.startswith("/"):
- if not key.startswith(self.name):
- return False
- # Make sure key is an absolute path by prepending this group's name
- else:
- key = self.name.rstrip("/") + "/" + key
-
- # key not matching any known pattern
- if not is_group(key) and not is_dataset(key) and\
- not is_link_to_group(key) and not is_link_to_dataset(key):
- return False
-
- # nonexistent scan in specfile
- scan_key = _get_scan_key_in_name(key)
- if scan_key not in self.file._sf:
- return False
-
- # nonexistent MCA analyser in scan
- mca_analyser_index = _get_mca_index_in_name(key)
- if mca_analyser_index is not None:
- if not _mca_analyser_in_scan(self.file._sf,
- scan_key,
- mca_analyser_index):
- return False
-
- # nonexistent motor name
- motor_name = _get_motor_in_name(key)
- if motor_name is not None:
- if not _motor_in_scan(self.file._sf,
- scan_key,
- motor_name):
- return False
-
- # nonexistent data column
- column_label = _get_data_column_label_in_name(key)
- if column_label is not None:
- if not _column_label_in_scan(self.file._sf,
- scan_key,
- column_label):
- return False
-
- if key.endswith("preset_time") or\
- key.endswith("elapsed_time") or\
- key.endswith("live_time"):
- return "CTIME" in self.file._sf[scan_key].mca_header_dict
-
- if sample_pattern.match(key):
- return ("G3" in self.file._sf[scan_key].scan_header_dict or
- "G1" in self.file._sf[scan_key].scan_header_dict)
-
- if key.endswith("sample/ub_matrix"):
- return "G3" in self.file._sf[scan_key].scan_header_dict
-
- if key.endswith("sample/unit_cell"):
- return "G1" in self.file._sf[scan_key].scan_header_dict
-
- if key.endswith("sample/unit_cell_abc"):
- return "G1" in self.file._sf[scan_key].scan_header_dict
-
-
- if key.endswith("sample/unit_cell_alphabetagamma"):
- return "G1" in self.file._sf[scan_key].scan_header_dict
-
- # header, title, start_time, existing scan/mca/motor/measurement
- return True
-
- def __eq__(self, other):
- return (isinstance(other, SpecH5Group) and
- self.name == other.name and
- self.file.filename == other.file.filename and
- self.keys() == other.keys())
-
- def get(self, name, default=None, getclass=False, getlink=False):
- """Retrieve an item by name, or a default value if name does not
- point to an existing item.
-
- :param name str: name of the item
- :param default: Default value returned if the name is not found
- :param bool getclass: if *True*, the returned object is the class of
- the item, instead of the item instance.
- :param bool getlink: Not implemented. This method always returns
- an instance of the original class of the requested item (or
- just the class, if *getclass* is *True*)
- :return: The requested item, or its class if *getclass* is *True*,
- or the specified *default* value if the group does not contain
- an item with the requested name.
- """
- if name not in self:
- return default
-
- if getlink and getclass:
- pass
-
- if getclass:
- return self[name].h5py_class
-
- return self[name]
-
- def __getitem__(self, key):
- """Return a :class:`SpecH5Group` or a :class:`SpecH5Dataset`
- if ``key`` is a valid name of a group or dataset.
-
- ``key`` can be a member of ``self.keys()``, i.e. an immediate child of
- the group, or a path reaching into subgroups (e.g.
- ``"instrument/positioners"``)
-
- In the special case were this group is the root group, ``key`` can
- start with a ``/`` character.
- :param key: Name of member
- :type key: str
- :raise: KeyError if ``key`` is not a known member of this group.
+ :param parent: parent Group
+ :param scan: specfile.Scan object
"""
- # accept numbers for scan indices
- if isinstance(key, int):
- number = self.file._sf.number(key)
- order = self.file._sf.order(key)
- full_key = "/%d.%d" % (number, order)
- # Relative path starting from this group (e.g "mca_0/info")
- elif not key.startswith("/"):
- full_key = self.name.rstrip("/") + "/" + key
- # Absolute path called from the root group or from a parent group
- elif key.startswith(self.name):
- full_key = key
- # Absolute path to an element called from a non-parent group
- else:
- raise KeyError(key + " is not a child of " + self.__repr__())
-
- if is_group(full_key):
- return SpecH5Group(full_key, self.file)
- elif is_dataset(full_key):
- return _dataset_builder(full_key, self.file, self)
- elif is_link_to_group(full_key):
- link_target = full_key.replace("measurement", "instrument").rstrip("/")[:-4]
- return SpecH5LinkToGroup(full_key, self.file, link_target)
- elif is_link_to_dataset(full_key):
- return _link_to_dataset_builder(full_key, self.file, self)
- else:
- raise KeyError("unrecognized group or dataset: " + full_key)
+ commonh5.Group.__init__(self, name="instrument", parent=parent,
+ attrs={"NX_class": "NXinstrument"})
+
+ self.add_node(InstrumentSpecfileGroup(parent=self, scan=scan))
+ self.add_node(PositionersGroup(parent=self, scan=scan))
+
+ num_analysers = _get_number_of_mca_analysers(scan)
+ for anal_idx in range(num_analysers):
+ self.add_node(InstrumentMcaGroup(parent=self,
+ analyser_index=anal_idx,
+ scan=scan))
+
+
+class InstrumentSpecfileGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, scan):
+ commonh5.Group.__init__(self, name="specfile", parent=parent,
+ attrs={"NX_class": "NXcollection"})
+ self.add_node(SpecH5NodeDataset(name="file_header",
+ data="\n".join(scan.file_header),
+ parent=self,
+ attrs={}))
+ self.add_node(SpecH5NodeDataset(name="scan_header",
+ data="\n".join(scan.scan_header),
+ parent=self,
+ attrs={}))
+
+
+class PositionersGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, scan):
+ commonh5.Group.__init__(self, name="positioners", parent=parent,
+ attrs={"NX_class": "NXcollection"})
+ for motor_name in scan.motor_names:
+ safe_motor_name = motor_name.replace("/", "%")
+ if motor_name in scan.labels and scan.data.shape[0] > 0:
+ # return a data column if one has the same label as the motor
+ motor_value = scan.data_column_by_name(motor_name)
+ else:
+ # Take value from #P scan header.
+ # (may return float("inf") if #P line is missing from scan hdr)
+ motor_value = scan.motor_position_by_name(motor_name)
+ self.add_node(SpecH5NodeDataset(name=safe_motor_name,
+ data=motor_value,
+ parent=self))
- def __iter__(self):
- for key in self.keys():
- yield key
- def items(self):
- for key in self.keys():
- yield key, self[key]
+class InstrumentMcaGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, analyser_index, scan):
+ name = "mca_%d" % analyser_index
+ commonh5.Group.__init__(self, name=name, parent=parent,
+ attrs={"NX_class": "NXdetector"})
- def __len__(self):
- """Return number of members, subgroups and datasets, attached to this
- group.
- """
- return len(self.keys())
+ self.add_node(McaDataDataset(parent=self,
+ analyser_index=analyser_index,
+ scan=scan))
- def __repr__(self):
- return '<SpecH5Group "%s" (%d members)>' % (self.name, len(self))
-
- def keys(self):
- """:return: List of all names of members attached to this group
- """
- # keys in hdf5 are unicode
- if self.name == "/":
- return self.file.keys()
-
- if scan_pattern.match(self.name):
- ret = static_items["scan"]
- if "G1" in self._scan.scan_header_dict or "G3" in self._scan.scan_header_dict:
- return ret + [u"sample"]
- return ret
-
- if positioners_group_pattern.match(self.name):
- motor_names = self._scan.motor_names
- return [name.replace("/", "%") for name in motor_names]
-
- if specfile_group_pattern.match(self.name):
- return static_items["scan/instrument/specfile"]
-
- if measurement_mca_group_pattern.match(self.name):
- return static_items["scan/measurement/mca"]
-
- if instrument_mca_group_pattern.match(self.name):
- ret = static_items["scan/instrument/mca"]
- if "CTIME" in self._scan.mca_header_dict:
- return ret + [u"preset_time", u"elapsed_time", u"live_time"]
- return ret
-
- if sample_pattern.match(self.name):
- ret = []
- if "G1" in self._scan.scan_header_dict:
- ret.append(u"unit_cell")
- ret.append(u"unit_cell_abc")
- ret.append(u"unit_cell_alphabetagamma")
- if "G3" in self._scan.scan_header_dict:
- ret.append(u"ub_matrix")
- return ret
-
- number_of_MCA_spectra = len(self._scan.mca)
- number_of_data_lines = self._scan.data.shape[1]
-
- if not number_of_data_lines == 0:
- # Number of MCA spectra must be a multiple of number of data lines
- assert number_of_MCA_spectra % number_of_data_lines == 0
- number_of_MCA_analysers = number_of_MCA_spectra // number_of_data_lines
- elif number_of_MCA_spectra:
- # Case of a scan without data lines, only MCA.
- # Our only option is to assume that the number of analysers
- # is the number of #@CHANN lines
- number_of_MCA_analysers = len(self._scan.mca.channels)
+ if len(scan.mca.channels) == 1:
+ # single @CALIB line applying to multiple devices
+ calibration_dataset = scan.mca.calibration[0]
+ channels_dataset = scan.mca.channels[0]
else:
- number_of_MCA_analysers = 0
-
- mca_list = ["mca_%d" % i for i in range(number_of_MCA_analysers)]
-
- if measurement_group_pattern.match(self.name):
- scan_labels = self._scan.labels
- return [label.replace("/", "%") for label in scan_labels] + mca_list
-
- if instrument_pattern.match(self.name):
- return static_items["scan/instrument"] + mca_list
-
- def visit(self, func, follow_links=False):
- """Recursively visit all names in this group and subgroups.
+ calibration_dataset = scan.mca.calibration[analyser_index]
+ channels_dataset = scan.mca.channels[analyser_index]
+ self.add_node(SpecH5NodeDataset(name="calibration",
+ data=calibration_dataset,
+ parent=self))
+ self.add_node(SpecH5NodeDataset(name="channels",
+ data=channels_dataset,
+ parent=self))
+
+ if "CTIME" in scan.mca_header_dict:
+ ctime_line = scan.mca_header_dict['CTIME']
+ preset_time, live_time, elapsed_time = _parse_ctime(ctime_line, analyser_index)
+ self.add_node(SpecH5NodeDataset(name="preset_time",
+ data=preset_time,
+ parent=self))
+ self.add_node(SpecH5NodeDataset(name="live_time",
+ data=live_time,
+ parent=self))
+ self.add_node(SpecH5NodeDataset(name="elapsed_time",
+ data=elapsed_time,
+ parent=self))
+
+
+class McaDataDataset(SpecH5LazyNodeDataset):
+ """Lazy loadable dataset for MCA data"""
+ def __init__(self, parent, analyser_index, scan):
+ commonh5.LazyLoadableDataset.__init__(
+ self, name="data", parent=parent,
+ attrs={"interpretation": "spectrum", })
+ self._scan = scan
+ self._analyser_index = analyser_index
+ self._shape = None
+ self._num_analysers = _get_number_of_mca_analysers(self._scan)
+
+ def _create_data(self):
+ return _demultiplex_mca(self._scan, self._analyser_index)
- :param func: Callable (function, method or callable object)
- :type func: function
+ @property
+ def shape(self):
+ if self._shape is None:
+ num_spectra_in_file = len(self._scan.mca)
+ num_spectra_per_analyser = num_spectra_in_file // self._num_analysers
+ len_spectrum = len(self._scan.mca[self._analyser_index])
+ self._shape = num_spectra_per_analyser, len_spectrum
+ return self._shape
- You supply a callable (function, method or callable object); it
- will be called exactly once for each link in this group and every
- group below it. Your callable must conform to the signature:
+ @property
+ def size(self):
+ return numpy.prod(self.shape, dtype=numpy.intp)
- ``func(<member name>) => <None or return value>``
+ @property
+ def dtype(self):
+ # we initialize the data with numpy.empty() without specifying a dtype
+ # in _demultiplex_mca()
+ return numpy.empty((1, )).dtype
- Returning ``None`` continues iteration, returning anything else stops
- and immediately returns that value from the visit method. No
- particular order of iteration within groups is guaranteed.
+ def __len__(self):
+ return self.shape[0]
- Example:
+ def __getitem__(self, item):
+ # optimization for fetching a single spectrum if data not already loaded
+ if not self._is_initialized:
+ if isinstance(item, integer_types):
+ if item < 0:
+ # negative indexing
+ item += len(self)
+ return self._scan.mca[self._analyser_index +
+ item * self._num_analysers]
+ # accessing a slice or element of a single spectrum [i, j:k]
+ try:
+ spectrum_idx, channel_idx_or_slice = item
+ assert isinstance(spectrum_idx, integer_types)
+ except (ValueError, TypeError, AssertionError):
+ pass
+ else:
+ if spectrum_idx < 0:
+ item += len(self)
+ idx = self._analyser_index + spectrum_idx * self._num_analysers
+ return self._scan.mca[idx][channel_idx_or_slice]
- .. code-block:: python
+ return super(McaDataDataset, self).__getitem__(item)
- # Get a list of all contents (groups and datasets) in a SpecFile
- mylist = []
- f = File('foo.dat')
- f.visit(mylist.append)
- """
- for member_name in self.keys():
- member = self[member_name]
- ret = None
- if (not is_link_to_dataset(member.name) and
- not is_link_to_group(member.name)) or follow_links:
- ret = func(member.name)
- if ret is not None:
- return ret
- # recurse into subgroups
- if isinstance(member, SpecH5Group):
- if not isinstance(member, SpecH5LinkToGroup) or follow_links:
- self[member_name].visit(func, follow_links)
-
- def visititems(self, func, follow_links=False):
- """Recursively visit names and objects in this group.
-
- :param func: Callable (function, method or callable object)
- :type func: function
-
- You supply a callable (function, method or callable object); it
- will be called exactly once for each
- member in this group and every group below it. Your callable must
- conform to the signature:
-
- ``func(<member name>, <object>) => <None or return value>``
-
- Returning ``None`` continues iteration, returning anything else stops
- and immediately returns that value from the visit method. No
- particular order of iteration within groups is guaranteed.
-
- Example:
-
- .. code-block:: python
-
- # Get a list of all datasets in a specific scan
- mylist = []
- def func(name, obj):
- if isinstance(obj, SpecH5Dataset):
- mylist.append(name)
-
- f = File('foo.dat')
- f["1.1"].visititems(func)
- """
- for member_name in self.keys():
- member = self[member_name]
- ret = None
- if (not is_link_to_dataset(member.name) and
- not is_link_to_group(member.name)) or follow_links:
- ret = func(member.name, member)
- if ret is not None:
- return ret
- # recurse into subgroups
- if isinstance(self[member_name], SpecH5Group):
- if not isinstance(self[member_name], SpecH5LinkToGroup) or follow_links:
- self[member_name].visititems(func, follow_links)
-
-
-class SpecH5LinkToGroup(SpecH5Group):
- """Special :class:`SpecH5Group` representing a link to a group.
-
- It works like a regular group but :meth:`SpecH5Group.visit`
- and :meth:`SpecH5Group.visititems` methods will recognize it as a
- link and will ignore it.
-
- An additional attribute indicates the name of the target group:
- :attr:`target`
- """
- def __init__(self, name, specfileh5, target):
- SpecH5Group.__init__(self, name, specfileh5)
- self.target = target
- """Name of the target group."""
- def keys(self):
- """:return: List of all names of members attached to the target group
+class MeasurementGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, scan):
"""
- # we only have a single type of link to a group:
- # /1.1/measurement/mca_0/info/ -> /1.1/instrument/mca_0/
- if measurement_mca_info_pattern.match(self.name):
- # link_target = self.name.replace("measurement", "instrument").rstrip("/")[:-4]
- # return SpecH5Group(link_target, self.file).keys()
- return SpecH5Group(self.target, self.file).keys()
- else:
- raise NameError("Unknown link to SpecH5Group: "
- "%s -> %s" % (self.name, self.target))
-
-
-class SpecH5(SpecH5Group):
- """Special :class:`SpecH5Group` representing the root of a SpecFile.
-
- :param filename: Path to SpecFile in filesystem
- :type filename: str
-
- In addition to all generic :class:`SpecH5Group` attributes, this class
- also keeps a reference to the original :class:`SpecFile` object and
- has a :attr:`filename` attribute.
- Its immediate children are scans, but it also gives access to any group
- or dataset in the entire SpecFile tree by specifying the full path.
- """
- def __init__(self, filename):
- self.filename = filename
- self.attrs = _get_attrs_dict("/")
- self._sf = SpecFile(filename)
-
- SpecH5Group.__init__(self, name="/", specfileh5=self)
- if len(self) == 0:
- # SpecFile library do not raise exception for non specfiles
- raise IOError("Empty specfile. Not a valid spec format.")
-
- def keys(self):
+ :param parent: parent Group
+ :param scan: specfile.Scan object
"""
- :return: List of all scan keys in this SpecFile
- (e.g. ``["1.1", "2.1"…]``)
+ commonh5.Group.__init__(self, name="measurement", parent=parent,
+ attrs={"NX_class": "NXcollection", })
+ for label in scan.labels:
+ safe_label = label.replace("/", "%")
+ self.add_node(SpecH5NodeDataset(name=safe_label,
+ data=scan.data_column_by_name(label),
+ parent=self))
+
+ num_analysers = _get_number_of_mca_analysers(scan)
+ for anal_idx in range(num_analysers):
+ self.add_node(MeasurementMcaGroup(parent=self, analyser_index=anal_idx))
+
+
+class MeasurementMcaGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, analyser_index):
+ basename = "mca_%d" % analyser_index
+ commonh5.Group.__init__(self, name=basename, parent=parent,
+ attrs={})
+
+ target_name = self.name.replace("measurement", "instrument")
+ self.add_node(commonh5.SoftLink(name="data",
+ path=target_name + "/data",
+ parent=self))
+ self.add_node(commonh5.SoftLink(name="info",
+ path=target_name,
+ parent=self))
+
+
+class SampleGroup(commonh5.Group, SpecH5Group):
+ def __init__(self, parent, scan):
"""
- return self._sf.keys()
-
- def __enter__(self):
- """Context manager enter"""
- return self
-
- def __exit__(self, type, value, tb): # pylint: disable=W0622
- """Context manager exit"""
- self.close()
- def close(self):
- """Close the object, and free up associated resources.
-
- After calling this method, attempts to use the object may fail.
+ :param parent: parent Group
+ :param scan: specfile.Scan object
"""
- self._sf = None
-
- def __repr__(self):
- return '<SpecH5 "%s" (%d members)>' % (self.filename, len(self))
-
- def __eq__(self, other):
- return (isinstance(other, SpecH5) and
- self.filename == other.filename and
- self.keys() == other.keys())
-
- @property
- def h5py_class(self):
- """h5py class which is mimicked by this class"""
- if h5py is None:
- raise ImportError("Cannot return h5py.File class, " +
- "unable to import h5py module")
- return h5py.File
+ commonh5.Group.__init__(self, name="sample", parent=parent,
+ attrs={"NX_class": "NXsample", })
+
+ if _unit_cell_in_scan(scan):
+ self.add_node(SpecH5NodeDataset(name="unit_cell",
+ data=_parse_unit_cell(scan.scan_header_dict["G1"]),
+ parent=self,
+ attrs={"interpretation": "scalar"}))
+ self.add_node(SpecH5NodeDataset(name="unit_cell_abc",
+ data=_parse_unit_cell(scan.scan_header_dict["G1"])[0, 0:3],
+ parent=self,
+ attrs={"interpretation": "scalar"}))
+ self.add_node(SpecH5NodeDataset(name="unit_cell_alphabetagamma",
+ data=_parse_unit_cell(scan.scan_header_dict["G1"])[0, 3:6],
+ parent=self,
+ attrs={"interpretation": "scalar"}))
+ if _ub_matrix_in_scan(scan):
+ self.add_node(SpecH5NodeDataset(name="ub_matrix",
+ data=_parse_UB_matrix(scan.scan_header_dict["G3"]),
+ parent=self,
+ attrs={"interpretation": "scalar"}))
diff --git a/silx/io/spectoh5.py b/silx/io/spectoh5.py
index 53988f2..fb3b739 100644
--- a/silx/io/spectoh5.py
+++ b/silx/io/spectoh5.py
@@ -21,284 +21,61 @@
# THE SOFTWARE.
#
# ############################################################################*/
-"""This module provides functions to convert a SpecFile into a HDF5 file.
+"""Deprecated module. Use :mod:`convert` instead."""
-Read the documentation of :mod:`silx.io.spech5` for information on the
-structure of the output HDF5 files.
+from .convert import Hdf5Writer
+from .convert import write_to_h5
+from .convert import convert as other_convert
-Strings are written to the HDF5 datasets as fixed-length ASCII (NumPy *S* type).
-This is done in order to produce files that have maximum compatibility with
-other HDF5 libraries, as recommended in the
-`h5py documentation <http://docs.h5py.org/en/latest/strings.html#how-to-store-text-strings>`_.
+from silx.utils import deprecation
-If you read the files back with *h5py* in Python 3, you will recover strings
-as bytes, which you should decode to transform them into python strings::
+deprecation.deprecated_warning(type_="Module",
+ name="silx.io.spectoh5",
+ since_version="0.6",
+ replacement="silx.io.convert")
- >>> import h5py
- >>> f = h5py.File("myfile.h5")
- >>> f["/1.1/instrument/specfile/scan_header"][0]
- b'#S 94 ascan del -0.5 0.5 20 1'
- >>> f["/1.1/instrument/specfile/scan_header"][0].decode()
- '#S 94 ascan del -0.5 0.5 20 1'
-Arrays of strings, such as file and scan headers, are stored as fixed-length
-strings. The length of all strings in an array is equal to the length of the
-longest string. Shorter strings are right-padded with blank spaces.
-
-.. note:: This module has a dependency on the `h5py <http://www.h5py.org/>`_
- library, which is not a mandatory dependency for `silx`. You might need
- to install it if you don't already have it.
-"""
-
-import numpy
-import logging
-
-_logger = logging.getLogger(__name__)
-
-try:
- import h5py
-except ImportError as e:
- _logger.error("Module " + __name__ + " requires h5py")
- raise e
-
-from .spech5 import SpecH5, SpecH5Group, SpecH5Dataset, \
- SpecH5LinkToGroup, SpecH5LinkToDataset
-
-
-__authors__ = ["P. Knobel"]
-__license__ = "MIT"
-__date__ = "07/02/2017"
-
-
-def _create_link(h5f, link_name, target_name,
- link_type="hard", overwrite_data=False):
- """Create a link in a HDF5 file
-
- If member with name ``link_name`` already exists, delete it first or
- ignore link depending on global param ``overwrite_data``.
-
- :param h5f: :class:`h5py.File` object
- :param link_name: Link path
- :param target_name: Handle for target group or dataset
- :param str link_type: "hard" (default) or "soft"
- :param bool overwrite_data: If True, delete existing member (group,
- dataset or link) with the same name. Default is False.
- """
- if link_name not in h5f:
- _logger.debug("Creating link " + link_name + " -> " + target_name)
- elif overwrite_data:
- _logger.warn("Overwriting " + link_name + " with link to" +
- target_name)
- del h5f[link_name]
- else:
- _logger.warn(link_name + " already exist. Can't create link to " +
- target_name)
- return None
-
- if link_type == "hard":
- h5f[link_name] = h5f[target_name]
- elif link_type == "soft":
- h5f[link_name] = h5py.SoftLink(target_name)
- else:
- raise ValueError("link_type must be 'hard' or 'soft'")
-
-
-class SpecToHdf5Writer(object):
- """Converter class to write a Spec file to a HDF5 file."""
- def __init__(self,
- h5path='/',
- overwrite_data=False,
- link_type="hard",
- create_dataset_args=None):
- """
-
- :param h5path: Target path where the scan groups will be written
- in the output HDF5 file.
- :param bool overwrite_data:
- See documentation of :func:`write_spec_to_h5`
- :param str link_type: ``"hard"`` (default) or ``"soft"``
- :param dict create_dataset_args: Dictionary of args you want to pass to
- ``h5py.File.create_dataset``.
- See documentation of :func:`write_spec_to_h5`
- """
- self.h5path = h5path
-
- self._h5f = None
- """SpecH5 object, assigned in :meth:`write`"""
-
- if create_dataset_args is None:
- create_dataset_args = {}
- self.create_dataset_args = create_dataset_args
-
- self.overwrite_data = overwrite_data # boolean
-
- self.link_type = link_type
- """'soft' or 'hard' """
-
- self._links = []
- """List of *(link_path, target_path)* tuples."""
-
- def _filter_links(self):
- """Remove all links that are part of the subtree whose
- root is a link to a group."""
- filtered_links = []
- for i, link in enumerate(self._links):
- link_is_valid = True
- link_path, target_path = link
- other_links = self._links[:i] + self._links[i+1:]
- for link_path2, target_path2 in other_links:
- if link_path.startswith(link_path2):
- # parent group is a link to a group
- link_is_valid = False
- break
- if link_is_valid:
- filtered_links.append(link)
- self._links = filtered_links
+class SpecToHdf5Writer(Hdf5Writer):
+ def __init__(self, h5path='/', overwrite_data=False,
+ link_type="hard", create_dataset_args=None):
+ deprecation.deprecated_warning(
+ type_="Class",
+ name="SpecToHdf5Writer",
+ since_version="0.6",
+ replacement="silx.io.convert.Hdf5Writer")
+ Hdf5Writer.__init__(self, h5path, overwrite_data,
+ link_type, create_dataset_args)
+ # methods whose signatures changed
def write(self, sfh5, h5f):
- """Do the conversion from :attr:`sfh5` (Spec file) to *h5f* (HDF5)
-
- All the parameters needed for the conversion have been initialized
- in the constructor.
-
- :param sfh5: :class:`SpecH5` object
- :param h5f: :class:`h5py.File` instance
- """
- # Recurse through all groups and datasets to add them to the HDF5
- sfh5 = sfh5
- self._h5f = h5f
- sfh5.visititems(self.append_spec_member_to_h5, follow_links=True)
-
- # Handle the attributes of the root group
- root_grp = h5f[self.h5path]
- for key in sfh5.attrs:
- if self.overwrite_data or key not in root_grp.attrs:
- root_grp.attrs.create(key,
- numpy.string_(sfh5.attrs[key]))
-
- # Handle links at the end, when their targets are created
- self._filter_links()
- for link_name, target_name in self._links:
- _create_link(self._h5f, link_name, target_name,
- link_type=self.link_type,
- overwrite_data=self.overwrite_data)
+ Hdf5Writer.write(self, infile=sfh5, h5f=h5f)
def append_spec_member_to_h5(self, spec_h5_name, obj):
- """Add one group or one dataset to :attr:`h5f`"""
- h5_name = self.h5path + spec_h5_name.lstrip("/")
-
- if isinstance(obj, SpecH5LinkToGroup) or\
- isinstance(obj, SpecH5LinkToDataset):
- # links to be created after all groups and datasets
- h5_target = self.h5path + obj.target.lstrip("/")
- self._links.append((h5_name, h5_target))
-
- elif isinstance(obj, SpecH5Dataset):
- _logger.debug("Saving dataset: " + h5_name)
-
- member_initially_exists = h5_name in self._h5f
-
- if self.overwrite_data and member_initially_exists:
- _logger.warn("Overwriting dataset: " + h5_name)
- del self._h5f[h5_name]
-
- if self.overwrite_data or not member_initially_exists:
- # fancy arguments don't apply to scalars (shape==())
- if obj.shape == ():
- ds = self._h5f.create_dataset(h5_name, data=obj.value)
- else:
- ds = self._h5f.create_dataset(h5_name, data=obj.value,
- **self.create_dataset_args)
-
- # add HDF5 attributes
- for key in obj.attrs:
- if self.overwrite_data or key not in ds.attrs:
- ds.attrs.create(key, numpy.string_(obj.attrs[key]))
-
- if not self.overwrite_data and member_initially_exists:
- _logger.warn("Ignoring existing dataset: " + h5_name)
-
- elif isinstance(obj, SpecH5Group):
- if h5_name not in self._h5f:
- _logger.debug("Creating group: " + h5_name)
- grp = self._h5f.create_group(h5_name)
- else:
- grp = self._h5f[h5_name]
-
- # add HDF5 attributes
- for key in obj.attrs:
- if self.overwrite_data or key not in grp.attrs:
- grp.attrs.create(key, numpy.string_(obj.attrs[key]))
+ Hdf5Writer.append_member_to_h5(self,
+ h5like_name=spec_h5_name,
+ obj=obj)
+@deprecation.deprecated(replacement="silx.io.convert.write_to_h5",
+ since_version="0.6")
def write_spec_to_h5(specfile, h5file, h5path='/',
mode="a", overwrite_data=False,
link_type="hard", create_dataset_args=None):
- """Write content of a SpecFile in a HDF5 file.
-
- :param specfile: Path of input SpecFile or :class:`SpecH5` object
- :param h5file: Path of output HDF5 file or HDF5 file handle
- (`h5py.File` object)
- :param h5path: Target path in HDF5 file in which scan groups are created.
- Default is root (``"/"``)
- :param mode: Can be ``"r+"`` (read/write, file must exist),
- ``"w"`` (write, existing file is lost), ``"w-"`` (write, fail
- if exists) or ``"a"`` (read/write if exists, create otherwise).
- This parameter is ignored if ``h5file`` is a file handle.
- :param overwrite_data: If ``True``, existing groups and datasets can be
- overwritten, if ``False`` they are skipped. This parameter is only
- relevant if ``file_mode`` is ``"r+"`` or ``"a"``.
- :param link_type: ``"hard"`` (default) or ``"soft"``
- :param create_dataset_args: Dictionary of args you want to pass to
- ``h5py.File.create_dataset``. This allows you to specify filters and
- compression parameters. Don't specify ``name`` and ``data``.
- These arguments don't apply to scalar datasets.
-
- The structure of the spec data in an HDF5 file is described in the
- documentation of :mod:`silx.io.spech5`.
- """
- if not isinstance(specfile, SpecH5):
- sfh5 = SpecH5(specfile)
- else:
- sfh5 = specfile
- if not h5path.endswith("/"):
- h5path += "/"
-
- writer = SpecToHdf5Writer(h5path=h5path,
- overwrite_data=overwrite_data,
- link_type=link_type,
- create_dataset_args=create_dataset_args)
-
- if not isinstance(h5file, h5py.File):
- # If h5file is a file path, open and close it
- with h5py.File(h5file, mode) as h5f:
- writer.write(sfh5, h5f)
- else:
- writer.write(sfh5, h5file)
+ write_to_h5(infile=specfile,
+ h5file=h5file,
+ h5path=h5path,
+ mode=mode,
+ overwrite_data=overwrite_data,
+ link_type=link_type,
+ create_dataset_args=create_dataset_args)
+@deprecation.deprecated(replacement="silx.io.convert.convert",
+ since_version="0.6")
def convert(specfile, h5file, mode="w-",
create_dataset_args=None):
- """Convert a SpecFile into an HDF5 file, write scans into the root (``/``)
- group.
-
- :param specfile: Path of input SpecFile or :class:`SpecH5` object
- :param h5file: Path of output HDF5 file, or h5py.File object
- :param mode: Can be ``"w"`` (write, existing file is
- lost), ``"w-"`` (write, fail if exists). This is ignored
- if ``h5file`` is a file handle.
- :param create_dataset_args: Dictionary of args you want to pass to
- ``h5py.File.create_dataset``. This allows you to specify filters and
- compression parameters. Don't specify ``name`` and ``data``.
-
- This is a convenience shortcut to call::
-
- write_spec_to_h5(specfile, h5file, h5path='/',
- mode="w-", link_type="hard")
- """
- if mode not in ["w", "w-"]:
- raise IOError("File mode must be 'w' or 'w-'. Use write_spec_to_h5" +
- " to append Spec data to an existing HDF5 file.")
- write_spec_to_h5(specfile, h5file, h5path='/', mode=mode,
- create_dataset_args=create_dataset_args)
+ other_convert(infile=specfile,
+ h5file=h5file,
+ mode=mode,
+ create_dataset_args=create_dataset_args)
diff --git a/silx/io/test/__init__.py b/silx/io/test/__init__.py
index 72bd8f9..2510ae2 100644
--- a/silx/io/test/__init__.py
+++ b/silx/io/test/__init__.py
@@ -24,7 +24,7 @@
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "31/08/2016"
+__date__ = "20/09/2017"
import unittest
@@ -37,6 +37,8 @@ from .test_octaveh5 import suite as test_octaveh5_suite
from .test_fabioh5 import suite as test_fabioh5_suite
from .test_utils import suite as test_utils_suite
from .test_nxdata import suite as test_nxdata_suite
+from .test_commonh5 import suite as test_commonh5_suite
+from .test_rawh5 import suite as test_rawh5_suite
def suite():
@@ -50,4 +52,6 @@ def suite():
test_suite.addTest(test_utils_suite())
test_suite.addTest(test_fabioh5_suite())
test_suite.addTest(test_nxdata_suite())
+ test_suite.addTest(test_commonh5_suite())
+ test_suite.addTest(test_rawh5_suite())
return test_suite
diff --git a/silx/io/test/test_commonh5.py b/silx/io/test/test_commonh5.py
new file mode 100644
index 0000000..05ef558
--- /dev/null
+++ b/silx/io/test/test_commonh5.py
@@ -0,0 +1,306 @@
+# coding: utf-8
+# /*##########################################################################
+# Copyright (C) 2016-2017 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.
+#
+# ############################################################################*/
+"""Tests for commonh5 wrapper"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "21/09/2017"
+
+import logging
+import numpy
+import unittest
+import tempfile
+import shutil
+
+_logger = logging.getLogger(__name__)
+
+import silx.io
+import silx.io.utils
+
+try:
+ import h5py
+except ImportError:
+ h5py = None
+
+try:
+ from .. import commonh5
+except ImportError:
+ commonh5 = None
+
+
+class TestCommonFeatures(unittest.TestCase):
+ """Test common features supported by h5py and our implementation."""
+
+ @classmethod
+ def createFile(cls):
+ return None
+
+ @classmethod
+ def setUpClass(cls):
+ # Set to None cause create_resource can raise an excpetion
+ cls.h5 = None
+ cls.h5 = cls.create_resource()
+ if cls.h5 is None:
+ raise unittest.SkipTest("File not created")
+
+ @classmethod
+ def create_resource(cls):
+ """Must be implemented"""
+ return None
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.h5 = None
+
+ def test_file(self):
+ node = self.h5
+ self.assertTrue(silx.io.is_file(node))
+ self.assertTrue(silx.io.is_group(node))
+ self.assertFalse(silx.io.is_dataset(node))
+ self.assertEqual(len(node.attrs), 0)
+
+ def test_group(self):
+ node = self.h5["group"]
+ self.assertFalse(silx.io.is_file(node))
+ self.assertTrue(silx.io.is_group(node))
+ self.assertFalse(silx.io.is_dataset(node))
+ self.assertEqual(len(node.attrs), 0)
+ if h5py is not None:
+ class_ = self.h5.get("group", getclass=True)
+ classlink = self.h5.get("group", getlink=True, getclass=True)
+ self.assertEqual(class_, h5py.Group)
+ self.assertEqual(classlink, h5py.HardLink)
+
+ def test_dataset(self):
+ node = self.h5["group/dataset"]
+ self.assertFalse(silx.io.is_file(node))
+ self.assertFalse(silx.io.is_group(node))
+ self.assertTrue(silx.io.is_dataset(node))
+ self.assertEqual(len(node.attrs), 0)
+ if h5py is not None:
+ class_ = self.h5.get("group/dataset", getclass=True)
+ classlink = self.h5.get("group/dataset", getlink=True, getclass=True)
+ self.assertEqual(class_, h5py.Dataset)
+ self.assertEqual(classlink, h5py.HardLink)
+
+ def test_soft_link(self):
+ node = self.h5["link/soft_link"]
+ self.assertEqual(node.name, "/link/soft_link")
+ if h5py is not None:
+ class_ = self.h5.get("link/soft_link", getclass=True)
+ link = self.h5.get("link/soft_link", getlink=True)
+ classlink = self.h5.get("link/soft_link", getlink=True, getclass=True)
+ self.assertEqual(class_, h5py.Dataset)
+ self.assertTrue(isinstance(link, (h5py.SoftLink, commonh5.SoftLink)))
+ self.assertTrue(silx.io.utils.is_softlink(link))
+ self.assertEqual(classlink, h5py.SoftLink)
+
+ def test_external_link(self):
+ node = self.h5["link/external_link"]
+ self.assertEqual(node.name, "/target/dataset")
+ if h5py is not None:
+ class_ = self.h5.get("link/external_link", getclass=True)
+ classlink = self.h5.get("link/external_link", getlink=True, getclass=True)
+ self.assertEqual(class_, h5py.Dataset)
+ self.assertEqual(classlink, h5py.ExternalLink)
+
+ def test_external_link_to_link(self):
+ node = self.h5["link/external_link_to_link"]
+ self.assertEqual(node.name, "/target/link")
+ if h5py is not None:
+ class_ = self.h5.get("link/external_link_to_link", getclass=True)
+ classlink = self.h5.get("link/external_link_to_link", getlink=True, getclass=True)
+ self.assertEqual(class_, h5py.Dataset)
+ self.assertEqual(classlink, h5py.ExternalLink)
+
+ def test_create_groups(self):
+ c = self.h5.create_group(self.id() + "/a/b/c")
+ d = c.create_group("/" + self.id() + "/a/b/d")
+
+ self.assertRaises(ValueError, self.h5.create_group, self.id() + "/a/b/d")
+ self.assertEqual(c.name, "/" + self.id() + "/a/b/c")
+ self.assertEqual(d.name, "/" + self.id() + "/a/b/d")
+
+ def test_setitem_python_object_dataset(self):
+ group = self.h5.create_group(self.id())
+ group["a"] = 10
+ self.assertEqual(group["a"].dtype.kind, "i")
+
+ def test_setitem_numpy_dataset(self):
+ group = self.h5.create_group(self.id())
+ group["a"] = numpy.array([10, 20, 30])
+ self.assertEqual(group["a"].dtype.kind, "i")
+ self.assertEqual(group["a"].shape, (3,))
+
+ def test_setitem_link(self):
+ group = self.h5.create_group(self.id())
+ group["a"] = 10
+ group["b"] = group["a"]
+ self.assertEqual(group["b"].dtype.kind, "i")
+
+ def test_setitem_dataset_is_sub_group(self):
+ self.h5[self.id() + "/a"] = 10
+
+
+class TestCommonFeatures_h5py(TestCommonFeatures):
+ """Check if h5py is compliant with what we expect."""
+
+ @classmethod
+ def create_resource(cls):
+ cls.tmp_dir = tempfile.mkdtemp()
+
+ externalh5 = h5py.File(cls.tmp_dir + "/external.h5", mode="w")
+ externalh5["target/dataset"] = 50
+ externalh5["target/link"] = h5py.SoftLink("/target/dataset")
+ externalh5.close()
+
+ h5 = h5py.File(cls.tmp_dir + "/base.h5", mode="w")
+ h5["group/dataset"] = 50
+ h5["link/soft_link"] = h5py.SoftLink("/group/dataset")
+ h5["link/external_link"] = h5py.ExternalLink("external.h5", "/target/dataset")
+ h5["link/external_link_to_link"] = h5py.ExternalLink("external.h5", "/target/link")
+
+ return h5
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestCommonFeatures_h5py, cls).tearDownClass()
+ if hasattr(cls, "tmp_dir") and cls.tmp_dir is not None:
+ shutil.rmtree(cls.tmp_dir)
+
+
+class TestCommonFeatures_commonH5(TestCommonFeatures):
+ """Check if commonh5 is compliant with h5py."""
+
+ @classmethod
+ def create_resource(cls):
+ h5 = commonh5.File("base.h5", "w")
+ h5.create_group("group").create_dataset("dataset", data=numpy.int32(50))
+
+ link = h5.create_group("link")
+ link.add_node(commonh5.SoftLink("soft_link", "/group/dataset"))
+
+ return h5
+
+ def test_external_link(self):
+ # not applicable
+ pass
+
+ def test_external_link_to_link(self):
+ # not applicable
+ pass
+
+
+class TestSpecificCommonH5(unittest.TestCase):
+ """Test specific features from commonh5.
+
+ Test of shared features should be done by TestCommonFeatures."""
+
+ def setUp(self):
+ if h5py is None:
+ self.skipTest("h5py is needed")
+ if commonh5 is None:
+ self.skipTest("silx.io.commonh5 is needed")
+
+ def test_node_attrs(self):
+ node = commonh5.Node("Foo", attrs={"a": 1})
+ self.assertEqual(node.attrs["a"], 1)
+ node.attrs["b"] = 8
+ self.assertEqual(node.attrs["b"], 8)
+ node.attrs["b"] = 2
+ self.assertEqual(node.attrs["b"], 2)
+
+ def test_node_readonly_attrs(self):
+ f = commonh5.File(name="Foo", mode="r")
+ node = commonh5.Node("Foo", attrs={"a": 1})
+ node.attrs["b"] = 8
+ f.add_node(node)
+ self.assertEqual(node.attrs["b"], 8)
+ try:
+ node.attrs["b"] = 1
+ self.fail()
+ except RuntimeError:
+ pass
+
+ def test_create_dataset(self):
+ f = commonh5.File(name="Foo", mode="w")
+ node = f.create_dataset("foo", data=numpy.array([1]))
+ self.assertIs(node.parent, f)
+ self.assertIs(f["foo"], node)
+
+ def test_create_group(self):
+ f = commonh5.File(name="Foo", mode="w")
+ node = f.create_group("foo")
+ self.assertIs(node.parent, f)
+ self.assertIs(f["foo"], node)
+
+ def test_readonly_create_dataset(self):
+ f = commonh5.File(name="Foo", mode="r")
+ try:
+ f.create_dataset("foo", data=numpy.array([1]))
+ self.fail()
+ except RuntimeError:
+ pass
+
+ def test_readonly_create_group(self):
+ f = commonh5.File(name="Foo", mode="r")
+ try:
+ f.create_group("foo")
+ self.fail()
+ except RuntimeError:
+ pass
+
+ def test_create_unicode_dataset(self):
+ f = commonh5.File(name="Foo", mode="w")
+ try:
+ f.create_dataset("foo", data=numpy.array(u"aaaa"))
+ self.fail()
+ except TypeError:
+ pass
+
+ def test_setitem_dataset(self):
+ self.h5 = commonh5.File(name="Foo", mode="w")
+ group = self.h5.create_group(self.id())
+ group["a"] = commonh5.Dataset(None, data=numpy.array(10))
+ self.assertEqual(group["a"].dtype.kind, "i")
+
+ def test_setitem_explicit_link(self):
+ self.h5 = commonh5.File(name="Foo", mode="w")
+ group = self.h5.create_group(self.id())
+ group["a"] = 10
+ group["b"] = commonh5.SoftLink(None, path="/" + self.id() + "/a")
+ self.assertEqual(group["b"].dtype.kind, "i")
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(loadTests(TestCommonFeatures_h5py))
+ test_suite.addTest(loadTests(TestCommonFeatures_commonH5))
+ test_suite.addTest(loadTests(TestSpecificCommonH5))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="suite")
diff --git a/silx/io/test/test_fabioh5.py b/silx/io/test/test_fabioh5.py
index c1f4a43..0237620 100644
--- a/silx/io/test/test_fabioh5.py
+++ b/silx/io/test/test_fabioh5.py
@@ -25,7 +25,7 @@
__authors__ = ["V. Valls"]
__license__ = "MIT"
-__date__ = "11/04/2017"
+__date__ = "29/08/2017"
import logging
import numpy
@@ -46,6 +46,7 @@ except ImportError:
if fabio is not None and h5py is not None:
from .. import fabioh5
+ from .. import commonh5
class TestFabioH5(unittest.TestCase):
@@ -95,12 +96,72 @@ class TestFabioH5(unittest.TestCase):
# result tested with a default h5py file
self.assertRaises(KeyError, lambda: self.h5_image["foo/foo"])
- def test_frames(self):
- dataset = self.h5_image["/scan_0/instrument/detector_0/data"]
+ def test_single_frame(self):
+ data = numpy.arange(2 * 3)
+ data.shape = 2, 3
+ fabio_image = fabio.edfimage.edfimage(data=data)
+ h5_image = fabioh5.File(fabio_image=fabio_image)
+
+ dataset = h5_image["/scan_0/instrument/detector_0/data"]
+ self.assertEquals(dataset.h5py_class, h5py.Dataset)
+ self.assertTrue(isinstance(dataset[()], numpy.ndarray))
+ self.assertEquals(dataset.dtype.kind, "i")
+ self.assertEquals(dataset.shape, (2, 3))
+ self.assertEquals(dataset[...][0, 0], 0)
+ self.assertEquals(dataset.attrs["interpretation"], "image")
+
+ def test_multi_frames(self):
+ data = numpy.arange(2 * 3)
+ data.shape = 2, 3
+ fabio_image = fabio.edfimage.edfimage(data=data)
+ fabio_image.appendFrame(data=data)
+ h5_image = fabioh5.File(fabio_image=fabio_image)
+
+ dataset = h5_image["/scan_0/instrument/detector_0/data"]
+ self.assertEquals(dataset.h5py_class, h5py.Dataset)
+ self.assertTrue(isinstance(dataset[()], numpy.ndarray))
+ self.assertEquals(dataset.dtype.kind, "i")
+ self.assertEquals(dataset.shape, (2, 2, 3))
+ self.assertEquals(dataset[...][0, 0, 0], 0)
+ self.assertEquals(dataset.attrs["interpretation"], "image")
+
+ def test_heterogeneous_frames(self):
+ """Frames containing 2 images with different sizes and a cube"""
+ data1 = numpy.arange(2 * 3)
+ data1.shape = 2, 3
+ data2 = numpy.arange(2 * 5)
+ data2.shape = 2, 5
+ data3 = numpy.arange(2 * 5 * 1)
+ data3.shape = 2, 5, 1
+ fabio_image = fabio.edfimage.edfimage(data=data1)
+ fabio_image.appendFrame(data=data2)
+ fabio_image.appendFrame(data=data3)
+ h5_image = fabioh5.File(fabio_image=fabio_image)
+
+ dataset = h5_image["/scan_0/instrument/detector_0/data"]
+ self.assertEquals(dataset.h5py_class, h5py.Dataset)
+ self.assertTrue(isinstance(dataset[()], numpy.ndarray))
+ self.assertEquals(dataset.dtype.kind, "i")
+ self.assertEquals(dataset.shape, (3, 2, 5, 1))
+ self.assertEquals(dataset[...][0, 0, 0], 0)
+ self.assertEquals(dataset.attrs["interpretation"], "image")
+
+ def test_single_3d_frame(self):
+ """Image source contains a cube"""
+ data = numpy.arange(2 * 3 * 4)
+ data.shape = 2, 3, 4
+ # Do not provide the data to the constructor to avoid slicing of the
+ # data. In this way the result stay a cube, and not a multi-frame
+ fabio_image = fabio.edfimage.edfimage()
+ fabio_image.data = data
+ h5_image = fabioh5.File(fabio_image=fabio_image)
+
+ dataset = h5_image["/scan_0/instrument/detector_0/data"]
self.assertEquals(dataset.h5py_class, h5py.Dataset)
self.assertTrue(isinstance(dataset[()], numpy.ndarray))
self.assertEquals(dataset.dtype.kind, "i")
- self.assertEquals(dataset.shape, (1, 3, 2))
+ self.assertEquals(dataset.shape, (2, 3, 4))
+ self.assertEquals(dataset[...][0, 0, 0], 0)
self.assertEquals(dataset.attrs["interpretation"], "image")
def test_metadata_int(self):
@@ -224,6 +285,30 @@ class TestFabioH5(unittest.TestCase):
self.assertIn(d.dtype.char, ['d', 'f'])
numpy.testing.assert_array_almost_equal(d[...], expected)
+ def test_get_api(self):
+ result = self.h5_image.get("scan_0", getclass=True, getlink=True)
+ self.assertIs(result, h5py.HardLink)
+ result = self.h5_image.get("scan_0", getclass=False, getlink=True)
+ self.assertIsInstance(result, h5py.HardLink)
+ result = self.h5_image.get("scan_0", getclass=True, getlink=False)
+ self.assertIs(result, h5py.Group)
+ result = self.h5_image.get("scan_0", getclass=False, getlink=False)
+ self.assertIsInstance(result, commonh5.Group)
+
+ def test_detector_link(self):
+ detector1 = self.h5_image["/scan_0/instrument/detector_0"]
+ detector2 = self.h5_image["/scan_0/measurement/image_0/info"]
+ self.assertIsNot(detector1, detector2)
+ self.assertEqual(list(detector1.items()), list(detector2.items()))
+ self.assertEqual(self.h5_image.get(detector2.name, getlink=True).path, detector1.name)
+
+ def test_detector_data_link(self):
+ data1 = self.h5_image["/scan_0/instrument/detector_0/data"]
+ data2 = self.h5_image["/scan_0/measurement/image_0/data"]
+ self.assertIsNot(data1, data2)
+ self.assertIs(data1._get_data(), data2._get_data())
+ self.assertEqual(self.h5_image.get(data2.name, getlink=True).path, data1.name)
+
def suite():
test_suite = unittest.TestSuite()
diff --git a/silx/io/test/test_nxdata.py b/silx/io/test/test_nxdata.py
index caa8c1e..f891db9 100644
--- a/silx/io/test/test_nxdata.py
+++ b/silx/io/test/test_nxdata.py
@@ -231,6 +231,13 @@ class TestNXdata(unittest.TestCase):
self.assertEqual(nxd.errors.shape, (2, 2, 3, 10))
self.assertFalse(nxd.is_scatter or nxd.is_x_y_value_scatter)
self.assertEqual(nxd.interpretation, "spectrum")
+ self.assertEqual(nxd.get_axis_errors("energy").shape,
+ (10,))
+ # test getting axis errors by long_name
+ self.assertTrue(numpy.array_equal(nxd.get_axis_errors("Calibrated energy"),
+ nxd.get_axis_errors("energy")))
+ self.assertTrue(numpy.array_equal(nxd.get_axis_errors(b"Calibrated energy"),
+ nxd.get_axis_errors("energy")))
def testImages(self):
nxd = nxdata.NXdata(self.h5f["images/2D_regular_image"])
diff --git a/silx/io/test/test_rawh5.py b/silx/io/test/test_rawh5.py
new file mode 100644
index 0000000..0f7205c
--- /dev/null
+++ b/silx/io/test/test_rawh5.py
@@ -0,0 +1,96 @@
+# 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.
+#
+# ###########################################################################*/
+"""Test for silx.gui.hdf5 module"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "21/09/2017"
+
+
+import unittest
+import tempfile
+import numpy
+import shutil
+from ..import rawh5
+
+
+class TestNumpyFile(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ cls.tmpDirectory = tempfile.mkdtemp()
+
+ @classmethod
+ def tearDownClass(cls):
+ shutil.rmtree(cls.tmpDirectory)
+
+ def testNumpyFile(self):
+ filename = "%s/%s.npy" % (self.tmpDirectory, self.id())
+ c = numpy.random.rand(5, 5)
+ numpy.save(filename, c)
+ h5 = rawh5.NumpyFile(filename)
+ self.assertIn("data", h5)
+ self.assertEqual(h5["data"].dtype.kind, "f")
+
+ def testNumpyZFile(self):
+ filename = "%s/%s.npz" % (self.tmpDirectory, self.id())
+ a = numpy.array(u"aaaaa")
+ b = numpy.array([1, 2, 3, 4])
+ c = numpy.random.rand(5, 5)
+ d = numpy.array(b"aaaaa")
+ e = numpy.array(u"i \u2661 my mother")
+ numpy.savez(filename, a, b=b, c=c, d=d, e=e)
+ h5 = rawh5.NumpyFile(filename)
+ self.assertIn("arr_0", h5)
+ self.assertIn("b", h5)
+ self.assertIn("c", h5)
+ self.assertIn("d", h5)
+ self.assertIn("e", h5)
+ self.assertEqual(h5["arr_0"].dtype.kind, "U")
+ self.assertEqual(h5["b"].dtype.kind, "i")
+ self.assertEqual(h5["c"].dtype.kind, "f")
+ self.assertEqual(h5["d"].dtype.kind, "S")
+ self.assertEqual(h5["e"].dtype.kind, "U")
+
+ def testNumpyZFileContainingDirectories(self):
+ filename = "%s/%s.npz" % (self.tmpDirectory, self.id())
+ data = {}
+ data['a/b/c'] = numpy.arange(10)
+ data['a/b/e'] = numpy.arange(10)
+ numpy.savez(filename, **data)
+ h5 = rawh5.NumpyFile(filename)
+ self.assertIn("a/b/c", h5)
+ self.assertIn("a/b/e", h5)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestNumpyFile))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/io/test/test_specfile.py b/silx/io/test/test_specfile.py
index 884cb04..0aef2e2 100644
--- a/silx/io/test/test_specfile.py
+++ b/silx/io/test/test_specfile.py
@@ -25,7 +25,7 @@
__authors__ = ["P. Knobel", "V.A. Sole"]
__license__ = "MIT"
-__date__ = "24/04/2017"
+__date__ = "03/08/2017"
import gc
import locale
@@ -36,12 +36,14 @@ import sys
import tempfile
import unittest
-logging.basicConfig()
-logger1 = logging.getLogger(__name__)
+from silx.test import utils
from ..specfile import SpecFile, Scan
from .. import specfile
+
+logger1 = logging.getLogger(__name__)
+
sftext = """#F /tmp/sf.dat
#E 1455180875
#D Thu Feb 11 09:54:35 2016
@@ -374,6 +376,7 @@ class TestSpecFile(unittest.TestCase):
self.assertEqual(self.scan25.mca.channels,
[])
+ @utils.test_logging(specfile._logger.name, warning=1)
def test_empty_scan(self):
"""Test reading a scan with no data points"""
self.assertEqual(len(self.empty_scan.labels),
diff --git a/silx/io/test/test_specfilewrapper.py b/silx/io/test/test_specfilewrapper.py
index e9e1a24..c5b0f39 100644
--- a/silx/io/test/test_specfilewrapper.py
+++ b/silx/io/test/test_specfilewrapper.py
@@ -25,7 +25,7 @@
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "05/07/2016"
+__date__ = "15/05/2017"
import gc
import locale
@@ -36,7 +36,6 @@ import sys
import tempfile
import unittest
-logging.basicConfig()
logger1 = logging.getLogger(__name__)
from ..specfilewrapper import Specfile
diff --git a/silx/io/test/test_spech5.py b/silx/io/test/test_spech5.py
index ac250ab..1d04c6f 100644
--- a/silx/io/test/test_spech5.py
+++ b/silx/io/test/test_spech5.py
@@ -25,12 +25,16 @@
import gc
from numpy import array_equal
import os
+import io
import sys
import tempfile
import unittest
import datetime
from functools import partial
+from silx.test import utils
+
+from .. import spech5
from ..spech5 import (SpecH5, SpecH5Group,
SpecH5Dataset, spec_date_to_iso8601)
from .. import specfile
@@ -42,7 +46,7 @@ except ImportError:
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "11/05/2017"
+__date__ = "26/07/2017"
sftext = """#F /tmp/sf.dat
#E 1455180875
@@ -107,6 +111,12 @@ sftext = """#F /tmp/sf.dat
#L a b
1 2
+#S 1001 ccccc
+#G1 0. 0. 0. 0 0 0 2.232368448 2.232368448 1.206680489 90 90 60 1 1 2 -1 2 2 26.132 7.41 -88.96 1.11 1.000012861 15.19 26.06 67.355 -88.96 1.11 1.000012861 15.11 0.723353 0.723353
+#G3 0. 0. 0. 0. 0.0 0. 0. 0. 0.
+#L a b
+1 2
+
"""
@@ -254,9 +264,6 @@ class TestSpecH5(unittest.TestCase):
# full path to element in group (OK)
self.assertIn("/1.1/instrument/positioners/Sslit1 HOff",
self.sfh5["/1.1/instrument"])
- # full path to element outside group (illegal)
- self.assertNotIn("/1.1/instrument/positioners/Sslit1 HOff",
- self.sfh5["/1.1/measurement"])
def testDataColumn(self):
self.assertAlmostEqual(sum(self.sfh5["/1.2/measurement/duo"]),
@@ -306,9 +313,20 @@ class TestSpecH5(unittest.TestCase):
# spech5 does not define external link, so there is no way
# a group can *get* a SpecH5 class
+ @unittest.skipIf(h5py is None, "test requires h5py (not installed)")
+ def testGetApi(self):
+ result = self.sfh5.get("1.1", getclass=True, getlink=True)
+ self.assertIs(result, h5py.HardLink)
+ result = self.sfh5.get("1.1", getclass=False, getlink=True)
+ self.assertIsInstance(result, h5py.HardLink)
+ result = self.sfh5.get("1.1", getclass=True, getlink=False)
+ self.assertIs(result, h5py.Group)
+ result = self.sfh5.get("1.1", getclass=False, getlink=False)
+ self.assertIsInstance(result, spech5.SpecH5Group)
+
def testGetItemGroup(self):
group = self.sfh5["25.1"]["instrument"]
- self.assertEqual(group["positioners"].keys(),
+ self.assertEqual(list(group["positioners"].keys()),
["Pslit HGap", "MRTSlit UP", "MRTSlit DOWN",
"Sslit1 VOff", "Sslit1 HOff", "Sslit1 VGap"])
with self.assertRaises(KeyError):
@@ -389,8 +407,8 @@ class TestSpecH5(unittest.TestCase):
self.sfh5["/1.2/instrument/mca_0/elapsed_time"])
def testListScanIndices(self):
- self.assertEqual(self.sfh5.keys(),
- ["1.1", "25.1", "1.2", "1000.1"])
+ self.assertEqual(list(self.sfh5.keys()),
+ ["1.1", "25.1", "1.2", "1000.1", "1001.1"])
self.assertEqual(self.sfh5["1.2"].attrs,
{"NX_class": "NXentry", })
@@ -477,30 +495,80 @@ class TestSpecH5(unittest.TestCase):
self.assertEqual(self.sfh5["/25.1/title"],
b"25 ascan c3th 1.33245 1.52245 40 0.15")
+ def testValues(self):
+ group = self.sfh5["/25.1"]
+ self.assertTrue(hasattr(group, "values"))
+ self.assertTrue(callable(group.values))
+ self.assertIn(self.sfh5["/25.1/title"],
+ self.sfh5["/25.1"].values())
+
# visit and visititems ignore links
def testVisit(self):
name_list = []
self.sfh5.visit(name_list.append)
- self.assertIn('/1.2/instrument/positioners/Pslit HGap', name_list)
- self.assertIn("/1.2/instrument/specfile/scan_header", name_list)
- self.assertEqual(len(name_list), 100) #, "actual name list: %s" % "\n".join(name_list))
+ self.assertIn('1.2/instrument/positioners/Pslit HGap', name_list)
+ self.assertIn("1.2/instrument/specfile/scan_header", name_list)
+ self.assertEqual(len(name_list), 117)
+
+ # test also visit of a subgroup, with various group name formats
+ name_list_leading_and_trailing_slash = []
+ self.sfh5['/1.2/instrument/'].visit(name_list_leading_and_trailing_slash.append)
+ name_list_leading_slash = []
+ self.sfh5['/1.2/instrument'].visit(name_list_leading_slash.append)
+ name_list_trailing_slash = []
+ self.sfh5['1.2/instrument/'].visit(name_list_trailing_slash.append)
+ name_list_no_slash = []
+ self.sfh5['1.2/instrument'].visit(name_list_no_slash.append)
+
+ # no differences expected in the output names
+ self.assertEqual(name_list_leading_and_trailing_slash,
+ name_list_leading_slash)
+ self.assertEqual(name_list_leading_slash,
+ name_list_trailing_slash)
+ self.assertEqual(name_list_leading_slash,
+ name_list_no_slash)
+ self.assertIn("positioners/Pslit HGap", name_list_no_slash)
+ self.assertIn("positioners", name_list_no_slash)
def testVisitItems(self):
dataset_name_list = []
- def func(name, obj):
- if isinstance(obj, SpecH5Dataset):
- dataset_name_list.append(name)
-
- self.sfh5.visititems(func)
- self.assertIn('/1.2/instrument/positioners/Pslit HGap', dataset_name_list)
- self.assertEqual(len(dataset_name_list), 73)
+ def func_generator(l):
+ """return a function appending names to list l"""
+ def func(name, obj):
+ if isinstance(obj, SpecH5Dataset):
+ l.append(name)
+ return func
+
+ self.sfh5.visititems(func_generator(dataset_name_list))
+ self.assertIn('1.2/instrument/positioners/Pslit HGap', dataset_name_list)
+ self.assertEqual(len(dataset_name_list), 85)
+
+ # test also visit of a subgroup, with various group name formats
+ name_list_leading_and_trailing_slash = []
+ self.sfh5['/1.2/instrument/'].visititems(func_generator(name_list_leading_and_trailing_slash))
+ name_list_leading_slash = []
+ self.sfh5['/1.2/instrument'].visititems(func_generator(name_list_leading_slash))
+ name_list_trailing_slash = []
+ self.sfh5['1.2/instrument/'].visititems(func_generator(name_list_trailing_slash))
+ name_list_no_slash = []
+ self.sfh5['1.2/instrument'].visititems(func_generator(name_list_no_slash))
+
+ # no differences expected in the output names
+ self.assertEqual(name_list_leading_and_trailing_slash,
+ name_list_leading_slash)
+ self.assertEqual(name_list_leading_slash,
+ name_list_trailing_slash)
+ self.assertEqual(name_list_leading_slash,
+ name_list_no_slash)
+ self.assertIn("positioners/Pslit HGap", name_list_no_slash)
def testNotSpecH5(self):
fd, fname = tempfile.mkstemp()
os.write(fd, b"Not a spec file!")
os.close(fd)
self.assertRaises(specfile.SfErrFileOpen, SpecH5, fname)
+ self.assertRaises(IOError, SpecH5, fname)
os.unlink(fname)
def testSample(self):
@@ -511,6 +579,21 @@ class TestSpecH5(unittest.TestCase):
self.assertIn("unit_cell_abc", self.sfh5["/1000.1/sample"])
self.assertIn("unit_cell_alphabetagamma", self.sfh5["/1000.1/sample"])
+ # All 0 values
+ self.assertNotIn("sample", self.sfh5["/1001.1"])
+ with self.assertRaises(KeyError):
+ uc = self.sfh5["/1001.1/sample/unit_cell"]
+
+ @utils.test_logging(spech5.logger1.name, warning=2)
+ def testOpenFileDescriptor(self):
+ """Open a SpecH5 file from a file descriptor"""
+ with io.open(self.sfh5.filename) as f:
+ sfh5 = SpecH5(f)
+ self.assertIsNotNone(sfh5)
+ name_list = []
+ # check if the object is working
+ self.sfh5.visit(name_list.append)
+
sftext_multi_mca_headers = """
#S 1 aaaaaa
@@ -767,7 +850,7 @@ class TestSpecH5SlashInLabels(unittest.TestCase):
def testLabels(self):
"""Ensure `/` is substituted with `%` and
ensure legitimate `%` in names are still working"""
- self.assertEqual(self.sfh5["1.1/measurement/"].keys(),
+ self.assertEqual(list(self.sfh5["1.1/measurement/"].keys()),
["GONY%mm", "PD3%A"])
# substituted "%"
@@ -784,7 +867,7 @@ class TestSpecH5SlashInLabels(unittest.TestCase):
def testMotors(self):
"""Ensure `/` is substituted with `%` and
ensure legitimate `%` in names are still working"""
- self.assertEqual(self.sfh5["1.1/instrument/positioners"].keys(),
+ self.assertEqual(list(self.sfh5["1.1/instrument/positioners"].keys()),
["Pslit%HGap", "MRTSlit%UP"])
# substituted "%"
self.assertIn("Pslit%HGap",
@@ -799,8 +882,6 @@ class TestSpecH5SlashInLabels(unittest.TestCase):
self.sfh5["1.1/instrument/positioners"])
-
-
def suite():
test_suite = unittest.TestSuite()
test_suite.addTest(
diff --git a/silx/io/test/test_spectoh5.py b/silx/io/test/test_spectoh5.py
index f42f8a8..421c48b 100644
--- a/silx/io/test/test_spectoh5.py
+++ b/silx/io/test/test_spectoh5.py
@@ -1,6 +1,6 @@
# coding: utf-8
# /*##########################################################################
-# Copyright (C) 2016 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2017 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
@@ -36,12 +36,12 @@ except ImportError:
h5py_missing = True
else:
h5py_missing = False
- from ..spech5 import SpecH5
- from ..spectoh5 import convert, write_spec_to_h5
+ from ..spech5 import SpecH5, SpecH5Group
+ from ..convert import convert, write_to_h5
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "05/10/2016"
+__date__ = "02/06/2017"
sftext = """#F /tmp/sf.dat
@@ -112,7 +112,7 @@ class TestConvertSpecHDF5(unittest.TestCase):
convert(self.spec_fname, self.h5_fname)
self.sfh5 = SpecH5(self.spec_fname)
- self.h5f = h5py.File(self.h5_fname)
+ self.h5f = h5py.File(self.h5_fname, "a")
def tearDown(self):
del self.sfh5
@@ -122,13 +122,22 @@ class TestConvertSpecHDF5(unittest.TestCase):
gc.collect()
def testAppendToHDF5(self):
- write_spec_to_h5(self.sfh5, self.h5f,
- h5path="/foo/bar/spam")
+ write_to_h5(self.sfh5, self.h5f, h5path="/foo/bar/spam")
self.assertTrue(
array_equal(self.h5f["/1.2/measurement/mca_1/data"],
self.h5f["/foo/bar/spam/1.2/measurement/mca_1/data"])
)
+ def testWriteSpecH5Group(self):
+ """Test passing a SpecH5Group as parameter, instead of a Spec filename
+ or a SpecH5."""
+ g = self.sfh5["1.1/instrument"]
+ self.assertIsInstance(g, SpecH5Group) # let's be paranoid
+ write_to_h5(g, self.h5f, h5path="my instruments")
+
+ self.assertAlmostEqual(self.h5f["my instruments/positioners/Sslit1 HOff"][tuple()],
+ 16.197579, places=4)
+
def testTitle(self):
"""Test the value of a dataset"""
title12 = self.h5f["/1.2/title"].value
diff --git a/silx/io/test/test_utils.py b/silx/io/test/test_utils.py
index 15d0005..09074bb 100644
--- a/silx/io/test/test_utils.py
+++ b/silx/io/test/test_utils.py
@@ -23,23 +23,22 @@
# ############################################################################*/
"""Tests for utils module"""
-
+import io
import numpy
import os
import re
import shutil
import tempfile
import unittest
+import sys
from .. import utils
try:
import h5py
-except ImportError:
- h5py_missing = True
-else:
- h5py_missing = False
from ..utils import h5ls
+except ImportError:
+ h5py = None
try:
import fabio
@@ -49,7 +48,7 @@ except ImportError:
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "11/01/2017"
+__date__ = "28/09/2017"
expected_spec1 = r"""#F .*
@@ -208,7 +207,7 @@ def assert_match_any_string_in_list(test, pattern, list_of_strings):
return False
-@unittest.skipIf(h5py_missing, "Could not import h5py")
+@unittest.skipIf(h5py is None, "Could not import h5py")
class TestH5Ls(unittest.TestCase):
"""Test displaying the following HDF5 file structure:
@@ -291,125 +290,131 @@ class TestH5Ls(unittest.TestCase):
class TestOpen(unittest.TestCase):
"""Test `silx.io.utils.open` function."""
+ @classmethod
+ def setUpClass(cls):
+ cls.tmp_directory = tempfile.mkdtemp()
+ cls.createResources(cls.tmp_directory)
+
+ @classmethod
+ def createResources(cls, directory):
+
+ if h5py is not None:
+ cls.h5_filename = os.path.join(directory, "test.h5")
+ h5 = h5py.File(cls.h5_filename, mode="w")
+ h5["group/group/dataset"] = 50
+ h5.close()
+
+ cls.spec_filename = os.path.join(directory, "test.dat")
+ utils.savespec(cls.spec_filename, [1], [1.1], xlabel="x", ylabel="y",
+ fmt=["%d", "%.2f"], close_file=True, scan_number=1)
+
+ if fabio is not None:
+ cls.edf_filename = os.path.join(directory, "test.edf")
+ header = fabio.fabioimage.OrderedDict()
+ header["integer"] = "10"
+ data = numpy.array([[10, 50], [50, 10]])
+ fabiofile = fabio.edfimage.EdfImage(data, header)
+ fabiofile.write(cls.edf_filename)
+
+ cls.txt_filename = os.path.join(directory, "test.txt")
+ f = io.open(cls.txt_filename, "w+t")
+ f.write(u"Kikoo")
+ f.close()
+
+ cls.missing_filename = os.path.join(directory, "test.missing")
+
+ @classmethod
+ def tearDownClass(cls):
+ if sys.platform == "win32" and fabio is not None:
+ # gc collect is needed to close a file descriptor
+ # opened by fabio and not released.
+ # https://github.com/silx-kit/fabio/issues/167
+ import gc
+ gc.collect()
+ shutil.rmtree(cls.tmp_directory)
+
def testH5(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
- # create a file
- tmp = tempfile.NamedTemporaryFile(suffix=".h5", delete=True)
- tmp.file.close()
- h5 = h5py.File(tmp.name, "w")
- g = h5.create_group("arrays")
- g.create_dataset("scalar", data=10)
- h5.close()
-
- # load it
- f = utils.open(tmp.name)
+ f = utils.open(self.h5_filename)
self.assertIsNotNone(f)
self.assertIsInstance(f, h5py.File)
f.close()
def testH5With(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
- # create a file
- tmp = tempfile.NamedTemporaryFile(suffix=".h5", delete=True)
- tmp.file.close()
- h5 = h5py.File(tmp.name, "w")
- g = h5.create_group("arrays")
- g.create_dataset("scalar", data=10)
- h5.close()
-
- # load it
- with utils.open(tmp.name) as f:
+ with utils.open(self.h5_filename) as f:
self.assertIsNotNone(f)
self.assertIsInstance(f, h5py.File)
- def testSpec(self):
- # create a file
- tmp = tempfile.NamedTemporaryFile(mode="w+t", suffix=".dat", delete=True)
- tmp.file.close()
- utils.savespec(tmp.name, [1], [1.1], xlabel="x", ylabel="y",
- fmt=["%d", "%.2f"], close_file=True, scan_number=1)
+ def testH5_withPath(self):
+ if h5py is None:
+ self.skipTest("H5py is missing")
- # load it
- f = utils.open(tmp.name)
+ f = utils.open(self.h5_filename + "::/group/group/dataset")
self.assertIsNotNone(f)
- self.assertEquals(f.h5py_class, h5py.File)
+ self.assertEqual(f.h5py_class, h5py.Dataset)
+ self.assertEqual(f[()], 50)
f.close()
- def testSpecWith(self):
- # create a file
- tmp = tempfile.NamedTemporaryFile(mode="w+t", suffix=".dat", delete=True)
- tmp.file.close()
- utils.savespec(tmp.name, [1], [1.1], xlabel="x", ylabel="y",
- fmt=["%d", "%.2f"], close_file=True, scan_number=1)
+ def testH5With_withPath(self):
+ if h5py is None:
+ self.skipTest("H5py is missing")
- # load it
- with utils.open(tmp.name) as f:
+ with utils.open(self.h5_filename + "::/group/group") as f:
self.assertIsNotNone(f)
+ self.assertEqual(f.h5py_class, h5py.Group)
+ self.assertIn("dataset", f)
+
+ def testSpec(self):
+ f = utils.open(self.spec_filename)
+ self.assertIsNotNone(f)
+ if h5py is not None:
self.assertEquals(f.h5py_class, h5py.File)
+ f.close()
+
+ def testSpecWith(self):
+ with utils.open(self.spec_filename) as f:
+ self.assertIsNotNone(f)
+ if h5py is not None:
+ self.assertEquals(f.h5py_class, h5py.File)
def testEdf(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
if fabio is None:
self.skipTest("Fabio is missing")
- # create a file
- tmp = tempfile.NamedTemporaryFile(suffix=".edf", delete=True)
- tmp.file.close()
- header = fabio.fabioimage.OrderedDict()
- header["integer"] = "10"
- data = numpy.array([[10, 50], [50, 10]])
- fabiofile = fabio.edfimage.EdfImage(data, header)
- fabiofile.write(tmp.name)
-
- # load it
- f = utils.open(tmp.name)
+ f = utils.open(self.edf_filename)
self.assertIsNotNone(f)
self.assertEquals(f.h5py_class, h5py.File)
f.close()
def testEdfWith(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
if fabio is None:
self.skipTest("Fabio is missing")
- # create a file
- tmp = tempfile.NamedTemporaryFile(suffix=".edf", delete=True)
- tmp.file.close()
- header = fabio.fabioimage.OrderedDict()
- header["integer"] = "10"
- data = numpy.array([[10, 50], [50, 10]])
- fabiofile = fabio.edfimage.EdfImage(data, header)
- fabiofile.write(tmp.name)
-
- # load it
- with utils.open(tmp.name) as f:
+ with utils.open(self.edf_filename) as f:
self.assertIsNotNone(f)
self.assertEquals(f.h5py_class, h5py.File)
def testUnsupported(self):
- # create a file
- tmp = tempfile.NamedTemporaryFile(mode="w+t", suffix=".txt", delete=True)
- tmp.write("Kikoo")
- tmp.close()
-
- # load it
- self.assertRaises(IOError, utils.open, tmp.name)
+ self.assertRaises(IOError, utils.open, self.txt_filename)
def testNotExists(self):
# load it
- self.assertRaises(IOError, utils.open, "#$.")
+ self.assertRaises(IOError, utils.open, self.missing_filename)
class TestNodes(unittest.TestCase):
"""Test `silx.io.utils.is_` functions."""
def test_real_h5py_objects(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
name = tempfile.mktemp(suffix=".h5")
@@ -433,7 +438,7 @@ class TestNodes(unittest.TestCase):
os.unlink(name)
def test_h5py_like_file(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
class Foo(object):
@@ -445,7 +450,7 @@ class TestNodes(unittest.TestCase):
self.assertFalse(utils.is_dataset(obj))
def test_h5py_like_group(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
class Foo(object):
@@ -457,7 +462,7 @@ class TestNodes(unittest.TestCase):
self.assertFalse(utils.is_dataset(obj))
def test_h5py_like_dataset(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
class Foo(object):
@@ -469,7 +474,7 @@ class TestNodes(unittest.TestCase):
self.assertTrue(utils.is_dataset(obj))
def test_bad(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
class Foo(object):
@@ -481,7 +486,7 @@ class TestNodes(unittest.TestCase):
self.assertFalse(utils.is_dataset(obj))
def test_bad_api(self):
- if h5py_missing:
+ if h5py is None:
self.skipTest("H5py is missing")
class Foo(object):
@@ -494,15 +499,12 @@ class TestNodes(unittest.TestCase):
def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestSave))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestH5Ls))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestOpen))
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestNodes))
+ test_suite.addTest(loadTests(TestSave))
+ test_suite.addTest(loadTests(TestH5Ls))
+ test_suite.addTest(loadTests(TestOpen))
+ test_suite.addTest(loadTests(TestNodes))
return test_suite
diff --git a/silx/io/utils.py b/silx/io/utils.py
index 2ab4496..361a28b 100644
--- a/silx/io/utils.py
+++ b/silx/io/utils.py
@@ -28,7 +28,9 @@ import os.path
import sys
import time
import logging
-from silx.utils.decorators import deprecated
+
+from silx.utils.deprecation import deprecated
+from silx.utils.proxy import Proxy
try:
import h5py
@@ -39,9 +41,9 @@ else:
h5py_missing = False
-__authors__ = ["P. Knobel"]
+__authors__ = ["P. Knobel", "V. Valls"]
__license__ = "MIT"
-__date__ = "13/12/2016"
+__date__ = "28/09/2017"
logger = logging.getLogger(__name__)
@@ -377,14 +379,17 @@ def h5ls(h5group, lvl=0):
return h5repr
-def open(filename): # pylint:disable=redefined-builtin
+def _open(filename):
"""
Load a file as an `h5py.File`-like object.
Format supported:
- h5 files, if `h5py` module is installed
- - Spec files if `SpecFile` module is installed
- - a set of raster image formats (tiff, edf...) if `fabio` is installed
+ - SPEC files exposed as a NeXus layout
+ - raster files exposed as a NeXus layout (if `fabio` is installed)
+ - Numpy files ('npy' and 'npz' files)
+
+ The file is opened in read-only mode.
:param str filename: A filename
:raises: IOError if the file can't be loaded as an h5py.File like object
@@ -393,29 +398,124 @@ def open(filename): # pylint:disable=redefined-builtin
if not os.path.isfile(filename):
raise IOError("Filename '%s' must be a file path" % filename)
+ debugging_info = []
+
+ _, extension = os.path.splitext(filename)
+
if not h5py_missing:
if h5py.is_hdf5(filename):
- return h5py.File(filename)
+ return h5py.File(filename, "r")
+
+ if extension in [".npz", ".npy"]:
+ try:
+ from . import rawh5
+ return rawh5.NumpyFile(filename)
+ except (IOError, ValueError) as e:
+ debugging_info.append((sys.exc_info(),
+ "File '%s' can't be read as a numpy file." % filename))
try:
from . import fabioh5
return fabioh5.File(filename)
except ImportError:
- logger.debug("fabioh5 can't be loaded.", exc_info=True)
+ debugging_info.append((sys.exc_info(), "fabioh5 can't be loaded."))
except Exception:
- logger.debug("File '%s' can't be read as fabio file.", filename, exc_info=True)
+ debugging_info.append((sys.exc_info(),
+ "File '%s' can't be read as fabio file." % filename))
try:
from . import spech5
return spech5.SpecH5(filename)
except ImportError:
- logger.debug("spech5 can't be loaded.", exc_info=True)
+ debugging_info.append((sys.exc_info(),
+ "spech5 can't be loaded."))
except IOError:
- logger.debug("File '%s' can't be read as spec file.", filename, exc_info=True)
+ debugging_info.append((sys.exc_info(),
+ "File '%s' can't be read as spec file." % filename))
+ for exc_info, message in debugging_info:
+ logger.debug(message, exc_info=exc_info)
raise IOError("File '%s' can't be read as HDF5" % filename)
+class _MainNode(Proxy):
+ """A main node is a sub node of the HDF5 tree which is responsible of the
+ closure of the file.
+
+ It is a proxy to the sub node, plus support context manager and `close`
+ method usually provided by `h5py.File`.
+
+ :param h5_node: Target to the proxy.
+ :param h5_file: Main file. This object became the owner of this file.
+ """
+
+ def __init__(self, h5_node, h5_file):
+ super(_MainNode, self).__init__(h5_node)
+ self.__file = h5_file
+ self.__class = get_h5py_class(h5_node)
+
+ @property
+ def h5py_class(self):
+ """Returns the h5py classes which is mimicked by this class. It can be
+ one of `h5py.File, h5py.Group` or `h5py.Dataset`.
+
+ :rtype: Class
+ """
+ return self.__class
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_val, exc_tb):
+ self.close()
+
+ def close(self):
+ """Close the file"""
+ self.__file.close()
+ self.__file = None
+
+
+def open(filename): # pylint:disable=redefined-builtin
+ """
+ Open a file as an `h5py`-like object.
+
+ Format supported:
+ - h5 files, if `h5py` module is installed
+ - SPEC files exposed as a NeXus layout
+ - raster files exposed as a NeXus layout (if `fabio` is installed)
+ - Numpy files ('npy' and 'npz' files)
+
+ The filename can be trailled an HDF5 path using the separator `::`. In this
+ case the object returned is a proxy to the target node, implementing the
+ `close` function and supporting `with` context.
+
+ The file is opened in read-only mode.
+
+ :param str filename: A filename which can containt an HDF5 path by using
+ `::` separator.
+ :raises: IOError if the file can't be loaded or path can't be found
+ :rtype: h5py-like node
+ """
+ if "::" in filename:
+ filename, h5_path = filename.split("::")
+ else:
+ filename, h5_path = filename, "/"
+
+ h5_file = _open(filename)
+
+ if h5_path in ["/", ""]:
+ # Short cut
+ return h5_file
+
+ if h5_path not in h5_file:
+ msg = "File '%s' do not contains path '%s'." % (filename, h5_path)
+ raise IOError(msg)
+
+ node = h5_file[h5_path]
+ proxy = _MainNode(node, h5_file)
+ return proxy
+
+
@deprecated
def load(filename):
"""
@@ -447,7 +547,7 @@ def get_h5py_class(obj):
"""
if hasattr(obj, "h5py_class"):
return obj.h5py_class
- elif isinstance(obj, (h5py.File, h5py.Group, h5py.Dataset)):
+ elif isinstance(obj, (h5py.File, h5py.Group, h5py.Dataset, h5py.SoftLink)):
return obj.__class__
else:
return None
@@ -467,7 +567,7 @@ def is_file(obj):
def is_group(obj):
"""
- True is the object is an h5py.Group-like object.
+ True if the object is a h5py.Group-like object.
:param obj: An object
"""
@@ -479,7 +579,7 @@ def is_group(obj):
def is_dataset(obj):
"""
- True is the object is an h5py.Dataset-like object.
+ True if the object is a h5py.Dataset-like object.
:param obj: An object
"""
@@ -489,6 +589,18 @@ def is_dataset(obj):
return issubclass(class_, h5py.Dataset)
+def is_softlink(obj):
+ """
+ True if the object is a h5py.SoftLink-like object.
+
+ :param obj: An object
+ """
+ class_ = get_h5py_class(obj)
+ if class_ is None:
+ return False
+ return issubclass(class_, h5py.SoftLink)
+
+
if h5py_missing:
def raise_h5py_missing(obj):
logger.error("get_h5py_class/is_file/is_group/is_dataset requires h5py")
@@ -498,3 +610,4 @@ if h5py_missing:
is_file = raise_h5py_missing
is_group = raise_h5py_missing
is_dataset = raise_h5py_missing
+ is_softlink = raise_h5py_missing
diff --git a/silx/math/histogramnd/chistogramnd.c b/silx/math/chistogramnd.c
index 83ce0cf..ec40935 100644
--- a/silx/math/histogramnd/chistogramnd.c
+++ b/silx/math/chistogramnd.c
@@ -1,28 +1,34 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h",
+ "silx/math/histogramnd/include/histogramnd_c.h"
+ ],
+ "include_dirs": [
+ "silx/math/histogramnd/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.chistogramnd"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +47,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +59,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +275,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +296,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +335,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +361,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,18 +445,14 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__chistogramnd
-#define __PYX_HAVE_API__chistogramnd
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
+#define __PYX_HAVE__silx__math__chistogramnd
+#define __PYX_HAVE_API__silx__math__chistogramnd
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
-#include "include/histogramnd_c.h"
+#include "histogramnd_c.h"
#include "pythread.h"
#include "pystate.h"
#ifdef _OPENMP
@@ -249,20 +463,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -270,16 +471,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -296,11 +515,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -314,18 +533,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -336,7 +562,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -416,11 +642,13 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
+/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
@@ -444,11 +672,12 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "chistogramnd.pyx",
+ "silx/math/chistogramnd.pyx",
"__init__.pxd",
"stringsource",
"type.pxd",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -458,6 +687,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -493,26 +723,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -529,19 +761,19 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -550,7 +782,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -559,7 +791,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -568,7 +800,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -577,7 +809,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -586,7 +818,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -595,7 +827,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -604,7 +836,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -613,7 +845,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -622,7 +854,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -631,7 +863,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -640,7 +872,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
*/
typedef npy_long __pyx_t_5numpy_int_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -649,7 +881,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -658,7 +890,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -667,7 +899,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -676,7 +908,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -685,7 +917,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -694,7 +926,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -703,7 +935,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -712,7 +944,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
*/
typedef npy_double __pyx_t_5numpy_float_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -721,7 +953,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
*/
typedef npy_double __pyx_t_5numpy_double_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -729,6 +961,7 @@ typedef npy_double __pyx_t_5numpy_double_t;
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
@@ -738,7 +971,9 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
@@ -748,16 +983,17 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
-struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd;
+struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd;
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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -766,7 +1002,7 @@ struct __pyx_memoryviewslice_obj;
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -775,7 +1011,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -784,7 +1020,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -793,21 +1029,21 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
-/* "chistogramnd.pyx":36
+/* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
* histo_range,
* n_bins,
*/
-struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd {
+struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd {
PyObject_HEAD
PyObject *__pyx_v_sample_type;
PyObject *__pyx_v_weights_type;
};
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -816,6 +1052,7 @@ struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd {
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -831,7 +1068,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -844,7 +1081,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -867,7 +1104,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -884,7 +1121,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -904,7 +1155,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -916,6 +1167,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -932,19 +1186,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -967,18 +1221,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -993,52 +1248,102 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -1046,7 +1351,16 @@ 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);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyObjectSetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
@@ -1063,26 +1377,35 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
+/* PySequenceContains.proto */
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
+ int result = PySequence_Contains(seq, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
+/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CyFunction_GetClosure(f) \
+#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
-#define __Pyx_CyFunction_GetClassObj(f) \
+#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
-#define __Pyx_CyFunction_Defaults(type, f) \
+#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
-#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
+#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
@@ -1106,7 +1429,7 @@ typedef struct {
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1122,12 +1445,18 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
-static int __Pyx_CyFunction_init(void);
+static int __pyx_CyFunction_init(void);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -1153,7 +1482,8 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1169,63 +1499,132 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#else
+ #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#endif
+
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-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
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-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);
-
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1241,12 +1640,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -1259,20 +1653,29 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1284,9 +1687,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -1300,26 +1714,29 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
-static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_histo_opt_type(histo_opt_type value);
+
+/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
@@ -1332,7 +1749,8 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
@@ -1340,107 +1758,111 @@ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
#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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
#if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(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);
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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);
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
#if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(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);
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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);
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
+/* CIntToPy.proto */
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);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1451,18 +1873,25 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
@@ -1471,12 +1900,16 @@ static int __Pyx_check_binary_version(void);
#endif
#endif
+/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
+/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1489,19 +1922,21 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* 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 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
@@ -1518,10 +1953,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha
/* Module declarations from 'cython' */
-/* Module declarations from 'histogramnd_c' */
+/* Module declarations from 'silx.math.histogramnd_c' */
-/* Module declarations from 'chistogramnd' */
-static PyTypeObject *__pyx_ptype_12chistogramnd___pyx_scope_struct__chistogramnd = 0;
+/* Module declarations from 'silx.math.chistogramnd' */
+static PyTypeObject *__pyx_ptype_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1531,24 +1966,26 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
-static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, double, double); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, float, float); /*proto*/
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memviewslice, __Pyx_memviewslice, int, int, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, __Pyx_memviewslice, int, __pyx_t_5numpy_int32_t, __pyx_t_5numpy_int32_t); /*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*/
@@ -1586,227 +2023,173 @@ static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 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 };
static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 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 };
-#define __Pyx_MODULE_NAME "chistogramnd"
-int __pyx_module_is_main_chistogramnd = 0;
+#define __Pyx_MODULE_NAME "silx.math.chistogramnd"
+int __pyx_module_is_main_silx__math__chistogramnd = 0;
-/* Implementation of 'chistogramnd' */
+/* Implementation of 'silx.math.chistogramnd' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ImportError;
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_12chistogramnd_12chistogramnd_raise_unsupported_type(PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_weights, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max, PyObject *__pyx_v_last_bin_closed, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_wh_dtype); /* 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_12chistogramnd___pyx_scope_struct__chistogramnd(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_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_np[] = "np";
-static char __pyx_k_rc[] = "rc";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_any[] = "any";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_sum[] = "sum";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_date[] = "__date__";
-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_tile[] = "tile";
-static char __pyx_k_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_edges[] = "edges";
-static char __pyx_k_equal[] = "equal";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_flags[] = "flags";
-static char __pyx_k_histo[] = "histo";
-static char __pyx_k_i_dim[] = "i_dim";
-static char __pyx_k_int32[] = "int32";
-static char __pyx_k_ndmin[] = "ndmin";
-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_zeros[] = "zeros";
-static char __pyx_k_double[] = "double";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_n_bins[] = "n_bins";
-static char __pyx_k_n_dims[] = "n_dims";
-static char __pyx_k_n_elem[] = "n_elem";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_offset[] = "offset";
-static char __pyx_k_sample[] = "sample";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_uint32[] = "uint32";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_cumul_c[] = "cumul_c";
-static char __pyx_k_float32[] = "float32";
-static char __pyx_k_float64[] = "float64";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_histo_c[] = "histo_c";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_s_shape[] = "s_shape";
-static char __pyx_k_w_shape[] = "w_shape";
-static char __pyx_k_weights[] = "weights";
-static char __pyx_k_D_Naudet[] = "D. Naudet";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_n_bins_c[] = "n_bins_c";
-static char __pyx_k_sample_c[] = "sample_c";
-static char __pyx_k_wh_dtype[] = "wh_dtype";
-static char __pyx_k_Exception[] = "Exception";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_bin_edges[] = "bin_edges";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_weights_c[] = "weights_c";
-static char __pyx_k_01_02_2016[] = "01/02/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_weight_max[] = "weight_max";
-static char __pyx_k_weight_min[] = "weight_min";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_bin_edges_c[] = "bin_edges_c";
-static char __pyx_k_histo_range[] = "histo_range";
-static char __pyx_k_sample_type[] = "sample_type";
-static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static char __pyx_k_chistogramnd[] = "chistogramnd";
-static char __pyx_k_option_flags[] = "option_flags";
-static char __pyx_k_output_shape[] = "output_shape";
-static char __pyx_k_weights_type[] = "weights_type";
-static char __pyx_k_histo_range_c[] = "histo_range_c";
-static char __pyx_k_i_histo_range[] = "i_histo_range";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_weighted_histo[] = "weighted_histo";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_err_histo_range[] = "err_histo_range";
-static char __pyx_k_last_bin_closed[] = "last_bin_closed";
-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_MemoryView_of_r_object[] = "<MemoryView of %r object>";
-static char __pyx_k_raise_unsupported_type[] = "raise_unsupported_type";
-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_wh_dtype_type_not_supported_0[] = "<wh_dtype> type not supported : {0}.";
-static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
-static char __pyx_k_users_payno_Documents_dev_esrf[] = "/users/payno/Documents/dev/esrf/silx/paynoSilx/silx/silx/math/histogramnd/chistogramnd.pyx";
-static char __pyx_k_weights_must_be_an_array_whose[] = "<weights> must be an array whose length is equal to the number of samples.";
-static char __pyx_k_Case_not_supported_sample_0_and[] = "Case not supported - sample:{0} and weights:{1}.";
-static char __pyx_k_histo_must_be_a_C_CONTIGUOUS_nu[] = "<histo> must be a C_CONTIGUOUS numpy array.";
-static char __pyx_k_histo_range_error_expected_n_di[] = "<histo_range> error : expected {n_dims} sets of lower and upper bin edges, got the following instead : {histo_range}. (provided <sample> contains {n_dims}D values)";
-static char __pyx_k_histogramnd_returned_an_error_0[] = "histogramnd returned an error : {0}";
-static char __pyx_k_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/math/histogramnd/chistogramnd.pyx";
-static char __pyx_k_n_bins_only_positive_values_all[] = "<n_bins> : only positive values allowed.";
-static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_weighted_histo_must_be_a_C_CONT[] = "<weighted_histo> must be a C_CONTIGUOUS numpy array.";
-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_Provided_histo_array_doesn_t_hav[] = "Provided <histo> array doesn't have a shape compatible with <n_bins> : should be {0} instead of {1}.";
-static char __pyx_k_Provided_weighted_histo_array_do[] = "Provided <weighted_histo> array doesn't have a shape compatible with <n_bins> : should be {0} instead of {1}.";
-static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
-static char __pyx_k_chistogramnd_locals_raise_unsupp[] = "chistogramnd.<locals>.raise_unsupported_type";
-static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
-static char __pyx_k_histogramnd_failed_to_allocate_m[] = "histogramnd failed to allocate memory.";
-static char __pyx_k_n_bins_must_be_either_a_scalar_s[] = "n_bins must be either a scalar (same number of bins for all dimensions) or an array (number of bins for each dimension).";
-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 char __pyx_k_Provided_histo_array_doesn_t_hav_2[] = "Provided <histo> array doesn't have the expected type : should be {0} instead of {1}.";
-static char __pyx_k_Provided_weighted_histo_array_do_2[] = "Provided <weighted_histo> array doesn't have the expected type : should be {0} or {1} instead of {2}.";
-static PyObject *__pyx_kp_s_01_02_2016;
+static const char __pyx_k_N[] = "N";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_np[] = "np";
+static const char __pyx_k_rc[] = "rc";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_any[] = "any";
+static const char __pyx_k_inf[] = "inf";
+static const char __pyx_k_nan[] = "nan";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_sum[] = "sum";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_tile[] = "tile";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_edges[] = "edges";
+static const char __pyx_k_equal[] = "equal";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_histo[] = "histo";
+static const char __pyx_k_i_dim[] = "i_dim";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_ndmin[] = "ndmin";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_double[] = "double";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_n_bins[] = "n_bins";
+static const char __pyx_k_n_dims[] = "n_dims";
+static const char __pyx_k_n_elem[] = "n_elem";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_offset[] = "offset";
+static const char __pyx_k_sample[] = "sample";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_uint32[] = "uint32";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_cumul_c[] = "cumul_c";
+static const char __pyx_k_float32[] = "float32";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_histo_c[] = "histo_c";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_s_shape[] = "s_shape";
+static const char __pyx_k_w_shape[] = "w_shape";
+static const char __pyx_k_weights[] = "weights";
+static const char __pyx_k_D_Naudet[] = "D. Naudet";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_n_bins_c[] = "n_bins_c";
+static const char __pyx_k_sample_c[] = "sample_c";
+static const char __pyx_k_wh_dtype[] = "wh_dtype";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_bin_edges[] = "bin_edges";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_weights_c[] = "weights_c";
+static const char __pyx_k_02_10_2017[] = "02/10/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_weight_max[] = "weight_max";
+static const char __pyx_k_weight_min[] = "weight_min";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_bin_edges_c[] = "bin_edges_c";
+static const char __pyx_k_histo_range[] = "histo_range";
+static const char __pyx_k_sample_type[] = "sample_type";
+static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_chistogramnd[] = "chistogramnd";
+static const char __pyx_k_newbyteorder[] = "newbyteorder";
+static const char __pyx_k_option_flags[] = "option_flags";
+static const char __pyx_k_output_shape[] = "output_shape";
+static const char __pyx_k_weights_type[] = "weights_type";
+static const char __pyx_k_histo_range_c[] = "histo_range_c";
+static const char __pyx_k_i_histo_range[] = "i_histo_range";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_weighted_histo[] = "weighted_histo";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_err_histo_range[] = "err_histo_range";
+static const char __pyx_k_last_bin_closed[] = "last_bin_closed";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_raise_unsupported_type[] = "raise_unsupported_type";
+static const char __pyx_k_silx_math_chistogramnd[] = "silx.math.chistogramnd";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Range_value_can_t_be_nan[] = "Range value can't be nan";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_wh_dtype_type_not_supported_0[] = "<wh_dtype> type not supported : {0}.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_weights_must_be_an_array_whose[] = "<weights> must be an array whose length is equal to the number of samples.";
+static const char __pyx_k_Case_not_supported_sample_0_and[] = "Case not supported - sample:{0} and weights:{1}.";
+static const char __pyx_k_histo_must_be_a_C_CONTIGUOUS_nu[] = "<histo> must be a C_CONTIGUOUS numpy array.";
+static const char __pyx_k_histo_range_error_expected_n_di[] = "<histo_range> error : expected {n_dims} sets of lower and upper bin edges, got the following instead : {histo_range}. (provided <sample> contains {n_dims}D values)";
+static const char __pyx_k_histogramnd_returned_an_error_0[] = "histogramnd returned an error : {0}";
+static const char __pyx_k_n_bins_only_positive_values_all[] = "<n_bins> : only positive values allowed.";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/chistogramnd.pyx";
+static const char __pyx_k_weighted_histo_must_be_a_C_CONT[] = "<weighted_histo> must be a C_CONTIGUOUS numpy array.";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_Provided_histo_array_doesn_t_hav[] = "Provided <histo> array doesn't have a shape compatible with <n_bins> : should be {0} instead of {1}.";
+static const char __pyx_k_Provided_weighted_histo_array_do[] = "Provided <weighted_histo> array doesn't have a shape compatible with <n_bins> : should be {0} instead of {1}.";
+static const char __pyx_k_Range_parameter_should_be_finite[] = "Range parameter should be finite value";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_chistogramnd_locals_raise_unsupp[] = "chistogramnd.<locals>.raise_unsupported_type";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_histogramnd_failed_to_allocate_m[] = "histogramnd failed to allocate memory.";
+static const char __pyx_k_n_bins_must_be_either_a_scalar_s[] = "n_bins must be either a scalar (same number of bins for all dimensions) or an array (number of bins for each dimension).";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static const char __pyx_k_Provided_histo_array_doesn_t_hav_2[] = "Provided <histo> array doesn't have the expected type : should be {0} instead of {1}.";
+static const char __pyx_k_Provided_weighted_histo_array_do_2[] = "Provided <weighted_histo> array doesn't have the expected type : should be {0} or {1} instead of {2}.";
+static PyObject *__pyx_kp_s_02_10_2017;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C_CONTIGUOUS;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
@@ -1815,9 +2198,9 @@ static PyObject *__pyx_kp_s_Case_not_supported_sample_0_and;
static PyObject *__pyx_kp_s_D_Naudet;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
-static PyObject *__pyx_n_s_Exception;
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_ImportError;
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;
@@ -1826,6 +2209,7 @@ 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_n_s_N;
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;
@@ -1833,6 +2217,8 @@ static PyObject *__pyx_kp_s_Provided_histo_array_doesn_t_hav;
static PyObject *__pyx_kp_s_Provided_histo_array_doesn_t_hav_2;
static PyObject *__pyx_kp_s_Provided_weighted_histo_array_do;
static PyObject *__pyx_kp_s_Provided_weighted_histo_array_do_2;
+static PyObject *__pyx_kp_s_Range_parameter_should_be_finite;
+static PyObject *__pyx_kp_s_Range_value_can_t_be_nan;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
@@ -1858,6 +2244,7 @@ static PyObject *__pyx_n_s_double;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_edges;
+static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equal;
static PyObject *__pyx_n_s_err_histo_range;
@@ -1881,6 +2268,7 @@ static PyObject *__pyx_n_s_i_dim;
static PyObject *__pyx_n_s_i_histo_range;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_inf;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
@@ -1888,7 +2276,6 @@ static PyObject *__pyx_n_s_last_bin_closed;
static PyObject *__pyx_n_s_license;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_memview;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_n_bins;
static PyObject *__pyx_n_s_n_bins_c;
@@ -1898,12 +2285,16 @@ static PyObject *__pyx_n_s_n_dims;
static PyObject *__pyx_n_s_n_elem;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_n_s_nan;
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_ndmin;
+static PyObject *__pyx_n_s_newbyteorder;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_option_flags;
@@ -1920,6 +2311,7 @@ static PyObject *__pyx_n_s_sample;
static PyObject *__pyx_n_s_sample_c;
static PyObject *__pyx_n_s_sample_type;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_silx_math_chistogramnd;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_step;
@@ -1936,6 +2328,7 @@ 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_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_w_shape;
static PyObject *__pyx_n_s_weight_max;
static PyObject *__pyx_n_s_weight_min;
@@ -1947,8 +2340,48 @@ static PyObject *__pyx_kp_s_weights_must_be_an_array_whose;
static PyObject *__pyx_n_s_weights_type;
static PyObject *__pyx_n_s_wh_dtype;
static PyObject *__pyx_kp_s_wh_dtype_type_not_supported_0;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_weights, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max, PyObject *__pyx_v_last_bin_closed, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_wh_dtype); /* 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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
@@ -1960,12 +2393,12 @@ 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__23;
-static PyObject *__pyx_slice__24;
-static PyObject *__pyx_slice__25;
+static PyObject *__pyx_slice__33;
+static PyObject *__pyx_slice__34;
+static PyObject *__pyx_slice__35;
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;
@@ -1977,17 +2410,27 @@ 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__32;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_codeobj__8;
-static PyObject *__pyx_codeobj__28;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__39;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__41;
+static PyObject *__pyx_tuple__42;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_codeobj__11;
+static PyObject *__pyx_codeobj__38;
-/* "chistogramnd.pyx":36
+/* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
@@ -1996,10 +2439,10 @@ static PyObject *__pyx_codeobj__28;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_12chistogramnd_chistogramnd[] = "chistogramnd(sample, histo_range, n_bins, weights=None, weight_min=None, weight_max=None, last_bin_closed=False, histo=None, weighted_histo=None, wh_dtype=None)\nComputes the multidimensional histogram of some data.\n\n :param sample:\n The data to be histogrammed.\n Its shape must be either\n (N,) if it contains one dimensional coordinates,\n or an (N,D) array where the rows are the\n coordinates of points in a D dimensional space.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n\n .. warning:: if sample is not a C_CONTIGUOUS ndarray (e.g : a non\n contiguous slice) then histogramnd will have to do make an internal\n copy.\n :type sample: :class:`numpy.array`\n\n :param histo_range:\n A (N, 2) array containing the histogram range along each dimension,\n where N is the sample's number of dimensions.\n :type histo_range: array_like\n\n :param n_bins:\n The number of bins :\n * a scalar (same number of bins for all dimensions)\n * a D elements array (number of bins for each dimensions)\n :type n_bins: scalar or array_like\n\n :param weights:\n A N elements numpy array of values associated with\n each sample.\n The values of the *weighted_histo* array\n returned by the function are equal to the sum of\n the weights associated with the samples falling\n into each bin.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n\n .. note:: If None, the weighted histogram returned will be None.\n :type weights: *optional*, :class:`numpy.array`\n\n :param weight_min:\n Use this parameter to filter out all samples whose\n weights are lower than this value.\n\n .. note:: This value will be cast to the same type\n as *weig""hts*.\n :type weight_min: *optional*, scalar\n\n :param weight_max:\n Use this parameter to filter out all samples whose\n weights are higher than this value.\n\n .. note:: This value will be cast to the same type\n as *weights*.\n\n :type weight_max: *optional*, scalar\n\n :param last_bin_closed:\n By default the last bin is half\n open (i.e.: [x,y) ; x included, y\n excluded), like all the other bins.\n Set this parameter to true if you want\n the LAST bin to be closed.\n :type last_bin_closed: *optional*, :class:`python.boolean`\n\n :param histo:\n Use this parameter if you want to pass your\n own histogram array instead of the one\n created by this function. New values\n will be added to this array. The returned array\n will then be this one (same reference).\n\n .. warning:: If the histo array was created by a previous\n call to histogramnd then the user is\n responsible for providing the same parameters\n (*n_bins*, *histo_range*, ...).\n :type histo: *optional*, :class:`numpy.array`\n\n :param weighted_histo:\n Use this parameter if you want to pass your\n own weighted histogram array instead of\n the created by this function. New\n values will be added to this array. The returned array\n will then be this one (same reference).\n\n .. warning:: If the weighted_histo array was created by a previous\n call to histogramnd then the user is\n responsible for providing the same parameters\n (*n_bins*, *histo_range*, ...).\n\n .. warning:: if weighted_histo is not a C_CONTIGUOUS ndarray (e.g : a\n non contiguous slice) then histogramnd will have to do make an\n internal copy.\n :type weighted_histo: *optional*, :class:`numpy.array`\n \n :param wh_dtype: type of the weighted histogram array. T""his parameter is\n ignored if *weighted_histo* is provided. If not provided, the\n weighted histogram array will contain values of the same type as\n *weights*. Allowed values are : `numpu.double` and `numpy.float32`.\n :type wh_dtype: *optional*, numpy data type\n\n :return: Histogram (bin counts, always returned), weighted histogram of\n the sample (or *None* if weights is *None*) and bin edges for each\n dimension.\n :rtype: *tuple* (:class:`numpy.array`, :class:`numpy.array`, `tuple`) or\n (:class:`numpy.array`, None, `tuple`)\n ";
-static PyMethodDef __pyx_mdef_12chistogramnd_1chistogramnd = {"chistogramnd", (PyCFunction)__pyx_pw_12chistogramnd_1chistogramnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_12chistogramnd_chistogramnd};
-static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12chistogramnd_chistogramnd[] = "chistogramnd(sample, histo_range, n_bins, weights=None, weight_min=None, weight_max=None, last_bin_closed=False, histo=None, weighted_histo=None, wh_dtype=None)\nComputes the multidimensional histogram of some data.\n\n :param sample:\n The data to be histogrammed.\n Its shape must be either\n (N,) if it contains one dimensional coordinates,\n or an (N,D) array where the rows are the\n coordinates of points in a D dimensional space.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n\n .. warning:: if sample is not a C_CONTIGUOUS ndarray (e.g : a non\n contiguous slice) then histogramnd will have to do make an internal\n copy.\n :type sample: :class:`numpy.array`\n\n :param histo_range:\n A (N, 2) array containing the histogram range along each dimension,\n where N is the sample's number of dimensions.\n :type histo_range: array_like\n\n :param n_bins:\n The number of bins :\n * a scalar (same number of bins for all dimensions)\n * a D elements array (number of bins for each dimensions)\n :type n_bins: scalar or array_like\n\n :param weights:\n A N elements numpy array of values associated with\n each sample.\n The values of the *weighted_histo* array\n returned by the function are equal to the sum of\n the weights associated with the samples falling\n into each bin.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n\n .. note:: If None, the weighted histogram returned will be None.\n :type weights: *optional*, :class:`numpy.array`\n\n :param weight_min:\n Use this parameter to filter out all samples whose\n weights are lower than this value.\n\n .. note:: This value will be cast to the same type\n as *weig""hts*.\n :type weight_min: *optional*, scalar\n\n :param weight_max:\n Use this parameter to filter out all samples whose\n weights are higher than this value.\n\n .. note:: This value will be cast to the same type\n as *weights*.\n\n :type weight_max: *optional*, scalar\n\n :param last_bin_closed:\n By default the last bin is half\n open (i.e.: [x,y) ; x included, y\n excluded), like all the other bins.\n Set this parameter to true if you want\n the LAST bin to be closed.\n :type last_bin_closed: *optional*, :class:`python.boolean`\n\n :param histo:\n Use this parameter if you want to pass your\n own histogram array instead of the one\n created by this function. New values\n will be added to this array. The returned array\n will then be this one (same reference).\n\n .. warning:: If the histo array was created by a previous\n call to histogramnd then the user is\n responsible for providing the same parameters\n (*n_bins*, *histo_range*, ...).\n :type histo: *optional*, :class:`numpy.array`\n\n :param weighted_histo:\n Use this parameter if you want to pass your\n own weighted histogram array instead of\n the created by this function. New\n values will be added to this array. The returned array\n will then be this one (same reference).\n\n .. warning:: If the weighted_histo array was created by a previous\n call to histogramnd then the user is\n responsible for providing the same parameters\n (*n_bins*, *histo_range*, ...).\n\n .. warning:: if weighted_histo is not a C_CONTIGUOUS ndarray (e.g : a\n non contiguous slice) then histogramnd will have to do make an\n internal copy.\n :type weighted_histo: *optional*, :class:`numpy.array`\n\n :param wh_dtype: type of the weighted histogram array. This ""parameter is\n ignored if *weighted_histo* is provided. If not provided, the\n weighted histogram array will contain values of the same type as\n *weights*. Allowed values are : `numpu.double` and `numpy.float32`.\n :type wh_dtype: *optional*, numpy data type\n\n :return: Histogram (bin counts, always returned), weighted histogram of\n the sample (or *None* if weights is *None*) and bin edges for each\n dimension.\n :rtype: *tuple* (:class:`numpy.array`, :class:`numpy.array`, `tuple`) or\n (:class:`numpy.array`, None, `tuple`)\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_12chistogramnd_1chistogramnd = {"chistogramnd", (PyCFunction)__pyx_pw_4silx_4math_12chistogramnd_1chistogramnd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12chistogramnd_chistogramnd};
+static PyObject *__pyx_pw_4silx_4math_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sample = 0;
PyObject *__pyx_v_histo_range = 0;
PyObject *__pyx_v_n_bins = 0;
@@ -2010,9 +2453,6 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
PyObject *__pyx_v_histo = 0;
PyObject *__pyx_v_weighted_histo = 0;
PyObject *__pyx_v_wh_dtype = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("chistogramnd (wrapper)", 0);
@@ -2020,7 +2460,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sample,&__pyx_n_s_histo_range,&__pyx_n_s_n_bins,&__pyx_n_s_weights,&__pyx_n_s_weight_min,&__pyx_n_s_weight_max,&__pyx_n_s_last_bin_closed,&__pyx_n_s_histo,&__pyx_n_s_weighted_histo,&__pyx_n_s_wh_dtype,0};
PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
- /* "chistogramnd.pyx":39
+ /* "silx/math/chistogramnd.pyx":39
* histo_range,
* n_bins,
* weights=None, # <<<<<<<<<<<<<<
@@ -2029,7 +2469,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[3] = ((PyObject *)Py_None);
- /* "chistogramnd.pyx":40
+ /* "silx/math/chistogramnd.pyx":40
* n_bins,
* weights=None,
* weight_min=None, # <<<<<<<<<<<<<<
@@ -2038,7 +2478,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[4] = ((PyObject *)Py_None);
- /* "chistogramnd.pyx":41
+ /* "silx/math/chistogramnd.pyx":41
* weights=None,
* weight_min=None,
* weight_max=None, # <<<<<<<<<<<<<<
@@ -2047,7 +2487,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[5] = ((PyObject *)Py_None);
- /* "chistogramnd.pyx":42
+ /* "silx/math/chistogramnd.pyx":42
* weight_min=None,
* weight_max=None,
* last_bin_closed=False, # <<<<<<<<<<<<<<
@@ -2056,7 +2496,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[6] = ((PyObject *)Py_False);
- /* "chistogramnd.pyx":43
+ /* "silx/math/chistogramnd.pyx":43
* weight_max=None,
* last_bin_closed=False,
* histo=None, # <<<<<<<<<<<<<<
@@ -2065,7 +2505,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[7] = ((PyObject *)Py_None);
- /* "chistogramnd.pyx":44
+ /* "silx/math/chistogramnd.pyx":44
* last_bin_closed=False,
* histo=None,
* weighted_histo=None, # <<<<<<<<<<<<<<
@@ -2074,7 +2514,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
values[8] = ((PyObject *)Py_None);
- /* "chistogramnd.pyx":45
+ /* "silx/math/chistogramnd.pyx":45
* histo=None,
* weighted_histo=None,
* wh_dtype=None): # <<<<<<<<<<<<<<
@@ -2107,12 +2547,12 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, 1); __PYX_ERR(0, 36, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, 2); __PYX_ERR(0, 36, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -2151,7 +2591,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chistogramnd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chistogramnd") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -2182,15 +2622,15 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("chistogramnd", 0, 3, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 36, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd.chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd.chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_12chistogramnd_chistogramnd(__pyx_self, __pyx_v_sample, __pyx_v_histo_range, __pyx_v_n_bins, __pyx_v_weights, __pyx_v_weight_min, __pyx_v_weight_max, __pyx_v_last_bin_closed, __pyx_v_histo, __pyx_v_weighted_histo, __pyx_v_wh_dtype);
+ __pyx_r = __pyx_pf_4silx_4math_12chistogramnd_chistogramnd(__pyx_self, __pyx_v_sample, __pyx_v_histo_range, __pyx_v_n_bins, __pyx_v_weights, __pyx_v_weight_min, __pyx_v_weight_max, __pyx_v_last_bin_closed, __pyx_v_histo, __pyx_v_weighted_histo, __pyx_v_wh_dtype);
- /* "chistogramnd.pyx":36
+ /* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
@@ -2203,7 +2643,7 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
return __pyx_r;
}
-/* "chistogramnd.pyx":292
+/* "silx/math/chistogramnd.pyx":299
* # functions. so I have to explicitly list them all...
*
* def raise_unsupported_type(): # <<<<<<<<<<<<<<
@@ -2212,50 +2652,47 @@ static PyObject *__pyx_pw_12chistogramnd_1chistogramnd(PyObject *__pyx_self, PyO
*/
/* Python wrapper */
-static PyObject *__pyx_pw_12chistogramnd_12chistogramnd_1raise_unsupported_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyMethodDef __pyx_mdef_12chistogramnd_12chistogramnd_1raise_unsupported_type = {"raise_unsupported_type", (PyCFunction)__pyx_pw_12chistogramnd_12chistogramnd_1raise_unsupported_type, METH_NOARGS, 0};
-static PyObject *__pyx_pw_12chistogramnd_12chistogramnd_1raise_unsupported_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_12chistogramnd_12chistogramnd_1raise_unsupported_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_12chistogramnd_12chistogramnd_1raise_unsupported_type = {"raise_unsupported_type", (PyCFunction)__pyx_pw_4silx_4math_12chistogramnd_12chistogramnd_1raise_unsupported_type, METH_NOARGS, 0};
+static PyObject *__pyx_pw_4silx_4math_12chistogramnd_12chistogramnd_1raise_unsupported_type(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("raise_unsupported_type (wrapper)", 0);
- __pyx_r = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_self);
+ __pyx_r = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_self);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(PyObject *__pyx_self) {
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_cur_scope;
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_outer_scope;
+static PyObject *__pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(PyObject *__pyx_self) {
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_cur_scope;
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_outer_scope;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
- Py_ssize_t __pyx_t_4;
+ int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("raise_unsupported_type", 0);
- __pyx_outer_scope = (struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *) __Pyx_CyFunction_GetClosure(__pyx_self);
+ __pyx_outer_scope = (struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *) __Pyx_CyFunction_GetClosure(__pyx_self);
__pyx_cur_scope = __pyx_outer_scope;
- /* "chistogramnd.pyx":295
+ /* "silx/math/chistogramnd.pyx":302
* raise TypeError('Case not supported - sample:{0} '
* 'and weights:{1}.'
* ''.format(sample_type, weights_type)) # <<<<<<<<<<<<<<
*
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Case_not_supported_sample_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Case_not_supported_sample_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(!__pyx_cur_scope->__pyx_v_sample_type)) { __Pyx_RaiseClosureNameError("sample_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
- if (unlikely(!__pyx_cur_scope->__pyx_v_weights_type)) { __Pyx_RaiseClosureNameError("weights_type"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_sample_type)) { __Pyx_RaiseClosureNameError("sample_type"); __PYX_ERR(0, 302, __pyx_L1_error) }
+ if (unlikely(!__pyx_cur_scope->__pyx_v_weights_type)) { __Pyx_RaiseClosureNameError("weights_type"); __PYX_ERR(0, 302, __pyx_L1_error) }
__pyx_t_3 = NULL;
__pyx_t_4 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2265,42 +2702,60 @@ static PyObject *__pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(P
__pyx_t_4 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- }
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sample_type);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_sample_type);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sample_type);
- __Pyx_INCREF(__pyx_cur_scope->__pyx_v_weights_type);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_weights_type);
- __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_weights_type);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_sample_type, __pyx_cur_scope->__pyx_v_weights_type};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_sample_type, __pyx_cur_scope->__pyx_v_weights_type};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_sample_type);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_sample_type);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_sample_type);
+ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_weights_type);
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_weights_type);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_weights_type);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "chistogramnd.pyx":293
+ /* "silx/math/chistogramnd.pyx":300
*
* def raise_unsupported_type():
* raise TypeError('Case not supported - sample:{0} ' # <<<<<<<<<<<<<<
* 'and weights:{1}.'
* ''.format(sample_type, weights_type))
*/
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 300, __pyx_L1_error)
- /* "chistogramnd.pyx":292
+ /* "silx/math/chistogramnd.pyx":299
* # functions. so I have to explicitly list them all...
*
* def raise_unsupported_type(): # <<<<<<<<<<<<<<
@@ -2314,14 +2769,14 @@ static PyObject *__pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(P
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("chistogramnd.chistogramnd.raise_unsupported_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd.chistogramnd.raise_unsupported_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "chistogramnd.pyx":36
+/* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
@@ -2329,8 +2784,8 @@ static PyObject *__pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(P
* n_bins,
*/
-static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_weights, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max, PyObject *__pyx_v_last_bin_closed, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_wh_dtype) {
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_cur_scope;
+static PyObject *__pyx_pf_4silx_4math_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_weights, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max, PyObject *__pyx_v_last_bin_closed, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_wh_dtype) {
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_cur_scope;
PyObject *__pyx_v_s_shape = NULL;
PyObject *__pyx_v_n_dims = NULL;
PyObject *__pyx_v_w_shape = NULL;
@@ -2362,157 +2817,41 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
PyObject *__pyx_t_6 = NULL;
int __pyx_t_7;
Py_ssize_t __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
__Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_14 = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_t_15;
- int __pyx_t_16;
+ __Pyx_memviewslice __pyx_t_16 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_17 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_18 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_19 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_20 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_21 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_22;
+ int __pyx_t_21;
+ double __pyx_t_22;
double __pyx_t_23;
- double __pyx_t_24;
- __Pyx_memviewslice __pyx_t_25 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_26 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_24 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ float __pyx_t_25;
+ float __pyx_t_26;
__Pyx_memviewslice __pyx_t_27 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_28 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_29 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __pyx_t_5numpy_int32_t __pyx_t_28;
+ __pyx_t_5numpy_int32_t __pyx_t_29;
__Pyx_memviewslice __pyx_t_30 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_t_31 = { 0, 0, { 0 }, { 0 }, { 0 } };
- float __pyx_t_32;
- float __pyx_t_33;
- __Pyx_memviewslice __pyx_t_34 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_35 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_36 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_37 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_38 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_39 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_40 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __pyx_t_5numpy_int32_t __pyx_t_41;
- __pyx_t_5numpy_int32_t __pyx_t_42;
- __Pyx_memviewslice __pyx_t_43 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_44 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_45 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_46 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_47 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_48 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_49 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_50 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_51 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_52 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_53 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_54 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_55 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_56 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_57 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_58 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_59 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_60 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_61 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_62 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_63 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_64 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_65 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_66 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_67 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_68 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_69 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_70 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_71 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_72 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_73 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_74 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_75 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_76 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_77 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_78 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_79 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_80 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_81 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_82 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_83 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_84 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_85 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_86 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_87 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_88 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_89 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_90 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_91 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_92 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_93 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_94 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_95 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_96 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_97 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_98 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_99 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_100 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_101 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_102 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_103 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_104 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_105 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_106 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_107 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_108 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_109 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_110 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_111 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_112 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_113 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_114 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_115 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_116 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_117 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_118 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_119 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_120 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_121 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_122 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_123 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_124 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_125 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_126 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_127 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_128 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_129 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_130 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_131 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_132 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_133 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_134 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_135 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_136 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_137 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_138 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_139 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_140 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_141 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_142 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_143 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_144 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_145 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_146 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_147 = { 0, 0, { 0 }, { 0 }, { 0 } };
- PyObject *(*__pyx_t_148)(PyObject *);
- int __pyx_t_149;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ __Pyx_memviewslice __pyx_t_32 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *(*__pyx_t_33)(PyObject *);
+ int __pyx_t_34;
__Pyx_RefNannySetupContext("chistogramnd", 0);
- __pyx_cur_scope = (struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *)__pyx_tp_new_12chistogramnd___pyx_scope_struct__chistogramnd(__pyx_ptype_12chistogramnd___pyx_scope_struct__chistogramnd, __pyx_empty_tuple, NULL);
+ __pyx_cur_scope = (struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)__pyx_tp_new_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(__pyx_ptype_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd, __pyx_empty_tuple, NULL);
if (unlikely(!__pyx_cur_scope)) {
- __Pyx_RefNannyFinishContext();
- return NULL;
+ __pyx_cur_scope = ((struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 36, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
}
- __Pyx_GOTREF(__pyx_cur_scope);
__Pyx_INCREF(__pyx_v_histo_range);
__Pyx_INCREF(__pyx_v_n_bins);
__Pyx_INCREF(__pyx_v_weight_min);
@@ -2521,8 +2860,8 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_v_weighted_histo);
__Pyx_INCREF(__pyx_v_wh_dtype);
- /* "chistogramnd.pyx":154
- * """ # noqa
+ /* "silx/math/chistogramnd.pyx":154
+ * """
*
* if wh_dtype is None: # <<<<<<<<<<<<<<
* wh_dtype = np.double
@@ -2532,24 +2871,32 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":155
+ /* "silx/math/chistogramnd.pyx":155
*
* if wh_dtype is None:
* wh_dtype = np.double # <<<<<<<<<<<<<<
* elif wh_dtype not in (np.double, np.float32):
* raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype))
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_wh_dtype, __pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd.pyx":154
+ * """
+ *
+ * if wh_dtype is None: # <<<<<<<<<<<<<<
+ * wh_dtype = np.double
+ * elif wh_dtype not in (np.double, np.float32):
+ */
goto __pyx_L3;
}
- /* "chistogramnd.pyx":156
+ /* "silx/math/chistogramnd.pyx":156
* if wh_dtype is None:
* wh_dtype = np.double
* elif wh_dtype not in (np.double, np.float32): # <<<<<<<<<<<<<<
@@ -2558,28 +2905,28 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
*/
__Pyx_INCREF(__pyx_v_wh_dtype);
__pyx_t_4 = __pyx_v_wh_dtype;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L4_bool_binop_done;
}
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_2 = __pyx_t_1;
__pyx_L4_bool_binop_done:;
@@ -2587,17 +2934,17 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd.pyx":157
+ /* "silx/math/chistogramnd.pyx":157
* wh_dtype = np.double
* elif wh_dtype not in (np.double, np.float32):
* raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype)) # <<<<<<<<<<<<<<
*
* if (weighted_histo is not None and
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_wh_dtype_type_not_supported_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_wh_dtype_type_not_supported_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -2607,35 +2954,61 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
}
}
if (!__pyx_t_5) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_wh_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_wh_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __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 = 157; __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;
- __Pyx_INCREF(__pyx_v_wh_dtype);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_wh_dtype);
- __Pyx_GIVEREF(__pyx_v_wh_dtype);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_wh_dtype};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_wh_dtype};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_wh_dtype);
+ __Pyx_GIVEREF(__pyx_v_wh_dtype);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_wh_dtype);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 157, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":156
+ * if wh_dtype is None:
+ * wh_dtype = np.double
+ * elif wh_dtype not in (np.double, np.float32): # <<<<<<<<<<<<<<
+ * raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype))
+ *
+ */
}
__pyx_L3:;
- /* "chistogramnd.pyx":159
+ /* "silx/math/chistogramnd.pyx":159
* raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype))
*
* if (weighted_histo is not None and # <<<<<<<<<<<<<<
@@ -2650,16 +3023,16 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
goto __pyx_L7_bool_binop_done;
}
- /* "chistogramnd.pyx":160
+ /* "silx/math/chistogramnd.pyx":160
*
* if (weighted_histo is not None and
* weighted_histo.flags['C_CONTIGUOUS'] is False): # <<<<<<<<<<<<<<
* raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.')
*
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = PyObject_GetItem(__pyx_t_4, __pyx_n_s_C_CONTIGUOUS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = (__pyx_t_3 == Py_False);
@@ -2667,23 +3040,39 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_7 != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L7_bool_binop_done:;
+
+ /* "silx/math/chistogramnd.pyx":159
+ * raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype))
+ *
+ * if (weighted_histo is not None and # <<<<<<<<<<<<<<
+ * weighted_histo.flags['C_CONTIGUOUS'] is False):
+ * raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.')
+ */
if (__pyx_t_1) {
- /* "chistogramnd.pyx":161
+ /* "silx/math/chistogramnd.pyx":161
* if (weighted_histo is not None and
* weighted_histo.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if histo is not None and histo.flags['C_CONTIGUOUS'] is False:
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 161, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":159
+ * raise ValueError('<wh_dtype> type not supported : {0}.'.format(wh_dtype))
+ *
+ * if (weighted_histo is not None and # <<<<<<<<<<<<<<
+ * weighted_histo.flags['C_CONTIGUOUS'] is False):
+ * raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.')
+ */
}
- /* "chistogramnd.pyx":163
+ /* "silx/math/chistogramnd.pyx":163
* raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.')
*
* if histo is not None and histo.flags['C_CONTIGUOUS'] is False: # <<<<<<<<<<<<<<
@@ -2697,9 +3086,9 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_1 = __pyx_t_7;
goto __pyx_L10_bool_binop_done;
}
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_flags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_C_CONTIGUOUS); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = (__pyx_t_4 == Py_False);
@@ -2709,45 +3098,53 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_L10_bool_binop_done:;
if (__pyx_t_1) {
- /* "chistogramnd.pyx":164
+ /* "silx/math/chistogramnd.pyx":164
*
* if histo is not None and histo.flags['C_CONTIGUOUS'] is False:
* raise ValueError('<histo> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* s_shape = sample.shape
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 164, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":163
+ * raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.')
+ *
+ * if histo is not None and histo.flags['C_CONTIGUOUS'] is False: # <<<<<<<<<<<<<<
+ * raise ValueError('<histo> must be a C_CONTIGUOUS numpy array.')
+ *
+ */
}
- /* "chistogramnd.pyx":166
+ /* "silx/math/chistogramnd.pyx":166
* raise ValueError('<histo> must be a C_CONTIGUOUS numpy array.')
*
* s_shape = sample.shape # <<<<<<<<<<<<<<
*
* n_dims = 1 if len(s_shape) == 1 else s_shape[1]
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_s_shape = __pyx_t_4;
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":168
+ /* "silx/math/chistogramnd.pyx":168
* s_shape = sample.shape
*
* n_dims = 1 if len(s_shape) == 1 else s_shape[1] # <<<<<<<<<<<<<<
*
* if weights is not None:
*/
- __pyx_t_8 = PyObject_Length(__pyx_v_s_shape); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_s_shape); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 168, __pyx_L1_error)
if (((__pyx_t_8 == 1) != 0)) {
__Pyx_INCREF(__pyx_int_1);
__pyx_t_4 = __pyx_int_1;
} else {
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __pyx_t_3;
__pyx_t_3 = 0;
@@ -2755,7 +3152,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_v_n_dims = __pyx_t_4;
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":170
+ /* "silx/math/chistogramnd.pyx":170
* n_dims = 1 if len(s_shape) == 1 else s_shape[1]
*
* if weights is not None: # <<<<<<<<<<<<<<
@@ -2766,89 +3163,105 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":171
+ /* "silx/math/chistogramnd.pyx":171
*
* if weights is not None:
* w_shape = weights.shape # <<<<<<<<<<<<<<
*
* # making sure the sample and weights sizes are coherent
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_w_shape = __pyx_t_4;
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":175
+ /* "silx/math/chistogramnd.pyx":175
* # making sure the sample and weights sizes are coherent
* # 2 different cases : 2D sample (N,M) and 1D (N)
* if len(w_shape) != 1 or w_shape[0] != s_shape[0]: # <<<<<<<<<<<<<<
* raise ValueError('<weights> must be an array whose length '
* 'is equal to the number of samples.')
*/
- __pyx_t_8 = PyObject_Length(__pyx_v_w_shape); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_w_shape); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 175, __pyx_L1_error)
__pyx_t_1 = ((__pyx_t_8 != 1) != 0);
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L14_bool_binop_done;
}
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_w_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_w_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_2 = __pyx_t_1;
__pyx_L14_bool_binop_done:;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":176
+ /* "silx/math/chistogramnd.pyx":176
* # 2 different cases : 2D sample (N,M) and 1D (N)
* if len(w_shape) != 1 or w_shape[0] != s_shape[0]:
* raise ValueError('<weights> must be an array whose length ' # <<<<<<<<<<<<<<
* 'is equal to the number of samples.')
*
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 176, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":175
+ * # making sure the sample and weights sizes are coherent
+ * # 2 different cases : 2D sample (N,M) and 1D (N)
+ * if len(w_shape) != 1 or w_shape[0] != s_shape[0]: # <<<<<<<<<<<<<<
+ * raise ValueError('<weights> must be an array whose length '
+ * 'is equal to the number of samples.')
+ */
}
- /* "chistogramnd.pyx":179
+ /* "silx/math/chistogramnd.pyx":179
* 'is equal to the number of samples.')
*
* weights_type = weights.dtype # <<<<<<<<<<<<<<
* else:
* weights_type = None
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 179, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
__pyx_cur_scope->__pyx_v_weights_type = __pyx_t_6;
__pyx_t_6 = 0;
+
+ /* "silx/math/chistogramnd.pyx":170
+ * n_dims = 1 if len(s_shape) == 1 else s_shape[1]
+ *
+ * if weights is not None: # <<<<<<<<<<<<<<
+ * w_shape = weights.shape
+ *
+ */
goto __pyx_L12;
}
- /*else*/ {
- /* "chistogramnd.pyx":181
+ /* "silx/math/chistogramnd.pyx":181
* weights_type = weights.dtype
* else:
* weights_type = None # <<<<<<<<<<<<<<
*
* # just in case those arent numpy arrays
*/
+ /*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
__pyx_cur_scope->__pyx_v_weights_type = Py_None;
}
__pyx_L12:;
- /* "chistogramnd.pyx":186
+ /* "silx/math/chistogramnd.pyx":186
* # (this allows the user to provide native python lists,
* # => easier for testing)
* i_histo_range = histo_range # <<<<<<<<<<<<<<
@@ -2858,20 +3271,20 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_v_histo_range);
__pyx_v_i_histo_range = __pyx_v_histo_range;
- /* "chistogramnd.pyx":187
+ /* "silx/math/chistogramnd.pyx":187
* # => easier for testing)
* i_histo_range = histo_range
* histo_range = np.array(histo_range) # <<<<<<<<<<<<<<
* err_histo_range = False
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -2881,24 +3294,42 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
}
}
if (!__pyx_t_3) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_histo_range); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_histo_range); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_INCREF(__pyx_v_histo_range);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_histo_range);
- __Pyx_GIVEREF(__pyx_v_histo_range);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_histo_range};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_histo_range};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_histo_range);
+ __Pyx_GIVEREF(__pyx_v_histo_range);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_histo_range);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __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_DECREF_SET(__pyx_v_histo_range, __pyx_t_6);
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":188
+ /* "silx/math/chistogramnd.pyx":188
* i_histo_range = histo_range
* histo_range = np.array(histo_range)
* err_histo_range = False # <<<<<<<<<<<<<<
@@ -2907,110 +3338,127 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
*/
__pyx_v_err_histo_range = 0;
- /* "chistogramnd.pyx":190
+ /* "silx/math/chistogramnd.pyx":190
* err_histo_range = False
*
* if n_dims == 1: # <<<<<<<<<<<<<<
* if histo_range.shape == (2,):
* pass
*/
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_n_dims, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 190, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":191
+ /* "silx/math/chistogramnd.pyx":191
*
* if n_dims == 1:
* if histo_range.shape == (2,): # <<<<<<<<<<<<<<
* pass
* elif histo_range.shape == (1, 2):
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_tuple__4, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_tuple__4, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_2) {
goto __pyx_L17;
}
- /* "chistogramnd.pyx":193
+ /* "silx/math/chistogramnd.pyx":193
* if histo_range.shape == (2,):
* pass
* elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
* histo_range.shape = -1
* else:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_tuple__5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_tuple__5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":194
+ /* "silx/math/chistogramnd.pyx":194
* pass
* elif histo_range.shape == (1, 2):
* histo_range.shape = -1 # <<<<<<<<<<<<<<
* else:
* err_histo_range = True
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape, __pyx_int_neg_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape, __pyx_int_neg_1) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":193
+ * if histo_range.shape == (2,):
+ * pass
+ * elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
+ * histo_range.shape = -1
+ * else:
+ */
goto __pyx_L17;
}
- /*else*/ {
- /* "chistogramnd.pyx":196
+ /* "silx/math/chistogramnd.pyx":196
* histo_range.shape = -1
* else:
* err_histo_range = True # <<<<<<<<<<<<<<
* elif n_dims != 1 and histo_range.shape != (n_dims, 2):
* err_histo_range = True
*/
+ /*else*/ {
__pyx_v_err_histo_range = 1;
}
__pyx_L17:;
+
+ /* "silx/math/chistogramnd.pyx":190
+ * err_histo_range = False
+ *
+ * if n_dims == 1: # <<<<<<<<<<<<<<
+ * if histo_range.shape == (2,):
+ * pass
+ */
goto __pyx_L16;
}
- /* "chistogramnd.pyx":197
+ /* "silx/math/chistogramnd.pyx":197
* else:
* err_histo_range = True
* elif n_dims != 1 and histo_range.shape != (n_dims, 2): # <<<<<<<<<<<<<<
* err_histo_range = True
*
*/
- __pyx_t_6 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
goto __pyx_L18_bool_binop_done;
}
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_dims);
__Pyx_INCREF(__pyx_int_2);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_2);
__Pyx_GIVEREF(__pyx_int_2);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_2);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_2 = __pyx_t_1;
__pyx_L18_bool_binop_done:;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":198
+ /* "silx/math/chistogramnd.pyx":198
* err_histo_range = True
* elif n_dims != 1 and histo_range.shape != (n_dims, 2):
* err_histo_range = True # <<<<<<<<<<<<<<
@@ -3018,11 +3466,18 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* if err_histo_range:
*/
__pyx_v_err_histo_range = 1;
- goto __pyx_L16;
+
+ /* "silx/math/chistogramnd.pyx":197
+ * else:
+ * err_histo_range = True
+ * elif n_dims != 1 and histo_range.shape != (n_dims, 2): # <<<<<<<<<<<<<<
+ * err_histo_range = True
+ *
+ */
}
__pyx_L16:;
- /* "chistogramnd.pyx":200
+ /* "silx/math/chistogramnd.pyx":200
* err_histo_range = True
*
* if err_histo_range: # <<<<<<<<<<<<<<
@@ -3032,81 +3487,167 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_v_err_histo_range != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":206
+ /* "silx/math/chistogramnd.pyx":206
* '(provided <sample> contains '
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range, # <<<<<<<<<<<<<<
* n_dims=n_dims))
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histo_range_error_expected_n_di, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histo_range_error_expected_n_di, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_histo_range, __pyx_v_i_histo_range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_histo_range, __pyx_v_i_histo_range) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
- /* "chistogramnd.pyx":207
+ /* "silx/math/chistogramnd.pyx":207
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range,
* n_dims=n_dims)) # <<<<<<<<<<<<<<
*
- * # checking n_bins size
+ * # check range value
*/
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_n_dims, __pyx_v_n_dims) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_n_dims, __pyx_v_n_dims) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
- /* "chistogramnd.pyx":206
+ /* "silx/math/chistogramnd.pyx":206
* '(provided <sample> contains '
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range, # <<<<<<<<<<<<<<
* n_dims=n_dims))
*
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __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;
- /* "chistogramnd.pyx":201
+ /* "silx/math/chistogramnd.pyx":201
*
* if err_histo_range:
* raise ValueError('<histo_range> error : expected {n_dims} sets of ' # <<<<<<<<<<<<<<
* 'lower and upper bin edges, '
* 'got the following instead : {histo_range}. '
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __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, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 201, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":200
+ * err_histo_range = True
+ *
+ * if err_histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('<histo_range> error : expected {n_dims} sets of '
+ * 'lower and upper bin edges, '
+ */
+ }
+
+ /* "silx/math/chistogramnd.pyx":210
+ *
+ * # check range value
+ * if np.inf in histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range:
+ */
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_histo_range, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "silx/math/chistogramnd.pyx":211
+ * # check range value
+ * if np.inf in histo_range:
+ * raise ValueError('Range parameter should be finite value') # <<<<<<<<<<<<<<
+ * if np.nan in histo_range:
+ * raise ValueError('Range value can\'t be nan')
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 211, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":210
+ *
+ * # check range value
+ * if np.inf in histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range:
+ */
+ }
+
+ /* "silx/math/chistogramnd.pyx":212
+ * if np.inf in histo_range:
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('Range value can\'t be nan')
+ *
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_t_6, __pyx_v_histo_range, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "silx/math/chistogramnd.pyx":213
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range:
+ * raise ValueError('Range value can\'t be nan') # <<<<<<<<<<<<<<
+ *
+ * # checking n_bins size
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 213, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":212
+ * if np.inf in histo_range:
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('Range value can\'t be nan')
+ *
+ */
}
- /* "chistogramnd.pyx":210
+ /* "silx/math/chistogramnd.pyx":216
*
* # checking n_bins size
* n_bins = np.array(n_bins, ndmin=1) # <<<<<<<<<<<<<<
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims)
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_bins);
__Pyx_GIVEREF(__pyx_v_n_bins);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_bins);
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_ndmin, __pyx_int_1) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -3114,245 +3655,339 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_DECREF_SET(__pyx_v_n_bins, __pyx_t_3);
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":211
+ /* "silx/math/chistogramnd.pyx":217
* # checking n_bins size
* n_bins = np.array(n_bins, ndmin=1)
* if len(n_bins) == 1: # <<<<<<<<<<<<<<
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
*/
- __pyx_t_8 = PyObject_Length(__pyx_v_n_bins); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_n_bins); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 217, __pyx_L1_error)
__pyx_t_2 = ((__pyx_t_8 == 1) != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":212
+ /* "silx/math/chistogramnd.pyx":218
* n_bins = np.array(n_bins, ndmin=1)
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims) # <<<<<<<<<<<<<<
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number '
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tile); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_tile); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
- __pyx_t_8 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_4 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_n_bins, __pyx_v_n_dims};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_n_bins, __pyx_v_n_dims};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_n_bins);
+ __Pyx_GIVEREF(__pyx_v_n_bins);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_n_bins);
+ __Pyx_INCREF(__pyx_v_n_dims);
+ __Pyx_GIVEREF(__pyx_v_n_dims);
+ PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_v_n_dims);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_8, __pyx_v_n_bins);
- __Pyx_GIVEREF(__pyx_v_n_bins);
- __Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_8, __pyx_v_n_dims);
- __Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_n_bins, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L21;
+
+ /* "silx/math/chistogramnd.pyx":217
+ * # checking n_bins size
+ * n_bins = np.array(n_bins, ndmin=1)
+ * if len(n_bins) == 1: # <<<<<<<<<<<<<<
+ * n_bins = np.tile(n_bins, n_dims)
+ * elif n_bins.shape != (n_dims,):
+ */
+ goto __pyx_L23;
}
- /* "chistogramnd.pyx":213
+ /* "silx/math/chistogramnd.pyx":219
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,): # <<<<<<<<<<<<<<
* raise ValueError('n_bins must be either a scalar (same number '
* 'of bins for all dimensions) or '
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_n_dims);
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":214
+ /* "silx/math/chistogramnd.pyx":220
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number ' # <<<<<<<<<<<<<<
* 'of bins for all dimensions) or '
* 'an array (number of bins for each '
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 220, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":219
+ * if len(n_bins) == 1:
+ * n_bins = np.tile(n_bins, n_dims)
+ * elif n_bins.shape != (n_dims,): # <<<<<<<<<<<<<<
+ * raise ValueError('n_bins must be either a scalar (same number '
+ * 'of bins for all dimensions) or '
+ */
}
- __pyx_L21:;
+ __pyx_L23:;
- /* "chistogramnd.pyx":222
+ /* "silx/math/chistogramnd.pyx":228
* # exception is thrown when calling np.zeros
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0): # <<<<<<<<<<<<<<
* raise ValueError('<n_bins> : only positive values allowed.')
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_any); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_equal); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_equal); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_8 = 1;
+ __Pyx_DECREF_SET(__pyx_t_10, function);
+ __pyx_t_9 = 1;
}
}
- __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_n_bins, Py_None};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_n_bins, Py_None};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_n_bins);
+ __Pyx_GIVEREF(__pyx_v_n_bins);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_9, __pyx_v_n_bins);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_9, Py_None);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
- __Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_n_bins);
- __Pyx_GIVEREF(__pyx_v_n_bins);
- __Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, Py_None);
- __Pyx_GIVEREF(Py_None);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_9)) {
+ __pyx_t_10 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_10)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- if (!__pyx_t_9) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_10) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __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_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
- goto __pyx_L23_bool_binop_done;
+ goto __pyx_L25_bool_binop_done;
}
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_any); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_n_bins, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_n_bins, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
}
}
if (!__pyx_t_6) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 228, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_1;
- __pyx_L23_bool_binop_done:;
+ __pyx_L25_bool_binop_done:;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":223
+ /* "silx/math/chistogramnd.pyx":229
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0):
* raise ValueError('<n_bins> : only positive values allowed.') # <<<<<<<<<<<<<<
*
* output_shape = tuple(n_bins)
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 229, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 229, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":228
+ * # exception is thrown when calling np.zeros
+ * # also testing for negative/null values
+ * if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0): # <<<<<<<<<<<<<<
+ * raise ValueError('<n_bins> : only positive values allowed.')
+ *
+ */
}
- /* "chistogramnd.pyx":225
+ /* "silx/math/chistogramnd.pyx":231
* raise ValueError('<n_bins> : only positive values allowed.')
*
* output_shape = tuple(n_bins) # <<<<<<<<<<<<<<
*
* # checking the histo array, if provided
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_n_bins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_bins);
- __Pyx_GIVEREF(__pyx_v_n_bins);
- __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyTuple_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_output_shape = ((PyObject*)__pyx_t_10);
- __pyx_t_10 = 0;
+ __pyx_v_output_shape = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
- /* "chistogramnd.pyx":228
+ /* "silx/math/chistogramnd.pyx":234
*
* # checking the histo array, if provided
* if histo is None: # <<<<<<<<<<<<<<
@@ -3363,205 +3998,271 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd.pyx":229
+ /* "silx/math/chistogramnd.pyx":235
* # checking the histo array, if provided
* if histo is None:
* histo = np.zeros(output_shape, dtype=np.uint32) # <<<<<<<<<<<<<<
* else:
* if histo.shape != output_shape:
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_output_shape);
__Pyx_GIVEREF(__pyx_v_output_shape);
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_output_shape);
+ __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF_SET(__pyx_v_histo, __pyx_t_6);
__pyx_t_6 = 0;
- goto __pyx_L25;
+
+ /* "silx/math/chistogramnd.pyx":234
+ *
+ * # checking the histo array, if provided
+ * if histo is None: # <<<<<<<<<<<<<<
+ * histo = np.zeros(output_shape, dtype=np.uint32)
+ * else:
+ */
+ goto __pyx_L27;
}
- /*else*/ {
- /* "chistogramnd.pyx":231
+ /* "silx/math/chistogramnd.pyx":237
* histo = np.zeros(output_shape, dtype=np.uint32)
* else:
* if histo.shape != output_shape: # <<<<<<<<<<<<<<
* raise ValueError('Provided <histo> array doesn\'t have '
* 'a shape compatible with <n_bins> '
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_v_output_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_RichCompare(__pyx_t_6, __pyx_v_output_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 237, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_1) {
- /* "chistogramnd.pyx":235
+ /* "silx/math/chistogramnd.pyx":241
* 'a shape compatible with <n_bins> '
* ': should be {0} instead of {1}.'
* ''.format(output_shape, histo.shape)) # <<<<<<<<<<<<<<
* if histo.dtype != np.uint32:
* raise ValueError('Provided <histo> array doesn\'t have '
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav, __pyx_n_s_format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_4)) {
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && 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_4);
+ __Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_6, function);
- __pyx_t_8 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_output_shape, __pyx_t_4};
+ __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_output_shape, __pyx_t_4};
+ __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_11) {
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_output_shape);
+ __Pyx_GIVEREF(__pyx_v_output_shape);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_9, __pyx_v_output_shape);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_9, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __Pyx_INCREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_output_shape);
- __Pyx_GIVEREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "chistogramnd.pyx":232
+ /* "silx/math/chistogramnd.pyx":238
* else:
* if histo.shape != output_shape:
* raise ValueError('Provided <histo> array doesn\'t have ' # <<<<<<<<<<<<<<
* 'a shape compatible with <n_bins> '
* ': should be {0} instead of {1}.'
*/
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 238, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_Raise(__pyx_t_9, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(0, 238, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":237
+ * histo = np.zeros(output_shape, dtype=np.uint32)
+ * else:
+ * if histo.shape != output_shape: # <<<<<<<<<<<<<<
+ * raise ValueError('Provided <histo> array doesn\'t have '
+ * 'a shape compatible with <n_bins> '
+ */
}
- /* "chistogramnd.pyx":236
+ /* "silx/math/chistogramnd.pyx":242
* ': should be {0} instead of {1}.'
* ''.format(output_shape, histo.shape))
* if histo.dtype != np.uint32: # <<<<<<<<<<<<<<
* raise ValueError('Provided <histo> array doesn\'t have '
* 'the expected type '
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_9, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_10, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
- /* "chistogramnd.pyx":240
+ /* "silx/math/chistogramnd.pyx":246
* 'the expected type '
* ': should be {0} instead of {1}.'
* ''.format(np.uint32, histo.dtype)) # <<<<<<<<<<<<<<
*
* # checking the weighted_histo array, if provided
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav_2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav_2, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = NULL;
- __pyx_t_8 = 0;
- 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)) {
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_11)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
- __pyx_t_8 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_4, __pyx_t_10};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_4, __pyx_t_10};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_11) {
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_10);
+ __pyx_t_4 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_10 = 0;
- __pyx_t_9 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __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_3); __pyx_t_3 = 0;
- /* "chistogramnd.pyx":237
+ /* "silx/math/chistogramnd.pyx":243
* ''.format(output_shape, histo.shape))
* if histo.dtype != np.uint32:
* raise ValueError('Provided <histo> array doesn\'t have ' # <<<<<<<<<<<<<<
* 'the expected type '
* ': should be {0} instead of {1}.'
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __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[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 243, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":242
+ * ': should be {0} instead of {1}.'
+ * ''.format(output_shape, histo.shape))
+ * if histo.dtype != np.uint32: # <<<<<<<<<<<<<<
+ * raise ValueError('Provided <histo> array doesn\'t have '
+ * 'the expected type '
+ */
}
}
- __pyx_L25:;
+ __pyx_L27:;
- /* "chistogramnd.pyx":243
+ /* "silx/math/chistogramnd.pyx":249
*
* # checking the weighted_histo array, if provided
* if weights_type is None: # <<<<<<<<<<<<<<
@@ -3572,7 +4273,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":245
+ /* "silx/math/chistogramnd.pyx":251
* if weights_type is None:
* # no weights provided, not creating the weighted_histo array
* weighted_histo = None # <<<<<<<<<<<<<<
@@ -3581,10 +4282,18 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
*/
__Pyx_INCREF(Py_None);
__Pyx_DECREF_SET(__pyx_v_weighted_histo, Py_None);
- goto __pyx_L28;
+
+ /* "silx/math/chistogramnd.pyx":249
+ *
+ * # checking the weighted_histo array, if provided
+ * if weights_type is None: # <<<<<<<<<<<<<<
+ * # no weights provided, not creating the weighted_histo array
+ * weighted_histo = None
+ */
+ goto __pyx_L30;
}
- /* "chistogramnd.pyx":246
+ /* "silx/math/chistogramnd.pyx":252
* # no weights provided, not creating the weighted_histo array
* weighted_histo = None
* elif weighted_histo is None: # <<<<<<<<<<<<<<
@@ -3595,7 +4304,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd.pyx":248
+ /* "silx/math/chistogramnd.pyx":254
* elif weighted_histo is None:
* # weights provided, but no weighted_histo, creating it
* if wh_dtype is None: # <<<<<<<<<<<<<<
@@ -3606,7 +4315,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":249
+ /* "silx/math/chistogramnd.pyx":255
* # weights provided, but no weighted_histo, creating it
* if wh_dtype is None:
* wh_dtype = weights_type # <<<<<<<<<<<<<<
@@ -3615,254 +4324,336 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
*/
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_weights_type);
__Pyx_DECREF_SET(__pyx_v_wh_dtype, __pyx_cur_scope->__pyx_v_weights_type);
- goto __pyx_L29;
+
+ /* "silx/math/chistogramnd.pyx":254
+ * elif weighted_histo is None:
+ * # weights provided, but no weighted_histo, creating it
+ * if wh_dtype is None: # <<<<<<<<<<<<<<
+ * wh_dtype = weights_type
+ * weighted_histo = np.zeros(output_shape, dtype=wh_dtype)
+ */
}
- __pyx_L29:;
- /* "chistogramnd.pyx":250
+ /* "silx/math/chistogramnd.pyx":256
* if wh_dtype is None:
* wh_dtype = weights_type
* weighted_histo = np.zeros(output_shape, dtype=wh_dtype) # <<<<<<<<<<<<<<
* else:
* # weighted_histo provided, checking shape/dtype
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_output_shape);
__Pyx_GIVEREF(__pyx_v_output_shape);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_output_shape);
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_wh_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_v_wh_dtype) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_weighted_histo, __pyx_t_9);
- __pyx_t_9 = 0;
- goto __pyx_L28;
+ __Pyx_DECREF_SET(__pyx_v_weighted_histo, __pyx_t_10);
+ __pyx_t_10 = 0;
+
+ /* "silx/math/chistogramnd.pyx":252
+ * # no weights provided, not creating the weighted_histo array
+ * weighted_histo = None
+ * elif weighted_histo is None: # <<<<<<<<<<<<<<
+ * # weights provided, but no weighted_histo, creating it
+ * if wh_dtype is None:
+ */
+ goto __pyx_L30;
}
- /*else*/ {
- /* "chistogramnd.pyx":253
+ /* "silx/math/chistogramnd.pyx":259
* else:
* # weighted_histo provided, checking shape/dtype
* if weighted_histo.shape != output_shape: # <<<<<<<<<<<<<<
* raise ValueError('Provided <weighted_histo> array doesn\'t have '
* 'a shape compatible with <n_bins> '
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_v_output_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_10, __pyx_v_output_shape, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 259, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":257
+ /* "silx/math/chistogramnd.pyx":263
* 'a shape compatible with <n_bins> '
* ': should be {0} instead of {1}.'
* ''.format(output_shape, weighted_histo.shape)) # <<<<<<<<<<<<<<
* if (weighted_histo.dtype != np.float64 and
* weighted_histo.dtype != np.float32):
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_weighted_histo_array_do, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_weighted_histo_array_do, __pyx_n_s_format); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_3 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- __pyx_t_8 = 1;
+ __Pyx_DECREF_SET(__pyx_t_10, function);
+ __pyx_t_9 = 1;
}
}
- __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_output_shape, __pyx_t_6};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_output_shape, __pyx_t_6};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_output_shape);
+ __Pyx_GIVEREF(__pyx_v_output_shape);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_9, __pyx_v_output_shape);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_9, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __Pyx_INCREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_output_shape);
- __Pyx_GIVEREF(__pyx_v_output_shape);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "chistogramnd.pyx":254
+ /* "silx/math/chistogramnd.pyx":260
* # weighted_histo provided, checking shape/dtype
* if weighted_histo.shape != output_shape:
* raise ValueError('Provided <weighted_histo> array doesn\'t have ' # <<<<<<<<<<<<<<
* 'a shape compatible with <n_bins> '
* ': should be {0} instead of {1}.'
*/
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 260, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 260, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":259
+ * else:
+ * # weighted_histo provided, checking shape/dtype
+ * if weighted_histo.shape != output_shape: # <<<<<<<<<<<<<<
+ * raise ValueError('Provided <weighted_histo> array doesn\'t have '
+ * 'a shape compatible with <n_bins> '
+ */
}
- /* "chistogramnd.pyx":258
+ /* "silx/math/chistogramnd.pyx":264
* ': should be {0} instead of {1}.'
* ''.format(output_shape, weighted_histo.shape))
* if (weighted_histo.dtype != np.float64 and # <<<<<<<<<<<<<<
* weighted_histo.dtype != np.float32):
* raise ValueError('Provided <weighted_histo> array doesn\'t have '
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
if (__pyx_t_1) {
} else {
__pyx_t_2 = __pyx_t_1;
- goto __pyx_L32_bool_binop_done;
+ goto __pyx_L34_bool_binop_done;
}
- /* "chistogramnd.pyx":259
+ /* "silx/math/chistogramnd.pyx":265
* ''.format(output_shape, weighted_histo.shape))
* if (weighted_histo.dtype != np.float64 and
* weighted_histo.dtype != np.float32): # <<<<<<<<<<<<<<
* raise ValueError('Provided <weighted_histo> array doesn\'t have '
* 'the expected type '
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_10, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 265, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 265, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_2 = __pyx_t_1;
- __pyx_L32_bool_binop_done:;
+ __pyx_L34_bool_binop_done:;
+
+ /* "silx/math/chistogramnd.pyx":264
+ * ': should be {0} instead of {1}.'
+ * ''.format(output_shape, weighted_histo.shape))
+ * if (weighted_histo.dtype != np.float64 and # <<<<<<<<<<<<<<
+ * weighted_histo.dtype != np.float32):
+ * raise ValueError('Provided <weighted_histo> array doesn\'t have '
+ */
if (__pyx_t_2) {
- /* "chistogramnd.pyx":263
+ /* "silx/math/chistogramnd.pyx":269
* 'the expected type '
* ': should be {0} or {1} instead of {2}.'
* ''.format(np.double, # <<<<<<<<<<<<<<
* np.float32,
* weighted_histo.dtype))
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_weighted_histo_array_do_2, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_weighted_histo_array_do_2, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_double); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "chistogramnd.pyx":264
+ /* "silx/math/chistogramnd.pyx":270
* ': should be {0} or {1} instead of {2}.'
* ''.format(np.double,
* np.float32, # <<<<<<<<<<<<<<
* weighted_histo.dtype))
*
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 270, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "chistogramnd.pyx":265
+ /* "silx/math/chistogramnd.pyx":271
* ''.format(np.double,
* np.float32,
* weighted_histo.dtype)) # <<<<<<<<<<<<<<
*
* option_flags = 0
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_4)) {
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && 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_4);
+ __Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_8 = 1;
+ __pyx_t_9 = 1;
}
}
- __pyx_t_11 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_t_6, __pyx_t_3, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_11, __pyx_t_6, __pyx_t_3, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_12 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__pyx_t_11) {
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_9, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_9, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_9, __pyx_t_10);
+ __pyx_t_6 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_8, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_8, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_8, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_6 = 0;
- __pyx_t_3 = 0;
- __pyx_t_9 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "chistogramnd.pyx":260
+ /* "silx/math/chistogramnd.pyx":266
* if (weighted_histo.dtype != np.float64 and
* weighted_histo.dtype != np.float32):
* raise ValueError('Provided <weighted_histo> array doesn\'t have ' # <<<<<<<<<<<<<<
* 'the expected type '
* ': should be {0} or {1} instead of {2}.'
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 266, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":264
+ * ': should be {0} instead of {1}.'
+ * ''.format(output_shape, weighted_histo.shape))
+ * if (weighted_histo.dtype != np.float64 and # <<<<<<<<<<<<<<
+ * weighted_histo.dtype != np.float32):
+ * raise ValueError('Provided <weighted_histo> array doesn\'t have '
+ */
}
}
- __pyx_L28:;
+ __pyx_L30:;
- /* "chistogramnd.pyx":267
+ /* "silx/math/chistogramnd.pyx":273
* weighted_histo.dtype))
*
* option_flags = 0 # <<<<<<<<<<<<<<
@@ -3872,7 +4663,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_int_0);
__pyx_v_option_flags = __pyx_int_0;
- /* "chistogramnd.pyx":269
+ /* "silx/math/chistogramnd.pyx":275
* option_flags = 0
*
* if weight_min is not None: # <<<<<<<<<<<<<<
@@ -3883,37 +4674,45 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd.pyx":270
+ /* "silx/math/chistogramnd.pyx":276
*
* if weight_min is not None:
* option_flags |= histogramnd_c.HISTO_WEIGHT_MIN # <<<<<<<<<<<<<<
* else:
* weight_min = 0
*/
- __pyx_t_10 = PyInt_FromLong(HISTO_WEIGHT_MIN); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_histo_opt_type(HISTO_WEIGHT_MIN); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_option_flags, __pyx_t_5);
__pyx_t_5 = 0;
- goto __pyx_L34;
+
+ /* "silx/math/chistogramnd.pyx":275
+ * option_flags = 0
+ *
+ * if weight_min is not None: # <<<<<<<<<<<<<<
+ * option_flags |= histogramnd_c.HISTO_WEIGHT_MIN
+ * else:
+ */
+ goto __pyx_L36;
}
- /*else*/ {
- /* "chistogramnd.pyx":272
+ /* "silx/math/chistogramnd.pyx":278
* option_flags |= histogramnd_c.HISTO_WEIGHT_MIN
* else:
* weight_min = 0 # <<<<<<<<<<<<<<
*
* if weight_max is not None:
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_weight_min, __pyx_int_0);
}
- __pyx_L34:;
+ __pyx_L36:;
- /* "chistogramnd.pyx":274
+ /* "silx/math/chistogramnd.pyx":280
* weight_min = 0
*
* if weight_max is not None: # <<<<<<<<<<<<<<
@@ -3924,37 +4723,45 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd.pyx":275
+ /* "silx/math/chistogramnd.pyx":281
*
* if weight_max is not None:
* option_flags |= histogramnd_c.HISTO_WEIGHT_MAX # <<<<<<<<<<<<<<
* else:
* weight_max = 0
*/
- __pyx_t_5 = PyInt_FromLong(HISTO_WEIGHT_MAX); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_histo_opt_type(HISTO_WEIGHT_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_4 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_option_flags, __pyx_t_10);
- __pyx_t_10 = 0;
- goto __pyx_L35;
+ __Pyx_DECREF_SET(__pyx_v_option_flags, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd.pyx":280
+ * weight_min = 0
+ *
+ * if weight_max is not None: # <<<<<<<<<<<<<<
+ * option_flags |= histogramnd_c.HISTO_WEIGHT_MAX
+ * else:
+ */
+ goto __pyx_L37;
}
- /*else*/ {
- /* "chistogramnd.pyx":277
+ /* "silx/math/chistogramnd.pyx":283
* option_flags |= histogramnd_c.HISTO_WEIGHT_MAX
* else:
* weight_max = 0 # <<<<<<<<<<<<<<
*
* if last_bin_closed is not None and last_bin_closed:
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_weight_max, __pyx_int_0);
}
- __pyx_L35:;
+ __pyx_L37:;
- /* "chistogramnd.pyx":279
+ /* "silx/math/chistogramnd.pyx":285
* weight_max = 0
*
* if last_bin_closed is not None and last_bin_closed: # <<<<<<<<<<<<<<
@@ -3966,210 +4773,256 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
if (__pyx_t_7) {
} else {
__pyx_t_2 = __pyx_t_7;
- goto __pyx_L37_bool_binop_done;
+ goto __pyx_L39_bool_binop_done;
}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_last_bin_closed); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_last_bin_closed); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
__pyx_t_2 = __pyx_t_7;
- __pyx_L37_bool_binop_done:;
+ __pyx_L39_bool_binop_done:;
if (__pyx_t_2) {
- /* "chistogramnd.pyx":280
+ /* "silx/math/chistogramnd.pyx":286
*
* if last_bin_closed is not None and last_bin_closed:
* option_flags |= histogramnd_c.HISTO_LAST_BIN_CLOSED # <<<<<<<<<<<<<<
*
* sample_type = sample.dtype
*/
- __pyx_t_10 = PyInt_FromLong(HISTO_LAST_BIN_CLOSED); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_histo_opt_type(HISTO_LAST_BIN_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyNumber_InPlaceOr(__pyx_v_option_flags, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_option_flags, __pyx_t_5);
__pyx_t_5 = 0;
- goto __pyx_L36;
+
+ /* "silx/math/chistogramnd.pyx":285
+ * weight_max = 0
+ *
+ * if last_bin_closed is not None and last_bin_closed: # <<<<<<<<<<<<<<
+ * option_flags |= histogramnd_c.HISTO_LAST_BIN_CLOSED
+ *
+ */
}
- __pyx_L36:;
- /* "chistogramnd.pyx":282
+ /* "silx/math/chistogramnd.pyx":288
* option_flags |= histogramnd_c.HISTO_LAST_BIN_CLOSED
*
* sample_type = sample.dtype # <<<<<<<<<<<<<<
+ * sample_type = sample_type.newbyteorder('N')
*
- * n_elem = sample.size // n_dims
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
__pyx_cur_scope->__pyx_v_sample_type = __pyx_t_5;
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":284
+ /* "silx/math/chistogramnd.pyx":289
+ *
* sample_type = sample.dtype
+ * sample_type = sample_type.newbyteorder('N') # <<<<<<<<<<<<<<
+ *
+ * n_elem = sample.size // n_dims
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_sample_type, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_sample_type);
+ __Pyx_DECREF_SET(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd.pyx":291
+ * sample_type = sample_type.newbyteorder('N')
*
* n_elem = sample.size // n_dims # <<<<<<<<<<<<<<
*
* bin_edges = np.zeros(n_bins.sum() + n_bins.size, dtype=np.double)
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_4, __pyx_v_n_dims); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = PyNumber_FloorDivide(__pyx_t_5, __pyx_v_n_dims); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_n_elem = __pyx_t_10;
- __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_n_elem = __pyx_t_5;
+ __pyx_t_5 = 0;
- /* "chistogramnd.pyx":286
+ /* "silx/math/chistogramnd.pyx":293
* n_elem = sample.size // n_dims
*
* bin_edges = np.zeros(n_bins.sum() + n_bins.size, dtype=np.double) # <<<<<<<<<<<<<<
*
* # wanted to store the functions in a dict (with the supported types
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_sum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_9);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_sum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
}
}
- if (__pyx_t_9) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (__pyx_t_10) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
} else {
- __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_11); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
}
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_9 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 293, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_v_bin_edges = __pyx_t_3;
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":292
+ /* "silx/math/chistogramnd.pyx":299
* # functions. so I have to explicitly list them all...
*
* def raise_unsupported_type(): # <<<<<<<<<<<<<<
* raise TypeError('Case not supported - sample:{0} '
* 'and weights:{1}.'
*/
- __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_12chistogramnd_12chistogramnd_1raise_unsupported_type, 0, __pyx_n_s_chistogramnd_locals_raise_unsupp, ((PyObject*)__pyx_cur_scope), __pyx_n_s_chistogramnd, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_12chistogramnd_12chistogramnd_1raise_unsupported_type, 0, __pyx_n_s_chistogramnd_locals_raise_unsupp, ((PyObject*)__pyx_cur_scope), __pyx_n_s_silx_math_chistogramnd, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_raise_unsupported_type = __pyx_t_3;
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":297
+ /* "silx/math/chistogramnd.pyx":304
* ''.format(sample_type, weights_type))
*
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,))) # <<<<<<<<<<<<<<
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)), # <<<<<<<<<<<<<<
+ * dtype=sample_type)
*
- * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)))
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
- }
- }
- if (!__pyx_t_10) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_9);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_reshape); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
}
}
- if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (!__pyx_t_4) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_v_sample_c = __pyx_t_3;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_3);
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":300
+ /* "silx/math/chistogramnd.pyx":305
+ *
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ * dtype=sample_type) # <<<<<<<<<<<<<<
+ *
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ */
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_cur_scope->__pyx_v_sample_type) < 0) __PYX_ERR(0, 305, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":304
+ * ''.format(sample_type, weights_type))
*
- * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)))
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)), # <<<<<<<<<<<<<<
+ * dtype=sample_type)
+ *
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_sample_c = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "silx/math/chistogramnd.pyx":309
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N'))
* if weights is not None else None) # <<<<<<<<<<<<<<
*
* histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
@@ -4177,312 +5030,404 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_v_weights != Py_None);
if ((__pyx_t_2 != 0)) {
- /* "chistogramnd.pyx":299
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ /* "silx/math/chistogramnd.pyx":307
+ * dtype=sample_type)
*
- * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,))) # <<<<<<<<<<<<<<
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)), # <<<<<<<<<<<<<<
+ * dtype=weights.dtype.newbyteorder('N'))
* if weights is not None else None)
- *
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __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_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
}
}
if (!__pyx_t_5) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_3 = __pyx_t_11;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "silx/math/chistogramnd.pyx":308
+ *
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ * if weights is not None else None)
+ *
+ */
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+
+ /* "silx/math/chistogramnd.pyx":307
+ * dtype=sample_type)
+ *
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)), # <<<<<<<<<<<<<<
+ * dtype=weights.dtype.newbyteorder('N'))
+ * if weights is not None else None)
+ */
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 307, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __pyx_t_11;
__pyx_t_11 = 0;
} else {
- /* "chistogramnd.pyx":300
- *
- * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)))
+ /* "silx/math/chistogramnd.pyx":309
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N'))
* if weights is not None else None) # <<<<<<<<<<<<<<
*
* histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
*/
__Pyx_INCREF(Py_None);
- __pyx_t_3 = Py_None;
+ __pyx_t_6 = Py_None;
}
- __pyx_v_weights_c = __pyx_t_3;
- __pyx_t_3 = 0;
+ __pyx_v_weights_c = __pyx_t_6;
+ __pyx_t_6 = 0;
- /* "chistogramnd.pyx":302
+ /* "silx/math/chistogramnd.pyx":311
* if weights is not None else None)
*
* histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)), # <<<<<<<<<<<<<<
* dtype=np.double)
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- if (!__pyx_t_12) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_3);
+ if (!__pyx_t_10) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_12};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_12);
+ __pyx_t_12 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __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 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "chistogramnd.pyx":303
+ /* "silx/math/chistogramnd.pyx":312
*
* histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
* dtype=np.double) # <<<<<<<<<<<<<<
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_double); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 312, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- /* "chistogramnd.pyx":302
+ /* "silx/math/chistogramnd.pyx":311
* if weights is not None else None)
*
* histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)), # <<<<<<<<<<<<<<
* dtype=np.double)
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 311, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_histo_range_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_histo_range_c = __pyx_t_12;
+ __pyx_t_12 = 0;
- /* "chistogramnd.pyx":305
+ /* "silx/math/chistogramnd.pyx":314
* dtype=np.double)
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)), # <<<<<<<<<<<<<<
* dtype=np.int32)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 314, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 314, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_11);
__pyx_t_11 = 0;
__pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_11) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_4};
+ __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_4};
+ __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
- __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 = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 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 = 305; __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_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12);
+ __pyx_t_12 = 0;
- /* "chistogramnd.pyx":306
+ /* "silx/math/chistogramnd.pyx":315
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
* dtype=np.int32) # <<<<<<<<<<<<<<
*
* histo_c = histo.reshape((histo.size,))
*/
- __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "chistogramnd.pyx":305
+ /* "silx/math/chistogramnd.pyx":314
* dtype=np.double)
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)), # <<<<<<<<<<<<<<
* dtype=np.int32)
*
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_n_bins_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_v_n_bins_c = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "chistogramnd.pyx":308
+ /* "silx/math/chistogramnd.pyx":317
* dtype=np.int32)
*
* histo_c = histo.reshape((histo.size,)) # <<<<<<<<<<<<<<
*
* if weighted_histo is not None:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_9);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
}
}
- if (!__pyx_t_9) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__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_GOTREF(__pyx_t_5);
+ if (!__pyx_t_3) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_histo_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_v_histo_c = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "chistogramnd.pyx":310
+ /* "silx/math/chistogramnd.pyx":319
* histo_c = histo.reshape((histo.size,))
*
* if weighted_histo is not None: # <<<<<<<<<<<<<<
@@ -4493,144 +5438,204 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "chistogramnd.pyx":311
+ /* "silx/math/chistogramnd.pyx":320
*
* if weighted_histo is not None:
* cumul_c = weighted_histo.reshape((weighted_histo.size,)) # <<<<<<<<<<<<<<
* else:
* cumul_c = None
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_12)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_12);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
}
}
- if (!__pyx_t_12) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
+ if (!__pyx_t_10) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_cumul_c = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L39;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_v_cumul_c = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd.pyx":319
+ * histo_c = histo.reshape((histo.size,))
+ *
+ * if weighted_histo is not None: # <<<<<<<<<<<<<<
+ * cumul_c = weighted_histo.reshape((weighted_histo.size,))
+ * else:
+ */
+ goto __pyx_L41;
}
- /*else*/ {
- /* "chistogramnd.pyx":313
+ /* "silx/math/chistogramnd.pyx":322
* cumul_c = weighted_histo.reshape((weighted_histo.size,))
* else:
* cumul_c = None # <<<<<<<<<<<<<<
*
- * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)))
+ * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)),
*/
+ /*else*/ {
__Pyx_INCREF(Py_None);
__pyx_v_cumul_c = Py_None;
}
- __pyx_L39:;
+ __pyx_L41:;
- /* "chistogramnd.pyx":315
+ /* "silx/math/chistogramnd.pyx":324
* cumul_c = None
*
- * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,))) # <<<<<<<<<<<<<<
+ * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)), # <<<<<<<<<<<<<<
+ * dtype=bin_edges.dtype.newbyteorder('N'))
*
- * rc = 0
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_edges, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_edges, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_edges, __pyx_n_s_size); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- __pyx_t_12 = 0;
- __pyx_t_12 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_12)) {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_edges, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_6)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- if (!__pyx_t_12) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (!__pyx_t_6) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
}
}
- if (!__pyx_t_3) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_bin_edges_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "chistogramnd.pyx":317
- * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)))
+ /* "silx/math/chistogramnd.pyx":325
+ *
+ * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)),
+ * dtype=bin_edges.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_bin_edges, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_11) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+
+ /* "silx/math/chistogramnd.pyx":324
+ * cumul_c = None
+ *
+ * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)), # <<<<<<<<<<<<<<
+ * dtype=bin_edges.dtype.newbyteorder('N'))
+ *
+ */
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_bin_edges_c = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "silx/math/chistogramnd.pyx":327
+ * dtype=bin_edges.dtype.newbyteorder('N'))
*
* rc = 0 # <<<<<<<<<<<<<<
*
@@ -4638,7 +5643,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
*/
__pyx_v_rc = 0;
- /* "chistogramnd.pyx":319
+ /* "silx/math/chistogramnd.pyx":329
* rc = 0
*
* if weighted_histo is None or weighted_histo.dtype == np.double: # <<<<<<<<<<<<<<
@@ -4650,70 +5655,70 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
if (!__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
- goto __pyx_L41_bool_binop_done;
+ goto __pyx_L43_bool_binop_done;
}
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_double); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_11, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 329, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_7 = __pyx_t_1;
- __pyx_L41_bool_binop_done:;
+ __pyx_L43_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":321
+ /* "silx/math/chistogramnd.pyx":331
* if weighted_histo is None or weighted_histo.dtype == np.double:
*
* if sample_type == np.float64: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":323
+ /* "silx/math/chistogramnd.pyx":333
* if sample_type == np.float64:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_double_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 333, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
- goto __pyx_L45_bool_binop_done;
+ goto __pyx_L47_bool_binop_done;
}
__pyx_t_1 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
__pyx_t_7 = __pyx_t_2;
- __pyx_L45_bool_binop_done:;
+ __pyx_L47_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":325
+ /* "silx/math/chistogramnd.pyx":335
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_double_double_double(sample_c, # <<<<<<<<<<<<<<
@@ -4721,9 +5726,9 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* n_dims,
*/
__pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_13.memview)) __PYX_ERR(0, 335, __pyx_L1_error)
- /* "chistogramnd.pyx":326
+ /* "silx/math/chistogramnd.pyx":336
*
* rc = _histogramnd_double_double_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
@@ -4731,2987 +5736,3447 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* n_elem,
*/
__pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_14.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 336, __pyx_L1_error)
- /* "chistogramnd.pyx":327
+ /* "silx/math/chistogramnd.pyx":337
* rc = _histogramnd_double_double_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
- /* "chistogramnd.pyx":328
+ /* "silx/math/chistogramnd.pyx":338
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
- /* "chistogramnd.pyx":329
+ /* "silx/math/chistogramnd.pyx":339
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_17.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 339, __pyx_L1_error)
- /* "chistogramnd.pyx":330
+ /* "silx/math/chistogramnd.pyx":340
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_18.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 340, __pyx_L1_error)
- /* "chistogramnd.pyx":331
+ /* "silx/math/chistogramnd.pyx":341
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_19.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 341, __pyx_L1_error)
- /* "chistogramnd.pyx":332
+ /* "silx/math/chistogramnd.pyx":342
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_20.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 342, __pyx_L1_error)
- /* "chistogramnd.pyx":333
+ /* "silx/math/chistogramnd.pyx":343
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_21 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_21.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 343, __pyx_L1_error)
- /* "chistogramnd.pyx":334
+ /* "silx/math/chistogramnd.pyx":344
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L1_error)
- /* "chistogramnd.pyx":335
+ /* "silx/math/chistogramnd.pyx":345
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 345, __pyx_L1_error)
- /* "chistogramnd.pyx":336
+ /* "silx/math/chistogramnd.pyx":346
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 346, __pyx_L1_error)
- /* "chistogramnd.pyx":325
+ /* "silx/math/chistogramnd.pyx":335
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_double_double_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_double_double(__pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24);
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_double(__pyx_t_13, __pyx_t_14, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23);
__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
+ __pyx_t_13.memview = NULL;
+ __pyx_t_13.data = NULL;
__PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
__PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
__PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
__PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
__PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
- goto __pyx_L44;
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":333
+ * if sample_type == np.float64:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_double_double(sample_c,
+ */
+ goto __pyx_L46;
}
- /* "chistogramnd.pyx":338
+ /* "silx/math/chistogramnd.pyx":348
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_float_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 348, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":340
+ /* "silx/math/chistogramnd.pyx":350
* elif weights_type == np.float32:
*
* rc = _histogramnd_double_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_25 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_25.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 350, __pyx_L1_error)
- /* "chistogramnd.pyx":341
+ /* "silx/math/chistogramnd.pyx":351
*
* rc = _histogramnd_double_float_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_26 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_26.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
- /* "chistogramnd.pyx":342
+ /* "silx/math/chistogramnd.pyx":352
* rc = _histogramnd_double_float_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 352, __pyx_L1_error)
- /* "chistogramnd.pyx":343
+ /* "silx/math/chistogramnd.pyx":353
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error)
- /* "chistogramnd.pyx":344
+ /* "silx/math/chistogramnd.pyx":354
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_27.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 354, __pyx_L1_error)
- /* "chistogramnd.pyx":345
+ /* "silx/math/chistogramnd.pyx":355
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_28 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_28.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 355, __pyx_L1_error)
- /* "chistogramnd.pyx":346
+ /* "silx/math/chistogramnd.pyx":356
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_29 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_29.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 356, __pyx_L1_error)
- /* "chistogramnd.pyx":347
+ /* "silx/math/chistogramnd.pyx":357
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_30.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 357, __pyx_L1_error)
- /* "chistogramnd.pyx":348
+ /* "silx/math/chistogramnd.pyx":358
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_31.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 358, __pyx_L1_error)
- /* "chistogramnd.pyx":349
+ /* "silx/math/chistogramnd.pyx":359
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error)
- /* "chistogramnd.pyx":350
+ /* "silx/math/chistogramnd.pyx":360
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L1_error)
- /* "chistogramnd.pyx":351
+ /* "silx/math/chistogramnd.pyx":361
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
- /* "chistogramnd.pyx":340
+ /* "silx/math/chistogramnd.pyx":350
* elif weights_type == np.float32:
*
* rc = _histogramnd_double_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_float_double(__pyx_t_25, __pyx_t_26, __pyx_t_22, __pyx_t_16, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30, __pyx_t_31, __pyx_t_15, __pyx_t_32, __pyx_t_33);
- __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
- goto __pyx_L44;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_double(__pyx_t_20, __pyx_t_24, __pyx_t_21, __pyx_t_15, __pyx_t_19, __pyx_t_17, __pyx_t_18, __pyx_t_16, __pyx_t_14, __pyx_t_9, __pyx_t_25, __pyx_t_26);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":348
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_float_double(sample_c,
+ */
+ goto __pyx_L46;
}
- /* "chistogramnd.pyx":353
+ /* "silx/math/chistogramnd.pyx":363
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_int32_t_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __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 = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":355
+ /* "silx/math/chistogramnd.pyx":365
* elif weights_type == np.int32:
*
* rc = _histogramnd_double_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_34 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_34.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
- /* "chistogramnd.pyx":356
+ /* "silx/math/chistogramnd.pyx":366
*
* rc = _histogramnd_double_int32_t_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_35 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_35.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 366, __pyx_L1_error)
- /* "chistogramnd.pyx":357
+ /* "silx/math/chistogramnd.pyx":367
* rc = _histogramnd_double_int32_t_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
- /* "chistogramnd.pyx":358
+ /* "silx/math/chistogramnd.pyx":368
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L1_error)
- /* "chistogramnd.pyx":359
+ /* "silx/math/chistogramnd.pyx":369
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_36 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_36.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 369, __pyx_L1_error)
- /* "chistogramnd.pyx":360
+ /* "silx/math/chistogramnd.pyx":370
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_37 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_37.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 370, __pyx_L1_error)
- /* "chistogramnd.pyx":361
+ /* "silx/math/chistogramnd.pyx":371
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_38 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_38.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 371, __pyx_L1_error)
- /* "chistogramnd.pyx":362
+ /* "silx/math/chistogramnd.pyx":372
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_39 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_39.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 372, __pyx_L1_error)
- /* "chistogramnd.pyx":363
+ /* "silx/math/chistogramnd.pyx":373
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_40 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_40.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 373, __pyx_L1_error)
- /* "chistogramnd.pyx":364
+ /* "silx/math/chistogramnd.pyx":374
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 374, __pyx_L1_error)
- /* "chistogramnd.pyx":365
+ /* "silx/math/chistogramnd.pyx":375
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L1_error)
- /* "chistogramnd.pyx":366
+ /* "silx/math/chistogramnd.pyx":376
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error)
- /* "chistogramnd.pyx":355
+ /* "silx/math/chistogramnd.pyx":365
* elif weights_type == np.int32:
*
* rc = _histogramnd_double_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__pyx_t_34, __pyx_t_35, __pyx_t_15, __pyx_t_16, __pyx_t_36, __pyx_t_37, __pyx_t_38, __pyx_t_39, __pyx_t_40, __pyx_t_22, __pyx_t_41, __pyx_t_42);
- __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
- goto __pyx_L44;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_double(__pyx_t_14, __pyx_t_27, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_28, __pyx_t_29);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":363
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_int32_t_double(sample_c,
+ */
+ goto __pyx_L46;
}
- /*else*/ {
- /* "chistogramnd.pyx":369
+ /* "silx/math/chistogramnd.pyx":379
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.float64
*/
- __pyx_t_9 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ /*else*/ {
+ __pyx_t_4 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 379, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __pyx_L44:;
- goto __pyx_L43;
+ __pyx_L46:;
+
+ /* "silx/math/chistogramnd.pyx":331
+ * if weighted_histo is None or weighted_histo.dtype == np.double:
+ *
+ * if sample_type == np.float64: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L45;
}
- /* "chistogramnd.pyx":372
+ /* "silx/math/chistogramnd.pyx":382
*
* # endif sample_type == np.float64
* elif sample_type == np.float32: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":374
+ /* "silx/math/chistogramnd.pyx":384
* elif sample_type == np.float32:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_double_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
- goto __pyx_L48_bool_binop_done;
+ goto __pyx_L50_bool_binop_done;
}
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
__pyx_t_7 = __pyx_t_1;
- __pyx_L48_bool_binop_done:;
+ __pyx_L50_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":376
+ /* "silx/math/chistogramnd.pyx":386
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_float_double_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_43 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_43.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 386, __pyx_L1_error)
- /* "chistogramnd.pyx":377
+ /* "silx/math/chistogramnd.pyx":387
*
* rc = _histogramnd_float_double_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_44 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_44.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 387, __pyx_L1_error)
- /* "chistogramnd.pyx":378
+ /* "silx/math/chistogramnd.pyx":388
* rc = _histogramnd_float_double_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error)
- /* "chistogramnd.pyx":379
+ /* "silx/math/chistogramnd.pyx":389
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
- /* "chistogramnd.pyx":380
+ /* "silx/math/chistogramnd.pyx":390
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_45 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_45.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 390, __pyx_L1_error)
- /* "chistogramnd.pyx":381
+ /* "silx/math/chistogramnd.pyx":391
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_46 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_46.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 391, __pyx_L1_error)
- /* "chistogramnd.pyx":382
+ /* "silx/math/chistogramnd.pyx":392
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_47 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_47.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 392, __pyx_L1_error)
- /* "chistogramnd.pyx":383
+ /* "silx/math/chistogramnd.pyx":393
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_48 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_48.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 393, __pyx_L1_error)
- /* "chistogramnd.pyx":384
+ /* "silx/math/chistogramnd.pyx":394
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_49 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_49.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 394, __pyx_L1_error)
- /* "chistogramnd.pyx":385
+ /* "silx/math/chistogramnd.pyx":395
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 395, __pyx_L1_error)
- /* "chistogramnd.pyx":386
+ /* "silx/math/chistogramnd.pyx":396
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
- /* "chistogramnd.pyx":387
+ /* "silx/math/chistogramnd.pyx":397
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L1_error)
- /* "chistogramnd.pyx":376
+ /* "silx/math/chistogramnd.pyx":386
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_float_double_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_double_double(__pyx_t_43, __pyx_t_44, __pyx_t_22, __pyx_t_16, __pyx_t_45, __pyx_t_46, __pyx_t_47, __pyx_t_48, __pyx_t_49, __pyx_t_15, __pyx_t_24, __pyx_t_23);
- __PYX_XDEC_MEMVIEW(&__pyx_t_43, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_44, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_45, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_46, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_47, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_48, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_49, 1);
- goto __pyx_L47;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_double(__pyx_t_24, __pyx_t_20, __pyx_t_21, __pyx_t_15, __pyx_t_19, __pyx_t_17, __pyx_t_18, __pyx_t_16, __pyx_t_14, __pyx_t_9, __pyx_t_23, __pyx_t_22);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":384
+ * elif sample_type == np.float32:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_double_double(sample_c,
+ */
+ goto __pyx_L49;
}
- /* "chistogramnd.pyx":389
+ /* "silx/math/chistogramnd.pyx":399
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_float_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":391
+ /* "silx/math/chistogramnd.pyx":401
* elif weights_type == np.float32:
*
* rc = _histogramnd_float_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_50 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_50.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 401, __pyx_L1_error)
- /* "chistogramnd.pyx":392
+ /* "silx/math/chistogramnd.pyx":402
*
* rc = _histogramnd_float_float_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_51 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_51.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 402, __pyx_L1_error)
- /* "chistogramnd.pyx":393
+ /* "silx/math/chistogramnd.pyx":403
* rc = _histogramnd_float_float_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L1_error)
- /* "chistogramnd.pyx":394
+ /* "silx/math/chistogramnd.pyx":404
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 404, __pyx_L1_error)
- /* "chistogramnd.pyx":395
+ /* "silx/math/chistogramnd.pyx":405
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_52 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_52.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
- /* "chistogramnd.pyx":396
+ /* "silx/math/chistogramnd.pyx":406
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_53 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_53.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 406, __pyx_L1_error)
- /* "chistogramnd.pyx":397
+ /* "silx/math/chistogramnd.pyx":407
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_54 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_54.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
- /* "chistogramnd.pyx":398
+ /* "silx/math/chistogramnd.pyx":408
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_55 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_55.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 408, __pyx_L1_error)
- /* "chistogramnd.pyx":399
+ /* "silx/math/chistogramnd.pyx":409
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_56 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_56.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 409, __pyx_L1_error)
- /* "chistogramnd.pyx":400
+ /* "silx/math/chistogramnd.pyx":410
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error)
- /* "chistogramnd.pyx":401
+ /* "silx/math/chistogramnd.pyx":411
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
- /* "chistogramnd.pyx":402
+ /* "silx/math/chistogramnd.pyx":412
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
- /* "chistogramnd.pyx":391
+ /* "silx/math/chistogramnd.pyx":401
* elif weights_type == np.float32:
*
* rc = _histogramnd_float_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_float_double(__pyx_t_50, __pyx_t_51, __pyx_t_15, __pyx_t_16, __pyx_t_52, __pyx_t_53, __pyx_t_54, __pyx_t_55, __pyx_t_56, __pyx_t_22, __pyx_t_33, __pyx_t_32);
- __PYX_XDEC_MEMVIEW(&__pyx_t_50, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_51, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_52, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_53, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_54, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_55, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_56, 1);
- goto __pyx_L47;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_double(__pyx_t_24, __pyx_t_30, __pyx_t_9, __pyx_t_15, __pyx_t_14, __pyx_t_17, __pyx_t_18, __pyx_t_16, __pyx_t_19, __pyx_t_21, __pyx_t_26, __pyx_t_25);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":399
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_float_double(sample_c,
+ */
+ goto __pyx_L49;
}
- /* "chistogramnd.pyx":404
+ /* "silx/math/chistogramnd.pyx":414
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_int32_t_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __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 = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 414, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":406
+ /* "silx/math/chistogramnd.pyx":416
* elif weights_type == np.int32:
*
* rc = _histogramnd_float_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_57 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_57.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 416, __pyx_L1_error)
- /* "chistogramnd.pyx":407
+ /* "silx/math/chistogramnd.pyx":417
*
* rc = _histogramnd_float_int32_t_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_58 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_58.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 417, __pyx_L1_error)
- /* "chistogramnd.pyx":408
+ /* "silx/math/chistogramnd.pyx":418
* rc = _histogramnd_float_int32_t_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 418, __pyx_L1_error)
- /* "chistogramnd.pyx":409
+ /* "silx/math/chistogramnd.pyx":419
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 419, __pyx_L1_error)
- /* "chistogramnd.pyx":410
+ /* "silx/math/chistogramnd.pyx":420
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_59 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_59.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 420, __pyx_L1_error)
- /* "chistogramnd.pyx":411
+ /* "silx/math/chistogramnd.pyx":421
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_60 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_60.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 421, __pyx_L1_error)
- /* "chistogramnd.pyx":412
+ /* "silx/math/chistogramnd.pyx":422
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_61 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_61.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 422, __pyx_L1_error)
- /* "chistogramnd.pyx":413
+ /* "silx/math/chistogramnd.pyx":423
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_62 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_62.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 423, __pyx_L1_error)
- /* "chistogramnd.pyx":414
+ /* "silx/math/chistogramnd.pyx":424
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_63 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_63.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 424, __pyx_L1_error)
- /* "chistogramnd.pyx":415
+ /* "silx/math/chistogramnd.pyx":425
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error)
- /* "chistogramnd.pyx":416
+ /* "silx/math/chistogramnd.pyx":426
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error)
- /* "chistogramnd.pyx":417
+ /* "silx/math/chistogramnd.pyx":427
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error)
- /* "chistogramnd.pyx":406
+ /* "silx/math/chistogramnd.pyx":416
* elif weights_type == np.int32:
*
* rc = _histogramnd_float_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__pyx_t_57, __pyx_t_58, __pyx_t_22, __pyx_t_16, __pyx_t_59, __pyx_t_60, __pyx_t_61, __pyx_t_62, __pyx_t_63, __pyx_t_15, __pyx_t_42, __pyx_t_41);
- __PYX_XDEC_MEMVIEW(&__pyx_t_57, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_58, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_59, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_60, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_61, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_62, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_63, 1);
- goto __pyx_L47;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_double(__pyx_t_30, __pyx_t_27, __pyx_t_21, __pyx_t_15, __pyx_t_19, __pyx_t_17, __pyx_t_18, __pyx_t_16, __pyx_t_14, __pyx_t_9, __pyx_t_29, __pyx_t_28);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":414
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_int32_t_double(sample_c,
+ */
+ goto __pyx_L49;
}
- /*else*/ {
- /* "chistogramnd.pyx":420
+ /* "silx/math/chistogramnd.pyx":430
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.float32
*/
- __pyx_t_9 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); 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_9); __pyx_t_9 = 0;
+ /*else*/ {
+ __pyx_t_4 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __pyx_L47:;
- goto __pyx_L43;
+ __pyx_L49:;
+
+ /* "silx/math/chistogramnd.pyx":382
+ *
+ * # endif sample_type == np.float64
+ * elif sample_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L45;
}
- /* "chistogramnd.pyx":423
+ /* "silx/math/chistogramnd.pyx":433
*
* # endif sample_type == np.float32
* elif sample_type == np.int32: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __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 = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":425
+ /* "silx/math/chistogramnd.pyx":435
* elif sample_type == np.int32:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_double_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); 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_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float64); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (!__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
- goto __pyx_L51_bool_binop_done;
+ goto __pyx_L53_bool_binop_done;
}
__pyx_t_1 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
__pyx_t_7 = __pyx_t_2;
- __pyx_L51_bool_binop_done:;
+ __pyx_L53_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":427
+ /* "silx/math/chistogramnd.pyx":437
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_int32_t_double_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_64 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_64.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 437, __pyx_L1_error)
- /* "chistogramnd.pyx":428
+ /* "silx/math/chistogramnd.pyx":438
*
* rc = _histogramnd_int32_t_double_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_65 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_65.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 438, __pyx_L1_error)
- /* "chistogramnd.pyx":429
+ /* "silx/math/chistogramnd.pyx":439
* rc = _histogramnd_int32_t_double_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error)
- /* "chistogramnd.pyx":430
+ /* "silx/math/chistogramnd.pyx":440
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error)
- /* "chistogramnd.pyx":431
+ /* "silx/math/chistogramnd.pyx":441
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_66 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_66.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 441, __pyx_L1_error)
- /* "chistogramnd.pyx":432
+ /* "silx/math/chistogramnd.pyx":442
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_67 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_67.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 442, __pyx_L1_error)
- /* "chistogramnd.pyx":433
+ /* "silx/math/chistogramnd.pyx":443
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_68 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_68.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 443, __pyx_L1_error)
- /* "chistogramnd.pyx":434
+ /* "silx/math/chistogramnd.pyx":444
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_69 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_69.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 444, __pyx_L1_error)
- /* "chistogramnd.pyx":435
+ /* "silx/math/chistogramnd.pyx":445
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_70 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_70.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 445, __pyx_L1_error)
- /* "chistogramnd.pyx":436
+ /* "silx/math/chistogramnd.pyx":446
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L1_error)
- /* "chistogramnd.pyx":437
+ /* "silx/math/chistogramnd.pyx":447
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error)
- /* "chistogramnd.pyx":438
+ /* "silx/math/chistogramnd.pyx":448
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error)
- /* "chistogramnd.pyx":427
+ /* "silx/math/chistogramnd.pyx":437
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_int32_t_double_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__pyx_t_64, __pyx_t_65, __pyx_t_15, __pyx_t_16, __pyx_t_66, __pyx_t_67, __pyx_t_68, __pyx_t_69, __pyx_t_70, __pyx_t_22, __pyx_t_23, __pyx_t_24);
- __PYX_XDEC_MEMVIEW(&__pyx_t_64, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_65, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_66, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_67, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_68, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_69, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_70, 1);
- goto __pyx_L50;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_double(__pyx_t_27, __pyx_t_14, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":435
+ * elif sample_type == np.int32:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_double_double(sample_c,
+ */
+ goto __pyx_L52;
}
- /* "chistogramnd.pyx":440
+ /* "silx/math/chistogramnd.pyx":450
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_float_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_float32); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 450, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":442
+ /* "silx/math/chistogramnd.pyx":452
* elif weights_type == np.float32:
*
* rc = _histogramnd_int32_t_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_71 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_71.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
- /* "chistogramnd.pyx":443
+ /* "silx/math/chistogramnd.pyx":453
*
* rc = _histogramnd_int32_t_float_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_72 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_72.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 453, __pyx_L1_error)
- /* "chistogramnd.pyx":444
+ /* "silx/math/chistogramnd.pyx":454
* rc = _histogramnd_int32_t_float_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error)
- /* "chistogramnd.pyx":445
+ /* "silx/math/chistogramnd.pyx":455
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 455, __pyx_L1_error)
- /* "chistogramnd.pyx":446
+ /* "silx/math/chistogramnd.pyx":456
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_73 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_73.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 456, __pyx_L1_error)
- /* "chistogramnd.pyx":447
+ /* "silx/math/chistogramnd.pyx":457
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_74 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_74.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 457, __pyx_L1_error)
- /* "chistogramnd.pyx":448
+ /* "silx/math/chistogramnd.pyx":458
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_75 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_75.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 458, __pyx_L1_error)
- /* "chistogramnd.pyx":449
+ /* "silx/math/chistogramnd.pyx":459
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_76 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_76.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 459, __pyx_L1_error)
- /* "chistogramnd.pyx":450
+ /* "silx/math/chistogramnd.pyx":460
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_77 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_77.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 460, __pyx_L1_error)
- /* "chistogramnd.pyx":451
+ /* "silx/math/chistogramnd.pyx":461
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 461, __pyx_L1_error)
- /* "chistogramnd.pyx":452
+ /* "silx/math/chistogramnd.pyx":462
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
- /* "chistogramnd.pyx":453
+ /* "silx/math/chistogramnd.pyx":463
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L1_error)
- /* "chistogramnd.pyx":442
+ /* "silx/math/chistogramnd.pyx":452
* elif weights_type == np.float32:
*
* rc = _histogramnd_int32_t_float_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__pyx_t_71, __pyx_t_72, __pyx_t_22, __pyx_t_16, __pyx_t_73, __pyx_t_74, __pyx_t_75, __pyx_t_76, __pyx_t_77, __pyx_t_15, __pyx_t_32, __pyx_t_33);
- __PYX_XDEC_MEMVIEW(&__pyx_t_71, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_72, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_73, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_74, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_75, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_76, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_77, 1);
- goto __pyx_L50;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_double(__pyx_t_27, __pyx_t_30, __pyx_t_21, __pyx_t_15, __pyx_t_20, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_16, __pyx_t_9, __pyx_t_25, __pyx_t_26);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":450
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_float_double(sample_c,
+ */
+ goto __pyx_L52;
}
- /* "chistogramnd.pyx":455
+ /* "silx/math/chistogramnd.pyx":465
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_int32_t_double(sample_c,
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __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 = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_10, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 465, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 465, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":457
+ /* "silx/math/chistogramnd.pyx":467
* elif weights_type == np.int32:
*
* rc = _histogramnd_int32_t_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_78 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_78.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 467, __pyx_L1_error)
- /* "chistogramnd.pyx":458
+ /* "silx/math/chistogramnd.pyx":468
*
* rc = _histogramnd_int32_t_int32_t_double(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_79 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_79.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 468, __pyx_L1_error)
- /* "chistogramnd.pyx":459
+ /* "silx/math/chistogramnd.pyx":469
* rc = _histogramnd_int32_t_int32_t_double(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L1_error)
- /* "chistogramnd.pyx":460
+ /* "silx/math/chistogramnd.pyx":470
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 470, __pyx_L1_error)
- /* "chistogramnd.pyx":461
+ /* "silx/math/chistogramnd.pyx":471
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_80 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_80.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 471, __pyx_L1_error)
- /* "chistogramnd.pyx":462
+ /* "silx/math/chistogramnd.pyx":472
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_81 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_81.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 472, __pyx_L1_error)
- /* "chistogramnd.pyx":463
+ /* "silx/math/chistogramnd.pyx":473
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_82 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_82.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 473, __pyx_L1_error)
- /* "chistogramnd.pyx":464
+ /* "silx/math/chistogramnd.pyx":474
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_83 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_83.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 474, __pyx_L1_error)
- /* "chistogramnd.pyx":465
+ /* "silx/math/chistogramnd.pyx":475
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_84 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_84.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 475, __pyx_L1_error)
- /* "chistogramnd.pyx":466
+ /* "silx/math/chistogramnd.pyx":476
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
- /* "chistogramnd.pyx":467
+ /* "silx/math/chistogramnd.pyx":477
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L1_error)
- /* "chistogramnd.pyx":468
+ /* "silx/math/chistogramnd.pyx":478
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L1_error)
- /* "chistogramnd.pyx":457
+ /* "silx/math/chistogramnd.pyx":467
* elif weights_type == np.int32:
*
* rc = _histogramnd_int32_t_int32_t_double(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__pyx_t_78, __pyx_t_79, __pyx_t_15, __pyx_t_16, __pyx_t_80, __pyx_t_81, __pyx_t_82, __pyx_t_83, __pyx_t_84, __pyx_t_22, __pyx_t_41, __pyx_t_42);
- __PYX_XDEC_MEMVIEW(&__pyx_t_78, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_79, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_80, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_81, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_82, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_83, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_84, 1);
- goto __pyx_L50;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_double(__pyx_t_27, __pyx_t_31, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_28, __pyx_t_29);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":465
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_int32_t_double(sample_c,
+ */
+ goto __pyx_L52;
}
- /*else*/ {
- /* "chistogramnd.pyx":471
+ /* "silx/math/chistogramnd.pyx":481
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.int32:
*/
- __pyx_t_9 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ /*else*/ {
+ __pyx_t_4 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __pyx_L50:;
- goto __pyx_L43;
+ __pyx_L52:;
+
+ /* "silx/math/chistogramnd.pyx":433
+ *
+ * # endif sample_type == np.float32
+ * elif sample_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L45;
}
- /*else*/ {
- /* "chistogramnd.pyx":475
+ /* "silx/math/chistogramnd.pyx":485
* # endif sample_type == np.int32:
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif weighted_histo is None or weighted_histo.dtype == np.double:
*/
- __pyx_t_9 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ /*else*/ {
+ __pyx_t_4 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
}
- __pyx_L43:;
- goto __pyx_L40;
+ __pyx_L45:;
+
+ /* "silx/math/chistogramnd.pyx":329
+ * rc = 0
+ *
+ * if weighted_histo is None or weighted_histo.dtype == np.double: # <<<<<<<<<<<<<<
+ *
+ * if sample_type == np.float64:
+ */
+ goto __pyx_L42;
}
- /* "chistogramnd.pyx":478
+ /* "silx/math/chistogramnd.pyx":488
*
* # endif weighted_histo is None or weighted_histo.dtype == np.double:
* elif weighted_histo.dtype == np.float32: # <<<<<<<<<<<<<<
*
* if sample_type == np.float64:
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_9, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":480
+ /* "silx/math/chistogramnd.pyx":490
* elif weighted_histo.dtype == np.float32:
*
* if sample_type == np.float64: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 490, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":482
+ /* "silx/math/chistogramnd.pyx":492
* if sample_type == np.float64:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_double_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
- goto __pyx_L55_bool_binop_done;
+ goto __pyx_L57_bool_binop_done;
}
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
__pyx_t_7 = __pyx_t_1;
- __pyx_L55_bool_binop_done:;
+ __pyx_L57_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":484
+ /* "silx/math/chistogramnd.pyx":494
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_double_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_85 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_85.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_20 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_20.memview)) __PYX_ERR(0, 494, __pyx_L1_error)
- /* "chistogramnd.pyx":485
+ /* "silx/math/chistogramnd.pyx":495
*
* rc = _histogramnd_double_double_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_86 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_86.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 495, __pyx_L1_error)
- /* "chistogramnd.pyx":486
+ /* "silx/math/chistogramnd.pyx":496
* rc = _histogramnd_double_double_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 496, __pyx_L1_error)
- /* "chistogramnd.pyx":487
+ /* "silx/math/chistogramnd.pyx":497
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
- /* "chistogramnd.pyx":488
+ /* "silx/math/chistogramnd.pyx":498
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_87 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_87.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 498, __pyx_L1_error)
- /* "chistogramnd.pyx":489
+ /* "silx/math/chistogramnd.pyx":499
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_88 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_88.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
- /* "chistogramnd.pyx":490
+ /* "silx/math/chistogramnd.pyx":500
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_89 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_89.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 500, __pyx_L1_error)
- /* "chistogramnd.pyx":491
+ /* "silx/math/chistogramnd.pyx":501
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_90 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_90.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
- /* "chistogramnd.pyx":492
+ /* "silx/math/chistogramnd.pyx":502
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_91 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_91.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 502, __pyx_L1_error)
- /* "chistogramnd.pyx":493
+ /* "silx/math/chistogramnd.pyx":503
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error)
- /* "chistogramnd.pyx":494
+ /* "silx/math/chistogramnd.pyx":504
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 504, __pyx_L1_error)
- /* "chistogramnd.pyx":495
+ /* "silx/math/chistogramnd.pyx":505
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 505, __pyx_L1_error)
- /* "chistogramnd.pyx":484
+ /* "silx/math/chistogramnd.pyx":494
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_double_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_double_float(__pyx_t_85, __pyx_t_86, __pyx_t_22, __pyx_t_16, __pyx_t_87, __pyx_t_88, __pyx_t_89, __pyx_t_90, __pyx_t_91, __pyx_t_15, __pyx_t_24, __pyx_t_23);
- __PYX_XDEC_MEMVIEW(&__pyx_t_85, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_86, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_87, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_88, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_89, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_90, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_91, 1);
- goto __pyx_L54;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_float(__pyx_t_20, __pyx_t_19, __pyx_t_21, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_30, __pyx_t_14, __pyx_t_9, __pyx_t_23, __pyx_t_22);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
+ __pyx_t_20.memview = NULL;
+ __pyx_t_20.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":492
+ * if sample_type == np.float64:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_double_float(sample_c,
+ */
+ goto __pyx_L56;
}
- /* "chistogramnd.pyx":497
+ /* "silx/math/chistogramnd.pyx":507
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_float_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":499
+ /* "silx/math/chistogramnd.pyx":509
* elif weights_type == np.float32:
*
* rc = _histogramnd_double_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_92 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_92.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 509, __pyx_L1_error)
- /* "chistogramnd.pyx":500
+ /* "silx/math/chistogramnd.pyx":510
*
* rc = _histogramnd_double_float_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_93 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_93.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 510, __pyx_L1_error)
- /* "chistogramnd.pyx":501
+ /* "silx/math/chistogramnd.pyx":511
* rc = _histogramnd_double_float_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L1_error)
- /* "chistogramnd.pyx":502
+ /* "silx/math/chistogramnd.pyx":512
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error)
- /* "chistogramnd.pyx":503
+ /* "silx/math/chistogramnd.pyx":513
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_94 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_94.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 513, __pyx_L1_error)
- /* "chistogramnd.pyx":504
+ /* "silx/math/chistogramnd.pyx":514
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_95 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_95.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 514, __pyx_L1_error)
- /* "chistogramnd.pyx":505
+ /* "silx/math/chistogramnd.pyx":515
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_96 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_96.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 515, __pyx_L1_error)
- /* "chistogramnd.pyx":506
+ /* "silx/math/chistogramnd.pyx":516
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_97 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_97.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 516, __pyx_L1_error)
- /* "chistogramnd.pyx":507
+ /* "silx/math/chistogramnd.pyx":517
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_98 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_98.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 517, __pyx_L1_error)
- /* "chistogramnd.pyx":508
+ /* "silx/math/chistogramnd.pyx":518
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error)
- /* "chistogramnd.pyx":509
+ /* "silx/math/chistogramnd.pyx":519
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L1_error)
- /* "chistogramnd.pyx":510
+ /* "silx/math/chistogramnd.pyx":520
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 520, __pyx_L1_error)
- /* "chistogramnd.pyx":499
+ /* "silx/math/chistogramnd.pyx":509
* elif weights_type == np.float32:
*
* rc = _histogramnd_double_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_float_float(__pyx_t_92, __pyx_t_93, __pyx_t_15, __pyx_t_16, __pyx_t_94, __pyx_t_95, __pyx_t_96, __pyx_t_97, __pyx_t_98, __pyx_t_22, __pyx_t_33, __pyx_t_32);
- __PYX_XDEC_MEMVIEW(&__pyx_t_92, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_93, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_94, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_95, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_96, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_97, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_98, 1);
- goto __pyx_L54;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_float(__pyx_t_14, __pyx_t_30, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_24, __pyx_t_19, __pyx_t_21, __pyx_t_26, __pyx_t_25);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":507
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_float_float(sample_c,
+ */
+ goto __pyx_L56;
}
- /* "chistogramnd.pyx":512
+ /* "silx/math/chistogramnd.pyx":522
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_double_int32_t_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 522, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 522, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":514
+ /* "silx/math/chistogramnd.pyx":524
* elif weights_type == np.int32:
*
* rc = _histogramnd_double_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_99 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_99.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 524, __pyx_L1_error)
- /* "chistogramnd.pyx":515
+ /* "silx/math/chistogramnd.pyx":525
*
* rc = _histogramnd_double_int32_t_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_100 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_100.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 525, __pyx_L1_error)
- /* "chistogramnd.pyx":516
+ /* "silx/math/chistogramnd.pyx":526
* rc = _histogramnd_double_int32_t_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 526, __pyx_L1_error)
- /* "chistogramnd.pyx":517
+ /* "silx/math/chistogramnd.pyx":527
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 527, __pyx_L1_error)
- /* "chistogramnd.pyx":518
+ /* "silx/math/chistogramnd.pyx":528
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_101 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_101.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 528, __pyx_L1_error)
- /* "chistogramnd.pyx":519
+ /* "silx/math/chistogramnd.pyx":529
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_102 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_102.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 529, __pyx_L1_error)
- /* "chistogramnd.pyx":520
+ /* "silx/math/chistogramnd.pyx":530
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_103 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_103.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 530, __pyx_L1_error)
- /* "chistogramnd.pyx":521
+ /* "silx/math/chistogramnd.pyx":531
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_104 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_104.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 531, __pyx_L1_error)
- /* "chistogramnd.pyx":522
+ /* "silx/math/chistogramnd.pyx":532
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_105 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_105.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 532, __pyx_L1_error)
- /* "chistogramnd.pyx":523
+ /* "silx/math/chistogramnd.pyx":533
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error)
- /* "chistogramnd.pyx":524
+ /* "silx/math/chistogramnd.pyx":534
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
- /* "chistogramnd.pyx":525
+ /* "silx/math/chistogramnd.pyx":535
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error)
- /* "chistogramnd.pyx":514
+ /* "silx/math/chistogramnd.pyx":524
* elif weights_type == np.int32:
*
* rc = _histogramnd_double_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__pyx_t_99, __pyx_t_100, __pyx_t_22, __pyx_t_16, __pyx_t_101, __pyx_t_102, __pyx_t_103, __pyx_t_104, __pyx_t_105, __pyx_t_15, __pyx_t_42, __pyx_t_41);
- __PYX_XDEC_MEMVIEW(&__pyx_t_99, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_100, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_101, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_102, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_103, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_104, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_105, 1);
- goto __pyx_L54;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_float(__pyx_t_19, __pyx_t_31, __pyx_t_21, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_24, __pyx_t_14, __pyx_t_9, __pyx_t_29, __pyx_t_28);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":522
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_double_int32_t_float(sample_c,
+ */
+ goto __pyx_L56;
}
- /*else*/ {
- /* "chistogramnd.pyx":528
+ /* "silx/math/chistogramnd.pyx":538
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.float64
*/
- __pyx_t_10 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ /*else*/ {
+ __pyx_t_3 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_L54:;
- goto __pyx_L53;
+ __pyx_L56:;
+
+ /* "silx/math/chistogramnd.pyx":490
+ * elif weighted_histo.dtype == np.float32:
+ *
+ * if sample_type == np.float64: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L55;
}
- /* "chistogramnd.pyx":531
+ /* "silx/math/chistogramnd.pyx":541
*
* # endif sample_type == np.float64
* elif sample_type == np.float32: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 541, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":533
+ /* "silx/math/chistogramnd.pyx":543
* elif sample_type == np.float32:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_double_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 543, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_1) {
} else {
__pyx_t_7 = __pyx_t_1;
- goto __pyx_L58_bool_binop_done;
+ goto __pyx_L60_bool_binop_done;
}
__pyx_t_1 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
__pyx_t_7 = __pyx_t_2;
- __pyx_L58_bool_binop_done:;
+ __pyx_L60_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":535
+ /* "silx/math/chistogramnd.pyx":545
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_float_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_106 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_106.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 545, __pyx_L1_error)
- /* "chistogramnd.pyx":536
+ /* "silx/math/chistogramnd.pyx":546
*
* rc = _histogramnd_float_double_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_107 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_107.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
- /* "chistogramnd.pyx":537
+ /* "silx/math/chistogramnd.pyx":547
* rc = _histogramnd_float_double_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
- /* "chistogramnd.pyx":538
+ /* "silx/math/chistogramnd.pyx":548
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error)
- /* "chistogramnd.pyx":539
+ /* "silx/math/chistogramnd.pyx":549
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_108 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_108.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 549, __pyx_L1_error)
- /* "chistogramnd.pyx":540
+ /* "silx/math/chistogramnd.pyx":550
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_109 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_109.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 550, __pyx_L1_error)
- /* "chistogramnd.pyx":541
+ /* "silx/math/chistogramnd.pyx":551
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_110 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_110.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
- /* "chistogramnd.pyx":542
+ /* "silx/math/chistogramnd.pyx":552
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_111 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_111.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 552, __pyx_L1_error)
- /* "chistogramnd.pyx":543
+ /* "silx/math/chistogramnd.pyx":553
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_112 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_112.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 553, __pyx_L1_error)
- /* "chistogramnd.pyx":544
+ /* "silx/math/chistogramnd.pyx":554
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error)
- /* "chistogramnd.pyx":545
+ /* "silx/math/chistogramnd.pyx":555
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L1_error)
- /* "chistogramnd.pyx":546
+ /* "silx/math/chistogramnd.pyx":556
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 556, __pyx_L1_error)
- /* "chistogramnd.pyx":535
+ /* "silx/math/chistogramnd.pyx":545
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_float_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_double_float(__pyx_t_106, __pyx_t_107, __pyx_t_15, __pyx_t_16, __pyx_t_108, __pyx_t_109, __pyx_t_110, __pyx_t_111, __pyx_t_112, __pyx_t_22, __pyx_t_23, __pyx_t_24);
- __PYX_XDEC_MEMVIEW(&__pyx_t_106, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_107, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_108, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_109, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_110, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_111, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_112, 1);
- goto __pyx_L57;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_float(__pyx_t_24, __pyx_t_14, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_30, __pyx_t_19, __pyx_t_21, __pyx_t_22, __pyx_t_23);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":543
+ * elif sample_type == np.float32:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_double_float(sample_c,
+ */
+ goto __pyx_L59;
}
- /* "chistogramnd.pyx":548
+ /* "silx/math/chistogramnd.pyx":558
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_float_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":550
+ /* "silx/math/chistogramnd.pyx":560
* elif weights_type == np.float32:
*
* rc = _histogramnd_float_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_113 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_113.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_30 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_30.memview)) __PYX_ERR(0, 560, __pyx_L1_error)
- /* "chistogramnd.pyx":551
+ /* "silx/math/chistogramnd.pyx":561
*
* rc = _histogramnd_float_float_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_114 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_114.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 561, __pyx_L1_error)
- /* "chistogramnd.pyx":552
+ /* "silx/math/chistogramnd.pyx":562
* rc = _histogramnd_float_float_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error)
- /* "chistogramnd.pyx":553
+ /* "silx/math/chistogramnd.pyx":563
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 563, __pyx_L1_error)
- /* "chistogramnd.pyx":554
+ /* "silx/math/chistogramnd.pyx":564
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_115 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_115.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 564, __pyx_L1_error)
- /* "chistogramnd.pyx":555
+ /* "silx/math/chistogramnd.pyx":565
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_116 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_116.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 565, __pyx_L1_error)
- /* "chistogramnd.pyx":556
+ /* "silx/math/chistogramnd.pyx":566
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_117 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_117.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 566, __pyx_L1_error)
- /* "chistogramnd.pyx":557
+ /* "silx/math/chistogramnd.pyx":567
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_118 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_118.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 567, __pyx_L1_error)
- /* "chistogramnd.pyx":558
+ /* "silx/math/chistogramnd.pyx":568
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_119 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_119.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 568, __pyx_L1_error)
- /* "chistogramnd.pyx":559
+ /* "silx/math/chistogramnd.pyx":569
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error)
- /* "chistogramnd.pyx":560
+ /* "silx/math/chistogramnd.pyx":570
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 570, __pyx_L1_error)
- /* "chistogramnd.pyx":561
+ /* "silx/math/chistogramnd.pyx":571
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L1_error)
- /* "chistogramnd.pyx":550
+ /* "silx/math/chistogramnd.pyx":560
* elif weights_type == np.float32:
*
* rc = _histogramnd_float_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_float_float(__pyx_t_113, __pyx_t_114, __pyx_t_22, __pyx_t_16, __pyx_t_115, __pyx_t_116, __pyx_t_117, __pyx_t_118, __pyx_t_119, __pyx_t_15, __pyx_t_32, __pyx_t_33);
- __PYX_XDEC_MEMVIEW(&__pyx_t_113, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_114, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_115, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_116, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_117, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_118, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_119, 1);
- goto __pyx_L57;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_float(__pyx_t_30, __pyx_t_24, __pyx_t_21, __pyx_t_15, __pyx_t_19, __pyx_t_17, __pyx_t_18, __pyx_t_32, __pyx_t_16, __pyx_t_9, __pyx_t_25, __pyx_t_26);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
+ __pyx_t_30.memview = NULL;
+ __pyx_t_30.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
+ __pyx_t_32.memview = NULL;
+ __pyx_t_32.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":558
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_float_float(sample_c,
+ */
+ goto __pyx_L59;
}
- /* "chistogramnd.pyx":563
+ /* "silx/math/chistogramnd.pyx":573
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_float_int32_t_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 573, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 573, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":565
+ /* "silx/math/chistogramnd.pyx":575
* elif weights_type == np.int32:
*
* rc = _histogramnd_float_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_120 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_120.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 575, __pyx_L1_error)
- /* "chistogramnd.pyx":566
+ /* "silx/math/chistogramnd.pyx":576
*
* rc = _histogramnd_float_int32_t_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_121 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_121.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 576, __pyx_L1_error)
- /* "chistogramnd.pyx":567
+ /* "silx/math/chistogramnd.pyx":577
* rc = _histogramnd_float_int32_t_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
- /* "chistogramnd.pyx":568
+ /* "silx/math/chistogramnd.pyx":578
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
- /* "chistogramnd.pyx":569
+ /* "silx/math/chistogramnd.pyx":579
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_122 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_122.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 579, __pyx_L1_error)
- /* "chistogramnd.pyx":570
+ /* "silx/math/chistogramnd.pyx":580
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_123 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_123.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 580, __pyx_L1_error)
- /* "chistogramnd.pyx":571
+ /* "silx/math/chistogramnd.pyx":581
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_124 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_124.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 581, __pyx_L1_error)
- /* "chistogramnd.pyx":572
+ /* "silx/math/chistogramnd.pyx":582
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_125 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_125.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 582, __pyx_L1_error)
- /* "chistogramnd.pyx":573
+ /* "silx/math/chistogramnd.pyx":583
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_126 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_126.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 583, __pyx_L1_error)
- /* "chistogramnd.pyx":574
+ /* "silx/math/chistogramnd.pyx":584
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
- /* "chistogramnd.pyx":575
+ /* "silx/math/chistogramnd.pyx":585
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 585, __pyx_L1_error)
- /* "chistogramnd.pyx":576
+ /* "silx/math/chistogramnd.pyx":586
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
- /* "chistogramnd.pyx":565
+ /* "silx/math/chistogramnd.pyx":575
* elif weights_type == np.int32:
*
* rc = _histogramnd_float_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__pyx_t_120, __pyx_t_121, __pyx_t_15, __pyx_t_16, __pyx_t_122, __pyx_t_123, __pyx_t_124, __pyx_t_125, __pyx_t_126, __pyx_t_22, __pyx_t_41, __pyx_t_42);
- __PYX_XDEC_MEMVIEW(&__pyx_t_120, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_121, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_122, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_123, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_124, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_125, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_126, 1);
- goto __pyx_L57;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_float(__pyx_t_32, __pyx_t_31, __pyx_t_9, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_24, __pyx_t_19, __pyx_t_21, __pyx_t_28, __pyx_t_29);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
+ __pyx_t_32.memview = NULL;
+ __pyx_t_32.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":573
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_float_int32_t_float(sample_c,
+ */
+ goto __pyx_L59;
}
- /*else*/ {
- /* "chistogramnd.pyx":579
+ /* "silx/math/chistogramnd.pyx":589
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.float32
*/
- __pyx_t_10 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ /*else*/ {
+ __pyx_t_3 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_L57:;
- goto __pyx_L53;
+ __pyx_L59:;
+
+ /* "silx/math/chistogramnd.pyx":541
+ *
+ * # endif sample_type == np.float64
+ * elif sample_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L55;
}
- /* "chistogramnd.pyx":582
+ /* "silx/math/chistogramnd.pyx":592
*
* # endif sample_type == np.float32
* elif sample_type == np.int32: # <<<<<<<<<<<<<<
*
* if weights_type == np.float64 or weights_type is None:
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 592, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_sample_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":584
+ /* "silx/math/chistogramnd.pyx":594
* elif sample_type == np.int32:
*
* if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_double_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (!__pyx_t_2) {
} else {
__pyx_t_7 = __pyx_t_2;
- goto __pyx_L61_bool_binop_done;
+ goto __pyx_L63_bool_binop_done;
}
__pyx_t_2 = (__pyx_cur_scope->__pyx_v_weights_type == Py_None);
__pyx_t_1 = (__pyx_t_2 != 0);
__pyx_t_7 = __pyx_t_1;
- __pyx_L61_bool_binop_done:;
+ __pyx_L63_bool_binop_done:;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":586
+ /* "silx/math/chistogramnd.pyx":596
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_int32_t_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_127 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_127.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 596, __pyx_L1_error)
- /* "chistogramnd.pyx":587
+ /* "silx/math/chistogramnd.pyx":597
*
* rc = _histogramnd_int32_t_double_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_128 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_128.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_19.memview)) __PYX_ERR(0, 597, __pyx_L1_error)
- /* "chistogramnd.pyx":588
+ /* "silx/math/chistogramnd.pyx":598
* rc = _histogramnd_int32_t_double_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error)
- /* "chistogramnd.pyx":589
+ /* "silx/math/chistogramnd.pyx":599
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 599, __pyx_L1_error)
- /* "chistogramnd.pyx":590
+ /* "silx/math/chistogramnd.pyx":600
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_129 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_129.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 600, __pyx_L1_error)
- /* "chistogramnd.pyx":591
+ /* "silx/math/chistogramnd.pyx":601
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_130 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_130.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 601, __pyx_L1_error)
- /* "chistogramnd.pyx":592
+ /* "silx/math/chistogramnd.pyx":602
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_131 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_131.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
- /* "chistogramnd.pyx":593
+ /* "silx/math/chistogramnd.pyx":603
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_132 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_132.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 603, __pyx_L1_error)
- /* "chistogramnd.pyx":594
+ /* "silx/math/chistogramnd.pyx":604
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_133 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_133.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 604, __pyx_L1_error)
- /* "chistogramnd.pyx":595
+ /* "silx/math/chistogramnd.pyx":605
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 605, __pyx_L1_error)
- /* "chistogramnd.pyx":596
+ /* "silx/math/chistogramnd.pyx":606
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_24 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_24 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_min); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 606, __pyx_L1_error)
- /* "chistogramnd.pyx":597
+ /* "silx/math/chistogramnd.pyx":607
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.float32:
*/
- __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_v_weight_max); if (unlikely((__pyx_t_22 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 607, __pyx_L1_error)
- /* "chistogramnd.pyx":586
+ /* "silx/math/chistogramnd.pyx":596
* if weights_type == np.float64 or weights_type is None:
*
* rc = _histogramnd_int32_t_double_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__pyx_t_127, __pyx_t_128, __pyx_t_22, __pyx_t_16, __pyx_t_129, __pyx_t_130, __pyx_t_131, __pyx_t_132, __pyx_t_133, __pyx_t_15, __pyx_t_24, __pyx_t_23);
- __PYX_XDEC_MEMVIEW(&__pyx_t_127, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_128, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_129, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_130, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_131, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_132, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_133, 1);
- goto __pyx_L60;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_float(__pyx_t_31, __pyx_t_19, __pyx_t_21, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_24, __pyx_t_14, __pyx_t_9, __pyx_t_23, __pyx_t_22);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
+ __pyx_t_19.memview = NULL;
+ __pyx_t_19.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":594
+ * elif sample_type == np.int32:
+ *
+ * if weights_type == np.float64 or weights_type is None: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_double_float(sample_c,
+ */
+ goto __pyx_L62;
}
- /* "chistogramnd.pyx":599
+ /* "silx/math/chistogramnd.pyx":609
* weight_max=weight_max)
*
* elif weights_type == np.float32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_float_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 609, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":601
+ /* "silx/math/chistogramnd.pyx":611
* elif weights_type == np.float32:
*
* rc = _histogramnd_int32_t_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_134 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_134.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 611, __pyx_L1_error)
- /* "chistogramnd.pyx":602
+ /* "silx/math/chistogramnd.pyx":612
*
* rc = _histogramnd_int32_t_float_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_135 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_135.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_24 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_24.memview)) __PYX_ERR(0, 612, __pyx_L1_error)
- /* "chistogramnd.pyx":603
+ /* "silx/math/chistogramnd.pyx":613
* rc = _histogramnd_int32_t_float_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 613, __pyx_L1_error)
- /* "chistogramnd.pyx":604
+ /* "silx/math/chistogramnd.pyx":614
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
- /* "chistogramnd.pyx":605
+ /* "silx/math/chistogramnd.pyx":615
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_136 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_136.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 615, __pyx_L1_error)
- /* "chistogramnd.pyx":606
+ /* "silx/math/chistogramnd.pyx":616
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_137 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_137.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 616, __pyx_L1_error)
- /* "chistogramnd.pyx":607
+ /* "silx/math/chistogramnd.pyx":617
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_138 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_138.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 617, __pyx_L1_error)
- /* "chistogramnd.pyx":608
+ /* "silx/math/chistogramnd.pyx":618
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_139 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_139.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 618, __pyx_L1_error)
- /* "chistogramnd.pyx":609
+ /* "silx/math/chistogramnd.pyx":619
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_140 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_140.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 619, __pyx_L1_error)
- /* "chistogramnd.pyx":610
+ /* "silx/math/chistogramnd.pyx":620
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error)
- /* "chistogramnd.pyx":611
+ /* "silx/math/chistogramnd.pyx":621
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_33 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_33 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_26 = __pyx_PyFloat_AsFloat(__pyx_v_weight_min); if (unlikely((__pyx_t_26 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 621, __pyx_L1_error)
- /* "chistogramnd.pyx":612
+ /* "silx/math/chistogramnd.pyx":622
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* elif weights_type == np.int32:
*/
- __pyx_t_32 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_32 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_25 = __pyx_PyFloat_AsFloat(__pyx_v_weight_max); if (unlikely((__pyx_t_25 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
- /* "chistogramnd.pyx":601
+ /* "silx/math/chistogramnd.pyx":611
* elif weights_type == np.float32:
*
* rc = _histogramnd_int32_t_float_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__pyx_t_134, __pyx_t_135, __pyx_t_15, __pyx_t_16, __pyx_t_136, __pyx_t_137, __pyx_t_138, __pyx_t_139, __pyx_t_140, __pyx_t_22, __pyx_t_33, __pyx_t_32);
- __PYX_XDEC_MEMVIEW(&__pyx_t_134, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_135, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_136, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_137, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_138, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_139, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_140, 1);
- goto __pyx_L60;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_float(__pyx_t_31, __pyx_t_24, __pyx_t_9, __pyx_t_15, __pyx_t_14, __pyx_t_17, __pyx_t_18, __pyx_t_32, __pyx_t_16, __pyx_t_21, __pyx_t_26, __pyx_t_25);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
+ __pyx_t_24.memview = NULL;
+ __pyx_t_24.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
+ __pyx_t_32.memview = NULL;
+ __pyx_t_32.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":609
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.float32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_float_float(sample_c,
+ */
+ goto __pyx_L62;
}
- /* "chistogramnd.pyx":614
+ /* "silx/math/chistogramnd.pyx":624
* weight_max=weight_max)
*
* elif weights_type == np.int32: # <<<<<<<<<<<<<<
*
* rc = _histogramnd_int32_t_int32_t_float(sample_c,
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 624, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_weights_type, __pyx_t_11, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 624, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_7) {
- /* "chistogramnd.pyx":616
+ /* "silx/math/chistogramnd.pyx":626
* elif weights_type == np.int32:
*
* rc = _histogramnd_int32_t_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_t_141 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
- if (unlikely(!__pyx_t_141.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_31 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_sample_c);
+ if (unlikely(!__pyx_t_31.memview)) __PYX_ERR(0, 626, __pyx_L1_error)
- /* "chistogramnd.pyx":617
+ /* "silx/math/chistogramnd.pyx":627
*
* rc = _histogramnd_int32_t_int32_t_float(sample_c,
* weights_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_142 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
- if (unlikely(!__pyx_t_142.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_27 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_weights_c);
+ if (unlikely(!__pyx_t_27.memview)) __PYX_ERR(0, 627, __pyx_L1_error)
- /* "chistogramnd.pyx":618
+ /* "silx/math/chistogramnd.pyx":628
* rc = _histogramnd_int32_t_int32_t_float(sample_c,
* weights_c,
* n_dims, # <<<<<<<<<<<<<<
* n_elem,
* histo_range_c,
*/
- __pyx_t_22 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_22 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_21 = __Pyx_PyInt_As_int(__pyx_v_n_dims); if (unlikely((__pyx_t_21 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 628, __pyx_L1_error)
- /* "chistogramnd.pyx":619
+ /* "silx/math/chistogramnd.pyx":629
* weights_c,
* n_dims,
* n_elem, # <<<<<<<<<<<<<<
* histo_range_c,
* n_bins_c,
*/
- __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_n_elem); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 629, __pyx_L1_error)
- /* "chistogramnd.pyx":620
+ /* "silx/math/chistogramnd.pyx":630
* n_dims,
* n_elem,
* histo_range_c, # <<<<<<<<<<<<<<
* n_bins_c,
* histo_c,
*/
- __pyx_t_143 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
- if (unlikely(!__pyx_t_143.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_histo_range_c);
+ if (unlikely(!__pyx_t_16.memview)) __PYX_ERR(0, 630, __pyx_L1_error)
- /* "chistogramnd.pyx":621
+ /* "silx/math/chistogramnd.pyx":631
* n_elem,
* histo_range_c,
* n_bins_c, # <<<<<<<<<<<<<<
* histo_c,
* cumul_c,
*/
- __pyx_t_144 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
- if (unlikely(!__pyx_t_144.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_n_bins_c);
+ if (unlikely(!__pyx_t_17.memview)) __PYX_ERR(0, 631, __pyx_L1_error)
- /* "chistogramnd.pyx":622
+ /* "silx/math/chistogramnd.pyx":632
* histo_range_c,
* n_bins_c,
* histo_c, # <<<<<<<<<<<<<<
* cumul_c,
* bin_edges_c,
*/
- __pyx_t_145 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
- if (unlikely(!__pyx_t_145.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_18 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(__pyx_v_histo_c);
+ if (unlikely(!__pyx_t_18.memview)) __PYX_ERR(0, 632, __pyx_L1_error)
- /* "chistogramnd.pyx":623
+ /* "silx/math/chistogramnd.pyx":633
* n_bins_c,
* histo_c,
* cumul_c, # <<<<<<<<<<<<<<
* bin_edges_c,
* option_flags,
*/
- __pyx_t_146 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
- if (unlikely(!__pyx_t_146.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_32 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_v_cumul_c);
+ if (unlikely(!__pyx_t_32.memview)) __PYX_ERR(0, 633, __pyx_L1_error)
- /* "chistogramnd.pyx":624
+ /* "silx/math/chistogramnd.pyx":634
* histo_c,
* cumul_c,
* bin_edges_c, # <<<<<<<<<<<<<<
* option_flags,
* weight_min=weight_min,
*/
- __pyx_t_147 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
- if (unlikely(!__pyx_t_147.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_bin_edges_c);
+ if (unlikely(!__pyx_t_14.memview)) __PYX_ERR(0, 634, __pyx_L1_error)
- /* "chistogramnd.pyx":625
+ /* "silx/math/chistogramnd.pyx":635
* cumul_c,
* bin_edges_c,
* option_flags, # <<<<<<<<<<<<<<
* weight_min=weight_min,
* weight_max=weight_max)
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_option_flags); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 635, __pyx_L1_error)
- /* "chistogramnd.pyx":626
+ /* "silx/math/chistogramnd.pyx":636
* bin_edges_c,
* option_flags,
* weight_min=weight_min, # <<<<<<<<<<<<<<
* weight_max=weight_max)
*
*/
- __pyx_t_42 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_42 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_29 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_min); if (unlikely((__pyx_t_29 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 636, __pyx_L1_error)
- /* "chistogramnd.pyx":627
+ /* "silx/math/chistogramnd.pyx":637
* option_flags,
* weight_min=weight_min,
* weight_max=weight_max) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_41 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_41 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_28 = __Pyx_PyInt_As_npy_int32(__pyx_v_weight_max); if (unlikely((__pyx_t_28 == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 637, __pyx_L1_error)
- /* "chistogramnd.pyx":616
+ /* "silx/math/chistogramnd.pyx":626
* elif weights_type == np.int32:
*
* rc = _histogramnd_int32_t_int32_t_float(sample_c, # <<<<<<<<<<<<<<
* weights_c,
* n_dims,
*/
- __pyx_v_rc = __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__pyx_t_141, __pyx_t_142, __pyx_t_22, __pyx_t_16, __pyx_t_143, __pyx_t_144, __pyx_t_145, __pyx_t_146, __pyx_t_147, __pyx_t_15, __pyx_t_42, __pyx_t_41);
- __PYX_XDEC_MEMVIEW(&__pyx_t_141, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_142, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_143, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_144, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_145, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_146, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_147, 1);
- goto __pyx_L60;
+ __pyx_v_rc = __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_float(__pyx_t_31, __pyx_t_27, __pyx_t_21, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_32, __pyx_t_14, __pyx_t_9, __pyx_t_29, __pyx_t_28);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
+ __pyx_t_31.memview = NULL;
+ __pyx_t_31.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
+ __pyx_t_27.memview = NULL;
+ __pyx_t_27.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
+ __pyx_t_16.memview = NULL;
+ __pyx_t_16.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
+ __pyx_t_17.memview = NULL;
+ __pyx_t_17.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
+ __pyx_t_18.memview = NULL;
+ __pyx_t_18.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
+ __pyx_t_32.memview = NULL;
+ __pyx_t_32.data = NULL;
+ __PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __pyx_t_14.memview = NULL;
+ __pyx_t_14.data = NULL;
+
+ /* "silx/math/chistogramnd.pyx":624
+ * weight_max=weight_max)
+ *
+ * elif weights_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * rc = _histogramnd_int32_t_int32_t_float(sample_c,
+ */
+ goto __pyx_L62;
}
- /*else*/ {
- /* "chistogramnd.pyx":630
+ /* "silx/math/chistogramnd.pyx":640
*
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # endif sample_type == np.int32:
*/
- __pyx_t_10 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ /*else*/ {
+ __pyx_t_3 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 640, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_L60:;
- goto __pyx_L53;
+ __pyx_L62:;
+
+ /* "silx/math/chistogramnd.pyx":592
+ *
+ * # endif sample_type == np.float32
+ * elif sample_type == np.int32: # <<<<<<<<<<<<<<
+ *
+ * if weights_type == np.float64 or weights_type is None:
+ */
+ goto __pyx_L55;
}
- /*else*/ {
- /* "chistogramnd.pyx":634
+ /* "silx/math/chistogramnd.pyx":644
* # endif sample_type == np.int32:
* else:
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* # end elseif weighted_histo.dtype == np.float32:
*/
- __pyx_t_10 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ /*else*/ {
+ __pyx_t_3 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_L53:;
- goto __pyx_L40;
+ __pyx_L55:;
+
+ /* "silx/math/chistogramnd.pyx":488
+ *
+ * # endif weighted_histo is None or weighted_histo.dtype == np.double:
+ * elif weighted_histo.dtype == np.float32: # <<<<<<<<<<<<<<
+ *
+ * if sample_type == np.float64:
+ */
+ goto __pyx_L42;
}
- /*else*/ {
- /* "chistogramnd.pyx":639
+ /* "silx/math/chistogramnd.pyx":649
* else:
* # this isnt supposed to happen since weighted_histo type was checked earlier
* raise_unsupported_type() # <<<<<<<<<<<<<<
*
* if rc != histogramnd_c.HISTO_OK:
*/
- __pyx_t_10 = __pyx_pf_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ /*else*/ {
+ __pyx_t_3 = __pyx_pf_4silx_4math_12chistogramnd_12chistogramnd_raise_unsupported_type(__pyx_v_raise_unsupported_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 649, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
- __pyx_L40:;
+ __pyx_L42:;
- /* "chistogramnd.pyx":641
+ /* "silx/math/chistogramnd.pyx":651
* raise_unsupported_type()
*
* if rc != histogramnd_c.HISTO_OK: # <<<<<<<<<<<<<<
@@ -7721,7 +9186,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_7 = ((__pyx_v_rc != HISTO_OK) != 0);
if (__pyx_t_7) {
- /* "chistogramnd.pyx":642
+ /* "silx/math/chistogramnd.pyx":652
*
* if rc != histogramnd_c.HISTO_OK:
* if rc == histogramnd_c.HISTO_ERR_ALLOC: # <<<<<<<<<<<<<<
@@ -7731,93 +9196,137 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__pyx_t_7 = ((__pyx_v_rc == HISTO_ERR_ALLOC) != 0);
if (__pyx_t_7) {
- /* "chistogramnd.pyx":643
+ /* "silx/math/chistogramnd.pyx":653
* if rc != histogramnd_c.HISTO_OK:
* if rc == histogramnd_c.HISTO_ERR_ALLOC:
* raise MemoryError('histogramnd failed to allocate memory.') # <<<<<<<<<<<<<<
* else:
* raise Exception('histogramnd returned an error : {0}'
*/
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(0, 653, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd.pyx":652
+ *
+ * if rc != histogramnd_c.HISTO_OK:
+ * if rc == histogramnd_c.HISTO_ERR_ALLOC: # <<<<<<<<<<<<<<
+ * raise MemoryError('histogramnd failed to allocate memory.')
+ * else:
+ */
}
+
+ /* "silx/math/chistogramnd.pyx":655
+ * raise MemoryError('histogramnd failed to allocate memory.')
+ * else:
+ * raise Exception('histogramnd returned an error : {0}' # <<<<<<<<<<<<<<
+ * ''.format(rc))
+ *
+ */
/*else*/ {
- /* "chistogramnd.pyx":646
+ /* "silx/math/chistogramnd.pyx":656
* else:
* raise Exception('histogramnd returned an error : {0}'
* ''.format(rc)) # <<<<<<<<<<<<<<
*
* edges = []
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histogramnd_returned_an_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_rc); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histogramnd_returned_an_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_rc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_12 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_12)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_12);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
}
}
- if (!__pyx_t_4) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_12) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__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_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_12, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12); __pyx_t_12 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 656, __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_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "chistogramnd.pyx":645
+ /* "silx/math/chistogramnd.pyx":655
* raise MemoryError('histogramnd failed to allocate memory.')
* else:
* raise Exception('histogramnd returned an error : {0}' # <<<<<<<<<<<<<<
* ''.format(rc))
*
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 655, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 655, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(0, 655, __pyx_L1_error)
}
+
+ /* "silx/math/chistogramnd.pyx":651
+ * raise_unsupported_type()
+ *
+ * if rc != histogramnd_c.HISTO_OK: # <<<<<<<<<<<<<<
+ * if rc == histogramnd_c.HISTO_ERR_ALLOC:
+ * raise MemoryError('histogramnd failed to allocate memory.')
+ */
}
- /* "chistogramnd.pyx":648
+ /* "silx/math/chistogramnd.pyx":658
* ''.format(rc))
*
* edges = [] # <<<<<<<<<<<<<<
* offset = 0
* for i_dim in range(n_dims):
*/
- __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_v_edges = ((PyObject*)__pyx_t_10);
- __pyx_t_10 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_edges = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
- /* "chistogramnd.pyx":649
+ /* "silx/math/chistogramnd.pyx":659
*
* edges = []
* offset = 0 # <<<<<<<<<<<<<<
@@ -7827,102 +9336,104 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_INCREF(__pyx_int_0);
__pyx_v_offset = __pyx_int_0;
- /* "chistogramnd.pyx":650
+ /* "silx/math/chistogramnd.pyx":660
* edges = []
* offset = 0
* for i_dim in range(n_dims): # <<<<<<<<<<<<<<
* edges.append(bin_edges[offset:offset + n_bins[i_dim] + 1])
* offset += n_bins[i_dim] + 1
*/
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
- __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0;
- __pyx_t_148 = NULL;
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n_dims);
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
+ __pyx_t_3 = __pyx_t_11; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
+ __pyx_t_33 = NULL;
} else {
- __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_148 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_33 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 660, __pyx_L1_error)
}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
for (;;) {
- if (likely(!__pyx_t_148)) {
- if (likely(PyList_CheckExact(__pyx_t_10))) {
- if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (likely(!__pyx_t_33)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
#endif
} else {
- if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 660, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 660, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
#endif
}
} else {
- __pyx_t_5 = __pyx_t_148(__pyx_t_10);
- if (unlikely(!__pyx_t_5)) {
+ __pyx_t_11 = __pyx_t_33(__pyx_t_3);
+ if (unlikely(!__pyx_t_11)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 660, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_11);
}
- __Pyx_XDECREF_SET(__pyx_v_i_dim, __pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_i_dim, __pyx_t_11);
+ __pyx_t_11 = 0;
- /* "chistogramnd.pyx":651
+ /* "silx/math/chistogramnd.pyx":661
* offset = 0
* for i_dim in range(n_dims):
* edges.append(bin_edges[offset:offset + n_bins[i_dim] + 1]) # <<<<<<<<<<<<<<
* offset += n_bins[i_dim] + 1
*
*/
- __pyx_t_5 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyNumber_Add(__pyx_v_offset, __pyx_t_5); 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);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_int_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_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_bin_edges, 0, 0, &__pyx_v_offset, &__pyx_t_5, NULL, 0, 0, 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);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_149 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_t_3); if (unlikely(__pyx_t_149 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = PyNumber_Add(__pyx_v_offset, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetSlice(__pyx_v_bin_edges, 0, 0, &__pyx_v_offset, &__pyx_t_11, NULL, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_34 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_t_10); if (unlikely(__pyx_t_34 == -1)) __PYX_ERR(0, 661, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "chistogramnd.pyx":652
+ /* "silx/math/chistogramnd.pyx":662
* for i_dim in range(n_dims):
* edges.append(bin_edges[offset:offset + n_bins[i_dim] + 1])
* offset += n_bins[i_dim] + 1 # <<<<<<<<<<<<<<
*
* return histo, weighted_histo, tuple(edges)
*/
- __pyx_t_3 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_offset, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_t_10 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_t_10, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_offset, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF_SET(__pyx_v_offset, __pyx_t_10);
+ __pyx_t_10 = 0;
- /* "chistogramnd.pyx":650
+ /* "silx/math/chistogramnd.pyx":660
* edges = []
* offset = 0
* for i_dim in range(n_dims): # <<<<<<<<<<<<<<
@@ -7930,9 +9441,9 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* offset += n_bins[i_dim] + 1
*/
}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "chistogramnd.pyx":654
+ /* "silx/math/chistogramnd.pyx":664
* offset += n_bins[i_dim] + 1
*
* return histo, weighted_histo, tuple(edges) # <<<<<<<<<<<<<<
@@ -7940,24 +9451,24 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* # =====================
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = PyList_AsTuple(__pyx_v_edges); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_AsTuple(__pyx_v_edges); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 664, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 664, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_histo);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_histo);
__Pyx_GIVEREF(__pyx_v_histo);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_histo);
__Pyx_INCREF(__pyx_v_weighted_histo);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_weighted_histo);
__Pyx_GIVEREF(__pyx_v_weighted_histo);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_r = __pyx_t_3;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_weighted_histo);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_3);
__pyx_t_3 = 0;
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
goto __pyx_L0;
- /* "chistogramnd.pyx":36
+ /* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
@@ -7971,137 +9482,22 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_14, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_16, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_17, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_18, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_19, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_20, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_21, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_25, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_26, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_24, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_27, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_28, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_29, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_30, 1);
__PYX_XDEC_MEMVIEW(&__pyx_t_31, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_34, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_35, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_36, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_37, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_38, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_39, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_40, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_43, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_44, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_45, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_46, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_47, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_48, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_49, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_50, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_51, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_52, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_53, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_54, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_55, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_56, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_57, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_58, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_59, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_60, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_61, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_62, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_63, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_64, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_65, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_66, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_67, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_68, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_69, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_70, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_71, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_72, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_73, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_74, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_75, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_76, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_77, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_78, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_79, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_80, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_81, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_82, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_83, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_84, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_85, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_86, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_87, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_88, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_89, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_90, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_91, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_92, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_93, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_94, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_95, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_96, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_97, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_98, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_99, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_100, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_101, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_102, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_103, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_104, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_105, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_106, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_107, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_108, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_109, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_110, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_111, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_112, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_113, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_114, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_115, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_116, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_117, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_118, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_119, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_120, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_121, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_122, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_123, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_124, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_125, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_126, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_127, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_128, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_129, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_130, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_131, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_132, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_133, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_134, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_135, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_136, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_137, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_138, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_139, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_140, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_141, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_142, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_143, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_144, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_145, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_146, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_147, 1);
- __Pyx_AddTraceback("chistogramnd.chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_32, 1);
+ __Pyx_AddTraceback("silx.math.chistogramnd.chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s_shape);
@@ -8136,7 +9532,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
return __pyx_r;
}
-/* "chistogramnd.pyx":665
+/* "silx/math/chistogramnd.pyx":675
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_double_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8144,7 +9540,7 @@ static PyObject *__pyx_pf_12chistogramnd_chistogramnd(CYTHON_UNUSED PyObject *__
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8154,7 +9550,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":678
+ /* "silx/math/chistogramnd.pyx":688
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8163,7 +9559,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":679
+ /* "silx/math/chistogramnd.pyx":689
*
* return histogramnd_c.histogramnd_double_double_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8172,7 +9568,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":682
+ /* "silx/math/chistogramnd.pyx":692
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8181,7 +9577,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":683
+ /* "silx/math/chistogramnd.pyx":693
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8190,7 +9586,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":684
+ /* "silx/math/chistogramnd.pyx":694
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8199,7 +9595,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":685
+ /* "silx/math/chistogramnd.pyx":695
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8208,7 +9604,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":686
+ /* "silx/math/chistogramnd.pyx":696
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8217,7 +9613,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":678
+ /* "silx/math/chistogramnd.pyx":688
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8227,7 +9623,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
__pyx_r = histogramnd_double_double_double((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":665
+ /* "silx/math/chistogramnd.pyx":675
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_double_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8240,7 +9636,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
return __pyx_r;
}
-/* "chistogramnd.pyx":696
+/* "silx/math/chistogramnd.pyx":706
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_float_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8248,7 +9644,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_double(__Pyx_memvie
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8258,7 +9654,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":709
+ /* "silx/math/chistogramnd.pyx":719
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8267,7 +9663,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":710
+ /* "silx/math/chistogramnd.pyx":720
*
* return histogramnd_c.histogramnd_double_float_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8276,7 +9672,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":713
+ /* "silx/math/chistogramnd.pyx":723
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8285,7 +9681,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":714
+ /* "silx/math/chistogramnd.pyx":724
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8294,7 +9690,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":715
+ /* "silx/math/chistogramnd.pyx":725
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8303,7 +9699,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":716
+ /* "silx/math/chistogramnd.pyx":726
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8312,7 +9708,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":717
+ /* "silx/math/chistogramnd.pyx":727
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8321,7 +9717,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":709
+ /* "silx/math/chistogramnd.pyx":719
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8331,7 +9727,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
__pyx_r = histogramnd_double_float_double((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":696
+ /* "silx/math/chistogramnd.pyx":706
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_float_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8344,7 +9740,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
return __pyx_r;
}
-/* "chistogramnd.pyx":727
+/* "silx/math/chistogramnd.pyx":737
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_int32_t_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8352,7 +9748,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_double(__Pyx_memview
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8362,7 +9758,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":740
+ /* "silx/math/chistogramnd.pyx":750
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8371,7 +9767,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":741
+ /* "silx/math/chistogramnd.pyx":751
*
* return histogramnd_c.histogramnd_double_int32_t_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8380,7 +9776,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":744
+ /* "silx/math/chistogramnd.pyx":754
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8389,7 +9785,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":745
+ /* "silx/math/chistogramnd.pyx":755
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8398,7 +9794,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":746
+ /* "silx/math/chistogramnd.pyx":756
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8407,7 +9803,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":747
+ /* "silx/math/chistogramnd.pyx":757
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8416,7 +9812,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":748
+ /* "silx/math/chistogramnd.pyx":758
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8425,7 +9821,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":740
+ /* "silx/math/chistogramnd.pyx":750
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8435,7 +9831,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
__pyx_r = histogramnd_double_int32_t_double((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":727
+ /* "silx/math/chistogramnd.pyx":737
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_int32_t_double(double[:] sample, # <<<<<<<<<<<<<<
@@ -8448,7 +9844,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
return __pyx_r;
}
-/* "chistogramnd.pyx":763
+/* "silx/math/chistogramnd.pyx":773
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_double_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8456,7 +9852,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_double(__Pyx_memvi
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8466,7 +9862,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":776
+ /* "silx/math/chistogramnd.pyx":786
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8475,7 +9871,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":777
+ /* "silx/math/chistogramnd.pyx":787
*
* return histogramnd_c.histogramnd_float_double_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8484,7 +9880,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":780
+ /* "silx/math/chistogramnd.pyx":790
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8493,7 +9889,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":781
+ /* "silx/math/chistogramnd.pyx":791
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8502,7 +9898,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":782
+ /* "silx/math/chistogramnd.pyx":792
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8511,7 +9907,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":783
+ /* "silx/math/chistogramnd.pyx":793
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8520,7 +9916,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":784
+ /* "silx/math/chistogramnd.pyx":794
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8529,7 +9925,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":776
+ /* "silx/math/chistogramnd.pyx":786
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8539,7 +9935,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
__pyx_r = histogramnd_float_double_double((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":763
+ /* "silx/math/chistogramnd.pyx":773
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_double_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8552,7 +9948,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
return __pyx_r;
}
-/* "chistogramnd.pyx":794
+/* "silx/math/chistogramnd.pyx":804
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_float_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8560,7 +9956,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_double(__Pyx_memview
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8570,7 +9966,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":807
+ /* "silx/math/chistogramnd.pyx":817
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8579,7 +9975,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":808
+ /* "silx/math/chistogramnd.pyx":818
*
* return histogramnd_c.histogramnd_float_float_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8588,7 +9984,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":811
+ /* "silx/math/chistogramnd.pyx":821
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8597,7 +9993,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":812
+ /* "silx/math/chistogramnd.pyx":822
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8606,7 +10002,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":813
+ /* "silx/math/chistogramnd.pyx":823
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8615,7 +10011,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":814
+ /* "silx/math/chistogramnd.pyx":824
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8624,7 +10020,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":815
+ /* "silx/math/chistogramnd.pyx":825
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8633,7 +10029,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":807
+ /* "silx/math/chistogramnd.pyx":817
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8643,7 +10039,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
__pyx_r = histogramnd_float_float_double((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":794
+ /* "silx/math/chistogramnd.pyx":804
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_float_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8656,7 +10052,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
return __pyx_r;
}
-/* "chistogramnd.pyx":825
+/* "silx/math/chistogramnd.pyx":835
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_int32_t_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8664,7 +10060,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_double(__Pyx_memviews
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8674,7 +10070,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":838
+ /* "silx/math/chistogramnd.pyx":848
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8683,7 +10079,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":839
+ /* "silx/math/chistogramnd.pyx":849
*
* return histogramnd_c.histogramnd_float_int32_t_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8692,7 +10088,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":842
+ /* "silx/math/chistogramnd.pyx":852
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8701,7 +10097,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":843
+ /* "silx/math/chistogramnd.pyx":853
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8710,7 +10106,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":844
+ /* "silx/math/chistogramnd.pyx":854
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8719,7 +10115,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":845
+ /* "silx/math/chistogramnd.pyx":855
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8728,7 +10124,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":846
+ /* "silx/math/chistogramnd.pyx":856
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8737,7 +10133,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":838
+ /* "silx/math/chistogramnd.pyx":848
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8747,7 +10143,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
__pyx_r = histogramnd_float_int32_t_double((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":825
+ /* "silx/math/chistogramnd.pyx":835
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_int32_t_double(float[:] sample, # <<<<<<<<<<<<<<
@@ -8760,7 +10156,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
return __pyx_r;
}
-/* "chistogramnd.pyx":861
+/* "silx/math/chistogramnd.pyx":871
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_double_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -8768,7 +10164,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_double(__Pyx_memvie
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8778,7 +10174,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":874
+ /* "silx/math/chistogramnd.pyx":884
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8787,7 +10183,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":875
+ /* "silx/math/chistogramnd.pyx":885
*
* return histogramnd_c.histogramnd_int32_t_double_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8796,7 +10192,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":878
+ /* "silx/math/chistogramnd.pyx":888
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8805,7 +10201,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":879
+ /* "silx/math/chistogramnd.pyx":889
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8814,7 +10210,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":880
+ /* "silx/math/chistogramnd.pyx":890
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8823,7 +10219,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":881
+ /* "silx/math/chistogramnd.pyx":891
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8832,7 +10228,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":882
+ /* "silx/math/chistogramnd.pyx":892
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8841,7 +10237,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":874
+ /* "silx/math/chistogramnd.pyx":884
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_double_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8851,7 +10247,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
__pyx_r = histogramnd_int32_t_double_double((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":861
+ /* "silx/math/chistogramnd.pyx":871
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_double_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -8864,7 +10260,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
return __pyx_r;
}
-/* "chistogramnd.pyx":892
+/* "silx/math/chistogramnd.pyx":902
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_float_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -8872,7 +10268,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_double(__Pyx_memvi
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8882,7 +10278,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":905
+ /* "silx/math/chistogramnd.pyx":915
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8891,7 +10287,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":906
+ /* "silx/math/chistogramnd.pyx":916
*
* return histogramnd_c.histogramnd_int32_t_float_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -8900,7 +10296,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":909
+ /* "silx/math/chistogramnd.pyx":919
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -8909,7 +10305,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":910
+ /* "silx/math/chistogramnd.pyx":920
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -8918,7 +10314,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":911
+ /* "silx/math/chistogramnd.pyx":921
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -8927,7 +10323,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":912
+ /* "silx/math/chistogramnd.pyx":922
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -8936,7 +10332,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":913
+ /* "silx/math/chistogramnd.pyx":923
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -8945,7 +10341,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":905
+ /* "silx/math/chistogramnd.pyx":915
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_float_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8955,7 +10351,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
__pyx_r = histogramnd_int32_t_float_double((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":892
+ /* "silx/math/chistogramnd.pyx":902
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_float_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -8968,7 +10364,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
return __pyx_r;
}
-/* "chistogramnd.pyx":923
+/* "silx/math/chistogramnd.pyx":933
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_int32_t_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -8976,7 +10372,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_double(__Pyx_memvie
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -8986,7 +10382,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":936
+ /* "silx/math/chistogramnd.pyx":946
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -8995,7 +10391,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":937
+ /* "silx/math/chistogramnd.pyx":947
*
* return histogramnd_c.histogramnd_int32_t_int32_t_double(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9004,7 +10400,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":940
+ /* "silx/math/chistogramnd.pyx":950
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9013,7 +10409,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":941
+ /* "silx/math/chistogramnd.pyx":951
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9022,7 +10418,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":942
+ /* "silx/math/chistogramnd.pyx":952
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9031,7 +10427,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":943
+ /* "silx/math/chistogramnd.pyx":953
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9040,7 +10436,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":944
+ /* "silx/math/chistogramnd.pyx":954
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9049,7 +10445,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":936
+ /* "silx/math/chistogramnd.pyx":946
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_int32_t_double(&sample[0], # <<<<<<<<<<<<<<
@@ -9059,7 +10455,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
__pyx_r = histogramnd_int32_t_int32_t_double((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":923
+ /* "silx/math/chistogramnd.pyx":933
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_int32_t_double(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9072,7 +10468,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
return __pyx_r;
}
-/* "chistogramnd.pyx":959
+/* "silx/math/chistogramnd.pyx":969
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_double_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9080,7 +10476,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_double(__Pyx_memv
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9090,7 +10486,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":972
+ /* "silx/math/chistogramnd.pyx":982
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9099,7 +10495,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":973
+ /* "silx/math/chistogramnd.pyx":983
*
* return histogramnd_c.histogramnd_double_double_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9108,7 +10504,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":976
+ /* "silx/math/chistogramnd.pyx":986
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9117,7 +10513,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":977
+ /* "silx/math/chistogramnd.pyx":987
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9126,7 +10522,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":978
+ /* "silx/math/chistogramnd.pyx":988
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9135,7 +10531,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":979
+ /* "silx/math/chistogramnd.pyx":989
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9144,7 +10540,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":980
+ /* "silx/math/chistogramnd.pyx":990
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9153,7 +10549,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":972
+ /* "silx/math/chistogramnd.pyx":982
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9163,7 +10559,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
__pyx_r = histogramnd_double_double_float((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":959
+ /* "silx/math/chistogramnd.pyx":969
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_double_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9176,7 +10572,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
return __pyx_r;
}
-/* "chistogramnd.pyx":990
+/* "silx/math/chistogramnd.pyx":1000
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_float_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9184,7 +10580,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_double_float(__Pyx_memview
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9194,7 +10590,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1003
+ /* "silx/math/chistogramnd.pyx":1013
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9203,7 +10599,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1004
+ /* "silx/math/chistogramnd.pyx":1014
*
* return histogramnd_c.histogramnd_double_float_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9212,7 +10608,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1007
+ /* "silx/math/chistogramnd.pyx":1017
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9221,7 +10617,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1008
+ /* "silx/math/chistogramnd.pyx":1018
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9230,7 +10626,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1009
+ /* "silx/math/chistogramnd.pyx":1019
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9239,7 +10635,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1010
+ /* "silx/math/chistogramnd.pyx":1020
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9248,7 +10644,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1011
+ /* "silx/math/chistogramnd.pyx":1021
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9257,7 +10653,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1003
+ /* "silx/math/chistogramnd.pyx":1013
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9267,7 +10663,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
__pyx_r = histogramnd_double_float_float((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":990
+ /* "silx/math/chistogramnd.pyx":1000
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_float_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9280,7 +10676,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
return __pyx_r;
}
-/* "chistogramnd.pyx":1021
+/* "silx/math/chistogramnd.pyx":1031
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_int32_t_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9288,7 +10684,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_float_float(__Pyx_memviews
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9298,7 +10694,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1034
+ /* "silx/math/chistogramnd.pyx":1044
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9307,7 +10703,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1035
+ /* "silx/math/chistogramnd.pyx":1045
*
* return histogramnd_c.histogramnd_double_int32_t_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9316,7 +10712,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1038
+ /* "silx/math/chistogramnd.pyx":1048
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9325,7 +10721,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1039
+ /* "silx/math/chistogramnd.pyx":1049
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9334,7 +10730,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1040
+ /* "silx/math/chistogramnd.pyx":1050
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9343,7 +10739,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1041
+ /* "silx/math/chistogramnd.pyx":1051
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9352,7 +10748,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1042
+ /* "silx/math/chistogramnd.pyx":1052
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9361,7 +10757,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1034
+ /* "silx/math/chistogramnd.pyx":1044
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_double_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9371,7 +10767,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
__pyx_r = histogramnd_double_int32_t_float((&(*((double *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1021
+ /* "silx/math/chistogramnd.pyx":1031
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_double_int32_t_float(double[:] sample, # <<<<<<<<<<<<<<
@@ -9384,7 +10780,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
return __pyx_r;
}
-/* "chistogramnd.pyx":1057
+/* "silx/math/chistogramnd.pyx":1067
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_double_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9392,7 +10788,7 @@ static int __pyx_f_12chistogramnd__histogramnd_double_int32_t_float(__Pyx_memvie
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9402,7 +10798,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1070
+ /* "silx/math/chistogramnd.pyx":1080
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9411,7 +10807,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1071
+ /* "silx/math/chistogramnd.pyx":1081
*
* return histogramnd_c.histogramnd_float_double_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9420,7 +10816,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1074
+ /* "silx/math/chistogramnd.pyx":1084
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9429,7 +10825,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1075
+ /* "silx/math/chistogramnd.pyx":1085
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9438,7 +10834,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1076
+ /* "silx/math/chistogramnd.pyx":1086
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9447,7 +10843,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1077
+ /* "silx/math/chistogramnd.pyx":1087
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9456,7 +10852,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1078
+ /* "silx/math/chistogramnd.pyx":1088
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9465,7 +10861,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1070
+ /* "silx/math/chistogramnd.pyx":1080
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9475,7 +10871,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
__pyx_r = histogramnd_float_double_float((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1057
+ /* "silx/math/chistogramnd.pyx":1067
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_double_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9488,7 +10884,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
return __pyx_r;
}
-/* "chistogramnd.pyx":1088
+/* "silx/math/chistogramnd.pyx":1098
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_float_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9496,7 +10892,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_double_float(__Pyx_memviews
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9506,7 +10902,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1101
+ /* "silx/math/chistogramnd.pyx":1111
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9515,7 +10911,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1102
+ /* "silx/math/chistogramnd.pyx":1112
*
* return histogramnd_c.histogramnd_float_float_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9524,7 +10920,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1105
+ /* "silx/math/chistogramnd.pyx":1115
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9533,7 +10929,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1106
+ /* "silx/math/chistogramnd.pyx":1116
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9542,7 +10938,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1107
+ /* "silx/math/chistogramnd.pyx":1117
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9551,7 +10947,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1108
+ /* "silx/math/chistogramnd.pyx":1118
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9560,7 +10956,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1109
+ /* "silx/math/chistogramnd.pyx":1119
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9569,7 +10965,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1101
+ /* "silx/math/chistogramnd.pyx":1111
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9579,7 +10975,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
__pyx_r = histogramnd_float_float_float((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1088
+ /* "silx/math/chistogramnd.pyx":1098
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_float_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9592,7 +10988,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
return __pyx_r;
}
-/* "chistogramnd.pyx":1119
+/* "silx/math/chistogramnd.pyx":1129
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_int32_t_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9600,7 +10996,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_float_float(__Pyx_memviewsl
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9610,7 +11006,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1132
+ /* "silx/math/chistogramnd.pyx":1142
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9619,7 +11015,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1133
+ /* "silx/math/chistogramnd.pyx":1143
*
* return histogramnd_c.histogramnd_float_int32_t_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9628,7 +11024,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1136
+ /* "silx/math/chistogramnd.pyx":1146
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9637,7 +11033,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1137
+ /* "silx/math/chistogramnd.pyx":1147
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9646,7 +11042,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1138
+ /* "silx/math/chistogramnd.pyx":1148
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9655,7 +11051,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1139
+ /* "silx/math/chistogramnd.pyx":1149
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9664,7 +11060,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1140
+ /* "silx/math/chistogramnd.pyx":1150
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9673,7 +11069,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1132
+ /* "silx/math/chistogramnd.pyx":1142
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_float_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9683,7 +11079,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
__pyx_r = histogramnd_float_int32_t_float((&(*((float *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1119
+ /* "silx/math/chistogramnd.pyx":1129
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_float_int32_t_float(float[:] sample, # <<<<<<<<<<<<<<
@@ -9696,7 +11092,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
return __pyx_r;
}
-/* "chistogramnd.pyx":1155
+/* "silx/math/chistogramnd.pyx":1165
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_double_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9704,7 +11100,7 @@ static int __pyx_f_12chistogramnd__histogramnd_float_int32_t_float(__Pyx_memview
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, double __pyx_v_weight_min, double __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9714,7 +11110,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1168
+ /* "silx/math/chistogramnd.pyx":1178
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9723,7 +11119,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1169
+ /* "silx/math/chistogramnd.pyx":1179
*
* return histogramnd_c.histogramnd_int32_t_double_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9732,7 +11128,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1172
+ /* "silx/math/chistogramnd.pyx":1182
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9741,7 +11137,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1173
+ /* "silx/math/chistogramnd.pyx":1183
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9750,7 +11146,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1174
+ /* "silx/math/chistogramnd.pyx":1184
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9759,7 +11155,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1175
+ /* "silx/math/chistogramnd.pyx":1185
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9768,7 +11164,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1176
+ /* "silx/math/chistogramnd.pyx":1186
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9777,7 +11173,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1168
+ /* "silx/math/chistogramnd.pyx":1178
* double weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_double_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9787,7 +11183,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
__pyx_r = histogramnd_int32_t_double_float((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1155
+ /* "silx/math/chistogramnd.pyx":1165
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_double_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9800,7 +11196,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
return __pyx_r;
}
-/* "chistogramnd.pyx":1186
+/* "silx/math/chistogramnd.pyx":1196
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_float_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9808,7 +11204,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_double_float(__Pyx_memvie
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, float __pyx_v_weight_min, float __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9818,7 +11214,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1199
+ /* "silx/math/chistogramnd.pyx":1209
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9827,7 +11223,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1200
+ /* "silx/math/chistogramnd.pyx":1210
*
* return histogramnd_c.histogramnd_int32_t_float_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9836,7 +11232,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1203
+ /* "silx/math/chistogramnd.pyx":1213
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9845,7 +11241,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1204
+ /* "silx/math/chistogramnd.pyx":1214
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9854,7 +11250,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1205
+ /* "silx/math/chistogramnd.pyx":1215
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9863,7 +11259,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1206
+ /* "silx/math/chistogramnd.pyx":1216
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9872,7 +11268,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1207
+ /* "silx/math/chistogramnd.pyx":1217
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9881,7 +11277,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1199
+ /* "silx/math/chistogramnd.pyx":1209
* float weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_float_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9891,7 +11287,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
__pyx_r = histogramnd_int32_t_float_float((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1186
+ /* "silx/math/chistogramnd.pyx":1196
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_float_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9904,7 +11300,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
return __pyx_r;
}
-/* "chistogramnd.pyx":1217
+/* "silx/math/chistogramnd.pyx":1227
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_int32_t_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -9912,7 +11308,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_float_float(__Pyx_memview
* int n_dims,
*/
-static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
+static int __pyx_f_4silx_4math_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memviewslice __pyx_v_sample, __Pyx_memviewslice __pyx_v_weights, int __pyx_v_n_dims, int __pyx_v_n_elem, __Pyx_memviewslice __pyx_v_histo_range, __Pyx_memviewslice __pyx_v_n_bins, __Pyx_memviewslice __pyx_v_histo, __Pyx_memviewslice __pyx_v_cumul, __Pyx_memviewslice __pyx_v_bin_edges, int __pyx_v_option_flags, __pyx_t_5numpy_int32_t __pyx_v_weight_min, __pyx_t_5numpy_int32_t __pyx_v_weight_max) {
int __pyx_r;
Py_ssize_t __pyx_t_1;
Py_ssize_t __pyx_t_2;
@@ -9922,7 +11318,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
- /* "chistogramnd.pyx":1230
+ /* "silx/math/chistogramnd.pyx":1240
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9931,7 +11327,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_1 = 0;
- /* "chistogramnd.pyx":1231
+ /* "silx/math/chistogramnd.pyx":1241
*
* return histogramnd_c.histogramnd_int32_t_int32_t_float(&sample[0],
* &weights[0], # <<<<<<<<<<<<<<
@@ -9940,7 +11336,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_2 = 0;
- /* "chistogramnd.pyx":1234
+ /* "silx/math/chistogramnd.pyx":1244
* n_dims,
* n_elem,
* &histo_range[0], # <<<<<<<<<<<<<<
@@ -9949,7 +11345,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_3 = 0;
- /* "chistogramnd.pyx":1235
+ /* "silx/math/chistogramnd.pyx":1245
* n_elem,
* &histo_range[0],
* &n_bins[0], # <<<<<<<<<<<<<<
@@ -9958,7 +11354,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_4 = 0;
- /* "chistogramnd.pyx":1236
+ /* "silx/math/chistogramnd.pyx":1246
* &histo_range[0],
* &n_bins[0],
* &histo[0], # <<<<<<<<<<<<<<
@@ -9967,7 +11363,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_5 = 0;
- /* "chistogramnd.pyx":1237
+ /* "silx/math/chistogramnd.pyx":1247
* &n_bins[0],
* &histo[0],
* &cumul[0], # <<<<<<<<<<<<<<
@@ -9976,7 +11372,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_6 = 0;
- /* "chistogramnd.pyx":1238
+ /* "silx/math/chistogramnd.pyx":1248
* &histo[0],
* &cumul[0],
* &bin_edges[0], # <<<<<<<<<<<<<<
@@ -9985,7 +11381,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
*/
__pyx_t_7 = 0;
- /* "chistogramnd.pyx":1230
+ /* "silx/math/chistogramnd.pyx":1240
* numpy.int32_t weight_max) nogil:
*
* return histogramnd_c.histogramnd_int32_t_int32_t_float(&sample[0], # <<<<<<<<<<<<<<
@@ -9995,7 +11391,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
__pyx_r = histogramnd_int32_t_int32_t_float((&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_sample.data + __pyx_t_1 * __pyx_v_sample.strides[0]) )))), (&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_weights.data + __pyx_t_2 * __pyx_v_weights.strides[0]) )))), __pyx_v_n_dims, __pyx_v_n_elem, (&(*((double *) ( /* dim=0 */ (__pyx_v_histo_range.data + __pyx_t_3 * __pyx_v_histo_range.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_n_bins.data + __pyx_t_4 * __pyx_v_n_bins.strides[0]) )))), (&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_histo.data + __pyx_t_5 * __pyx_v_histo.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_cumul.data + __pyx_t_6 * __pyx_v_cumul.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_bin_edges.data + __pyx_t_7 * __pyx_v_bin_edges.strides[0]) )))), __pyx_v_option_flags, __pyx_v_weight_min, __pyx_v_weight_max);
goto __pyx_L0;
- /* "chistogramnd.pyx":1217
+ /* "silx/math/chistogramnd.pyx":1227
* @cython.initializedcheck(False)
* @cython.nonecheck(False)
* cdef int _histogramnd_int32_t_int32_t_float(numpy.int32_t[:] sample, # <<<<<<<<<<<<<<
@@ -10008,7 +11404,7 @@ static int __pyx_f_12chistogramnd__histogramnd_int32_t_int32_t_float(__Pyx_memvi
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -10049,16 +11445,13 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
@@ -10071,7 +11464,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L0;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -10080,7 +11473,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_endian_detector = 1;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -10089,7 +11482,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -10098,7 +11491,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -10108,7 +11501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -10116,22 +11509,30 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
+ /*else*/ {
__pyx_v_copy_shape = 0;
}
__pyx_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -10145,7 +11546,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L6_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -10155,23 +11556,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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;}
+ __PYX_ERR(1, 218, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -10185,7 +11602,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L9_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -10195,23 +11612,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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;}
+ __PYX_ERR(1, 222, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -10220,7 +11653,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -10229,7 +11662,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
@@ -10239,7 +11672,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = (__pyx_v_copy_shape != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
* # 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) # <<<<<<<<<<<<<<
@@ -10248,7 +11681,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
* # 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 # <<<<<<<<<<<<<<
@@ -10257,7 +11690,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231
* 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): # <<<<<<<<<<<<<<
@@ -10268,7 +11701,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -10277,7 +11710,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -10286,20 +11719,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ * 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.
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
* 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
*/
+ /*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
* else:
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -10310,7 +11751,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L11:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -10319,7 +11760,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->suboffsets = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -10328,7 +11769,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -10337,28 +11778,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
- * cdef list stack
+ * cdef int offset
*/
__pyx_v_f = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -10367,7 +11808,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
@@ -10385,7 +11826,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -10397,17 +11838,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
+ /*else*/ {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -10416,7 +11865,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L14:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -10426,7 +11875,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -10436,7 +11885,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
@@ -10456,7 +11905,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L20_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
@@ -10472,43 +11921,51 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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;}
- }
+ __PYX_ERR(1, 259, __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)
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
*/
- switch (__pyx_v_t) {
+ }
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
* (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"
*/
+ switch (__pyx_v_t) {
case NPY_BYTE:
- __pyx_v_f = __pyx_k_b;
+ __pyx_v_f = ((char *)"b");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -10516,10 +11973,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_USHORT: f = "H"
*/
case NPY_UBYTE:
- __pyx_v_f = __pyx_k_B;
+ __pyx_v_f = ((char *)"B");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -10527,10 +11984,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_INT: f = "i"
*/
case NPY_SHORT:
- __pyx_v_f = __pyx_k_h;
+ __pyx_v_f = ((char *)"h");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -10538,10 +11995,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_UINT: f = "I"
*/
case NPY_USHORT:
- __pyx_v_f = __pyx_k_H;
+ __pyx_v_f = ((char *)"H");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -10549,10 +12006,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONG: f = "l"
*/
case NPY_INT:
- __pyx_v_f = __pyx_k_i;
+ __pyx_v_f = ((char *)"i");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -10560,10 +12017,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONG: f = "L"
*/
case NPY_UINT:
- __pyx_v_f = __pyx_k_I;
+ __pyx_v_f = ((char *)"I");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -10571,10 +12028,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGLONG: f = "q"
*/
case NPY_LONG:
- __pyx_v_f = __pyx_k_l;
+ __pyx_v_f = ((char *)"l");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -10582,10 +12039,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONGLONG: f = "Q"
*/
case NPY_ULONG:
- __pyx_v_f = __pyx_k_L;
+ __pyx_v_f = ((char *)"L");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -10593,10 +12050,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_FLOAT: f = "f"
*/
case NPY_LONGLONG:
- __pyx_v_f = __pyx_k_q;
+ __pyx_v_f = ((char *)"q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -10604,10 +12061,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_DOUBLE: f = "d"
*/
case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k_Q;
+ __pyx_v_f = ((char *)"Q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -10615,10 +12072,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGDOUBLE: f = "g"
*/
case NPY_FLOAT:
- __pyx_v_f = __pyx_k_f;
+ __pyx_v_f = ((char *)"f");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -10626,10 +12083,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CFLOAT: f = "Zf"
*/
case NPY_DOUBLE:
- __pyx_v_f = __pyx_k_d;
+ __pyx_v_f = ((char *)"d");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -10637,10 +12094,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CDOUBLE: f = "Zd"
*/
case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k_g;
+ __pyx_v_f = ((char *)"g");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -10648,10 +12105,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
case NPY_CFLOAT:
- __pyx_v_f = __pyx_k_Zf;
+ __pyx_v_f = ((char *)"Zf");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -10659,10 +12116,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_OBJECT: f = "O"
*/
case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k_Zd;
+ __pyx_v_f = ((char *)"Zd");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -10670,10 +12127,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* else:
*/
case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k_Zg;
+ __pyx_v_f = ((char *)"Zg");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -10681,37 +12138,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
case NPY_OBJECT:
- __pyx_v_f = __pyx_k_O;
+ __pyx_v_f = ((char *)"O");
break;
default:
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __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_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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;}
+ __PYX_ERR(1, 278, __pyx_L1_error)
break;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -10720,7 +12177,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->format = __pyx_v_f;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -10729,19 +12186,27 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
* 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));
+ /*else*/ {
+ __pyx_v_info->format = ((char *)malloc(0xFF));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
* else:
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -10750,7 +12215,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->format[0]) = '^';
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -10759,17 +12224,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_offset = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285
* 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
__pyx_v_f = __pyx_t_7;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
@@ -10779,7 +12244,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
(__pyx_v_f[0]) = '\x00';
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -10811,7 +12276,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -10835,7 +12300,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -10845,7 +12310,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -10853,11 +12318,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
- goto __pyx_L3;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
}
- __pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -10867,7 +12338,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -10875,11 +12346,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
*
*/
free(__pyx_v_info->strides);
- goto __pyx_L4;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
+ * 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_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -10891,7 +12368,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -10903,12 +12380,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -10916,13 +12390,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -10941,7 +12415,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -10953,12 +12427,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -10966,13 +12437,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -10991,7 +12462,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -11003,12 +12474,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -11016,13 +12484,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -11041,7 +12509,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -11053,12 +12521,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -11066,13 +12531,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
* 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_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_ERR(1, 780, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -11091,7 +12556,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -11103,12 +12568,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -11116,13 +12578,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
* 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_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_ERR(1, 783, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -11141,7 +12603,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -11168,22 +12630,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ *
+ * cdef dtype child
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
@@ -11191,7 +12650,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -11200,33 +12659,38 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
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_ERR(1, 794, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 794, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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
+ /* "../../../../../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;};
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 795, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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;}
+ 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_ERR(1, 795, __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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11235,7 +12699,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -11243,60 +12707,68 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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;}
+ __PYX_ERR(1, 796, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __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_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __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;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __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_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __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
+ /* "../../../../../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__13, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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;}
+ __PYX_ERR(1, 799, __pyx_L1_error)
+
+ /* "../../../../../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")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11316,7 +12788,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__pyx_L8_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
+ /* "../../../../../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)): # <<<<<<<<<<<<<<
@@ -11332,23 +12804,39 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
+
+ /* "../../../../../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")
+ */
if (__pyx_t_6) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 803, __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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -11356,24 +12844,24 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* 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_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __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
+ /* "../../../../../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;
+ (__pyx_v_f[0]) = 0x78;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11382,7 +12870,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_f = (__pyx_v_f + 1);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -11393,7 +12881,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
(__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -11403,7 +12891,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -11413,19 +12901,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __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
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -11435,357 +12923,365 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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__15, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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;}
+ __PYX_ERR(1, 823, __pyx_L1_error)
+
+ /* "../../../../../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.")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __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
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 104;
+ (__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 105;
+ (__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 108;
+ (__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 113;
+ (__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 102;
+ (__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 100;
+ (__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 103;
+ (__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __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[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __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[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __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
+ /* "../../../../../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;}
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_ERR(1, 844, __pyx_L1_error)
}
__pyx_L15:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11793,23 +13289,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../../../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:
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
+ /* "../../../../../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;}
+ /*else*/ {
+ __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_ERR(1, 849, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -11819,7 +13323,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11829,7 +13333,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_r = __pyx_v_f;
goto __pyx_L0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -11854,7 +13358,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -11869,7 +13373,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
int __pyx_t_2;
__Pyx_RefNannySetupContext("set_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -11880,7 +13384,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
@@ -11888,20 +13392,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
+
+ /* "../../../../../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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ /* "../../../../../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)
*/
+ /*else*/ {
Py_INCREF(__pyx_v_base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11912,7 +13424,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
}
__pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ /* "../../../../../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) # <<<<<<<<<<<<<<
@@ -11921,7 +13433,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
Py_XDECREF(__pyx_v_arr->base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
* baseptr = <PyObject*>base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
@@ -11930,7 +13442,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
__pyx_v_arr->base = __pyx_v_baseptr;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -11942,7 +13454,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -11956,7 +13468,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -11966,7 +13478,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -11977,21 +13489,31 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "../../../../../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:
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
* return None
* else:
* return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
*/
+ /*else*/ {
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -12006,7 +13528,397 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":987
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":988
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 989, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":993
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":994
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 995, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":999
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12022,9 +13934,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -12052,12 +13961,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -12071,7 +13980,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -12085,14 +13994,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __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;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -12104,19 +14013,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __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(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __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;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12133,7 +14042,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -12145,19 +14054,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -12166,12 +14072,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
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_ERR(2, 127, __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_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -12180,7 +14086,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -12190,21 +14096,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __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;}
+ __PYX_ERR(2, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -12214,95 +14128,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __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;}
+ __PYX_ERR(2, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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);
+ 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_ERR(2, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -12312,43 +14239,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -12358,42 +14294,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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;}
+ __PYX_ERR(2, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -12402,7 +14346,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -12410,19 +14354,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -12431,7 +14375,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -12443,20 +14387,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -12465,7 +14417,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -12477,34 +14429,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __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_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -12513,7 +14473,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -12522,19 +14482,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -12544,7 +14504,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -12553,7 +14513,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -12563,21 +14523,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__19, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -12587,7 +14555,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -12596,7 +14564,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -12604,30 +14572,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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;}
+ __PYX_ERR(2, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
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_ERR(2, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -12636,7 +14592,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -12645,14 +14601,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12665,7 +14633,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -12676,7 +14644,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12690,14 +14658,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -12708,16 +14676,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -12726,18 +14691,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12745,21 +14710,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12767,11 +14740,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -12781,21 +14761,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__20, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __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;}
+ __PYX_ERR(2, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -12805,7 +14793,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -12815,7 +14803,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -12825,7 +14813,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -12835,7 +14823,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -12845,7 +14833,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -12854,7 +14842,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -12864,7 +14852,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -12873,7 +14861,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -12883,7 +14871,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -12892,22 +14880,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -12920,7 +14916,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12950,7 +14946,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -12963,18 +14959,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -12984,7 +14980,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -12992,10 +14988,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -13005,7 +15009,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -13015,7 +15019,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -13023,32 +15027,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -13060,84 +15077,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -13145,15 +15206,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -13167,24 +15228,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -13192,16 +15250,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __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_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -13221,7 +15279,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -13235,24 +15293,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -13260,16 +15315,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __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_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -13289,7 +15344,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -13303,35 +15358,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __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;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -13351,7 +15403,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13368,12 +15420,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -13383,96 +15432,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __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_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __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_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __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_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __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_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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
+ /* "View.MemoryView":248
* 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;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -13483,7 +15540,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -13495,7 +15552,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13518,7 +15575,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13530,9 +15587,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -13554,7 +15608,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -13565,25 +15619,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -13596,7 +15650,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13610,7 +15664,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13624,19 +15678,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -13648,7 +15702,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13663,7 +15717,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13677,7 +15731,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -13686,7 +15740,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -13695,7 +15749,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -13705,7 +15759,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -13713,21 +15767,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13740,7 +15800,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -13754,9 +15814,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -13781,7 +15838,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -13790,7 +15847,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -13802,43 +15859,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -13851,7 +15903,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -13860,14 +15912,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -13880,16 +15932,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -13899,7 +15951,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -13908,90 +15960,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -14000,7 +16139,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -14009,7 +16148,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -14021,8 +16160,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -14030,7 +16167,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -14043,19 +16180,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -14066,41 +16208,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -14112,8 +16357,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -14133,12 +16378,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -14147,7 +16389,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -14159,25 +16401,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __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;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -14186,7 +16430,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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;}
+ else __PYX_ERR(2, 389, __pyx_L1_error)
}
break;
}
@@ -14197,18 +16441,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __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_ERR(2, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -14218,7 +16462,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -14228,8 +16472,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -14248,7 +16492,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -14262,14 +16506,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -14281,12 +16525,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -14297,7 +16538,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -14308,20 +16549,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14329,39 +16578,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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;}
+ __PYX_ERR(2, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __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_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __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
+ /* "View.MemoryView":402
*
* 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;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -14369,25 +16618,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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;}
+ /*else*/ {
+ __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_ERR(2, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -14395,14 +16652,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_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_ERR(2, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -14425,7 +16682,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14439,14 +16696,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -14455,24 +16712,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14480,111 +16734,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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;}
+ __PYX_ERR(2, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __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_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __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
+ /* "View.MemoryView":411
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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_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_ERR(2, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __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_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_ERR(2, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __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_ERR(2, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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;}
+ /*else*/ {
+ __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_ERR(2, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14609,7 +16879,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14629,24 +16899,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -14654,81 +16921,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -14745,12 +17023,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -14758,11 +17046,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -14774,7 +17068,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14796,7 +17090,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14813,55 +17107,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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;}
+ __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_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14882,7 +17173,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -14891,7 +17182,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -14909,12 +17200,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -14923,7 +17211,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -14932,7 +17220,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -14942,7 +17230,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -14951,7 +17239,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -14961,17 +17249,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* 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;}
+ PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -14979,22 +17275,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -15003,7 +17307,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -15013,7 +17317,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -15021,24 +17325,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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;}
+ /*else*/ {
+ __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_ERR(2, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -15048,21 +17360,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -15072,7 +17390,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -15085,8 +17403,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -15100,6 +17420,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -15117,7 +17438,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -15138,7 +17459,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -15152,33 +17473,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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_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_ERR(2, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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_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_ERR(2, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -15199,7 +17517,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15220,41 +17538,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -15262,26 +17576,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __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_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -15291,38 +17607,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -15330,14 +17674,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -15350,51 +17702,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__21, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __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;}
+ __PYX_ERR(2, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -15402,7 +17765,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15428,7 +17791,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15449,31 +17812,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -15484,53 +17845,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __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_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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;}
+ 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_ERR(2, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __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_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -15540,66 +17909,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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;}
+ 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_ERR(2, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 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_ERR(2, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -15608,9 +17997,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15627,7 +18016,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -15638,7 +18027,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15652,14 +18041,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -15674,7 +18063,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15684,7 +18073,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -15693,22 +18082,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15718,7 +18115,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -15727,22 +18124,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -15752,7 +18157,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -15761,22 +18166,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -15786,7 +18199,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -15795,22 +18208,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -15820,7 +18241,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -15830,7 +18251,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -15840,7 +18261,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -15850,7 +18271,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -15859,7 +18280,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -15872,7 +18293,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15890,78 +18311,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __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;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __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
+ /* "View.MemoryView":541
+ * def T(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;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -15976,49 +18394,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -16029,77 +18447,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__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_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __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_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16108,102 +18525,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __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;}
+ __PYX_ERR(2, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__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_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __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_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16212,110 +18636,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__32, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16324,55 +18751,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -16387,55 +18811,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__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_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -16450,51 +18871,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __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_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __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_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __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;
@@ -16502,11 +18920,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -16523,156 +18941,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_int_1);
__pyx_v_result = __pyx_int_1;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -16681,18 +19058,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16703,8 +19079,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16717,20 +19093,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -16740,7 +19116,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -16749,9 +19125,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -16761,8 +19145,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16775,7 +19159,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16789,25 +19173,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -16815,54 +19196,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __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;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16883,7 +19264,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16897,24 +19278,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -16922,27 +19300,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 0, __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_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16962,7 +19340,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -16976,48 +19354,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -17036,8 +19411,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -17050,49 +19425,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -17110,8 +19482,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -17124,26 +19496,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -17152,7 +19521,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -17161,17 +19530,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(2, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -17179,14 +19548,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -17204,7 +19573,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -17218,14 +19587,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -17233,12 +19602,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -17247,7 +19613,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -17256,17 +19622,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(2, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -17274,13 +19640,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -17299,7 +19665,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -17314,40 +19680,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -17356,7 +19719,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -17368,7 +19731,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -17390,7 +19753,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17404,18 +19767,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17429,7 +19792,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17458,12 +19821,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -17474,49 +19834,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -17525,7 +19893,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -17534,7 +19902,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17547,25 +19915,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __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;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -17574,7 +19944,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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;}
+ else __PYX_ERR(2, 665, __pyx_L1_error)
}
break;
}
@@ -17584,13 +19954,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -17601,7 +19971,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -17611,27 +19981,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __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_ERR(2, 668, __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__23);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __Pyx_INCREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__33);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -17639,22 +20009,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__34); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -17662,17 +20040,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -17685,29 +20071,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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_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_ERR(2, 675, __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_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __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;}
+ __PYX_ERR(2, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -17726,18 +20120,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17748,17 +20142,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -17768,29 +20162,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __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__25);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25);
- __Pyx_GIVEREF(__pyx_slice__25);
+ __Pyx_INCREF(__pyx_slice__35);
+ __Pyx_GIVEREF(__pyx_slice__35);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__35);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -17800,32 +20200,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17851,76 +20251,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -17929,7 +20336,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -17968,12 +20375,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -17983,7 +20387,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -17992,7 +20396,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -18003,36 +20407,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ __PYX_ERR(2, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -18040,20 +20444,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -18064,7 +20476,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -18074,7 +20486,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -18084,7 +20496,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -18093,7 +20505,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -18102,7 +20514,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -18114,25 +20526,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __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;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -18141,7 +20555,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ else __PYX_ERR(2, 732, __pyx_L1_error)
}
break;
}
@@ -18152,7 +20566,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -18162,27 +20576,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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;}
+ __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_ERR(2, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -18193,7 +20615,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -18202,7 +20624,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -18211,16 +20633,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -18228,24 +20650,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -18254,20 +20684,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -18276,20 +20706,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -18298,55 +20728,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __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
+ /* "View.MemoryView":751
*
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __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
+ /* "View.MemoryView":752
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __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
+ /* "View.MemoryView":754
* 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;}
+ __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_ERR(2, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -18357,7 +20787,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -18367,18 +20797,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -18387,73 +20817,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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_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_ERR(2, 763, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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_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_ERR(2, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -18475,7 +20913,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -18490,11 +20928,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -18504,7 +20939,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -18514,7 +20949,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18522,11 +20957,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -18540,28 +20981,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -18573,7 +21028,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -18591,19 +21046,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -18613,7 +21074,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -18623,7 +21084,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18632,7 +21093,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -18642,7 +21103,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -18650,13 +21111,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -18666,7 +21141,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -18676,7 +21151,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18684,38 +21159,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18723,24 +21221,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -18750,7 +21256,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18760,7 +21266,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -18769,7 +21275,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18779,7 +21285,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -18787,13 +21293,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -18803,7 +21323,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -18811,49 +21331,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -18863,7 +21406,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -18871,11 +21414,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -18884,7 +21433,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -18894,7 +21443,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -18902,11 +21451,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -18916,7 +21471,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -18924,11 +21479,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -18937,7 +21498,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -18946,7 +21507,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -18957,7 +21518,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -18967,7 +21528,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -18975,23 +21536,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -19001,7 +21570,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -19011,7 +21580,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -19021,7 +21590,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -19029,39 +21598,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -19071,7 +21670,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -19095,7 +21694,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -19115,21 +21714,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -19139,7 +21735,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -19149,7 +21745,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -19157,28 +21753,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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;}
+ __PYX_ERR(2, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
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_ERR(2, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -19186,20 +21770,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -19208,7 +21800,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -19218,7 +21810,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -19226,13 +21818,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -19242,7 +21840,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -19251,7 +21849,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -19261,35 +21859,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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;}
+ __PYX_ERR(2, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -19299,32 +21911,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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;}
+ __PYX_ERR(2, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -19333,7 +21953,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -19343,7 +21963,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -19351,11 +21971,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -19365,7 +21991,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -19384,7 +22010,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19407,11 +22033,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -19421,7 +22044,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -19431,7 +22054,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -19441,7 +22064,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -19452,7 +22075,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -19461,7 +22084,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -19473,7 +22096,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -19485,7 +22108,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -19503,20 +22126,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -19526,7 +22155,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19550,7 +22179,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19563,17 +22192,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -19582,7 +22211,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19594,7 +22223,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19607,12 +22236,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -19622,7 +22248,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -19630,30 +22256,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19672,7 +22306,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19686,12 +22320,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -19701,32 +22332,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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;}
+ /*else*/ {
+ __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_ERR(2, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19747,36 +22386,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -19785,11 +22424,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -19800,7 +22439,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -19810,7 +22449,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -19818,16 +22458,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -19836,7 +22474,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -19847,35 +22485,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -19884,7 +22530,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -19893,14 +22539,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -19908,7 +22554,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -19918,7 +22564,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -19928,7 +22574,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -19937,7 +22583,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -19946,7 +22592,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -19955,7 +22601,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -19964,7 +22610,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -19973,66 +22619,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -20040,7 +22748,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -20049,7 +22757,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -20061,7 +22769,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -20077,12 +22785,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -20097,36 +22806,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -20135,19 +22841,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -20158,7 +22872,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -20169,7 +22883,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -20177,7 +22891,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -20194,10 +22908,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -20207,7 +22921,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -20217,7 +22931,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -20227,7 +22941,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -20236,7 +22950,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -20245,7 +22959,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -20256,59 +22970,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -20320,7 +23015,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -20333,12 +23028,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20347,7 +23039,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20355,13 +23047,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -20380,7 +23072,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20398,23 +23090,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -20424,7 +23113,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -20433,20 +23122,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -20457,7 +23154,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -20466,20 +23163,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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_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_ERR(2, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20498,7 +23195,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20510,7 +23207,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -20520,7 +23217,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -20529,21 +23226,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20556,7 +23261,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20573,7 +23278,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -20582,7 +23287,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -20591,17 +23296,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20611,7 +23316,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20620,7 +23325,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20628,11 +23333,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20643,7 +23356,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20653,7 +23366,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20662,7 +23375,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20670,11 +23383,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -20684,7 +23405,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -20693,21 +23414,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20720,7 +23449,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20740,7 +23469,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -20749,7 +23478,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -20758,7 +23487,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -20767,7 +23496,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -20776,7 +23505,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -20786,7 +23515,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -20806,7 +23535,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -20820,9 +23549,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -20830,22 +23567,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -20854,7 +23599,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20863,7 +23608,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20874,22 +23619,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -20898,7 +23651,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20907,7 +23660,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20919,7 +23672,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20930,7 +23683,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20940,7 +23693,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -20949,7 +23702,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20960,7 +23713,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20976,7 +23729,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -20986,7 +23739,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20997,7 +23750,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -21007,7 +23760,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -21017,7 +23770,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -21030,7 +23783,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -21045,7 +23798,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -21055,7 +23808,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -21066,7 +23819,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -21075,7 +23828,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -21084,21 +23837,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -21107,7 +23868,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -21119,7 +23880,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -21129,7 +23890,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -21142,7 +23903,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -21161,11 +23922,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -21175,7 +23933,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -21184,7 +23942,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -21193,7 +23951,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -21203,19 +23961,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -21224,7 +23988,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -21234,7 +23998,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21245,7 +24009,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -21254,17 +24018,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -21273,7 +24037,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21284,7 +24048,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -21294,53 +24058,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -21350,7 +24128,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -21374,7 +24152,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21389,62 +24167,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __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_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __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_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __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_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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;}
+ __PYX_ERR(2, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21467,7 +24242,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21483,33 +24258,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __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_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __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_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -21519,26 +24291,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(2, 1242, __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;}
+ __PYX_ERR(2, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21563,7 +24355,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21580,16 +24372,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -21599,18 +24388,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -21620,39 +24409,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;}
+ __PYX_ERR(2, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(2, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21677,7 +24494,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -21702,11 +24519,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -21715,7 +24529,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -21725,7 +24539,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -21734,7 +24548,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -21743,7 +24557,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -21752,7 +24566,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -21762,7 +24576,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21770,10 +24584,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -21783,7 +24605,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -21791,11 +24613,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21811,7 +24640,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21822,7 +24651,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -21832,7 +24661,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -21842,7 +24671,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -21851,7 +24680,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -21859,25 +24688,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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;}
+ /*else*/ {
+ __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_ERR(2, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -21887,62 +24730,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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_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_ERR(2, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -21950,11 +24805,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -21964,51 +24825,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
*
- * 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)
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -22017,7 +24893,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22026,7 +24902,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -22035,7 +24911,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -22044,7 +24920,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -22053,7 +24929,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -22062,12 +24938,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -22081,28 +24971,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22111,7 +25007,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -22120,7 +25016,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -22129,7 +25025,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -22138,7 +25034,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -22148,7 +25044,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -22172,21 +25068,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -22195,87 +25091,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -22283,7 +25179,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -22294,7 +25190,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -22304,7 +25200,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -22312,11 +25208,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -22327,7 +25229,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22342,7 +25244,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -22351,7 +25253,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22366,7 +25268,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22382,7 +25284,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -22393,7 +25295,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22403,7 +25305,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -22413,7 +25315,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -22421,36 +25323,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -22460,7 +25386,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22472,7 +25398,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22482,7 +25408,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22491,7 +25417,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -22500,7 +25426,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -22509,7 +25435,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22520,7 +25446,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22536,7 +25462,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -22545,7 +25471,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -22554,7 +25480,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22564,7 +25490,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -22575,7 +25501,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -22584,7 +25510,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -22593,22 +25519,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -22617,7 +25551,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -22629,7 +25563,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22640,14 +25574,14 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
-static struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_freelist_12chistogramnd___pyx_scope_struct__chistogramnd[8];
-static int __pyx_freecount_12chistogramnd___pyx_scope_struct__chistogramnd = 0;
+static struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *__pyx_freelist_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd[8];
+static int __pyx_freecount_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd = 0;
-static PyObject *__pyx_tp_new_12chistogramnd___pyx_scope_struct__chistogramnd(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+static PyObject *__pyx_tp_new_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
PyObject *o;
- if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_12chistogramnd___pyx_scope_struct__chistogramnd > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd)))) {
- o = (PyObject*)__pyx_freelist_12chistogramnd___pyx_scope_struct__chistogramnd[--__pyx_freecount_12chistogramnd___pyx_scope_struct__chistogramnd];
- memset(o, 0, sizeof(struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd));
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd)))) {
+ o = (PyObject*)__pyx_freelist_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd[--__pyx_freecount_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd];
+ memset(o, 0, sizeof(struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd));
(void) PyObject_INIT(o, t);
PyObject_GC_Track(o);
} else {
@@ -22657,21 +25591,21 @@ static PyObject *__pyx_tp_new_12chistogramnd___pyx_scope_struct__chistogramnd(Py
return o;
}
-static void __pyx_tp_dealloc_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o) {
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
+static void __pyx_tp_dealloc_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o) {
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
PyObject_GC_UnTrack(o);
Py_CLEAR(p->__pyx_v_sample_type);
Py_CLEAR(p->__pyx_v_weights_type);
- if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_12chistogramnd___pyx_scope_struct__chistogramnd < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd)))) {
- __pyx_freelist_12chistogramnd___pyx_scope_struct__chistogramnd[__pyx_freecount_12chistogramnd___pyx_scope_struct__chistogramnd++] = ((struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *)o);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd)))) {
+ __pyx_freelist_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd[__pyx_freecount_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd++] = ((struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)o);
} else {
(*Py_TYPE(o)->tp_free)(o);
}
}
-static int __pyx_tp_traverse_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o, visitproc v, void *a) {
+static int __pyx_tp_traverse_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o, visitproc v, void *a) {
int e;
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
if (p->__pyx_v_sample_type) {
e = (*v)(p->__pyx_v_sample_type, a); if (e) return e;
}
@@ -22681,9 +25615,9 @@ static int __pyx_tp_traverse_12chistogramnd___pyx_scope_struct__chistogramnd(PyO
return 0;
}
-static int __pyx_tp_clear_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o) {
+static int __pyx_tp_clear_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd(PyObject *o) {
PyObject* tmp;
- struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
+ struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *p = (struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd *)o;
tmp = ((PyObject*)p->__pyx_v_sample_type);
p->__pyx_v_sample_type = Py_None; Py_INCREF(Py_None);
Py_XDECREF(tmp);
@@ -22693,19 +25627,20 @@ static int __pyx_tp_clear_12chistogramnd___pyx_scope_struct__chistogramnd(PyObje
return 0;
}
-static PyTypeObject __pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd = {
+static PyTypeObject __pyx_type_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd.__pyx_scope_struct__chistogramnd", /*tp_name*/
- sizeof(struct __pyx_obj_12chistogramnd___pyx_scope_struct__chistogramnd), /*tp_basicsize*/
+ "silx.math.chistogramnd.__pyx_scope_struct__chistogramnd", /*tp_name*/
+ sizeof(struct __pyx_obj_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_dealloc*/
+ __pyx_tp_dealloc_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -22719,8 +25654,8 @@ static PyTypeObject __pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd =
0, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
- __pyx_tp_traverse_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_traverse*/
- __pyx_tp_clear_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_clear*/
+ __pyx_tp_traverse_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_traverse*/
+ __pyx_tp_clear_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
@@ -22735,7 +25670,7 @@ static PyTypeObject __pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd =
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_new*/
+ __pyx_tp_new_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -22749,6 +25684,7 @@ static PyTypeObject __pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd =
0, /*tp_finalize*/
#endif
};
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -22760,12 +25696,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -22816,7 +25754,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -22825,7 +25763,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -22867,7 +25805,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd.array", /*tp_name*/
+ "silx.math.chistogramnd.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -22876,8 +25814,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -22972,7 +25911,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd.Enum", /*tp_name*/
+ "silx.math.chistogramnd.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -22981,8 +25920,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -23043,10 +25983,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -23124,39 +26065,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -23168,15 +26109,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -23218,7 +26159,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd.memoryview", /*tp_name*/
+ "silx.math.chistogramnd.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -23227,8 +26168,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -23328,7 +26270,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -23336,13 +26278,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd._memoryviewslice", /*tp_name*/
+ "silx.math.chistogramnd._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -23351,8 +26293,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -23428,7 +26371,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_01_02_2016, __pyx_k_01_02_2016, sizeof(__pyx_k_01_02_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_02_10_2017, __pyx_k_02_10_2017, sizeof(__pyx_k_02_10_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 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_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
{&__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},
@@ -23437,9 +26381,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_D_Naudet, __pyx_k_D_Naudet, sizeof(__pyx_k_D_Naudet), 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_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 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_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_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},
@@ -23448,6 +26392,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 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_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},
@@ -23455,6 +26400,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Provided_histo_array_doesn_t_hav_2, __pyx_k_Provided_histo_array_doesn_t_hav_2, sizeof(__pyx_k_Provided_histo_array_doesn_t_hav_2), 0, 0, 1, 0},
{&__pyx_kp_s_Provided_weighted_histo_array_do, __pyx_k_Provided_weighted_histo_array_do, sizeof(__pyx_k_Provided_weighted_histo_array_do), 0, 0, 1, 0},
{&__pyx_kp_s_Provided_weighted_histo_array_do_2, __pyx_k_Provided_weighted_histo_array_do_2, sizeof(__pyx_k_Provided_weighted_histo_array_do_2), 0, 0, 1, 0},
+ {&__pyx_kp_s_Range_parameter_should_be_finite, __pyx_k_Range_parameter_should_be_finite, sizeof(__pyx_k_Range_parameter_should_be_finite), 0, 0, 1, 0},
+ {&__pyx_kp_s_Range_value_can_t_be_nan, __pyx_k_Range_value_can_t_be_nan, sizeof(__pyx_k_Range_value_can_t_be_nan), 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},
@@ -23480,6 +26427,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
{&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
{&__pyx_n_s_equal, __pyx_k_equal, sizeof(__pyx_k_equal), 0, 0, 1, 1},
{&__pyx_n_s_err_histo_range, __pyx_k_err_histo_range, sizeof(__pyx_k_err_histo_range), 0, 0, 1, 1},
@@ -23503,6 +26451,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_i_histo_range, __pyx_k_i_histo_range, sizeof(__pyx_k_i_histo_range), 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_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
{&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 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},
@@ -23510,7 +26459,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
{&__pyx_n_s_n_bins, __pyx_k_n_bins, sizeof(__pyx_k_n_bins), 0, 0, 1, 1},
{&__pyx_n_s_n_bins_c, __pyx_k_n_bins_c, sizeof(__pyx_k_n_bins_c), 0, 0, 1, 1},
@@ -23520,12 +26468,16 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_n_elem, __pyx_k_n_elem, sizeof(__pyx_k_n_elem), 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_nan, __pyx_k_nan, sizeof(__pyx_k_nan), 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_ndmin, __pyx_k_ndmin, sizeof(__pyx_k_ndmin), 0, 0, 1, 1},
+ {&__pyx_n_s_newbyteorder, __pyx_k_newbyteorder, sizeof(__pyx_k_newbyteorder), 0, 0, 1, 1},
{&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
+ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
{&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
{&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
{&__pyx_n_s_option_flags, __pyx_k_option_flags, sizeof(__pyx_k_option_flags), 0, 0, 1, 1},
@@ -23542,6 +26494,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_sample_c, __pyx_k_sample_c, sizeof(__pyx_k_sample_c), 0, 0, 1, 1},
{&__pyx_n_s_sample_type, __pyx_k_sample_type, sizeof(__pyx_k_sample_type), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_math_chistogramnd, __pyx_k_silx_math_chistogramnd, sizeof(__pyx_k_silx_math_chistogramnd), 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},
@@ -23558,6 +26511,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_w_shape, __pyx_k_w_shape, sizeof(__pyx_k_w_shape), 0, 0, 1, 1},
{&__pyx_n_s_weight_max, __pyx_k_weight_max, sizeof(__pyx_k_weight_max), 0, 0, 1, 1},
{&__pyx_n_s_weight_min, __pyx_k_weight_min, sizeof(__pyx_k_weight_min), 0, 0, 1, 1},
@@ -23569,26 +26523,20 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_weights_type, __pyx_k_weights_type, sizeof(__pyx_k_weights_type), 0, 0, 1, 1},
{&__pyx_n_s_wh_dtype, __pyx_k_wh_dtype, sizeof(__pyx_k_wh_dtype), 0, 0, 1, 1},
{&__pyx_kp_s_wh_dtype_type_not_supported_0, __pyx_k_wh_dtype_type_not_supported_0, sizeof(__pyx_k_wh_dtype_type_not_supported_0), 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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __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 = 650; __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 = 293; __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_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;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 157, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 653, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 660, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 300, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -23598,356 +26546,467 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "chistogramnd.pyx":161
+ /* "silx/math/chistogramnd.pyx":161
* if (weighted_histo is not None and
* weighted_histo.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<weighted_histo> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if histo is not None and histo.flags['C_CONTIGUOUS'] is False:
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_weighted_histo_must_be_a_C_CONT); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_weighted_histo_must_be_a_C_CONT); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "chistogramnd.pyx":164
+ /* "silx/math/chistogramnd.pyx":164
*
* if histo is not None and histo.flags['C_CONTIGUOUS'] is False:
* raise ValueError('<histo> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* s_shape = sample.shape
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_histo_must_be_a_C_CONTIGUOUS_nu); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_histo_must_be_a_C_CONTIGUOUS_nu); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "chistogramnd.pyx":176
+ /* "silx/math/chistogramnd.pyx":176
* # 2 different cases : 2D sample (N,M) and 1D (N)
* if len(w_shape) != 1 or w_shape[0] != s_shape[0]:
* raise ValueError('<weights> must be an array whose length ' # <<<<<<<<<<<<<<
* 'is equal to the number of samples.')
*
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_weights_must_be_an_array_whose); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_weights_must_be_an_array_whose); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 176, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "chistogramnd.pyx":191
+ /* "silx/math/chistogramnd.pyx":191
*
* if n_dims == 1:
* if histo_range.shape == (2,): # <<<<<<<<<<<<<<
* pass
* elif histo_range.shape == (1, 2):
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "chistogramnd.pyx":193
+ /* "silx/math/chistogramnd.pyx":193
* if histo_range.shape == (2,):
* pass
* elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
* histo_range.shape = -1
* else:
*/
- __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 193, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "chistogramnd.pyx":214
+ /* "silx/math/chistogramnd.pyx":211
+ * # check range value
+ * if np.inf in histo_range:
+ * raise ValueError('Range parameter should be finite value') # <<<<<<<<<<<<<<
+ * if np.nan in histo_range:
+ * raise ValueError('Range value can\'t be nan')
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_Range_parameter_should_be_finite); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "silx/math/chistogramnd.pyx":213
+ * raise ValueError('Range parameter should be finite value')
+ * if np.nan in histo_range:
+ * raise ValueError('Range value can\'t be nan') # <<<<<<<<<<<<<<
+ *
+ * # checking n_bins size
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Range_value_can_t_be_nan); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "silx/math/chistogramnd.pyx":220
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number ' # <<<<<<<<<<<<<<
* 'of bins for all dimensions) or '
* 'an array (number of bins for each '
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_n_bins_must_be_either_a_scalar_s); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_n_bins_must_be_either_a_scalar_s); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 220, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "chistogramnd.pyx":223
+ /* "silx/math/chistogramnd.pyx":229
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0):
* raise ValueError('<n_bins> : only positive values allowed.') # <<<<<<<<<<<<<<
*
* output_shape = tuple(n_bins)
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_n_bins_only_positive_values_all); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_n_bins_only_positive_values_all); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 229, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "chistogramnd.pyx":292
+ /* "silx/math/chistogramnd.pyx":289
+ *
+ * sample_type = sample.dtype
+ * sample_type = sample_type.newbyteorder('N') # <<<<<<<<<<<<<<
+ *
+ * n_elem = sample.size // n_dims
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "silx/math/chistogramnd.pyx":299
* # functions. so I have to explicitly list them all...
*
* def raise_unsupported_type(): # <<<<<<<<<<<<<<
* raise TypeError('Case not supported - sample:{0} '
* 'and weights:{1}.'
*/
- __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_raise_unsupported_type, 292, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_raise_unsupported_type, 299, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 299, __pyx_L1_error)
- /* "chistogramnd.pyx":643
+ /* "silx/math/chistogramnd.pyx":308
+ *
+ * weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ * if weights is not None else None)
+ *
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 308, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "silx/math/chistogramnd.pyx":325
+ *
+ * bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)),
+ * dtype=bin_edges.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "silx/math/chistogramnd.pyx":653
* if rc != histogramnd_c.HISTO_OK:
* if rc == histogramnd_c.HISTO_ERR_ALLOC:
* raise MemoryError('histogramnd failed to allocate memory.') # <<<<<<<<<<<<<<
* else:
* raise Exception('histogramnd returned an error : {0}'
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_histogramnd_failed_to_allocate_m); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_histogramnd_failed_to_allocate_m); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__11 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__11);
- __Pyx_GIVEREF(__pyx_tuple__11);
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ /* "../../../../../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__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__13);
- __Pyx_GIVEREF(__pyx_tuple__13);
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 799, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__14 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 803, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
+ /* "../../../../../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__15 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 823, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":127
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 989, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 1001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__32 = PyTuple_New(1); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__32, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__32);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(2, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__24);
- __Pyx_GIVEREF(__pyx_slice__24);
+ __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(2, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__34);
+ __Pyx_GIVEREF(__pyx_slice__34);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__25);
- __Pyx_GIVEREF(__pyx_slice__25);
+ __pyx_slice__35 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(2, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__35);
+ __Pyx_GIVEREF(__pyx_slice__35);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
- /* "chistogramnd.pyx":36
+ /* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
* histo_range,
* n_bins,
*/
- __pyx_tuple__27 = PyTuple_Pack(34, __pyx_n_s_sample, __pyx_n_s_histo_range, __pyx_n_s_n_bins, __pyx_n_s_weights, __pyx_n_s_weight_min, __pyx_n_s_weight_max, __pyx_n_s_last_bin_closed, __pyx_n_s_histo, __pyx_n_s_weighted_histo, __pyx_n_s_wh_dtype, __pyx_n_s_s_shape, __pyx_n_s_n_dims, __pyx_n_s_w_shape, __pyx_n_s_weights_type, __pyx_n_s_i_histo_range, __pyx_n_s_err_histo_range, __pyx_n_s_output_shape, __pyx_n_s_option_flags, __pyx_n_s_sample_type, __pyx_n_s_n_elem, __pyx_n_s_bin_edges, __pyx_n_s_raise_unsupported_type, __pyx_n_s_raise_unsupported_type, __pyx_n_s_sample_c, __pyx_n_s_weights_c, __pyx_n_s_histo_range_c, __pyx_n_s_n_bins_c, __pyx_n_s_histo_c, __pyx_n_s_cumul_c, __pyx_n_s_bin_edges_c, __pyx_n_s_rc, __pyx_n_s_edges, __pyx_n_s_offset, __pyx_n_s_i_dim); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
- __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(10, 0, 34, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_chistogramnd, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__37 = PyTuple_Pack(34, __pyx_n_s_sample, __pyx_n_s_histo_range, __pyx_n_s_n_bins, __pyx_n_s_weights, __pyx_n_s_weight_min, __pyx_n_s_weight_max, __pyx_n_s_last_bin_closed, __pyx_n_s_histo, __pyx_n_s_weighted_histo, __pyx_n_s_wh_dtype, __pyx_n_s_s_shape, __pyx_n_s_n_dims, __pyx_n_s_w_shape, __pyx_n_s_weights_type, __pyx_n_s_i_histo_range, __pyx_n_s_err_histo_range, __pyx_n_s_output_shape, __pyx_n_s_option_flags, __pyx_n_s_sample_type, __pyx_n_s_n_elem, __pyx_n_s_bin_edges, __pyx_n_s_raise_unsupported_type, __pyx_n_s_raise_unsupported_type, __pyx_n_s_sample_c, __pyx_n_s_weights_c, __pyx_n_s_histo_range_c, __pyx_n_s_n_bins_c, __pyx_n_s_histo_c, __pyx_n_s_cumul_c, __pyx_n_s_bin_edges_c, __pyx_n_s_rc, __pyx_n_s_edges, __pyx_n_s_offset, __pyx_n_s_i_dim); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(10, 0, 34, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_chistogramnd, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 36, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(2, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* 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_direct); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
+ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__40);
+ __Pyx_GIVEREF(__pyx_tuple__40);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
+ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__42);
+ __Pyx_GIVEREF(__pyx_tuple__42);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -23956,11 +27015,11 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -23975,10 +27034,7 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
#endif
{
PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ static PyThread_type_lock __pyx_t_2[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -23990,17 +27046,24 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_chistogramnd(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -24015,34 +27078,34 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_chistogramnd) {
- 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 (__pyx_module_is_main_silx__math__chistogramnd) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "chistogramnd")) {
- if (unlikely(PyDict_SetItemString(modules, "chistogramnd", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.chistogramnd")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.chistogramnd", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -24052,13 +27115,16 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd.tp_print = 0;
- __pyx_ptype_12chistogramnd___pyx_scope_struct__chistogramnd = &__pyx_type_12chistogramnd___pyx_scope_struct__chistogramnd;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
+ __pyx_type_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd.tp_print = 0;
+ __pyx_ptype_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd = &__pyx_type_4silx_4math_12chistogramnd___pyx_scope_struct__chistogramnd;
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -24069,18 +27135,18 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __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",
@@ -24089,208 +27155,222 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
#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;}
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "chistogramnd.pyx":25
+ /* "silx/math/chistogramnd.pyx":25
* # ############################################################################*[inserted by cython to avoid comment closer]/
*
* __authors__ = ["D. Naudet"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "01/02/2016"
+ * __date__ = "02/10/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_D_Naudet);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_D_Naudet);
__Pyx_GIVEREF(__pyx_kp_s_D_Naudet);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_D_Naudet);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd.pyx":26
+ /* "silx/math/chistogramnd.pyx":26
*
* __authors__ = ["D. Naudet"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "01/02/2016"
+ * __date__ = "02/10/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
- /* "chistogramnd.pyx":27
+ /* "silx/math/chistogramnd.pyx":27
* __authors__ = ["D. Naudet"]
* __license__ = "MIT"
- * __date__ = "01/02/2016" # <<<<<<<<<<<<<<
+ * __date__ = "02/10/2017" # <<<<<<<<<<<<<<
*
* cimport numpy # noqa
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_01_02_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_02_10_2017) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
- /* "chistogramnd.pyx":31
+ /* "silx/math/chistogramnd.pyx":31
* cimport numpy # noqa
* cimport cython
* import numpy as np # <<<<<<<<<<<<<<
*
* cimport histogramnd_c
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd.pyx":36
+ /* "silx/math/chistogramnd.pyx":36
*
*
* def chistogramnd(sample, # <<<<<<<<<<<<<<
* histo_range,
* n_bins,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_12chistogramnd_1chistogramnd, NULL, __pyx_n_s_chistogramnd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12chistogramnd_1chistogramnd, NULL, __pyx_n_s_silx_math_chistogramnd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_chistogramnd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_chistogramnd, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd.pyx":1244
- *
- *
- * if __name__=='__main__': # <<<<<<<<<<<<<<
- * pass
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
- goto __pyx_L2;
- }
- __pyx_L2:;
-
- /* "chistogramnd.pyx":1
+ /* "silx/math/chistogramnd.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* # /[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __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;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__29, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __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
+ /* "View.MemoryView":283
*
* 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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __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
+ /* "View.MemoryView":284
* 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__31, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __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
+ /* "View.MemoryView":287
*
*
* 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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __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
+ /* "View.MemoryView":288
*
* 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__33, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_2[0] = PyThread_allocate_lock();
+ __pyx_t_2[1] = PyThread_allocate_lock();
+ __pyx_t_2[2] = PyThread_allocate_lock();
+ __pyx_t_2[3] = PyThread_allocate_lock();
+ __pyx_t_2[4] = PyThread_allocate_lock();
+ __pyx_t_2[5] = PyThread_allocate_lock();
+ __pyx_t_2[6] = PyThread_allocate_lock();
+ __pyx_t_2[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __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;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __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;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -24305,11 +27385,11 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
__Pyx_XDECREF(__pyx_t_1);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.chistogramnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init chistogramnd");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.chistogramnd");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -24320,7 +27400,8 @@ PyMODINIT_FUNC PyInit_chistogramnd(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -24337,6 +27418,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -24350,6 +27432,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -24375,6 +27458,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -24388,6 +27472,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -24489,10 +27574,150 @@ bad:
return -1;
}
+/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
@@ -24512,10 +27737,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -24525,27 +27750,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
+/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -24584,6 +27804,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -24617,10 +27838,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -24680,7 +27904,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -24700,9 +27924,10 @@ bad:
}
#endif
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+/* GetModuleGlobalName */
+ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -24717,7 +27942,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -24736,7 +27962,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -24748,6 +27975,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -24755,18 +27987,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -24774,8 +28015,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -24788,8 +28030,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -24801,9 +28044,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -24827,10 +28071,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -24844,8 +28087,99 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -24859,7 +28193,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+/* FetchCommonType */
+ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -24897,7 +28232,8 @@ bad:
goto done;
}
-static PyObject *
+/* CythonFunction */
+ static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
@@ -25050,15 +28386,25 @@ __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
+ int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
+ #else
+ op->defaults_tuple = PySequence_ITEM(res, 0);
+ if (unlikely(!op->defaults_tuple)) result = -1;
+ else {
+ op->defaults_kwdict = PySequence_ITEM(res, 1);
+ if (unlikely(!op->defaults_kwdict)) result = -1;
+ }
+ #endif
Py_DECREF(res);
- return 0;
+ return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
@@ -25168,9 +28514,6 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(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}
@@ -25245,7 +28588,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
- PyMem_Free(m->defaults);
+ PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
@@ -25306,37 +28649,40 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
+ PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
- switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
+ switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0)
+ 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) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 0)
+ if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%zd given)",
+ "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 1)
- return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+ if (likely(size == 1)) {
+ PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
+ if (unlikely(!arg0)) return NULL;
+ result = (*meth)(self, arg0);
+ Py_DECREF(arg0);
+ return result;
+ }
PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%zd given)",
+ "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
@@ -25351,11 +28697,32 @@ static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject
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);
+static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
+}
+static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
+ PyObject *result;
+ __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
+ if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
+ Py_ssize_t argc;
+ PyObject *new_args;
+ PyObject *self;
+ argc = PyTuple_GET_SIZE(args);
+ new_args = PyTuple_GetSlice(args, 1, argc);
+ if (unlikely(!new_args))
+ return NULL;
+ self = PyTuple_GetItem(args, 0);
+ if (unlikely(!self)) {
+ Py_DECREF(new_args);
+ return NULL;
+ }
+ result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
+ Py_DECREF(new_args);
+ } else {
+ result = __Pyx_CyFunction_Call(func, args, kw);
+ }
+ return result;
}
-#endif
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
@@ -25375,7 +28742,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
0,
0,
- __Pyx_CyFunction_Call,
+ __Pyx_CyFunction_CallAsMethod,
0,
0,
0,
@@ -25416,10 +28783,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
#endif
};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
- __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
+static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL) {
return -1;
@@ -25428,7 +28792,7 @@ static int __Pyx_CyFunction_init(void) {
}
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);
+ m->defaults = PyObject_Malloc(size);
if (!m->defaults)
return PyErr_NoMemory();
memset(m->defaults, 0, size);
@@ -25451,7 +28815,8 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
Py_INCREF(dict);
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -26000,7 +29365,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -26056,7 +29422,6 @@ no_fail:
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
@@ -26135,11 +29500,128 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* SliceObject */
+ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+ Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_USE_TYPE_SLOTS
PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
@@ -26170,10 +29652,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
if (cstart < 0) cstart = 0;
}
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
goto bad;
+ PyErr_Clear();
}
}
return ms->sq_slice(obj, cstart, cstop);
@@ -26216,7 +29697,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
Py_XDECREF(owned_stop);
if (unlikely(!py_slice)) goto bad;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_USE_TYPE_SLOTS
result = mp->mp_subscript(obj, py_slice);
#else
result = PyObject_GetItem(obj, py_slice);
@@ -26232,22 +29713,26 @@ bad:
return NULL;
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -26259,7 +29744,103 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -26285,7 +29866,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26322,7 +29904,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26405,14 +29988,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -26424,13 +30009,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -26450,129 +30042,134 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-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
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
+
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -26593,9 +30190,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -26612,13 +30214,14 @@ bad:
return -1;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -26691,7 +30294,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -26764,7 +30368,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -26794,95 +30398,99 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ *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);
+}
+
+/* Capsule */
+ 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;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -26893,218 +30501,61 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#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;
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_histo_opt_type(histo_opt_type value) {
+ const histo_opt_type neg_one = (histo_opt_type) -1, const_zero = (histo_opt_type) 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;
- }
+ if (is_unsigned) {
+ if (sizeof(histo_opt_type) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(histo_opt_type) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(histo_opt_type) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#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_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;
- }
+ if (sizeof(histo_opt_type) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(histo_opt_type) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#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;
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(histo_opt_type),
+ little, !is_unsigned);
+ }
}
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -27123,60 +30574,86 @@ raise_neg_overflow:
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
}
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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) {
+ static CYTHON_INLINE float __Pyx_c_abs_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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) {
@@ -27194,24 +30671,32 @@ raise_neg_overflow:
case 1:
return a;
case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_absf(a);
+ r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
@@ -27224,7 +30709,8 @@ raise_neg_overflow:
#endif
#endif
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -27243,60 +30729,86 @@ raise_neg_overflow:
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
}
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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) {
+ static CYTHON_INLINE double __Pyx_c_abs_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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) {
@@ -27314,24 +30826,32 @@ raise_neg_overflow:
case 1:
return a;
case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_abs(a);
+ r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
@@ -27344,22 +30864,27 @@ raise_neg_overflow:
#endif
#endif
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -27370,64 +30895,39 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-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;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
} 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);
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
- *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);
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
+ }
}
-static __Pyx_memviewslice
+/* MemviewSliceCopyTemplate */
+ 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,
@@ -27493,20 +30993,387 @@ no_fail:
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);
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
#endif
- return cobj;
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
}
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int32) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
+ case 2:
+ if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
+ return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
+ return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
+ return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (npy_int32) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int32) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ npy_int32 val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (npy_int32) -1;
+ }
+ } else {
+ npy_int32 val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -27523,36 +31390,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -27561,7 +31521,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -27584,7 +31544,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -27600,8 +31560,9 @@ raise_neg_overflow:
return (char) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -27618,36 +31579,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -27656,7 +31710,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -27679,7 +31733,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -27695,7 +31749,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -27735,7 +31790,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -27916,7 +31972,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -27938,7 +31995,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -27960,7 +32018,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -27982,7 +32041,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -28004,7 +32064,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -28026,7 +32087,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -28041,7 +32103,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-#ifndef __PYX_HAVE_RT_ImportModule
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
@@ -28058,7 +32121,8 @@ bad:
}
#endif
-#ifndef __PYX_HAVE_RT_ImportType
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
@@ -28104,14 +32168,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif
if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling",
- module_name, class_name);
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
goto bad;
}
return (PyTypeObject *)result;
@@ -28122,7 +32186,8 @@ bad:
}
#endif
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -28160,7 +32225,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -28201,7 +32266,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -28222,8 +32287,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -28231,9 +32298,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -28242,11 +32310,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -28271,18 +32342,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/histogramnd/chistogramnd.pyx b/silx/math/chistogramnd.pyx
index f7b4b78..f4daa2e 100644
--- a/silx/math/histogramnd/chistogramnd.pyx
+++ b/silx/math/chistogramnd.pyx
@@ -24,7 +24,7 @@
__authors__ = ["D. Naudet"]
__license__ = "MIT"
-__date__ = "01/02/2016"
+__date__ = "02/10/2017"
cimport numpy # noqa
cimport cython
@@ -137,7 +137,7 @@ def chistogramnd(sample,
non contiguous slice) then histogramnd will have to do make an
internal copy.
:type weighted_histo: *optional*, :class:`numpy.array`
-
+
:param wh_dtype: type of the weighted histogram array. This parameter is
ignored if *weighted_histo* is provided. If not provided, the
weighted histogram array will contain values of the same type as
@@ -149,8 +149,8 @@ def chistogramnd(sample,
dimension.
:rtype: *tuple* (:class:`numpy.array`, :class:`numpy.array`, `tuple`) or
(:class:`numpy.array`, None, `tuple`)
- """ # noqa
-
+ """
+
if wh_dtype is None:
wh_dtype = np.double
elif wh_dtype not in (np.double, np.float32):
@@ -206,6 +206,12 @@ def chistogramnd(sample,
''.format(histo_range=i_histo_range,
n_dims=n_dims))
+ # check range value
+ if np.inf in histo_range:
+ raise ValueError('Range parameter should be finite value')
+ if np.nan in histo_range:
+ raise ValueError('Range value can\'t be nan')
+
# checking n_bins size
n_bins = np.array(n_bins, ndmin=1)
if len(n_bins) == 1:
@@ -280,6 +286,7 @@ def chistogramnd(sample,
option_flags |= histogramnd_c.HISTO_LAST_BIN_CLOSED
sample_type = sample.dtype
+ sample_type = sample_type.newbyteorder('N')
n_elem = sample.size // n_dims
@@ -294,9 +301,11 @@ def chistogramnd(sample,
'and weights:{1}.'
''.format(sample_type, weights_type))
- sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ dtype=sample_type)
- weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)))
+ weights_c = (np.ascontiguousarray(weights.reshape((weights.size,)),
+ dtype=weights.dtype.newbyteorder('N'))
if weights is not None else None)
histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
@@ -312,7 +321,8 @@ def chistogramnd(sample,
else:
cumul_c = None
- bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)))
+ bin_edges_c = np.ascontiguousarray(bin_edges.reshape((bin_edges.size,)),
+ dtype=bin_edges.dtype.newbyteorder('N'))
rc = 0
@@ -1239,7 +1249,3 @@ cdef int _histogramnd_int32_t_int32_t_float(numpy.int32_t[:] sample,
option_flags,
weight_min,
weight_max)
-
-
-if __name__=='__main__':
- pass
diff --git a/silx/math/histogramnd/chistogramnd_lut.c b/silx/math/chistogramnd_lut.c
index 3ef6da5..868310f 100644
--- a/silx/math/histogramnd/chistogramnd_lut.c
+++ b/silx/math/chistogramnd_lut.c
@@ -1,28 +1,33 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h"
+ ],
+ "include_dirs": [
+ "silx/math/histogramnd/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.chistogramnd_lut"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +46,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +58,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +274,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +295,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +334,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +360,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,15 +444,11 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__chistogramnd_lut
-#define __PYX_HAVE_API__chistogramnd_lut
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
+#define __PYX_HAVE__silx__math__chistogramnd_lut
+#define __PYX_HAVE_API__silx__math__chistogramnd_lut
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "pythread.h"
@@ -248,20 +461,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -269,16 +469,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -295,11 +513,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -313,18 +531,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -335,7 +560,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -415,11 +640,13 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
+/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
@@ -443,11 +670,12 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "chistogramnd_lut.pyx",
+ "silx/math/chistogramnd_lut.pyx",
"__init__.pxd",
"stringsource",
"type.pxd",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -457,6 +685,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -492,26 +721,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -528,19 +759,19 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -549,7 +780,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -558,7 +789,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -567,7 +798,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -576,7 +807,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -585,7 +816,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -594,7 +825,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -603,7 +834,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -612,7 +843,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -621,7 +852,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -630,7 +861,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -639,7 +870,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
*/
typedef npy_long __pyx_t_5numpy_int_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -648,7 +879,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -657,7 +888,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -666,7 +897,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -675,7 +906,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -684,7 +915,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -693,7 +924,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -702,7 +933,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -711,7 +942,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
*/
typedef npy_double __pyx_t_5numpy_float_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -720,7 +951,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
*/
typedef npy_double __pyx_t_5numpy_double_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -728,6 +959,7 @@ typedef npy_double __pyx_t_5numpy_double_t;
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
@@ -737,7 +969,9 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
@@ -747,6 +981,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
@@ -755,7 +990,7 @@ struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -764,7 +999,7 @@ struct __pyx_memoryviewslice_obj;
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -773,7 +1008,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -782,7 +1017,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -791,7 +1026,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -800,6 +1035,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -815,7 +1051,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -828,7 +1064,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -851,7 +1087,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -868,7 +1104,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -888,7 +1138,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -900,6 +1150,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -916,19 +1169,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -951,18 +1204,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -977,31 +1231,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -1009,47 +1268,132 @@ 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);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
-#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
+/* SliceObject.proto */
+#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)\
__Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
int has_cstart, int has_cstop, int wraparound);
-#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) : \
+/* SetItemInt.proto */
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1065,12 +1409,17 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
-static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* PyDictContains.proto */
+static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
-#if PY_MAJOR_VERSION >= 3
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
@@ -1090,38 +1439,66 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif
+/* UnicodeAsUCS4.proto */
+static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
+
+/* object_ord.proto */
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyObject_Ord(c)\
+ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
+#else
+#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
+#endif
+static long __Pyx__PyObject_Ord(PyObject* c);
+
+/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
+/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
int is_tuple, int has_known_size, int decref_tuple);
+/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -1147,47 +1524,58 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#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)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1203,12 +1591,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -1221,31 +1604,41 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CyFunction_GetClosure(f) \
+#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
-#define __Pyx_CyFunction_GetClassObj(f) \
+#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
-#define __Pyx_CyFunction_Defaults(type, f) \
+#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
-#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
+#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
@@ -1269,7 +1662,7 @@ typedef struct {
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1285,15 +1678,16 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
-static int __Pyx_CyFunction_init(void);
+static int __pyx_CyFunction_init(void);
+/* FusedFunction.proto */
typedef struct {
__pyx_CyFunctionObject func;
PyObject *__signatures__;
PyObject *type;
PyObject *self;
} __pyx_FusedFunctionObject;
-#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1305,9 +1699,10 @@ static PyTypeObject *__pyx_FusedFunctionType = NULL;
static int __pyx_FusedFunction_init(void);
#define __Pyx_FusedFunction_USED
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1319,11 +1714,53 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
+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;
+
+/* None.proto */
+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};
+
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1334,71 +1771,44 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_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};
-
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
-
-static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
-
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* Print.proto */
static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif
-static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
-
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
-
-static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
-
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
@@ -1411,7 +1821,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
@@ -1419,103 +1830,117 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
#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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
#if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(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);
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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);
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
#if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(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);
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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);
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *);
+
+/* PrintOne.proto */
+static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
+
+/* BytesContains.proto */
+static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
@@ -1524,12 +1949,16 @@ static int __Pyx_check_binary_version(void);
#endif
#endif
+/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
+/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1542,19 +1971,21 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* 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 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
@@ -1571,7 +2002,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha
/* Module declarations from 'cython' */
-/* Module declarations from 'chistogramnd_lut' */
+/* Module declarations from 'silx.math.chistogramnd_lut' */
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1581,6 +2012,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1621,405 +2054,283 @@ static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_int16_t = { "int16_t", NU
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 };
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
-#define __Pyx_MODULE_NAME "chistogramnd_lut"
-int __pyx_module_is_main_chistogramnd_lut = 0;
+#define __Pyx_MODULE_NAME "silx.math.chistogramnd_lut"
+int __pyx_module_is_main_silx__math__chistogramnd_lut = 0;
-/* Implementation of 'chistogramnd_lut' */
+/* Implementation of 'silx.math.chistogramnd_lut' */
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_AttributeError;
-static PyObject *__pyx_builtin_ord;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_RuntimeError;
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_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_histo_lut, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(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_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(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_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
-static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* 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_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_ex[] = "ex";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_np[] = "np";
-static char __pyx_k_rc[] = "rc";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k__14[] = "()";
-static char __pyx_k__16[] = "|";
-static char __pyx_k_any[] = "any";
-static char __pyx_k_end[] = "end";
-static char __pyx_k_h_c[] = "h_c";
-static char __pyx_k_lut[] = "lut";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_ord[] = "ord";
-static char __pyx_k_w_c[] = "w_c";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_file[] = "file";
-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_ndim[] = "ndim";
-static char __pyx_k_pack[] = "pack";
-static char __pyx_k_prod[] = "prod";
-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_tile[] = "tile";
-static char __pyx_k_type[] = "type";
-static char __pyx_k_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_edges[] = "edges";
-static char __pyx_k_equal[] = "equal";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_flags[] = "flags";
-static char __pyx_k_g_max[] = "g_max";
-static char __pyx_k_g_min[] = "g_min";
-static char __pyx_k_histo[] = "histo";
-static char __pyx_k_i_dim[] = "i_dim";
-static char __pyx_k_i_lut[] = "i_lut";
-static char __pyx_k_int16[] = "int16";
-static char __pyx_k_int32[] = "int32";
-static char __pyx_k_int64[] = "int64";
-static char __pyx_k_lut_c[] = "lut_c";
-static char __pyx_k_ndmin[] = "ndmin";
-static char __pyx_k_numpy[] = "numpy";
-static char __pyx_k_o_lut[] = "o_lut";
-static char __pyx_k_print[] = "print";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_shape[] = "shape";
-static char __pyx_k_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_w_h_c[] = "w_h_c";
-static char __pyx_k_zeros[] = "zeros";
-static char __pyx_k_arange[] = "arange";
-static char __pyx_k_double[] = "double";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_kwargs[] = "kwargs";
-static char __pyx_k_n_bins[] = "n_bins";
-static char __pyx_k_n_dims[] = "n_dims";
-static char __pyx_k_n_elem[] = "n_elem";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_sample[] = "sample";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_uint32[] = "uint32";
-static char __pyx_k_uint64[] = "uint64";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_bin_idx[] = "bin_idx";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_h_lut_c[] = "h_lut_c";
-static char __pyx_k_histo_c[] = "histo_c";
-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_lut_idx[] = "lut_idx";
-static char __pyx_k_max_idx[] = "max_idx";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_ndarray[] = "ndarray";
-static char __pyx_k_o_histo[] = "o_histo";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_rng_max[] = "rng_max";
-static char __pyx_k_rng_min[] = "rng_min";
-static char __pyx_k_s_shape[] = "s_shape";
-static char __pyx_k_w_dtype[] = "w_dtype";
-static char __pyx_k_weights[] = "weights";
-static char __pyx_k_D_Naudet[] = "D. Naudet";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_defaults[] = "defaults";
-static char __pyx_k_elem_idx[] = "elem_idx";
-static char __pyx_k_i_n_bins[] = "i_n_bins";
-static char __pyx_k_i_n_dims[] = "i_n_dims";
-static char __pyx_k_i_sample[] = "i_sample";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_n_bins_c[] = "n_bins_c";
-static char __pyx_k_sample_c[] = "sample_c";
-static char __pyx_k_Exception[] = "Exception";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_dim_edges[] = "dim_edges";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_float32_t[] = "float32_t";
-static char __pyx_k_float64_t[] = "float64_t";
-static char __pyx_k_histo_lut[] = "histo_lut";
-static char __pyx_k_i_n_elems[] = "i_n_elems";
-static char __pyx_k_i_weights[] = "i_weights";
-static char __pyx_k_lut_dtype[] = "lut_dtype";
-static char __pyx_k_15_05_2016[] = "15/05/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_bins_range[] = "bins_range";
-static char __pyx_k_elem_coord[] = "elem_coord";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_signatures[] = "signatures";
-static char __pyx_k_weight_max[] = "weight_max";
-static char __pyx_k_weight_min[] = "weight_min";
-static char __pyx_k_ImportError[] = "ImportError";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_histo_range[] = "histo_range";
-static char __pyx_k_sample_type[] = "sample_type";
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static char __pyx_k_i_weight_max[] = "i_weight_max";
-static char __pyx_k_i_weight_min[] = "i_weight_min";
-static char __pyx_k_histo_range_c[] = "histo_range_c";
-static char __pyx_k_i_histo_range[] = "i_histo_range";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_weighted_histo[] = "weighted_histo";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_err_histo_range[] = "err_histo_range";
-static char __pyx_k_int32_t_int16_t[] = "int32_t|int16_t";
-static char __pyx_k_int32_t_int32_t[] = "int32_t|int32_t";
-static char __pyx_k_int32_t_int64_t[] = "int32_t|int64_t";
-static char __pyx_k_int64_t_int16_t[] = "int64_t|int16_t";
-static char __pyx_k_int64_t_int32_t[] = "int64_t|int32_t";
-static char __pyx_k_int64_t_int64_t[] = "int64_t|int64_t";
-static char __pyx_k_last_bin_closed[] = "last_bin_closed";
-static char __pyx_k_chistogramnd_lut[] = "chistogramnd_lut";
-static char __pyx_k_filt_max_weights[] = "filt_max_weights";
-static char __pyx_k_filt_min_weights[] = "filt_min_weights";
-static char __pyx_k_o_weighted_histo[] = "o_weighted_histo";
-static char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
-static char __pyx_k_float32_t_int16_t[] = "float32_t|int16_t";
-static char __pyx_k_float32_t_int32_t[] = "float32_t|int32_t";
-static char __pyx_k_float32_t_int64_t[] = "float32_t|int64_t";
-static char __pyx_k_float64_t_int16_t[] = "float64_t|int16_t";
-static char __pyx_k_float64_t_int32_t[] = "float64_t|int32_t";
-static char __pyx_k_float64_t_int64_t[] = "float64_t|int64_t";
-static char __pyx_k_i_filt_max_weights[] = "i_filt_max_weights";
-static char __pyx_k_i_filt_min_weights[] = "i_filt_min_weights";
-static char __pyx_k_strided_and_direct[] = "<strided and direct>";
-static char __pyx_k_histogramnd_get_lut[] = "histogramnd_get_lut";
-static char __pyx_k_histogramnd_from_lut[] = "histogramnd_from_lut";
-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_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_int32_t_int16_t_int32_t[] = "int32_t|int16_t|int32_t";
-static char __pyx_k_int32_t_int16_t_int64_t[] = "int32_t|int16_t|int64_t";
-static char __pyx_k_int32_t_int32_t_int32_t[] = "int32_t|int32_t|int32_t";
-static char __pyx_k_int32_t_int32_t_int64_t[] = "int32_t|int32_t|int64_t";
-static char __pyx_k_int32_t_int64_t_int32_t[] = "int32_t|int64_t|int32_t";
-static char __pyx_k_int32_t_int64_t_int64_t[] = "int32_t|int64_t|int64_t";
-static char __pyx_k_int64_t_int16_t_int32_t[] = "int64_t|int16_t|int32_t";
-static char __pyx_k_int64_t_int16_t_int64_t[] = "int64_t|int16_t|int64_t";
-static char __pyx_k_int64_t_int32_t_int32_t[] = "int64_t|int32_t|int32_t";
-static char __pyx_k_int64_t_int32_t_int64_t[] = "int64_t|int32_t|int64_t";
-static char __pyx_k_int64_t_int64_t_int32_t[] = "int64_t|int64_t|int32_t";
-static char __pyx_k_int64_t_int64_t_int64_t[] = "int64_t|int64_t|int64_t";
-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_float32_t_int16_t_int32_t[] = "float32_t|int16_t|int32_t";
-static char __pyx_k_float32_t_int16_t_int64_t[] = "float32_t|int16_t|int64_t";
-static char __pyx_k_float32_t_int32_t_int32_t[] = "float32_t|int32_t|int32_t";
-static char __pyx_k_float32_t_int32_t_int64_t[] = "float32_t|int32_t|int64_t";
-static char __pyx_k_float32_t_int64_t_int32_t[] = "float32_t|int64_t|int32_t";
-static char __pyx_k_float32_t_int64_t_int64_t[] = "float32_t|int64_t|int64_t";
-static char __pyx_k_float64_t_int16_t_int32_t[] = "float64_t|int16_t|int32_t";
-static char __pyx_k_float64_t_int16_t_int64_t[] = "float64_t|int16_t|int64_t";
-static char __pyx_k_float64_t_int32_t_int32_t[] = "float64_t|int32_t|int32_t";
-static char __pyx_k_float64_t_int32_t_int64_t[] = "float64_t|int32_t|int64_t";
-static char __pyx_k_float64_t_int64_t_int32_t[] = "float64_t|int64_t|int32_t";
-static char __pyx_k_float64_t_int64_t_int64_t[] = "float64_t|int64_t|int64_t";
-static char __pyx_k_histogramnd_get_lut_fused[] = "_histogramnd_get_lut_fused";
-static char __pyx_k_int32_t_int16_t_float32_t[] = "int32_t|int16_t|float32_t";
-static char __pyx_k_int32_t_int16_t_float64_t[] = "int32_t|int16_t|float64_t";
-static char __pyx_k_int32_t_int32_t_float32_t[] = "int32_t|int32_t|float32_t";
-static char __pyx_k_int32_t_int32_t_float64_t[] = "int32_t|int32_t|float64_t";
-static char __pyx_k_int32_t_int64_t_float32_t[] = "int32_t|int64_t|float32_t";
-static char __pyx_k_int32_t_int64_t_float64_t[] = "int32_t|int64_t|float64_t";
-static char __pyx_k_int64_t_int16_t_float32_t[] = "int64_t|int16_t|float32_t";
-static char __pyx_k_int64_t_int16_t_float64_t[] = "int64_t|int16_t|float64_t";
-static char __pyx_k_int64_t_int32_t_float32_t[] = "int64_t|int32_t|float32_t";
-static char __pyx_k_int64_t_int32_t_float64_t[] = "int64_t|int32_t|float64_t";
-static char __pyx_k_int64_t_int64_t_float32_t[] = "int64_t|int64_t|float32_t";
-static char __pyx_k_int64_t_int64_t_float64_t[] = "int64_t|int64_t|float64_t";
-static char __pyx_k_Index_out_of_bounds_axis_d[] = "Index out of bounds (axis %d)";
-static char __pyx_k_histogramnd_from_lut_fused[] = "_histogramnd_from_lut_fused";
-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_Type_not_supported_sample_0[] = "Type not supported - sample : {0}";
-static char __pyx_k_float32_t_int16_t_float32_t[] = "float32_t|int16_t|float32_t";
-static char __pyx_k_float32_t_int16_t_float64_t[] = "float32_t|int16_t|float64_t";
-static char __pyx_k_float32_t_int32_t_float32_t[] = "float32_t|int32_t|float32_t";
-static char __pyx_k_float32_t_int32_t_float64_t[] = "float32_t|int32_t|float64_t";
-static char __pyx_k_float32_t_int64_t_float32_t[] = "float32_t|int64_t|float32_t";
-static char __pyx_k_float32_t_int64_t_float64_t[] = "float32_t|int64_t|float64_t";
-static char __pyx_k_float64_t_int16_t_float32_t[] = "float64_t|int16_t|float32_t";
-static char __pyx_k_float64_t_int16_t_float64_t[] = "float64_t|int16_t|float64_t";
-static char __pyx_k_float64_t_int32_t_float32_t[] = "float64_t|int32_t|float32_t";
-static char __pyx_k_float64_t_int32_t_float64_t[] = "float64_t|int32_t|float64_t";
-static char __pyx_k_float64_t_int64_t_float32_t[] = "float64_t|int64_t|float32_t";
-static char __pyx_k_float64_t_int64_t_float64_t[] = "float64_t|int64_t|float64_t";
-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_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_The_LUT_and_weights_arrays_must[] = "The LUT and weights arrays must have the same number of elements.";
-static char __pyx_k_histo_range_error_expected_n_di[] = "<histo_range> error : expected {n_dims} sets of lower and upper bin edges, got the following instead : {histo_range}. (provided <sample> contains {n_dims}D values)";
-static char __pyx_k_histogramnd_returned_an_error_0[] = "histogramnd returned an error : {0}";
-static char __pyx_k_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/math/histogramnd/chistogramnd_lut.pyx";
-static char __pyx_k_n_bins_only_positive_values_all[] = "<n_bins> : only positive values allowed.";
-static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_At_least_one_of_the_following_pa[] = "At least one of the following parameters has to be provided : <shape> or <histo> or <weighted_histo>";
-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_Case_not_supported_weights_0_and[] = "Case not supported - weights:{0} and histo:{1}.";
-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_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_Provided_dtype_and_weighted_hist[] = "Provided <dtype> and <weighted_histo>'s dtype do not match.";
-static char __pyx_k_Provided_histo_array_doesn_t_hav[] = "Provided <histo> array doesn't have the expected type : should be {0} instead of {1}.";
-static char __pyx_k_The_histo_shape_does_not_matchth[] = "The <histo> shape does not matchthe <weighted_histo> shape.";
-static char __pyx_k_The_shape_value_does_not_matchth[] = "The <shape> value does not matchthe <histo> shape.";
-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_n_bins_must_be_either_a_scalar_s[] = "n_bins must be either a scalar (same number of bins for all dimensions) or an array (number of bins for each dimension).";
-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 char __pyx_k_The_shape_value_does_not_matchth_2[] = "The <shape> value does not matchthe <weighted_histo> shape.";
+static const char __pyx_k_N[] = "N";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_ex[] = "ex";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_np[] = "np";
+static const char __pyx_k_rc[] = "rc";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k__21[] = "()";
+static const char __pyx_k__23[] = "|";
+static const char __pyx_k_any[] = "any";
+static const char __pyx_k_end[] = "end";
+static const char __pyx_k_h_c[] = "h_c";
+static const char __pyx_k_lut[] = "lut";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_w_c[] = "w_c";
+static const char __pyx_k_zip[] = "zip";
+static const char __pyx_k_args[] = "args";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_file[] = "file";
+static const char __pyx_k_kind[] = "kind";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_prod[] = "prod";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_tile[] = "tile";
+static const char __pyx_k_type[] = "type";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_edges[] = "edges";
+static const char __pyx_k_equal[] = "equal";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_g_max[] = "g_max";
+static const char __pyx_k_g_min[] = "g_min";
+static const char __pyx_k_histo[] = "histo";
+static const char __pyx_k_i_dim[] = "i_dim";
+static const char __pyx_k_i_lut[] = "i_lut";
+static const char __pyx_k_int16[] = "int16";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_int64[] = "int64";
+static const char __pyx_k_lut_c[] = "lut_c";
+static const char __pyx_k_ndmin[] = "ndmin";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_o_lut[] = "o_lut";
+static const char __pyx_k_print[] = "print";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_split[] = "split";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_strip[] = "strip";
+static const char __pyx_k_w_h_c[] = "w_h_c";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_arange[] = "arange";
+static const char __pyx_k_double[] = "double";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_kwargs[] = "kwargs";
+static const char __pyx_k_n_bins[] = "n_bins";
+static const char __pyx_k_n_dims[] = "n_dims";
+static const char __pyx_k_n_elem[] = "n_elem";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_sample[] = "sample";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_uint32[] = "uint32";
+static const char __pyx_k_uint64[] = "uint64";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_bin_idx[] = "bin_idx";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_h_lut_c[] = "h_lut_c";
+static const char __pyx_k_histo_c[] = "histo_c";
+static const char __pyx_k_int16_t[] = "int16_t";
+static const char __pyx_k_int32_t[] = "int32_t";
+static const char __pyx_k_int64_t[] = "int64_t";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_lut_idx[] = "lut_idx";
+static const char __pyx_k_max_idx[] = "max_idx";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_ndarray[] = "ndarray";
+static const char __pyx_k_o_histo[] = "o_histo";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_rng_max[] = "rng_max";
+static const char __pyx_k_rng_min[] = "rng_min";
+static const char __pyx_k_s_shape[] = "s_shape";
+static const char __pyx_k_w_dtype[] = "w_dtype";
+static const char __pyx_k_weights[] = "weights";
+static const char __pyx_k_D_Naudet[] = "D. Naudet";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_defaults[] = "defaults";
+static const char __pyx_k_elem_idx[] = "elem_idx";
+static const char __pyx_k_i_n_bins[] = "i_n_bins";
+static const char __pyx_k_i_n_dims[] = "i_n_dims";
+static const char __pyx_k_i_sample[] = "i_sample";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_n_bins_c[] = "n_bins_c";
+static const char __pyx_k_sample_c[] = "sample_c";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_dim_edges[] = "dim_edges";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_float32_t[] = "float32_t";
+static const char __pyx_k_float64_t[] = "float64_t";
+static const char __pyx_k_histo_lut[] = "histo_lut";
+static const char __pyx_k_i_n_elems[] = "i_n_elems";
+static const char __pyx_k_i_weights[] = "i_weights";
+static const char __pyx_k_lut_dtype[] = "lut_dtype";
+static const char __pyx_k_15_05_2016[] = "15/05/2016";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_bins_range[] = "bins_range";
+static const char __pyx_k_elem_coord[] = "elem_coord";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_signatures[] = "signatures";
+static const char __pyx_k_weight_max[] = "weight_max";
+static const char __pyx_k_weight_min[] = "weight_min";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_histo_range[] = "histo_range";
+static const char __pyx_k_sample_type[] = "sample_type";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_i_weight_max[] = "i_weight_max";
+static const char __pyx_k_i_weight_min[] = "i_weight_min";
+static const char __pyx_k_newbyteorder[] = "newbyteorder";
+static const char __pyx_k_histo_range_c[] = "histo_range_c";
+static const char __pyx_k_i_histo_range[] = "i_histo_range";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_AttributeError[] = "AttributeError";
+static const char __pyx_k_weighted_histo[] = "weighted_histo";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_err_histo_range[] = "err_histo_range";
+static const char __pyx_k_int32_t_int16_t[] = "int32_t|int16_t";
+static const char __pyx_k_int32_t_int32_t[] = "int32_t|int32_t";
+static const char __pyx_k_int32_t_int64_t[] = "int32_t|int64_t";
+static const char __pyx_k_int64_t_int16_t[] = "int64_t|int16_t";
+static const char __pyx_k_int64_t_int32_t[] = "int64_t|int32_t";
+static const char __pyx_k_int64_t_int64_t[] = "int64_t|int64_t";
+static const char __pyx_k_last_bin_closed[] = "last_bin_closed";
+static const char __pyx_k_filt_max_weights[] = "filt_max_weights";
+static const char __pyx_k_filt_min_weights[] = "filt_min_weights";
+static const char __pyx_k_o_weighted_histo[] = "o_weighted_histo";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_float32_t_int16_t[] = "float32_t|int16_t";
+static const char __pyx_k_float32_t_int32_t[] = "float32_t|int32_t";
+static const char __pyx_k_float32_t_int64_t[] = "float32_t|int64_t";
+static const char __pyx_k_float64_t_int16_t[] = "float64_t|int16_t";
+static const char __pyx_k_float64_t_int32_t[] = "float64_t|int32_t";
+static const char __pyx_k_float64_t_int64_t[] = "float64_t|int64_t";
+static const char __pyx_k_i_filt_max_weights[] = "i_filt_max_weights";
+static const char __pyx_k_i_filt_min_weights[] = "i_filt_min_weights";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_histogramnd_get_lut[] = "histogramnd_get_lut";
+static const char __pyx_k_histogramnd_from_lut[] = "histogramnd_from_lut";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_int32_t_int16_t_int32_t[] = "int32_t|int16_t|int32_t";
+static const char __pyx_k_int32_t_int16_t_int64_t[] = "int32_t|int16_t|int64_t";
+static const char __pyx_k_int32_t_int32_t_int32_t[] = "int32_t|int32_t|int32_t";
+static const char __pyx_k_int32_t_int32_t_int64_t[] = "int32_t|int32_t|int64_t";
+static const char __pyx_k_int32_t_int64_t_int32_t[] = "int32_t|int64_t|int32_t";
+static const char __pyx_k_int32_t_int64_t_int64_t[] = "int32_t|int64_t|int64_t";
+static const char __pyx_k_int64_t_int16_t_int32_t[] = "int64_t|int16_t|int32_t";
+static const char __pyx_k_int64_t_int16_t_int64_t[] = "int64_t|int16_t|int64_t";
+static const char __pyx_k_int64_t_int32_t_int32_t[] = "int64_t|int32_t|int32_t";
+static const char __pyx_k_int64_t_int32_t_int64_t[] = "int64_t|int32_t|int64_t";
+static const char __pyx_k_int64_t_int64_t_int32_t[] = "int64_t|int64_t|int32_t";
+static const char __pyx_k_int64_t_int64_t_int64_t[] = "int64_t|int64_t|int64_t";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_float32_t_int16_t_int32_t[] = "float32_t|int16_t|int32_t";
+static const char __pyx_k_float32_t_int16_t_int64_t[] = "float32_t|int16_t|int64_t";
+static const char __pyx_k_float32_t_int32_t_int32_t[] = "float32_t|int32_t|int32_t";
+static const char __pyx_k_float32_t_int32_t_int64_t[] = "float32_t|int32_t|int64_t";
+static const char __pyx_k_float32_t_int64_t_int32_t[] = "float32_t|int64_t|int32_t";
+static const char __pyx_k_float32_t_int64_t_int64_t[] = "float32_t|int64_t|int64_t";
+static const char __pyx_k_float64_t_int16_t_int32_t[] = "float64_t|int16_t|int32_t";
+static const char __pyx_k_float64_t_int16_t_int64_t[] = "float64_t|int16_t|int64_t";
+static const char __pyx_k_float64_t_int32_t_int32_t[] = "float64_t|int32_t|int32_t";
+static const char __pyx_k_float64_t_int32_t_int64_t[] = "float64_t|int32_t|int64_t";
+static const char __pyx_k_float64_t_int64_t_int32_t[] = "float64_t|int64_t|int32_t";
+static const char __pyx_k_float64_t_int64_t_int64_t[] = "float64_t|int64_t|int64_t";
+static const char __pyx_k_histogramnd_get_lut_fused[] = "_histogramnd_get_lut_fused";
+static const char __pyx_k_int32_t_int16_t_float32_t[] = "int32_t|int16_t|float32_t";
+static const char __pyx_k_int32_t_int16_t_float64_t[] = "int32_t|int16_t|float64_t";
+static const char __pyx_k_int32_t_int32_t_float32_t[] = "int32_t|int32_t|float32_t";
+static const char __pyx_k_int32_t_int32_t_float64_t[] = "int32_t|int32_t|float64_t";
+static const char __pyx_k_int32_t_int64_t_float32_t[] = "int32_t|int64_t|float32_t";
+static const char __pyx_k_int32_t_int64_t_float64_t[] = "int32_t|int64_t|float64_t";
+static const char __pyx_k_int64_t_int16_t_float32_t[] = "int64_t|int16_t|float32_t";
+static const char __pyx_k_int64_t_int16_t_float64_t[] = "int64_t|int16_t|float64_t";
+static const char __pyx_k_int64_t_int32_t_float32_t[] = "int64_t|int32_t|float32_t";
+static const char __pyx_k_int64_t_int32_t_float64_t[] = "int64_t|int32_t|float64_t";
+static const char __pyx_k_int64_t_int64_t_float32_t[] = "int64_t|int64_t|float32_t";
+static const char __pyx_k_int64_t_int64_t_float64_t[] = "int64_t|int64_t|float64_t";
+static const char __pyx_k_histogramnd_from_lut_fused[] = "_histogramnd_from_lut_fused";
+static const char __pyx_k_silx_math_chistogramnd_lut[] = "silx.math.chistogramnd_lut";
+static const char __pyx_k_No_matching_signature_found[] = "No matching signature found";
+static const char __pyx_k_Type_not_supported_sample_0[] = "Type not supported - sample : {0}";
+static const char __pyx_k_float32_t_int16_t_float32_t[] = "float32_t|int16_t|float32_t";
+static const char __pyx_k_float32_t_int16_t_float64_t[] = "float32_t|int16_t|float64_t";
+static const char __pyx_k_float32_t_int32_t_float32_t[] = "float32_t|int32_t|float32_t";
+static const char __pyx_k_float32_t_int32_t_float64_t[] = "float32_t|int32_t|float64_t";
+static const char __pyx_k_float32_t_int64_t_float32_t[] = "float32_t|int64_t|float32_t";
+static const char __pyx_k_float32_t_int64_t_float64_t[] = "float32_t|int64_t|float64_t";
+static const char __pyx_k_float64_t_int16_t_float32_t[] = "float64_t|int16_t|float32_t";
+static const char __pyx_k_float64_t_int16_t_float64_t[] = "float64_t|int16_t|float64_t";
+static const char __pyx_k_float64_t_int32_t_float32_t[] = "float64_t|int32_t|float32_t";
+static const char __pyx_k_float64_t_int32_t_float64_t[] = "float64_t|int32_t|float64_t";
+static const char __pyx_k_float64_t_int64_t_float32_t[] = "float64_t|int64_t|float32_t";
+static const char __pyx_k_float64_t_int64_t_float64_t[] = "float64_t|int64_t|float64_t";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_The_LUT_and_weights_arrays_must[] = "The LUT and weights arrays must have the same number of elements.";
+static const char __pyx_k_histo_range_error_expected_n_di[] = "<histo_range> error : expected {n_dims} sets of lower and upper bin edges, got the following instead : {histo_range}. (provided <sample> contains {n_dims}D values)";
+static const char __pyx_k_histogramnd_returned_an_error_0[] = "histogramnd returned an error : {0}";
+static const char __pyx_k_n_bins_only_positive_values_all[] = "<n_bins> : only positive values allowed.";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/chistogramnd_lut.pyx";
+static const char __pyx_k_At_least_one_of_the_following_pa[] = "At least one of the following parameters has to be provided : <shape> or <histo> or <weighted_histo>";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Case_not_supported_weights_0_and[] = "Case not supported - weights:{0} and histo:{1}.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_Provided_dtype_and_weighted_hist[] = "Provided <dtype> and <weighted_histo>'s dtype do not match.";
+static const char __pyx_k_Provided_histo_array_doesn_t_hav[] = "Provided <histo> array doesn't have the expected type : should be {0} instead of {1}.";
+static const char __pyx_k_The_histo_shape_does_not_matchth[] = "The <histo> shape does not matchthe <weighted_histo> shape.";
+static const char __pyx_k_The_shape_value_does_not_matchth[] = "The <shape> value does not matchthe <histo> shape.";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_n_bins_must_be_either_a_scalar_s[] = "n_bins must be either a scalar (same number of bins for all dimensions) or an array (number of bins for each dimension).";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static const char __pyx_k_The_shape_value_does_not_matchth_2[] = "The <shape> value does not matchthe <weighted_histo> shape.";
static PyObject *__pyx_kp_s_15_05_2016;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_At_least_one_of_the_following_pa;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
@@ -2029,7 +2340,6 @@ static PyObject *__pyx_kp_s_Case_not_supported_weights_0_and;
static PyObject *__pyx_kp_s_D_Naudet;
static PyObject *__pyx_n_s_Ellipsis;
static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
-static PyObject *__pyx_n_s_Exception;
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;
@@ -2043,6 +2353,7 @@ 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_n_s_N;
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;
@@ -2058,8 +2369,8 @@ static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Type_not_supported_sample_0;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
static PyObject *__pyx_n_s_ValueError;
-static PyObject *__pyx_kp_s__14;
-static PyObject *__pyx_kp_s__16;
+static PyObject *__pyx_kp_s__21;
+static PyObject *__pyx_kp_s__23;
static PyObject *__pyx_n_s_allocate_buffer;
static PyObject *__pyx_n_s_any;
static PyObject *__pyx_n_s_arange;
@@ -2072,7 +2383,6 @@ static PyObject *__pyx_n_s_bin_idx;
static PyObject *__pyx_n_s_bins_range;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
-static PyObject *__pyx_n_s_chistogramnd_lut;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
@@ -2085,6 +2395,7 @@ static PyObject *__pyx_n_s_dtype_is_object;
static PyObject *__pyx_n_s_edges;
static PyObject *__pyx_n_s_elem_coord;
static PyObject *__pyx_n_s_elem_idx;
+static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_equal;
@@ -2210,7 +2521,6 @@ static PyObject *__pyx_n_s_lut_idx;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max_idx;
static PyObject *__pyx_n_s_memview;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_n_bins;
static PyObject *__pyx_n_s_n_bins_c;
@@ -2225,13 +2535,15 @@ 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_ndmin;
+static PyObject *__pyx_n_s_newbyteorder;
static PyObject *__pyx_n_s_np;
static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_o_histo;
static PyObject *__pyx_n_s_o_lut;
static PyObject *__pyx_n_s_o_weighted_histo;
static PyObject *__pyx_n_s_obj;
-static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_prod;
@@ -2248,6 +2560,7 @@ static PyObject *__pyx_n_s_sample_c;
static PyObject *__pyx_n_s_sample_type;
static PyObject *__pyx_n_s_shape;
static PyObject *__pyx_n_s_signatures;
+static PyObject *__pyx_n_s_silx_math_chistogramnd_lut;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_start;
@@ -2267,6 +2580,7 @@ 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_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_w_c;
static PyObject *__pyx_n_s_w_dtype;
static PyObject *__pyx_n_s_w_h_c;
@@ -2274,9 +2588,110 @@ static PyObject *__pyx_n_s_weight_max;
static PyObject *__pyx_n_s_weight_min;
static PyObject *__pyx_n_s_weighted_histo;
static PyObject *__pyx_n_s_weights;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zeros;
static PyObject *__pyx_n_s_zip;
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_histo_lut, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused(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_4silx_4math_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused(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_4silx_4math_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* proto */
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed); /* 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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
@@ -2284,29 +2699,29 @@ static PyObject *__pyx_int_32768;
static PyObject *__pyx_int_2147483648;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
-static PyObject *__pyx_slice__7;
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__37;
-static PyObject *__pyx_slice__38;
-static PyObject *__pyx_slice__39;
-static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_slice__10;
+static PyObject *__pyx_slice__49;
+static PyObject *__pyx_slice__50;
+static PyObject *__pyx_slice__51;
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__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;
@@ -2320,22 +2735,34 @@ static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
+static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
+static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__50;
-static PyObject *__pyx_tuple__51;
+static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_codeobj__42;
-static PyObject *__pyx_codeobj__44;
-static PyObject *__pyx_codeobj__46;
-static PyObject *__pyx_codeobj__48;
-
-/* "chistogramnd_lut.pyx":58
+static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__57;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_tuple__63;
+static PyObject *__pyx_tuple__64;
+static PyObject *__pyx_tuple__65;
+static PyObject *__pyx_codeobj__54;
+static PyObject *__pyx_codeobj__56;
+static PyObject *__pyx_codeobj__58;
+static PyObject *__pyx_codeobj__60;
+
+/* "silx/math/chistogramnd_lut.pyx":58
*
*
* def histogramnd_get_lut(sample, # <<<<<<<<<<<<<<
@@ -2344,17 +2771,14 @@ static PyObject *__pyx_codeobj__48;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_16chistogramnd_lut_histogramnd_get_lut[] = "histogramnd_get_lut(sample, histo_range, n_bins, last_bin_closed=False)\nTBD\n\n :param sample:\n The data to be histogrammed.\n Its shape must be either (N,) if it contains one dimensional\n coordinates, or an (N, D) array where the rows are the\n coordinates of points in a D dimensional space.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n :type sample: :class:`numpy.array`\n\n :param histo_range:\n A (N, 2) array containing the histogram range along each dimension,\n where N is the sample's number of dimensions.\n :type histo_range: array_like\n\n :param n_bins:\n The number of bins :\n * a scalar (same number of bins for all dimensions)\n * a D elements array (number of bins for each dimensions)\n :type n_bins: scalar or array_like\n\n :param last_bin_closed:\n By default the last bin is half\n open (i.e.: [x,y) ; x included, y\n excluded), like all the other bins.\n Set this parameter to true if you want\n the LAST bin to be closed.\n :type last_bin_closed: *optional*, :class:`python.boolean`\n\n :return: The indices for each sample and the histogram (bin counts).\n :rtype: tuple : (:class:`numpy.array`, :class:`numpy.array`)\n ";
-static PyMethodDef __pyx_mdef_16chistogramnd_lut_1histogramnd_get_lut = {"histogramnd_get_lut", (PyCFunction)__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_histogramnd_get_lut};
-static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_16chistogramnd_lut_histogramnd_get_lut[] = "histogramnd_get_lut(sample, histo_range, n_bins, last_bin_closed=False)\nTBD\n\n :param sample:\n The data to be histogrammed.\n Its shape must be either (N,) if it contains one dimensional\n coordinates, or an (N, D) array where the rows are the\n coordinates of points in a D dimensional space.\n The following dtypes are supported : :class:`numpy.float64`,\n :class:`numpy.float32`, :class:`numpy.int32`.\n :type sample: :class:`numpy.array`\n\n :param histo_range:\n A (N, 2) array containing the histogram range along each dimension,\n where N is the sample's number of dimensions.\n :type histo_range: array_like\n\n :param n_bins:\n The number of bins :\n * a scalar (same number of bins for all dimensions)\n * a D elements array (number of bins for each dimensions)\n :type n_bins: scalar or array_like\n\n :param last_bin_closed:\n By default the last bin is half\n open (i.e.: [x,y) ; x included, y\n excluded), like all the other bins.\n Set this parameter to true if you want\n the LAST bin to be closed.\n :type last_bin_closed: *optional*, :class:`python.boolean`\n\n :return: The indices for each sample and the histogram (bin counts).\n :rtype: tuple : (:class:`numpy.array`, :class:`numpy.array`)\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_16chistogramnd_lut_1histogramnd_get_lut = {"histogramnd_get_lut", (PyCFunction)__pyx_pw_4silx_4math_16chistogramnd_lut_1histogramnd_get_lut, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_histogramnd_get_lut};
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_sample = 0;
PyObject *__pyx_v_histo_range = 0;
PyObject *__pyx_v_n_bins = 0;
PyObject *__pyx_v_last_bin_closed = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("histogramnd_get_lut (wrapper)", 0);
@@ -2362,7 +2786,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__py
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sample,&__pyx_n_s_histo_range,&__pyx_n_s_n_bins,&__pyx_n_s_last_bin_closed,0};
PyObject* values[4] = {0,0,0,0};
- /* "chistogramnd_lut.pyx":61
+ /* "silx/math/chistogramnd_lut.pyx":61
* histo_range,
* n_bins,
* last_bin_closed=False): # <<<<<<<<<<<<<<
@@ -2389,12 +2813,12 @@ static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__py
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, 1); __PYX_ERR(0, 58, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, 2); __PYX_ERR(0, 58, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -2403,7 +2827,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histogramnd_get_lut") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histogramnd_get_lut") < 0)) __PYX_ERR(0, 58, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -2422,15 +2846,15 @@ static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("histogramnd_get_lut", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 58, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_histogramnd_get_lut(__pyx_self, __pyx_v_sample, __pyx_v_histo_range, __pyx_v_n_bins, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_histogramnd_get_lut(__pyx_self, __pyx_v_sample, __pyx_v_histo_range, __pyx_v_n_bins, __pyx_v_last_bin_closed);
- /* "chistogramnd_lut.pyx":58
+ /* "silx/math/chistogramnd_lut.pyx":58
*
*
* def histogramnd_get_lut(sample, # <<<<<<<<<<<<<<
@@ -2443,7 +2867,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_1histogramnd_get_lut(PyObject *__py
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_sample, PyObject *__pyx_v_histo_range, PyObject *__pyx_v_n_bins, PyObject *__pyx_v_last_bin_closed) {
PyObject *__pyx_v_s_shape = NULL;
PyObject *__pyx_v_n_dims = NULL;
PyObject *__pyx_v_i_histo_range = NULL;
@@ -2453,6 +2877,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
PyObject *__pyx_v_lut_dtype = NULL;
PyObject *__pyx_v_lut = NULL;
PyObject *__pyx_v_histo = NULL;
+ PyObject *__pyx_v_dtype = NULL;
PyObject *__pyx_v_sample_c = NULL;
PyObject *__pyx_v_histo_range_c = NULL;
PyObject *__pyx_v_n_bins_c = NULL;
@@ -2474,47 +2899,44 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
PyObject *__pyx_t_5 = NULL;
int __pyx_t_6;
int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_8;
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
- int __pyx_t_14;
+ PyObject *__pyx_t_14 = NULL;
PyObject *(*__pyx_t_15)(PyObject *);
int __pyx_t_16;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("histogramnd_get_lut", 0);
__Pyx_INCREF(__pyx_v_histo_range);
__Pyx_INCREF(__pyx_v_n_bins);
- /* "chistogramnd_lut.pyx":96
+ /* "silx/math/chistogramnd_lut.pyx":96
* """
*
* s_shape = sample.shape # <<<<<<<<<<<<<<
*
* n_dims = 1 if len(s_shape) == 1 else s_shape[1]
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_s_shape = __pyx_t_1;
__pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":98
+ /* "silx/math/chistogramnd_lut.pyx":98
* s_shape = sample.shape
*
* n_dims = 1 if len(s_shape) == 1 else s_shape[1] # <<<<<<<<<<<<<<
*
* # just in case those arent numpy arrays
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_s_shape); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_s_shape); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 98, __pyx_L1_error)
if (((__pyx_t_2 == 1) != 0)) {
__Pyx_INCREF(__pyx_int_1);
__pyx_t_1 = __pyx_int_1;
} else {
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_s_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_1 = __pyx_t_3;
__pyx_t_3 = 0;
@@ -2522,7 +2944,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__pyx_v_n_dims = __pyx_t_1;
__pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":103
+ /* "silx/math/chistogramnd_lut.pyx":103
* # (this allows the user to provide native python lists,
* # => easier for testing)
* i_histo_range = histo_range # <<<<<<<<<<<<<<
@@ -2532,20 +2954,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__Pyx_INCREF(__pyx_v_histo_range);
__pyx_v_i_histo_range = __pyx_v_histo_range;
- /* "chistogramnd_lut.pyx":104
+ /* "silx/math/chistogramnd_lut.pyx":104
* # => easier for testing)
* i_histo_range = histo_range
* histo_range = np.array(histo_range) # <<<<<<<<<<<<<<
* err_histo_range = False
*
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -2555,24 +2977,42 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_histo_range); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_histo_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_INCREF(__pyx_v_histo_range);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_histo_range);
- __Pyx_GIVEREF(__pyx_v_histo_range);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_histo_range};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_histo_range};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(__pyx_v_histo_range);
+ __Pyx_GIVEREF(__pyx_v_histo_range);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_histo_range);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_histo_range, __pyx_t_1);
__pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":105
+ /* "silx/math/chistogramnd_lut.pyx":105
* i_histo_range = histo_range
* histo_range = np.array(histo_range)
* err_histo_range = False # <<<<<<<<<<<<<<
@@ -2581,115 +3021,132 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
*/
__pyx_v_err_histo_range = 0;
- /* "chistogramnd_lut.pyx":107
+ /* "silx/math/chistogramnd_lut.pyx":107
* err_histo_range = False
*
* if n_dims == 1: # <<<<<<<<<<<<<<
* if histo_range.shape == (2,):
* pass
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n_dims, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 107, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":108
+ /* "silx/math/chistogramnd_lut.pyx":108
*
* if n_dims == 1:
* if histo_range.shape == (2,): # <<<<<<<<<<<<<<
* pass
* elif histo_range.shape == (1, 2):
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple_, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_tuple_, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
goto __pyx_L4;
}
- /* "chistogramnd_lut.pyx":110
+ /* "silx/math/chistogramnd_lut.pyx":110
* if histo_range.shape == (2,):
* pass
* elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
* histo_range.reshape(-1)
* else:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_tuple__2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_tuple__2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":111
+ /* "silx/math/chistogramnd_lut.pyx":111
* pass
* elif histo_range.shape == (1, 2):
* histo_range.reshape(-1) # <<<<<<<<<<<<<<
* else:
* err_histo_range = True
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":110
+ * if histo_range.shape == (2,):
+ * pass
+ * elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
+ * histo_range.reshape(-1)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":113
+ /* "silx/math/chistogramnd_lut.pyx":113
* histo_range.reshape(-1)
* else:
* err_histo_range = True # <<<<<<<<<<<<<<
* elif n_dims != 1 and histo_range.shape != (n_dims, 2):
* err_histo_range = True
*/
+ /*else*/ {
__pyx_v_err_histo_range = 1;
}
__pyx_L4:;
+
+ /* "silx/math/chistogramnd_lut.pyx":107
+ * err_histo_range = False
+ *
+ * if n_dims == 1: # <<<<<<<<<<<<<<
+ * if histo_range.shape == (2,):
+ * pass
+ */
goto __pyx_L3;
}
- /* "chistogramnd_lut.pyx":114
+ /* "silx/math/chistogramnd_lut.pyx":114
* else:
* err_histo_range = True
* elif n_dims != 1 and histo_range.shape != (n_dims, 2): # <<<<<<<<<<<<<<
* err_histo_range = True
*
*/
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_n_dims, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L5_bool_binop_done;
}
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n_dims);
__Pyx_INCREF(__pyx_int_2);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_2);
__Pyx_GIVEREF(__pyx_int_2);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_2);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __pyx_t_7;
__pyx_L5_bool_binop_done:;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":115
+ /* "silx/math/chistogramnd_lut.pyx":115
* err_histo_range = True
* elif n_dims != 1 and histo_range.shape != (n_dims, 2):
* err_histo_range = True # <<<<<<<<<<<<<<
@@ -2697,11 +3154,18 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
* if err_histo_range:
*/
__pyx_v_err_histo_range = 1;
- goto __pyx_L3;
+
+ /* "silx/math/chistogramnd_lut.pyx":114
+ * else:
+ * err_histo_range = True
+ * elif n_dims != 1 and histo_range.shape != (n_dims, 2): # <<<<<<<<<<<<<<
+ * err_histo_range = True
+ *
+ */
}
__pyx_L3:;
- /* "chistogramnd_lut.pyx":117
+ /* "silx/math/chistogramnd_lut.pyx":117
* err_histo_range = True
*
* if err_histo_range: # <<<<<<<<<<<<<<
@@ -2711,74 +3175,82 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__pyx_t_6 = (__pyx_v_err_histo_range != 0);
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":123
+ /* "silx/math/chistogramnd_lut.pyx":123
* '(provided <sample> contains '
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range, # <<<<<<<<<<<<<<
* n_dims=n_dims))
*
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histo_range_error_expected_n_di, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histo_range_error_expected_n_di, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_histo_range, __pyx_v_i_histo_range) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_histo_range, __pyx_v_i_histo_range) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":124
+ /* "silx/math/chistogramnd_lut.pyx":124
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range,
* n_dims=n_dims)) # <<<<<<<<<<<<<<
*
* histo_range = np.double(histo_range)
*/
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n_dims, __pyx_v_n_dims) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_n_dims, __pyx_v_n_dims) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":123
+ /* "silx/math/chistogramnd_lut.pyx":123
* '(provided <sample> contains '
* '{n_dims}D values)'
* ''.format(histo_range=i_histo_range, # <<<<<<<<<<<<<<
* n_dims=n_dims))
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":118
+ /* "silx/math/chistogramnd_lut.pyx":118
*
* if err_histo_range:
* raise ValueError('<histo_range> error : expected {n_dims} sets of ' # <<<<<<<<<<<<<<
* 'lower and upper bin edges, '
* 'got the following instead : {histo_range}. '
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 118, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":117
+ * err_histo_range = True
+ *
+ * if err_histo_range: # <<<<<<<<<<<<<<
+ * raise ValueError('<histo_range> error : expected {n_dims} sets of '
+ * 'lower and upper bin edges, '
+ */
}
- /* "chistogramnd_lut.pyx":126
+ /* "silx/math/chistogramnd_lut.pyx":126
* n_dims=n_dims))
*
* histo_range = np.double(histo_range) # <<<<<<<<<<<<<<
*
* # checking n_bins size
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_double); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -2788,44 +3260,62 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
}
}
if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_histo_range); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_histo_range); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __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 = NULL;
- __Pyx_INCREF(__pyx_v_histo_range);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_histo_range);
- __Pyx_GIVEREF(__pyx_v_histo_range);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_histo_range};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_histo_range};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_histo_range);
+ __Pyx_GIVEREF(__pyx_v_histo_range);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_histo_range);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_histo_range, __pyx_t_4);
__pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":129
+ /* "silx/math/chistogramnd_lut.pyx":129
*
* # checking n_bins size
* n_bins = np.array(n_bins, ndmin=1) # <<<<<<<<<<<<<<
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims)
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_bins);
__Pyx_GIVEREF(__pyx_v_n_bins);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_bins);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ndmin, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ndmin, __pyx_int_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2833,548 +3323,679 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__Pyx_DECREF_SET(__pyx_v_n_bins, __pyx_t_1);
__pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":130
+ /* "silx/math/chistogramnd_lut.pyx":130
* # checking n_bins size
* n_bins = np.array(n_bins, ndmin=1)
* if len(n_bins) == 1: # <<<<<<<<<<<<<<
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_n_bins); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_v_n_bins); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 130, __pyx_L1_error)
__pyx_t_6 = ((__pyx_t_2 == 1) != 0);
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":131
+ /* "silx/math/chistogramnd_lut.pyx":131
* n_bins = np.array(n_bins, ndmin=1)
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims) # <<<<<<<<<<<<<<
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number '
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tile); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tile); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- __pyx_t_2 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_4, function);
- __pyx_t_2 = 1;
+ __pyx_t_8 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_n_bins, __pyx_v_n_dims};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_n_bins, __pyx_v_n_dims};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_n_bins);
+ __Pyx_GIVEREF(__pyx_v_n_bins);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_n_bins);
+ __Pyx_INCREF(__pyx_v_n_dims);
+ __Pyx_GIVEREF(__pyx_v_n_dims);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_n_dims);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_2, __pyx_v_n_bins);
- __Pyx_GIVEREF(__pyx_v_n_bins);
- __Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_2, __pyx_v_n_dims);
- __Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF_SET(__pyx_v_n_bins, __pyx_t_1);
__pyx_t_1 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":130
+ * # checking n_bins size
+ * n_bins = np.array(n_bins, ndmin=1)
+ * if len(n_bins) == 1: # <<<<<<<<<<<<<<
+ * n_bins = np.tile(n_bins, n_dims)
+ * elif n_bins.shape != (n_dims,):
+ */
goto __pyx_L8;
}
- /* "chistogramnd_lut.pyx":132
+ /* "silx/math/chistogramnd_lut.pyx":132
* if len(n_bins) == 1:
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,): # <<<<<<<<<<<<<<
* raise ValueError('n_bins must be either a scalar (same number '
* 'of bins for all dimensions) or '
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_n_dims);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":133
+ /* "silx/math/chistogramnd_lut.pyx":133
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number ' # <<<<<<<<<<<<<<
* 'of bins for all dimensions) or '
* 'an array (number of bins for each '
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 133, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":132
+ * if len(n_bins) == 1:
+ * n_bins = np.tile(n_bins, n_dims)
+ * elif n_bins.shape != (n_dims,): # <<<<<<<<<<<<<<
+ * raise ValueError('n_bins must be either a scalar (same number '
+ * 'of bins for all dimensions) or '
+ */
}
__pyx_L8:;
- /* "chistogramnd_lut.pyx":141
+ /* "silx/math/chistogramnd_lut.pyx":141
* # exception is thrown when calling np.zeros
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0): # <<<<<<<<<<<<<<
* raise ValueError('<n_bins> : only positive values allowed.')
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_any); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_equal); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_equal); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- __pyx_t_2 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- __pyx_t_2 = 1;
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_n_bins, Py_None};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_n_bins, Py_None};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_n_bins);
+ __Pyx_GIVEREF(__pyx_v_n_bins);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_n_bins);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, Py_None);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- __Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_2, __pyx_v_n_bins);
- __Pyx_GIVEREF(__pyx_v_n_bins);
- __Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_2, Py_None);
- __Pyx_GIVEREF(Py_None);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_8)) {
+ __pyx_t_9 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_9)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_1, function);
}
}
- if (!__pyx_t_8) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_9) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_4};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_4};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (!__pyx_t_7) {
} else {
__pyx_t_6 = __pyx_t_7;
goto __pyx_L10_bool_binop_done;
}
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_bins, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_v_n_bins, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
}
}
if (!__pyx_t_4) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_6 = __pyx_t_7;
__pyx_L10_bool_binop_done:;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":142
+ /* "silx/math/chistogramnd_lut.pyx":142
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0):
* raise ValueError('<n_bins> : only positive values allowed.') # <<<<<<<<<<<<<<
*
* sample_type = sample.dtype
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_Raise(__pyx_t_5, 0, 0, 0);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 142, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":141
+ * # exception is thrown when calling np.zeros
+ * # also testing for negative/null values
+ * if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0): # <<<<<<<<<<<<<<
+ * raise ValueError('<n_bins> : only positive values allowed.')
+ *
+ */
}
- /* "chistogramnd_lut.pyx":144
+ /* "silx/math/chistogramnd_lut.pyx":144
* raise ValueError('<n_bins> : only positive values allowed.')
*
* sample_type = sample.dtype # <<<<<<<<<<<<<<
*
* n_elem = sample.size // n_dims
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_v_sample_type = __pyx_t_5;
__pyx_t_5 = 0;
- /* "chistogramnd_lut.pyx":146
+ /* "silx/math/chistogramnd_lut.pyx":146
* sample_type = sample.dtype
*
* n_elem = sample.size // n_dims # <<<<<<<<<<<<<<
*
* if n_bins.prod(dtype=np.uint64) < 2**15:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PyNumber_FloorDivide(__pyx_t_5, __pyx_v_n_dims); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyNumber_FloorDivide(__pyx_t_5, __pyx_v_n_dims); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_n_elem = __pyx_t_9;
- __pyx_t_9 = 0;
+ __pyx_v_n_elem = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":148
+ /* "silx/math/chistogramnd_lut.pyx":148
* n_elem = sample.size // n_dims
*
* if n_bins.prod(dtype=np.uint64) < 2**15: # <<<<<<<<<<<<<<
* lut_dtype = np.int16
* elif n_bins.prod(dtype=np.uint64) < 2**31:
*/
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_prod); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_prod); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 148, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 148, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_int_32768, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":149
+ /* "silx/math/chistogramnd_lut.pyx":149
*
* if n_bins.prod(dtype=np.uint64) < 2**15:
* lut_dtype = np.int16 # <<<<<<<<<<<<<<
* elif n_bins.prod(dtype=np.uint64) < 2**31:
* lut_dtype = np.int32
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_lut_dtype = __pyx_t_1;
__pyx_t_1 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":148
+ * n_elem = sample.size // n_dims
+ *
+ * if n_bins.prod(dtype=np.uint64) < 2**15: # <<<<<<<<<<<<<<
+ * lut_dtype = np.int16
+ * elif n_bins.prod(dtype=np.uint64) < 2**31:
+ */
goto __pyx_L12;
}
- /* "chistogramnd_lut.pyx":150
+ /* "silx/math/chistogramnd_lut.pyx":150
* if n_bins.prod(dtype=np.uint64) < 2**15:
* lut_dtype = np.int16
* elif n_bins.prod(dtype=np.uint64) < 2**31: # <<<<<<<<<<<<<<
* lut_dtype = np.int32
- * else:
+ *
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_prod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_uint64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, __pyx_int_2147483648, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_int_2147483648, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":151
+ /* "silx/math/chistogramnd_lut.pyx":151
* lut_dtype = np.int16
* elif n_bins.prod(dtype=np.uint64) < 2**31:
* lut_dtype = np.int32 # <<<<<<<<<<<<<<
+ *
* else:
- * lut_dtype = np.int64
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_lut_dtype = __pyx_t_8;
- __pyx_t_8 = 0;
+ __pyx_v_lut_dtype = __pyx_t_9;
+ __pyx_t_9 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":150
+ * if n_bins.prod(dtype=np.uint64) < 2**15:
+ * lut_dtype = np.int16
+ * elif n_bins.prod(dtype=np.uint64) < 2**31: # <<<<<<<<<<<<<<
+ * lut_dtype = np.int32
+ *
+ */
goto __pyx_L12;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":153
- * lut_dtype = np.int32
+ /* "silx/math/chistogramnd_lut.pyx":154
+ *
* else:
* lut_dtype = np.int64 # <<<<<<<<<<<<<<
*
* # allocating the output arrays
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_lut_dtype = __pyx_t_5;
__pyx_t_5 = 0;
}
__pyx_L12:;
- /* "chistogramnd_lut.pyx":156
+ /* "silx/math/chistogramnd_lut.pyx":157
*
* # allocating the output arrays
* lut = np.zeros(n_elem, dtype=lut_dtype) # <<<<<<<<<<<<<<
* histo = np.zeros(n_bins, dtype=np.uint32)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__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 = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_n_elem);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_n_elem);
__Pyx_GIVEREF(__pyx_v_n_elem);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_n_elem);
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_lut_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __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_1, __pyx_n_s_dtype, __pyx_v_lut_dtype) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_lut = __pyx_t_9;
- __pyx_t_9 = 0;
+ __pyx_v_lut = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":157
+ /* "silx/math/chistogramnd_lut.pyx":158
* # allocating the output arrays
* lut = np.zeros(n_elem, dtype=lut_dtype)
* histo = np.zeros(n_bins, dtype=np.uint32) # <<<<<<<<<<<<<<
*
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ * dtype = sample.dtype.newbyteorder("N")
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __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 = 157; __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_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_n_bins);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_n_bins);
__Pyx_GIVEREF(__pyx_v_n_bins);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_n_bins);
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_histo = __pyx_t_4;
__pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":159
+ /* "silx/math/chistogramnd_lut.pyx":160
* histo = np.zeros(n_bins, dtype=np.uint32)
*
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,))) # <<<<<<<<<<<<<<
- *
- * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)))
+ * dtype = sample.dtype.newbyteorder("N") # <<<<<<<<<<<<<<
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ * dtype=dtype)
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
- __Pyx_GIVEREF(__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_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __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;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); 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_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_9, function);
- }
- }
- if (!__pyx_t_1) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_sample_c = __pyx_t_4;
+ __pyx_v_dtype = __pyx_t_4;
__pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":161
- * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":161
*
- * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,))) # <<<<<<<<<<<<<<
+ * dtype = sample.dtype.newbyteorder("N")
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)), # <<<<<<<<<<<<<<
+ * dtype=dtype)
*
- * n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sample, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __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 = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
__pyx_t_1 = 0;
__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 (CYTHON_UNPACK_METHODS && 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_5);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
}
}
if (!__pyx_t_1) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_9};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_9};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":162
+ * dtype = sample.dtype.newbyteorder("N")
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ * dtype=dtype) # <<<<<<<<<<<<<<
+ *
+ * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
+ */
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":161
+ *
+ * dtype = sample.dtype.newbyteorder("N")
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)), # <<<<<<<<<<<<<<
+ * dtype=dtype)
+ *
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_sample_c = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":164
+ * dtype=dtype)
+ *
+ * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo_range.dtype.newbyteorder("N"))
+ *
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -3384,132 +4005,256 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
}
}
if (!__pyx_t_5) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- 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+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_9};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_v_histo_range_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
+ __pyx_t_3 = 0;
- /* "chistogramnd_lut.pyx":163
- * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":165
+ *
+ * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
+ * dtype=histo_range.dtype.newbyteorder("N")) # <<<<<<<<<<<<<<
+ *
+ * n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
+ */
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 165, __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__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":164
+ * dtype=dtype)
+ *
+ * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo_range.dtype.newbyteorder("N"))
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_histo_range_c = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":167
+ * dtype=histo_range.dtype.newbyteorder("N"))
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)), # <<<<<<<<<<<<<<
* dtype=np.int32)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_n_bins, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(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_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
+ __Pyx_DECREF_SET(__pyx_t_10, function);
}
}
- if (!__pyx_t_9) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_GOTREF(__pyx_t_4);
+ if (!__pyx_t_4) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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 = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9); __Pyx_GIVEREF(__pyx_t_9); __pyx_t_9 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 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 = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":164
+ /* "silx/math/chistogramnd_lut.pyx":168
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
* dtype=np.int32) # <<<<<<<<<<<<<<
*
* lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":163
- * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":167
+ * dtype=histo_range.dtype.newbyteorder("N"))
*
* n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)), # <<<<<<<<<<<<<<
* dtype=np.int32)
*
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_n_bins_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_n_bins_c = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":166
+ /* "silx/math/chistogramnd_lut.pyx":170
* dtype=np.int32)
*
* lut_c = np.ascontiguousarray(lut.reshape((lut.size,))) # <<<<<<<<<<<<<<
- * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)))
- *
+ * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ * dtype=histo.dtype.newbyteorder('N'))
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_lut, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_lut, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __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_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
@@ -3519,128 +4264,154 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
}
}
if (!__pyx_t_3) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- }
- }
- if (!__pyx_t_10) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
- PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_1};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_lut_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_v_lut_c = __pyx_t_9;
+ __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":167
+ /* "silx/math/chistogramnd_lut.pyx":171
*
* lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
- * histo_c = np.ascontiguousarray(histo.reshape((histo.size,))) # <<<<<<<<<<<<<<
+ * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo.dtype.newbyteorder('N'))
*
- * rc = 0
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_10);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
}
}
- if (!__pyx_t_10) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ if (!__pyx_t_1) {
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- }
- }
- if (!__pyx_t_4) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_histo_c = __pyx_t_5;
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9);
+ __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":169
- * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":172
+ * lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
+ * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ * dtype=histo.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":171
+ *
+ * lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
+ * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo.dtype.newbyteorder('N'))
+ *
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_11, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_histo_c = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":174
+ * dtype=histo.dtype.newbyteorder('N'))
*
* rc = 0 # <<<<<<<<<<<<<<
*
@@ -3649,7 +4420,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__Pyx_INCREF(__pyx_int_0);
__pyx_v_rc = __pyx_int_0;
- /* "chistogramnd_lut.pyx":171
+ /* "silx/math/chistogramnd_lut.pyx":176
* rc = 0
*
* try: # <<<<<<<<<<<<<<
@@ -3657,493 +4428,617 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
* n_dims,
*/
{
- __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
- __Pyx_XGOTREF(__pyx_t_11);
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_14);
/*try:*/ {
- /* "chistogramnd_lut.pyx":172
+ /* "silx/math/chistogramnd_lut.pyx":177
*
* try:
* rc = _histogramnd_get_lut_fused(sample_c, # <<<<<<<<<<<<<<
* n_dims,
* n_elem,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_histogramnd_get_lut_fused); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_histogramnd_get_lut_fused); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 177, __pyx_L13_error)
+ __Pyx_GOTREF(__pyx_t_9);
- /* "chistogramnd_lut.pyx":179
+ /* "silx/math/chistogramnd_lut.pyx":184
* lut_c,
* histo_c,
* last_bin_closed) # <<<<<<<<<<<<<<
* except TypeError as ex:
* raise TypeError('Type not supported - sample : {0}'
*/
- __pyx_t_3 = NULL;
- __pyx_t_2 = 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_t_11 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_11)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
- __pyx_t_2 = 1;
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_8 = PyTuple_New(8+__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_3) {
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[9] = {__pyx_t_11, __pyx_v_sample_c, __pyx_v_n_dims, __pyx_v_n_elem, __pyx_v_histo_range_c, __pyx_v_n_bins_c, __pyx_v_lut_c, __pyx_v_histo_c, __pyx_v_last_bin_closed};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L13_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[9] = {__pyx_t_11, __pyx_v_sample_c, __pyx_v_n_dims, __pyx_v_n_elem, __pyx_v_histo_range_c, __pyx_v_n_bins_c, __pyx_v_lut_c, __pyx_v_histo_c, __pyx_v_last_bin_closed};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 8+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L13_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(8+__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 177, __pyx_L13_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_11) {
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_sample_c);
+ __Pyx_GIVEREF(__pyx_v_sample_c);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_8, __pyx_v_sample_c);
+ __Pyx_INCREF(__pyx_v_n_dims);
+ __Pyx_GIVEREF(__pyx_v_n_dims);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_8, __pyx_v_n_dims);
+ __Pyx_INCREF(__pyx_v_n_elem);
+ __Pyx_GIVEREF(__pyx_v_n_elem);
+ PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_8, __pyx_v_n_elem);
+ __Pyx_INCREF(__pyx_v_histo_range_c);
+ __Pyx_GIVEREF(__pyx_v_histo_range_c);
+ PyTuple_SET_ITEM(__pyx_t_10, 3+__pyx_t_8, __pyx_v_histo_range_c);
+ __Pyx_INCREF(__pyx_v_n_bins_c);
+ __Pyx_GIVEREF(__pyx_v_n_bins_c);
+ PyTuple_SET_ITEM(__pyx_t_10, 4+__pyx_t_8, __pyx_v_n_bins_c);
+ __Pyx_INCREF(__pyx_v_lut_c);
+ __Pyx_GIVEREF(__pyx_v_lut_c);
+ PyTuple_SET_ITEM(__pyx_t_10, 5+__pyx_t_8, __pyx_v_lut_c);
+ __Pyx_INCREF(__pyx_v_histo_c);
+ __Pyx_GIVEREF(__pyx_v_histo_c);
+ PyTuple_SET_ITEM(__pyx_t_10, 6+__pyx_t_8, __pyx_v_histo_c);
+ __Pyx_INCREF(__pyx_v_last_bin_closed);
+ __Pyx_GIVEREF(__pyx_v_last_bin_closed);
+ PyTuple_SET_ITEM(__pyx_t_10, 7+__pyx_t_8, __pyx_v_last_bin_closed);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L13_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- __Pyx_INCREF(__pyx_v_sample_c);
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_2, __pyx_v_sample_c);
- __Pyx_GIVEREF(__pyx_v_sample_c);
- __Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_2, __pyx_v_n_dims);
- __Pyx_GIVEREF(__pyx_v_n_dims);
- __Pyx_INCREF(__pyx_v_n_elem);
- PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_2, __pyx_v_n_elem);
- __Pyx_GIVEREF(__pyx_v_n_elem);
- __Pyx_INCREF(__pyx_v_histo_range_c);
- PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_2, __pyx_v_histo_range_c);
- __Pyx_GIVEREF(__pyx_v_histo_range_c);
- __Pyx_INCREF(__pyx_v_n_bins_c);
- PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_2, __pyx_v_n_bins_c);
- __Pyx_GIVEREF(__pyx_v_n_bins_c);
- __Pyx_INCREF(__pyx_v_lut_c);
- PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_2, __pyx_v_lut_c);
- __Pyx_GIVEREF(__pyx_v_lut_c);
- __Pyx_INCREF(__pyx_v_histo_c);
- PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_2, __pyx_v_histo_c);
- __Pyx_GIVEREF(__pyx_v_histo_c);
- __Pyx_INCREF(__pyx_v_last_bin_closed);
- PyTuple_SET_ITEM(__pyx_t_8, 7+__pyx_t_2, __pyx_v_last_bin_closed);
- __Pyx_GIVEREF(__pyx_v_last_bin_closed);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF_SET(__pyx_v_rc, __pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF_SET(__pyx_v_rc, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":176
+ * rc = 0
+ *
+ * try: # <<<<<<<<<<<<<<
+ * rc = _histogramnd_get_lut_fused(sample_c,
+ * n_dims,
+ */
}
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
goto __pyx_L20_try_end;
__pyx_L13_error:;
+ __Pyx_PyThreadState_assign
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "chistogramnd_lut.pyx":180
+ /* "silx/math/chistogramnd_lut.pyx":185
* histo_c,
* last_bin_closed)
* except TypeError as ex: # <<<<<<<<<<<<<<
* raise TypeError('Type not supported - sample : {0}'
* ''.format(sample_type))
*/
- __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_14) {
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_1);
- __pyx_v_ex = __pyx_t_1;
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_8) {
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(0, 185, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_INCREF(__pyx_t_9);
+ __pyx_v_ex = __pyx_t_9;
- /* "chistogramnd_lut.pyx":182
+ /* "silx/math/chistogramnd_lut.pyx":187
* except TypeError as ex:
* raise TypeError('Type not supported - sample : {0}'
* ''.format(sample_type)) # <<<<<<<<<<<<<<
*
* if rc != 0:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Type_not_supported_sample_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_9)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_9);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Type_not_supported_sample_0, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
- if (!__pyx_t_9) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_sample_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ if (!__pyx_t_1) {
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_sample_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L15_except_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;
- __Pyx_INCREF(__pyx_v_sample_type);
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_sample_type);
- __Pyx_GIVEREF(__pyx_v_sample_type);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_sample_type};
+ __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_11);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_sample_type};
+ __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_11);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_sample_type);
+ __Pyx_GIVEREF(__pyx_v_sample_type);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_sample_type);
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 187, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "chistogramnd_lut.pyx":181
+ /* "silx/math/chistogramnd_lut.pyx":186
* last_bin_closed)
* except TypeError as ex:
* raise TypeError('Type not supported - sample : {0}' # <<<<<<<<<<<<<<
* ''.format(sample_type))
*
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L15_except_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_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L15_except_error)
__Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_11);
+ __pyx_t_11 = 0;
+ __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 186, __pyx_L15_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
+ __Pyx_Raise(__pyx_t_11, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __PYX_ERR(0, 186, __pyx_L15_except_error)
}
goto __pyx_L15_except_error;
__pyx_L15_except_error:;
- __Pyx_XGIVEREF(__pyx_t_11);
+
+ /* "silx/math/chistogramnd_lut.pyx":176
+ * rc = 0
+ *
+ * try: # <<<<<<<<<<<<<<
+ * rc = _histogramnd_get_lut_fused(sample_c,
+ * n_dims,
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
- __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
goto __pyx_L1_error;
__pyx_L20_try_end:;
}
- /* "chistogramnd_lut.pyx":184
+ /* "silx/math/chistogramnd_lut.pyx":189
* ''.format(sample_type))
*
* if rc != 0: # <<<<<<<<<<<<<<
* raise Exception('histogramnd returned an error : {0}'
* ''.format(rc))
*/
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_rc, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_10 = PyObject_RichCompare(__pyx_v_rc, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 189, __pyx_L1_error)
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 189, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_6) {
- /* "chistogramnd_lut.pyx":186
+ /* "silx/math/chistogramnd_lut.pyx":191
* if rc != 0:
* raise Exception('histogramnd returned an error : {0}'
* ''.format(rc)) # <<<<<<<<<<<<<<
*
* edges = []
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histogramnd_returned_an_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_5);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_histogramnd_returned_an_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
}
}
- if (!__pyx_t_5) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_rc); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ if (!__pyx_t_4) {
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_rc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_rc);
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_rc);
- __Pyx_GIVEREF(__pyx_v_rc);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rc};
+ __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_rc};
+ __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_rc);
+ __Pyx_GIVEREF(__pyx_v_rc);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_rc);
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":185
+ /* "silx/math/chistogramnd_lut.pyx":190
*
* if rc != 0:
* raise Exception('histogramnd returned an error : {0}' # <<<<<<<<<<<<<<
* ''.format(rc))
*
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(0, 190, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":189
+ * ''.format(sample_type))
+ *
+ * if rc != 0: # <<<<<<<<<<<<<<
+ * raise Exception('histogramnd returned an error : {0}'
+ * ''.format(rc))
+ */
}
- /* "chistogramnd_lut.pyx":188
+ /* "silx/math/chistogramnd_lut.pyx":193
* ''.format(rc))
*
* edges = [] # <<<<<<<<<<<<<<
* histo_range = histo_range.reshape(-1)
* for i_dim in range(n_dims):
*/
- __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_v_edges = ((PyObject*)__pyx_t_8);
- __pyx_t_8 = 0;
+ __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 193, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_v_edges = ((PyObject*)__pyx_t_10);
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":189
+ /* "silx/math/chistogramnd_lut.pyx":194
*
* edges = []
* histo_range = histo_range.reshape(-1) # <<<<<<<<<<<<<<
* for i_dim in range(n_dims):
* dim_edges = np.zeros(n_bins[i_dim] + 1)
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF_SET(__pyx_v_histo_range, __pyx_t_1);
- __pyx_t_1 = 0;
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_range, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 194, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 194, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_v_histo_range, __pyx_t_9);
+ __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":190
+ /* "silx/math/chistogramnd_lut.pyx":195
* edges = []
* histo_range = histo_range.reshape(-1)
* for i_dim in range(n_dims): # <<<<<<<<<<<<<<
* dim_edges = np.zeros(n_bins[i_dim] + 1)
* rng_min = histo_range[2 * i_dim]
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_n_dims);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_n_dims);
__Pyx_GIVEREF(__pyx_v_n_dims);
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) {
- __pyx_t_1 = __pyx_t_8; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_n_dims);
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
+ __pyx_t_9 = __pyx_t_10; __Pyx_INCREF(__pyx_t_9); __pyx_t_2 = 0;
__pyx_t_15 = NULL;
} else {
- __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_15 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_15 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 195, __pyx_L1_error)
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
for (;;) {
if (likely(!__pyx_t_15)) {
- if (likely(PyList_CheckExact(__pyx_t_1))) {
- if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (likely(PyList_CheckExact(__pyx_t_9))) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_10 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
#endif
} else {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_8); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_2); __Pyx_INCREF(__pyx_t_10); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 195, __pyx_L1_error)
#else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PySequence_ITEM(__pyx_t_9, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
#endif
}
} else {
- __pyx_t_8 = __pyx_t_15(__pyx_t_1);
- if (unlikely(!__pyx_t_8)) {
+ __pyx_t_10 = __pyx_t_15(__pyx_t_9);
+ if (unlikely(!__pyx_t_10)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 195, __pyx_L1_error)
}
break;
}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_10);
}
- __Pyx_XDECREF_SET(__pyx_v_i_dim, __pyx_t_8);
- __pyx_t_8 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_i_dim, __pyx_t_10);
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":191
+ /* "silx/math/chistogramnd_lut.pyx":196
* histo_range = histo_range.reshape(-1)
* for i_dim in range(n_dims):
* dim_edges = np.zeros(n_bins[i_dim] + 1) # <<<<<<<<<<<<<<
* rng_min = histo_range[2 * i_dim]
* rng_max = histo_range[2 * i_dim + 1]
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_3)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_11, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_t_11 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_11)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- if (!__pyx_t_3) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_GOTREF(__pyx_t_8);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_11) {
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
+ __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_11, __pyx_t_3};
+ __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF_SET(__pyx_v_dim_edges, __pyx_t_8);
- __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_dim_edges, __pyx_t_10);
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":192
+ /* "silx/math/chistogramnd_lut.pyx":197
* for i_dim in range(n_dims):
* dim_edges = np.zeros(n_bins[i_dim] + 1)
* rng_min = histo_range[2 * i_dim] # <<<<<<<<<<<<<<
* rng_max = histo_range[2 * i_dim + 1]
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) *
*/
- __pyx_t_8 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i_dim); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_5 = PyObject_GetItem(__pyx_v_histo_range, __pyx_t_8); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF_SET(__pyx_v_rng_min, __pyx_t_5);
- __pyx_t_5 = 0;
+ __pyx_t_10 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i_dim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_histo_range, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_rng_min, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":193
+ /* "silx/math/chistogramnd_lut.pyx":198
* dim_edges = np.zeros(n_bins[i_dim] + 1)
* rng_min = histo_range[2 * i_dim]
* rng_max = histo_range[2 * i_dim + 1] # <<<<<<<<<<<<<<
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) *
* ((rng_max - rng_min) / n_bins[i_dim]))
*/
- __pyx_t_5 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i_dim); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_GetItem(__pyx_v_histo_range, __pyx_t_8); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF_SET(__pyx_v_rng_max, __pyx_t_5);
- __pyx_t_5 = 0;
+ __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_v_i_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_10 = __Pyx_PyInt_AddObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 198, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_GetItem(__pyx_v_histo_range, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_rng_max, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":194
+ /* "silx/math/chistogramnd_lut.pyx":199
* rng_min = histo_range[2 * i_dim]
* rng_max = histo_range[2 * i_dim + 1]
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) * # <<<<<<<<<<<<<<
* ((rng_max - rng_min) / n_bins[i_dim]))
* dim_edges[-1] = rng_max
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_arange); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_arange); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_3);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_4) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_5);
+ if (!__pyx_t_3) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __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_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_t_10};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10);
+ __pyx_t_10 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "chistogramnd_lut.pyx":195
+ /* "silx/math/chistogramnd_lut.pyx":200
* rng_max = histo_range[2 * i_dim + 1]
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) *
* ((rng_max - rng_min) / n_bins[i_dim])) # <<<<<<<<<<<<<<
* dim_edges[-1] = rng_max
* edges.append(dim_edges)
*/
- __pyx_t_10 = PyNumber_Subtract(__pyx_v_rng_max, __pyx_v_rng_min); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Subtract(__pyx_v_rng_max, __pyx_v_rng_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_11 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_n_bins, __pyx_v_i_dim); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "chistogramnd_lut.pyx":194
+ /* "silx/math/chistogramnd_lut.pyx":199
* rng_min = histo_range[2 * i_dim]
* rng_max = histo_range[2 * i_dim + 1]
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) * # <<<<<<<<<<<<<<
* ((rng_max - rng_min) / n_bins[i_dim]))
* dim_edges[-1] = rng_max
*/
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_v_rng_min, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__Pyx_PyObject_SetSlice(__pyx_v_dim_edges, __pyx_t_8, 0, -1, NULL, NULL, &__pyx_slice__7, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_11 = PyNumber_Multiply(__pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = PyNumber_Add(__pyx_v_rng_min, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ if (__Pyx_PyObject_SetSlice(__pyx_v_dim_edges, __pyx_t_10, 0, -1L, NULL, NULL, &__pyx_slice__10, 0, 1, 1) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":196
+ /* "silx/math/chistogramnd_lut.pyx":201
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) *
* ((rng_max - rng_min) / n_bins[i_dim]))
* dim_edges[-1] = rng_max # <<<<<<<<<<<<<<
* edges.append(dim_edges)
*
*/
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dim_edges, -1, __pyx_v_rng_max, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dim_edges, -1L, __pyx_v_rng_max, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":197
+ /* "silx/math/chistogramnd_lut.pyx":202
* ((rng_max - rng_min) / n_bins[i_dim]))
* dim_edges[-1] = rng_max
* edges.append(dim_edges) # <<<<<<<<<<<<<<
*
* return lut, histo, tuple(edges)
*/
- __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_v_dim_edges); if (unlikely(__pyx_t_16 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = __Pyx_PyList_Append(__pyx_v_edges, __pyx_v_dim_edges); if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 202, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":190
+ /* "silx/math/chistogramnd_lut.pyx":195
* edges = []
* histo_range = histo_range.reshape(-1)
* for i_dim in range(n_dims): # <<<<<<<<<<<<<<
@@ -4151,9 +5046,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
* rng_min = histo_range[2 * i_dim]
*/
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "chistogramnd_lut.pyx":199
+ /* "silx/math/chistogramnd_lut.pyx":204
* edges.append(dim_edges)
*
* return lut, histo, tuple(edges) # <<<<<<<<<<<<<<
@@ -4161,24 +5056,24 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_AsTuple(__pyx_v_edges); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyList_AsTuple(__pyx_v_edges); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_lut);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_lut);
__Pyx_GIVEREF(__pyx_v_lut);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_lut);
__Pyx_INCREF(__pyx_v_histo);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_histo);
__Pyx_GIVEREF(__pyx_v_histo);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_r = __pyx_t_8;
- __pyx_t_8 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_histo);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_r = __pyx_t_10;
+ __pyx_t_10 = 0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":58
+ /* "silx/math/chistogramnd_lut.pyx":58
*
*
* def histogramnd_get_lut(sample, # <<<<<<<<<<<<<<
@@ -4192,10 +5087,10 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_get_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_s_shape);
@@ -4206,6 +5101,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
__Pyx_XDECREF(__pyx_v_lut_dtype);
__Pyx_XDECREF(__pyx_v_lut);
__Pyx_XDECREF(__pyx_v_histo);
+ __Pyx_XDECREF(__pyx_v_dtype);
__Pyx_XDECREF(__pyx_v_sample_c);
__Pyx_XDECREF(__pyx_v_histo_range_c);
__Pyx_XDECREF(__pyx_v_n_bins_c);
@@ -4225,7 +5121,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
return __pyx_r;
}
-/* "chistogramnd_lut.pyx":206
+/* "silx/math/chistogramnd_lut.pyx":211
*
*
* def histogramnd_from_lut(weights, # <<<<<<<<<<<<<<
@@ -4234,10 +5130,10 @@ static PyObject *__pyx_pf_16chistogramnd_lut_histogramnd_get_lut(CYTHON_UNUSED P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_16chistogramnd_lut_2histogramnd_from_lut[] = "histogramnd_from_lut(weights, histo_lut, histo=None, weighted_histo=None, shape=None, dtype=None, weight_min=None, weight_max=None)\n\n dtype ignored if weighted_histo provided\n ";
-static PyMethodDef __pyx_mdef_16chistogramnd_lut_3histogramnd_from_lut = {"histogramnd_from_lut", (PyCFunction)__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_2histogramnd_from_lut};
-static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_16chistogramnd_lut_2histogramnd_from_lut[] = "histogramnd_from_lut(weights, histo_lut, histo=None, weighted_histo=None, shape=None, dtype=None, weight_min=None, weight_max=None)\n\n dtype ignored if weighted_histo provided\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_16chistogramnd_lut_3histogramnd_from_lut = {"histogramnd_from_lut", (PyCFunction)__pyx_pw_4silx_4math_16chistogramnd_lut_3histogramnd_from_lut, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_2histogramnd_from_lut};
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_weights = 0;
PyObject *__pyx_v_histo_lut = 0;
PyObject *__pyx_v_histo = 0;
@@ -4246,9 +5142,6 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
PyObject *__pyx_v_dtype = 0;
PyObject *__pyx_v_weight_min = 0;
PyObject *__pyx_v_weight_max = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("histogramnd_from_lut (wrapper)", 0);
@@ -4256,7 +5149,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_weights,&__pyx_n_s_histo_lut,&__pyx_n_s_histo,&__pyx_n_s_weighted_histo,&__pyx_n_s_shape,&__pyx_n_s_dtype,&__pyx_n_s_weight_min,&__pyx_n_s_weight_max,0};
PyObject* values[8] = {0,0,0,0,0,0,0,0};
- /* "chistogramnd_lut.pyx":208
+ /* "silx/math/chistogramnd_lut.pyx":213
* def histogramnd_from_lut(weights,
* histo_lut,
* histo=None, # <<<<<<<<<<<<<<
@@ -4265,7 +5158,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
*/
values[2] = ((PyObject *)Py_None);
- /* "chistogramnd_lut.pyx":209
+ /* "silx/math/chistogramnd_lut.pyx":214
* histo_lut,
* histo=None,
* weighted_histo=None, # <<<<<<<<<<<<<<
@@ -4274,7 +5167,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
*/
values[3] = ((PyObject *)Py_None);
- /* "chistogramnd_lut.pyx":210
+ /* "silx/math/chistogramnd_lut.pyx":215
* histo=None,
* weighted_histo=None,
* shape=None, # <<<<<<<<<<<<<<
@@ -4283,7 +5176,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
*/
values[4] = ((PyObject *)Py_None);
- /* "chistogramnd_lut.pyx":211
+ /* "silx/math/chistogramnd_lut.pyx":216
* weighted_histo=None,
* shape=None,
* dtype=None, # <<<<<<<<<<<<<<
@@ -4292,7 +5185,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
*/
values[5] = ((PyObject *)Py_None);
- /* "chistogramnd_lut.pyx":212
+ /* "silx/math/chistogramnd_lut.pyx":217
* shape=None,
* dtype=None,
* weight_min=None, # <<<<<<<<<<<<<<
@@ -4301,7 +5194,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
*/
values[6] = ((PyObject *)Py_None);
- /* "chistogramnd_lut.pyx":213
+ /* "silx/math/chistogramnd_lut.pyx":218
* dtype=None,
* weight_min=None,
* weight_max=None): # <<<<<<<<<<<<<<
@@ -4332,7 +5225,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_histo_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("histogramnd_from_lut", 0, 2, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("histogramnd_from_lut", 0, 2, 8, 1); __PYX_ERR(0, 211, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -4366,7 +5259,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histogramnd_from_lut") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "histogramnd_from_lut") < 0)) __PYX_ERR(0, 211, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4393,15 +5286,15 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("histogramnd_from_lut", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("histogramnd_from_lut", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 211, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(__pyx_self, __pyx_v_weights, __pyx_v_histo_lut, __pyx_v_histo, __pyx_v_weighted_histo, __pyx_v_shape, __pyx_v_dtype, __pyx_v_weight_min, __pyx_v_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_2histogramnd_from_lut(__pyx_self, __pyx_v_weights, __pyx_v_histo_lut, __pyx_v_histo, __pyx_v_weighted_histo, __pyx_v_shape, __pyx_v_dtype, __pyx_v_weight_min, __pyx_v_weight_max);
- /* "chistogramnd_lut.pyx":206
+ /* "silx/math/chistogramnd_lut.pyx":211
*
*
* def histogramnd_from_lut(weights, # <<<<<<<<<<<<<<
@@ -4414,7 +5307,7 @@ static PyObject *__pyx_pw_16chistogramnd_lut_3histogramnd_from_lut(PyObject *__p
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_histo_lut, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_weights, PyObject *__pyx_v_histo_lut, PyObject *__pyx_v_histo, PyObject *__pyx_v_weighted_histo, PyObject *__pyx_v_shape, PyObject *__pyx_v_dtype, PyObject *__pyx_v_weight_min, PyObject *__pyx_v_weight_max) {
PyObject *__pyx_v_w_dtype = NULL;
PyObject *__pyx_v_w_c = NULL;
PyObject *__pyx_v_h_c = NULL;
@@ -4434,7 +5327,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
+ int __pyx_t_9;
PyObject *__pyx_t_10 = NULL;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
@@ -4443,10 +5336,6 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- int __pyx_t_18;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("histogramnd_from_lut", 0);
__Pyx_INCREF(__pyx_v_histo);
__Pyx_INCREF(__pyx_v_weighted_histo);
@@ -4455,7 +5344,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__Pyx_INCREF(__pyx_v_weight_min);
__Pyx_INCREF(__pyx_v_weight_max);
- /* "chistogramnd_lut.pyx":218
+ /* "silx/math/chistogramnd_lut.pyx":223
* """
*
* if histo is None and weighted_histo is None: # <<<<<<<<<<<<<<
@@ -4475,7 +5364,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":219
+ /* "silx/math/chistogramnd_lut.pyx":224
*
* if histo is None and weighted_histo is None:
* if shape is None: # <<<<<<<<<<<<<<
@@ -4486,24 +5375,38 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":220
+ /* "silx/math/chistogramnd_lut.pyx":225
* if histo is None and weighted_histo is None:
* if shape is None:
* raise ValueError('At least one of the following parameters has to ' # <<<<<<<<<<<<<<
* 'be provided : <shape> or <histo> or '
* '<weighted_histo>')
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 225, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_Raise(__pyx_t_4, 0, 0, 0);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 225, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":224
+ *
+ * if histo is None and weighted_histo is None:
+ * if shape is None: # <<<<<<<<<<<<<<
+ * raise ValueError('At least one of the following parameters has to '
+ * 'be provided : <shape> or <histo> or '
+ */
}
- goto __pyx_L3;
+
+ /* "silx/math/chistogramnd_lut.pyx":223
+ * """
+ *
+ * if histo is None and weighted_histo is None: # <<<<<<<<<<<<<<
+ * if shape is None:
+ * raise ValueError('At least one of the following parameters has to '
+ */
}
- __pyx_L3:;
- /* "chistogramnd_lut.pyx":224
+ /* "silx/math/chistogramnd_lut.pyx":229
* '<weighted_histo>')
*
* if shape is not None: # <<<<<<<<<<<<<<
@@ -4514,7 +5417,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":225
+ /* "silx/math/chistogramnd_lut.pyx":230
*
* if shape is not None:
* if histo is not None and list(histo.shape) != list(shape): # <<<<<<<<<<<<<<
@@ -4528,48 +5431,45 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = __pyx_t_3;
goto __pyx_L9_bool_binop_done;
}
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __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 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PySequence_List(__pyx_v_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 230, __pyx_L1_error)
__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 = 225; __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);
- __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = __pyx_t_3;
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":226
+ /* "silx/math/chistogramnd_lut.pyx":231
* if shape is not None:
* if histo is not None and list(histo.shape) != list(shape):
* raise ValueError('The <shape> value does not match' # <<<<<<<<<<<<<<
* 'the <histo> shape.')
*
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 231, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":230
+ *
+ * if shape is not None:
+ * if histo is not None and list(histo.shape) != list(shape): # <<<<<<<<<<<<<<
+ * raise ValueError('The <shape> value does not match'
+ * 'the <histo> shape.')
+ */
}
- /* "chistogramnd_lut.pyx":229
+ /* "silx/math/chistogramnd_lut.pyx":234
* 'the <histo> shape.')
*
* if(weighted_histo is not None and # <<<<<<<<<<<<<<
@@ -4584,100 +5484,121 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
goto __pyx_L12_bool_binop_done;
}
- /* "chistogramnd_lut.pyx":230
+ /* "silx/math/chistogramnd_lut.pyx":235
*
* if(weighted_histo is not None and
* list(weighted_histo.shape) != list(shape)): # <<<<<<<<<<<<<<
* raise ValueError('The <shape> value does not match'
* 'the <weighted_histo> shape.')
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __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 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_6 = PySequence_List(__pyx_v_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_1 = __pyx_t_2;
__pyx_L12_bool_binop_done:;
+
+ /* "silx/math/chistogramnd_lut.pyx":234
+ * 'the <histo> shape.')
+ *
+ * if(weighted_histo is not None and # <<<<<<<<<<<<<<
+ * list(weighted_histo.shape) != list(shape)):
+ * raise ValueError('The <shape> value does not match'
+ */
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":231
+ /* "silx/math/chistogramnd_lut.pyx":236
* if(weighted_histo is not None and
* list(weighted_histo.shape) != list(shape)):
* raise ValueError('The <shape> value does not match' # <<<<<<<<<<<<<<
* 'the <weighted_histo> shape.')
* else:
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(0, 236, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":234
+ * 'the <histo> shape.')
+ *
+ * if(weighted_histo is not None and # <<<<<<<<<<<<<<
+ * list(weighted_histo.shape) != list(shape)):
+ * raise ValueError('The <shape> value does not match'
+ */
}
+
+ /* "silx/math/chistogramnd_lut.pyx":229
+ * '<weighted_histo>')
+ *
+ * if shape is not None: # <<<<<<<<<<<<<<
+ * if histo is not None and list(histo.shape) != list(shape):
+ * raise ValueError('The <shape> value does not match'
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":234
+ /* "silx/math/chistogramnd_lut.pyx":239
* 'the <weighted_histo> shape.')
* else:
* if histo is not None: # <<<<<<<<<<<<<<
* shape = histo.shape
* else:
*/
+ /*else*/ {
__pyx_t_1 = (__pyx_v_histo != Py_None);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":235
+ /* "silx/math/chistogramnd_lut.pyx":240
* else:
* if histo is not None:
* shape = histo.shape # <<<<<<<<<<<<<<
* else:
* shape = weighted_histo.shape
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_6);
- __pyx_t_6 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":239
+ * 'the <weighted_histo> shape.')
+ * else:
+ * if histo is not None: # <<<<<<<<<<<<<<
+ * shape = histo.shape
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":237
+ /* "silx/math/chistogramnd_lut.pyx":242
* shape = histo.shape
* else:
* shape = weighted_histo.shape # <<<<<<<<<<<<<<
*
* if histo is not None:
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_6);
- __pyx_t_6 = 0;
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF_SET(__pyx_v_shape, __pyx_t_5);
+ __pyx_t_5 = 0;
}
__pyx_L14:;
}
__pyx_L7:;
- /* "chistogramnd_lut.pyx":239
+ /* "silx/math/chistogramnd_lut.pyx":244
* shape = weighted_histo.shape
*
* if histo is not None: # <<<<<<<<<<<<<<
@@ -4688,92 +5609,122 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":240
+ /* "silx/math/chistogramnd_lut.pyx":245
*
* if histo is not None:
* if histo.dtype != np.uint32: # <<<<<<<<<<<<<<
* raise ValueError('Provided <histo> array doesn\'t have '
* 'the expected type '
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 245, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 245, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":244
+ /* "silx/math/chistogramnd_lut.pyx":249
* 'the expected type '
* ': should be {0} instead of {1}.'
* ''.format(np.uint32, histo.dtype)) # <<<<<<<<<<<<<<
*
* if weighted_histo is not None:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Provided_histo_array_doesn_t_hav, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __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_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__pyx_t_8 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+ if (CYTHON_UNPACK_METHODS && 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_5);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_8);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_9 = 1;
}
}
- __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_5};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_t_5};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ if (__pyx_t_8) {
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_5);
+ __pyx_t_7 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_7 = 0;
- __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":241
+ /* "silx/math/chistogramnd_lut.pyx":246
* if histo is not None:
* if histo.dtype != np.uint32:
* raise ValueError('Provided <histo> array doesn\'t have ' # <<<<<<<<<<<<<<
* 'the expected type '
* ': should be {0} instead of {1}.'
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 246, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":245
+ *
+ * if histo is not None:
+ * if histo.dtype != np.uint32: # <<<<<<<<<<<<<<
+ * raise ValueError('Provided <histo> array doesn\'t have '
+ * 'the expected type '
+ */
}
- /* "chistogramnd_lut.pyx":246
+ /* "silx/math/chistogramnd_lut.pyx":251
* ''.format(np.uint32, histo.dtype))
*
* if weighted_histo is not None: # <<<<<<<<<<<<<<
@@ -4784,93 +5735,115 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":247
+ /* "silx/math/chistogramnd_lut.pyx":252
*
* if weighted_histo is not None:
* if histo.shape != weighted_histo.shape: # <<<<<<<<<<<<<<
* raise ValueError('The <histo> shape does not match'
* 'the <weighted_histo> shape.')
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyObject_RichCompare(__pyx_t_6, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 252, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":248
+ /* "silx/math/chistogramnd_lut.pyx":253
* if weighted_histo is not None:
* if histo.shape != weighted_histo.shape:
* raise ValueError('The <histo> shape does not match' # <<<<<<<<<<<<<<
* 'the <weighted_histo> shape.')
* else:
*/
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_Raise(__pyx_t_10, 0, 0, 0);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 253, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":252
+ *
+ * if weighted_histo is not None:
+ * if histo.shape != weighted_histo.shape: # <<<<<<<<<<<<<<
+ * raise ValueError('The <histo> shape does not match'
+ * 'the <weighted_histo> shape.')
+ */
}
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":251
+ * ''.format(np.uint32, histo.dtype))
+ *
+ * if weighted_histo is not None: # <<<<<<<<<<<<<<
+ * if histo.shape != weighted_histo.shape:
+ * raise ValueError('The <histo> shape does not match'
+ */
}
- __pyx_L17:;
+
+ /* "silx/math/chistogramnd_lut.pyx":244
+ * shape = weighted_histo.shape
+ *
+ * if histo is not None: # <<<<<<<<<<<<<<
+ * if histo.dtype != np.uint32:
+ * raise ValueError('Provided <histo> array doesn\'t have '
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":251
+ /* "silx/math/chistogramnd_lut.pyx":256
* 'the <weighted_histo> shape.')
* else:
* histo = np.zeros(shape, dtype=np.uint32) # <<<<<<<<<<<<<<
*
* w_dtype = weights.dtype
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
__Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_shape);
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, __pyx_t_4); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF_SET(__pyx_v_histo, __pyx_t_7);
__pyx_t_7 = 0;
}
__pyx_L15:;
- /* "chistogramnd_lut.pyx":253
+ /* "silx/math/chistogramnd_lut.pyx":258
* histo = np.zeros(shape, dtype=np.uint32)
*
* w_dtype = weights.dtype # <<<<<<<<<<<<<<
*
* if dtype is None:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_w_dtype = __pyx_t_7;
__pyx_t_7 = 0;
- /* "chistogramnd_lut.pyx":255
+ /* "silx/math/chistogramnd_lut.pyx":260
* w_dtype = weights.dtype
*
* if dtype is None: # <<<<<<<<<<<<<<
@@ -4881,7 +5854,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":256
+ /* "silx/math/chistogramnd_lut.pyx":261
*
* if dtype is None:
* if weighted_histo is None: # <<<<<<<<<<<<<<
@@ -4892,7 +5865,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":257
+ /* "silx/math/chistogramnd_lut.pyx":262
* if dtype is None:
* if weighted_histo is None:
* dtype = w_dtype # <<<<<<<<<<<<<<
@@ -4901,27 +5874,43 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
*/
__Pyx_INCREF(__pyx_v_w_dtype);
__Pyx_DECREF_SET(__pyx_v_dtype, __pyx_v_w_dtype);
+
+ /* "silx/math/chistogramnd_lut.pyx":261
+ *
+ * if dtype is None:
+ * if weighted_histo is None: # <<<<<<<<<<<<<<
+ * dtype = w_dtype
+ * else:
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":259
+ /* "silx/math/chistogramnd_lut.pyx":264
* dtype = w_dtype
* else:
* dtype = weighted_histo.dtype # <<<<<<<<<<<<<<
* elif weighted_histo is not None:
* if weighted_histo.dtype != dtype:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_7);
__pyx_t_7 = 0;
}
__pyx_L20:;
+
+ /* "silx/math/chistogramnd_lut.pyx":260
+ * w_dtype = weights.dtype
+ *
+ * if dtype is None: # <<<<<<<<<<<<<<
+ * if weighted_histo is None:
+ * dtype = w_dtype
+ */
goto __pyx_L19;
}
- /* "chistogramnd_lut.pyx":260
+ /* "silx/math/chistogramnd_lut.pyx":265
* else:
* dtype = weighted_histo.dtype
* elif weighted_histo is not None: # <<<<<<<<<<<<<<
@@ -4932,51 +5921,66 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":261
+ /* "silx/math/chistogramnd_lut.pyx":266
* dtype = weighted_histo.dtype
* elif weighted_histo is not None:
* if weighted_histo.dtype != dtype: # <<<<<<<<<<<<<<
* raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype'
* ' do not match.')
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_v_dtype, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_dtype, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":262
+ /* "silx/math/chistogramnd_lut.pyx":267
* elif weighted_histo is not None:
* if weighted_histo.dtype != dtype:
* raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype' # <<<<<<<<<<<<<<
* ' do not match.')
* dtype = weighted_histo.dtype
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 267, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":266
+ * dtype = weighted_histo.dtype
+ * elif weighted_histo is not None:
+ * if weighted_histo.dtype != dtype: # <<<<<<<<<<<<<<
+ * raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype'
+ * ' do not match.')
+ */
}
- /* "chistogramnd_lut.pyx":264
+ /* "silx/math/chistogramnd_lut.pyx":269
* raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype'
* ' do not match.')
* dtype = weighted_histo.dtype # <<<<<<<<<<<<<<
*
* if weighted_histo is None:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L19;
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_dtype, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":265
+ * else:
+ * dtype = weighted_histo.dtype
+ * elif weighted_histo is not None: # <<<<<<<<<<<<<<
+ * if weighted_histo.dtype != dtype:
+ * raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype'
+ */
}
__pyx_L19:;
- /* "chistogramnd_lut.pyx":266
+ /* "silx/math/chistogramnd_lut.pyx":271
* dtype = weighted_histo.dtype
*
* if weighted_histo is None: # <<<<<<<<<<<<<<
@@ -4987,375 +5991,544 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":267
+ /* "silx/math/chistogramnd_lut.pyx":272
*
* if weighted_histo is None:
* weighted_histo = np.zeros(shape, dtype=dtype) # <<<<<<<<<<<<<<
*
* if histo_lut.size != weights.size:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __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 = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_shape);
+ __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 272, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_v_dtype) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, __pyx_t_10); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_v_dtype) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 272, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF_SET(__pyx_v_weighted_histo, __pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L22;
+ __Pyx_DECREF_SET(__pyx_v_weighted_histo, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":271
+ * dtype = weighted_histo.dtype
+ *
+ * if weighted_histo is None: # <<<<<<<<<<<<<<
+ * weighted_histo = np.zeros(shape, dtype=dtype)
+ *
+ */
}
- __pyx_L22:;
- /* "chistogramnd_lut.pyx":269
+ /* "silx/math/chistogramnd_lut.pyx":274
* weighted_histo = np.zeros(shape, dtype=dtype)
*
* if histo_lut.size != weights.size: # <<<<<<<<<<<<<<
* raise ValueError('The LUT and weights arrays must have the same '
* 'number of elements.')
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 274, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 274, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 274, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 274, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":270
+ /* "silx/math/chistogramnd_lut.pyx":275
*
* if histo_lut.size != weights.size:
* raise ValueError('The LUT and weights arrays must have the same ' # <<<<<<<<<<<<<<
* 'number of elements.')
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 275, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 275, __pyx_L1_error)
+
+ /* "silx/math/chistogramnd_lut.pyx":274
+ * weighted_histo = np.zeros(shape, dtype=dtype)
+ *
+ * if histo_lut.size != weights.size: # <<<<<<<<<<<<<<
+ * raise ValueError('The LUT and weights arrays must have the same '
+ * 'number of elements.')
+ */
}
- /* "chistogramnd_lut.pyx":273
+ /* "silx/math/chistogramnd_lut.pyx":278
* 'number of elements.')
*
- * w_c = np.ascontiguousarray(weights.reshape((weights.size,))) # <<<<<<<<<<<<<<
+ * w_c = np.ascontiguousarray(weights.reshape((weights.size,)), # <<<<<<<<<<<<<<
+ * dtype=weights.dtype.newbyteorder('N'))
*
- * h_c = np.ascontiguousarray(histo.reshape((histo.size,)))
*/
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_6);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- }
- }
- if (!__pyx_t_6) {
- __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_10);
- } else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- }
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
+ __pyx_t_7 = 0;
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_w_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "chistogramnd_lut.pyx":275
- * w_c = np.ascontiguousarray(weights.reshape((weights.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":279
*
- * h_c = np.ascontiguousarray(histo.reshape((histo.size,))) # <<<<<<<<<<<<<<
+ * w_c = np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
*
- * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,))) # noqa
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)),
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":278
+ * 'number of elements.')
+ *
+ * w_c = np.ascontiguousarray(weights.reshape((weights.size,)), # <<<<<<<<<<<<<<
+ * dtype=weights.dtype.newbyteorder('N'))
+ *
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_7);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- }
- }
- if (!__pyx_t_7) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __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;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- }
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- }
- }
- if (!__pyx_t_10) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __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 = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __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_11); __pyx_t_11 = 0;
- __pyx_v_h_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_w_c = __pyx_t_8;
+ __pyx_t_8 = 0;
- /* "chistogramnd_lut.pyx":277
- * h_c = np.ascontiguousarray(histo.reshape((histo.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":281
+ * dtype=weights.dtype.newbyteorder('N'))
*
- * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,))) # noqa # <<<<<<<<<<<<<<
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo.dtype.newbyteorder('N'))
*
- * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)))
*/
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 281, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10);
__pyx_t_10 = 0;
__pyx_t_10 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_10);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_5, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
if (!__pyx_t_10) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_5};
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_5};
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
+ __pyx_t_8 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":282
+ *
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ * dtype=histo.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)),
+ */
+ __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":281
+ * dtype=weights.dtype.newbyteorder('N'))
+ *
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=histo.dtype.newbyteorder('N'))
+ *
+ */
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 281, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_v_h_c = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":284
+ * dtype=histo.dtype.newbyteorder('N'))
+ *
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=weighted_histo.dtype.newbyteorder('N')) # noqa
+ *
+ */
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
}
}
- if (!__pyx_t_5) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- __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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_6) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- __pyx_t_11 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_w_h_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7);
+ __pyx_t_7 = 0;
- /* "chistogramnd_lut.pyx":279
- * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,))) # noqa
+ /* "silx/math/chistogramnd_lut.pyx":285
*
- * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,))) # <<<<<<<<<<<<<<
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)),
+ * dtype=weighted_histo.dtype.newbyteorder('N')) # noqa # <<<<<<<<<<<<<<
*
- * rc = 0
+ * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)),
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_reshape); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weighted_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_10) < 0) __PYX_ERR(0, 285, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":284
+ * dtype=histo.dtype.newbyteorder('N'))
+ *
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)), # <<<<<<<<<<<<<<
+ * dtype=weighted_histo.dtype.newbyteorder('N')) # noqa
+ *
+ */
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_w_h_c = __pyx_t_10;
+ __pyx_t_10 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":287
+ * dtype=weighted_histo.dtype.newbyteorder('N')) # noqa
+ *
+ * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)), # <<<<<<<<<<<<<<
+ * histo_lut.dtype.newbyteorder('N'))
+ *
+ */
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
+ __Pyx_DECREF_SET(__pyx_t_8, function);
}
}
if (!__pyx_t_5) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __pyx_t_8 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
}
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":288
+ *
+ * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)),
+ * histo_lut.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo_lut, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_t_11 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_7);
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_11)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_11);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_9 = 1;
}
}
- if (!__pyx_t_11) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_GOTREF(__pyx_t_4);
- } else {
- __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_7, __pyx_t_8};
+ __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11); __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = NULL;
- PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_t_7, __pyx_t_8};
+ __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_11) {
+ __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11); __pyx_t_11 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_t_8);
+ __pyx_t_7 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_h_lut_c = __pyx_t_4;
- __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_h_lut_c = __pyx_t_10;
+ __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":281
- * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)))
+ /* "silx/math/chistogramnd_lut.pyx":290
+ * histo_lut.dtype.newbyteorder('N'))
*
* rc = 0 # <<<<<<<<<<<<<<
*
@@ -5363,7 +6536,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
*/
__pyx_v_rc = 0;
- /* "chistogramnd_lut.pyx":283
+ /* "silx/math/chistogramnd_lut.pyx":292
* rc = 0
*
* if weight_min is None: # <<<<<<<<<<<<<<
@@ -5374,7 +6547,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "chistogramnd_lut.pyx":284
+ /* "silx/math/chistogramnd_lut.pyx":293
*
* if weight_min is None:
* weight_min = 0 # <<<<<<<<<<<<<<
@@ -5384,7 +6557,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_weight_min, __pyx_int_0);
- /* "chistogramnd_lut.pyx":285
+ /* "silx/math/chistogramnd_lut.pyx":294
* if weight_min is None:
* weight_min = 0
* filt_min_weights = False # <<<<<<<<<<<<<<
@@ -5392,22 +6565,30 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
* filt_min_weights = True
*/
__pyx_v_filt_min_weights = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":292
+ * rc = 0
+ *
+ * if weight_min is None: # <<<<<<<<<<<<<<
+ * weight_min = 0
+ * filt_min_weights = False
+ */
goto __pyx_L24;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":287
+ /* "silx/math/chistogramnd_lut.pyx":296
* filt_min_weights = False
* else:
* filt_min_weights = True # <<<<<<<<<<<<<<
*
* if weight_max is None:
*/
+ /*else*/ {
__pyx_v_filt_min_weights = 1;
}
__pyx_L24:;
- /* "chistogramnd_lut.pyx":289
+ /* "silx/math/chistogramnd_lut.pyx":298
* filt_min_weights = True
*
* if weight_max is None: # <<<<<<<<<<<<<<
@@ -5418,7 +6599,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "chistogramnd_lut.pyx":290
+ /* "silx/math/chistogramnd_lut.pyx":299
*
* if weight_max is None:
* weight_max = 0 # <<<<<<<<<<<<<<
@@ -5428,7 +6609,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_weight_max, __pyx_int_0);
- /* "chistogramnd_lut.pyx":291
+ /* "silx/math/chistogramnd_lut.pyx":300
* if weight_max is None:
* weight_max = 0
* filt_max_weights = False # <<<<<<<<<<<<<<
@@ -5436,22 +6617,30 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
* filt_max_weights = True
*/
__pyx_v_filt_max_weights = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":298
+ * filt_min_weights = True
+ *
+ * if weight_max is None: # <<<<<<<<<<<<<<
+ * weight_max = 0
+ * filt_max_weights = False
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":293
+ /* "silx/math/chistogramnd_lut.pyx":302
* filt_max_weights = False
* else:
* filt_max_weights = True # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_filt_max_weights = 1;
}
__pyx_L25:;
- /* "chistogramnd_lut.pyx":295
+ /* "silx/math/chistogramnd_lut.pyx":304
* filt_max_weights = True
*
* try: # <<<<<<<<<<<<<<
@@ -5459,98 +6648,118 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
* h_lut_c,
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
__Pyx_XGOTREF(__pyx_t_12);
__Pyx_XGOTREF(__pyx_t_13);
__Pyx_XGOTREF(__pyx_t_14);
/*try:*/ {
- /* "chistogramnd_lut.pyx":296
+ /* "silx/math/chistogramnd_lut.pyx":305
*
* try:
* _histogramnd_from_lut_fused(w_c, # <<<<<<<<<<<<<<
* h_lut_c,
* h_c,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_histogramnd_from_lut_fused); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_histogramnd_from_lut_fused); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_4);
- /* "chistogramnd_lut.pyx":300
+ /* "silx/math/chistogramnd_lut.pyx":309
* h_c,
* w_h_c,
* weights.size, # <<<<<<<<<<<<<<
* filt_min_weights,
* w_dtype.type(weight_min),
*/
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_10);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 309, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_6);
- /* "chistogramnd_lut.pyx":301
+ /* "silx/math/chistogramnd_lut.pyx":310
* w_h_c,
* weights.size,
* filt_min_weights, # <<<<<<<<<<<<<<
* w_dtype.type(weight_min),
* filt_max_weights,
*/
- __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_filt_min_weights); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_filt_min_weights); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 310, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_8);
- /* "chistogramnd_lut.pyx":302
+ /* "silx/math/chistogramnd_lut.pyx":311
* weights.size,
* filt_min_weights,
* w_dtype.type(weight_min), # <<<<<<<<<<<<<<
* filt_max_weights,
* w_dtype.type(weight_max))
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_w_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_w_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_11);
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_11);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
}
}
if (!__pyx_t_5) {
- __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_weight_min); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_weight_min); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_weight_min);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_weight_min);
- __Pyx_GIVEREF(__pyx_v_weight_min);
- __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_min};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_weight_min};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_weight_min);
+ __Pyx_GIVEREF(__pyx_v_weight_min);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_weight_min);
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "chistogramnd_lut.pyx":303
+ /* "silx/math/chistogramnd_lut.pyx":312
* filt_min_weights,
* w_dtype.type(weight_min),
* filt_max_weights, # <<<<<<<<<<<<<<
* w_dtype.type(weight_max))
* except TypeError as ex:
*/
- __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_filt_max_weights); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyBool_FromLong(__pyx_v_filt_max_weights); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 312, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_11);
- /* "chistogramnd_lut.pyx":304
+ /* "silx/math/chistogramnd_lut.pyx":313
* w_dtype.type(weight_min),
* filt_max_weights,
* w_dtype.type(weight_max)) # <<<<<<<<<<<<<<
* except TypeError as ex:
* print(ex)
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_w_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_w_dtype, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L26_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_16)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -5560,174 +6769,260 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
}
}
if (!__pyx_t_16) {
- __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_weight_max); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
+ __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_weight_max); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 313, __pyx_L26_error)
__Pyx_GOTREF(__pyx_t_15);
} else {
- __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_17);
- PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- __Pyx_INCREF(__pyx_v_weight_max);
- PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_v_weight_max);
- __Pyx_GIVEREF(__pyx_v_weight_max);
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_weight_max};
+ __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 313, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_15);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_16, __pyx_v_weight_max};
+ __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 313, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_15);
+ } else
+ #endif
+ {
+ __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 313, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
+ __Pyx_INCREF(__pyx_v_weight_max);
+ __Pyx_GIVEREF(__pyx_v_weight_max);
+ PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_v_weight_max);
+ __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_17, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 313, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
__pyx_t_9 = 1;
}
}
- __pyx_t_17 = PyTuple_New(9+__pyx_t_9); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_17);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- }
- __Pyx_INCREF(__pyx_v_w_c);
- PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_9, __pyx_v_w_c);
- __Pyx_GIVEREF(__pyx_v_w_c);
- __Pyx_INCREF(__pyx_v_h_lut_c);
- PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_9, __pyx_v_h_lut_c);
- __Pyx_GIVEREF(__pyx_v_h_lut_c);
- __Pyx_INCREF(__pyx_v_h_c);
- PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_9, __pyx_v_h_c);
- __Pyx_GIVEREF(__pyx_v_h_c);
- __Pyx_INCREF(__pyx_v_w_h_c);
- PyTuple_SET_ITEM(__pyx_t_17, 3+__pyx_t_9, __pyx_v_w_h_c);
- __Pyx_GIVEREF(__pyx_v_w_h_c);
- PyTuple_SET_ITEM(__pyx_t_17, 4+__pyx_t_9, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_17, 5+__pyx_t_9, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_17, 6+__pyx_t_9, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_17, 7+__pyx_t_9, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_17, 8+__pyx_t_9, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- __pyx_t_10 = 0;
- __pyx_t_6 = 0;
- __pyx_t_11 = 0;
- __pyx_t_8 = 0;
- __pyx_t_15 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L26_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[10] = {__pyx_t_5, __pyx_v_w_c, __pyx_v_h_lut_c, __pyx_v_h_c, __pyx_v_w_h_c, __pyx_t_6, __pyx_t_8, __pyx_t_7, __pyx_t_11, __pyx_t_15};
+ __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 9+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[10] = {__pyx_t_5, __pyx_v_w_c, __pyx_v_h_lut_c, __pyx_v_h_c, __pyx_v_w_h_c, __pyx_t_6, __pyx_t_8, __pyx_t_7, __pyx_t_11, __pyx_t_15};
+ __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 9+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L26_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_17 = PyTuple_New(9+__pyx_t_9); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 305, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_w_c);
+ __Pyx_GIVEREF(__pyx_v_w_c);
+ PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_9, __pyx_v_w_c);
+ __Pyx_INCREF(__pyx_v_h_lut_c);
+ __Pyx_GIVEREF(__pyx_v_h_lut_c);
+ PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_9, __pyx_v_h_lut_c);
+ __Pyx_INCREF(__pyx_v_h_c);
+ __Pyx_GIVEREF(__pyx_v_h_c);
+ PyTuple_SET_ITEM(__pyx_t_17, 2+__pyx_t_9, __pyx_v_h_c);
+ __Pyx_INCREF(__pyx_v_w_h_c);
+ __Pyx_GIVEREF(__pyx_v_w_h_c);
+ PyTuple_SET_ITEM(__pyx_t_17, 3+__pyx_t_9, __pyx_v_w_h_c);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_17, 4+__pyx_t_9, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_17, 5+__pyx_t_9, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_17, 6+__pyx_t_9, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_17, 7+__pyx_t_9, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_17, 8+__pyx_t_9, __pyx_t_15);
+ __pyx_t_6 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_17, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L26_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ }
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+ /* "silx/math/chistogramnd_lut.pyx":304
+ * filt_max_weights = True
+ *
+ * try: # <<<<<<<<<<<<<<
+ * _histogramnd_from_lut_fused(w_c,
+ * h_lut_c,
+ */
}
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
__Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
__Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
goto __pyx_L33_try_end;
__pyx_L26_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
__Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "chistogramnd_lut.pyx":305
+ /* "silx/math/chistogramnd_lut.pyx":314
* filt_max_weights,
* w_dtype.type(weight_max))
* except TypeError as ex: # <<<<<<<<<<<<<<
* print(ex)
* raise TypeError('Case not supported - weights:{0} '
*/
- __pyx_t_18 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_18) {
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_4, &__pyx_t_17) < 0) __PYX_ERR(0, 314, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
__Pyx_GOTREF(__pyx_t_4);
- __Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_17);
- __Pyx_INCREF(__pyx_t_7);
- __pyx_v_ex = __pyx_t_7;
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ex = __pyx_t_4;
- /* "chistogramnd_lut.pyx":306
+ /* "silx/math/chistogramnd_lut.pyx":315
* w_dtype.type(weight_max))
* except TypeError as ex:
* print(ex) # <<<<<<<<<<<<<<
* raise TypeError('Case not supported - weights:{0} '
* 'and histo:{1}.'
*/
- if (__Pyx_PrintOne(0, __pyx_v_ex) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
+ if (__Pyx_PrintOne(0, __pyx_v_ex) < 0) __PYX_ERR(0, 315, __pyx_L28_except_error)
- /* "chistogramnd_lut.pyx":309
+ /* "silx/math/chistogramnd_lut.pyx":318
* raise TypeError('Case not supported - weights:{0} '
* 'and histo:{1}.'
* ''.format(weights.dtype, histo.dtype)) # <<<<<<<<<<<<<<
*
* return histo, weighted_histo
*/
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Case_not_supported_weights_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Case_not_supported_weights_0_and, __pyx_n_s_format); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 318, __pyx_L28_except_error)
__Pyx_GOTREF(__pyx_t_11);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_10 = NULL;
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_weights, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_histo, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_6 = NULL;
__pyx_t_9 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
- if (likely(__pyx_t_10)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
- __Pyx_INCREF(__pyx_t_10);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
__pyx_t_9 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_10) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_10 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_8};
+ __pyx_t_15 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_8};
+ __pyx_t_15 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_6) {
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_8);
+ __pyx_t_7 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 318, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_11 = 0;
- __pyx_t_6 = 0;
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
- __Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
- /* "chistogramnd_lut.pyx":307
+ /* "silx/math/chistogramnd_lut.pyx":316
* except TypeError as ex:
* print(ex)
* raise TypeError('Case not supported - weights:{0} ' # <<<<<<<<<<<<<<
* 'and histo:{1}.'
* ''.format(weights.dtype, histo.dtype))
*/
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_15);
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 316, __pyx_L28_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
__Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_15);
__pyx_t_15 = 0;
- __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
+ __pyx_t_15 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 316, __pyx_L28_except_error)
__Pyx_GOTREF(__pyx_t_15);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__Pyx_Raise(__pyx_t_15, 0, 0, 0);
__Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L28_except_error;}
+ __PYX_ERR(0, 316, __pyx_L28_except_error)
}
goto __pyx_L28_except_error;
__pyx_L28_except_error:;
+
+ /* "silx/math/chistogramnd_lut.pyx":304
+ * filt_max_weights = True
+ *
+ * try: # <<<<<<<<<<<<<<
+ * _histogramnd_from_lut_fused(w_c,
+ * h_lut_c,
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_12);
__Pyx_XGIVEREF(__pyx_t_13);
__Pyx_XGIVEREF(__pyx_t_14);
@@ -5736,7 +7031,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__pyx_L33_try_end:;
}
- /* "chistogramnd_lut.pyx":311
+ /* "silx/math/chistogramnd_lut.pyx":320
* ''.format(weights.dtype, histo.dtype))
*
* return histo, weighted_histo # <<<<<<<<<<<<<<
@@ -5744,19 +7039,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
__Pyx_INCREF(__pyx_v_histo);
- PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_histo);
__Pyx_GIVEREF(__pyx_v_histo);
+ PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_v_histo);
__Pyx_INCREF(__pyx_v_weighted_histo);
- PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_weighted_histo);
__Pyx_GIVEREF(__pyx_v_weighted_histo);
+ PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_v_weighted_histo);
__pyx_r = __pyx_t_17;
__pyx_t_17 = 0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":206
+ /* "silx/math/chistogramnd_lut.pyx":211
*
*
* def histogramnd_from_lut(weights, # <<<<<<<<<<<<<<
@@ -5776,7 +7071,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_AddTraceback("chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.histogramnd_from_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_w_dtype);
@@ -5796,7 +7091,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
return __pyx_r;
}
-/* "chistogramnd_lut.pyx":323
+/* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -5805,17 +7100,14 @@ static PyObject *__pyx_pf_16chistogramnd_lut_2histogramnd_from_lut(CYTHON_UNUSED
*/
/* Python wrapper */
-static PyObject *__pyx_pw_16chistogramnd_lut_5_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused[] = "_histogramnd_from_lut_fused(signatures, args, kwargs, defaults)";
-static PyMethodDef __pyx_mdef_16chistogramnd_lut_5_histogramnd_from_lut_fused = {"_histogramnd_from_lut_fused", (PyCFunction)__pyx_pw_16chistogramnd_lut_5_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_pw_16chistogramnd_lut_5_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_5_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused[] = "_histogramnd_from_lut_fused(signatures, args, kwargs, defaults)";
+static PyMethodDef __pyx_mdef_4silx_4math_16chistogramnd_lut_5_histogramnd_from_lut_fused = {"_histogramnd_from_lut_fused", (PyCFunction)__pyx_pw_4silx_4math_16chistogramnd_lut_5_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_5_histogramnd_from_lut_fused(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);
@@ -5841,21 +7133,21 @@ static PyObject *__pyx_pw_16chistogramnd_lut_5_histogramnd_from_lut_fused(PyObje
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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -5872,30 +7164,30 @@ static PyObject *__pyx_pw_16chistogramnd_lut_5_histogramnd_from_lut_fused(PyObje
}
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 = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused(__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_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused(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;
+ PyTypeObject *__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_int32_t_is_signed;
int __pyx_v____pyx_int16_t_is_signed;
int __pyx_v____pyx_int64_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;
@@ -5916,58 +7208,54 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
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;
+ long __pyx_t_11;
+ __Pyx_memviewslice __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ PyObject *(*__pyx_t_16)(PyObject *);
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;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *(*__pyx_t_20)(PyObject *);
+ int __pyx_t_21;
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused", 0);
__Pyx_INCREF(__pyx_v_kwargs);
- __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1 * 3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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_INCREF(Py_None);
- PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_INCREF(Py_None);
- PyList_SET_ITEM(__pyx_t_1, 2, Py_None);
- __Pyx_GIVEREF(Py_None);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < 3; __pyx_temp++) {
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyList_SET_ITEM(__pyx_t_1, __pyx_temp, 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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
/*try:*/ {
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __pyx_v_ndarray = ((PyObject*)__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_ERR(0, 332, __pyx_L4_error)
+ __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
__pyx_t_1 = 0;
}
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -5975,16 +7263,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L11_try_end;
__pyx_L4_error:;
+ __Pyx_PyThreadState_assign
__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);
+ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
- __Pyx_AddTraceback("chistogramnd_lut.__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 = 323; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 332, __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_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)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;
@@ -5992,32 +7281,34 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
goto __pyx_L1_error;
__pyx_L5_exception_handled:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
__pyx_L11_try_end:;
}
- __pyx_v_itemsize = -1;
- __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0);
- __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
- __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0);
+ __pyx_v_itemsize = -1L;
+ __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
+ __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
+ __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
__pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
__Pyx_INCREF(__pyx_t_9);
@@ -6027,16 +7318,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_i_weights, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_i_weights, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_weights); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_weights); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_v_arg = __pyx_t_9;
__pyx_t_9 = 0;
@@ -6045,978 +7336,915 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
/*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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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));
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L18;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_arg_base = __pyx_t_8;
+ __pyx_t_8 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L18;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L18:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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_ERR(0, 332, __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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 332, __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_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L22_bool_binop_done:;
+ if (__pyx_t_3) {
+ 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_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L26_bool_binop_done:;
+ if (__pyx_t_3) {
+ 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_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'f':
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L30_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __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_int32_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 = 323; __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 = 323; __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_int32_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_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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_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 = 323; __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 = 323; __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_int64_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_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'f':
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float64_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 = 323; __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 = 323; __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);
- __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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L34_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 = 323; __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 = 323; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L34_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L30_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- goto __pyx_L21;
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L33_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L33_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __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_L37_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L36_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L36_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L37_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L36;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L36:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L41_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L40_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L40_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L41_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_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_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L40;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L40:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L45_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L44_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L44_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __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_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L45_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L44;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L44:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L49_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L48_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L48_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __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_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L49_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L48;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L48:;
- 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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
}
- __pyx_L17_break:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_L15:;
+ __pyx_L16_break:;
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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((1 < __pyx_t_10) != 0);
- if (__pyx_t_2) {
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_3 = ((1 < __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
__pyx_t_8 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 1);
__Pyx_INCREF(__pyx_t_8);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_8);
__pyx_t_8 = 0;
- goto __pyx_L52;
+ goto __pyx_L51;
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_2 = (__Pyx_PyDict_Contains(__pyx_n_s_i_lut, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_i_lut, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_lut); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_lut); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_8);
__pyx_t_8 = 0;
- goto __pyx_L52;
+ goto __pyx_L51;
}
/*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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L52:;
- if (0) {
- goto __pyx_L53;
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- /*else*/ {
- while (1) {
- if (!1) break;
- __pyx_t_3 = (__pyx_v_ndarray != ((PyObject*)Py_None));
+ __pyx_L51:;
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
+ __pyx_t_9 = 0;
+ goto __pyx_L55;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
__pyx_t_9 = 0;
- goto __pyx_L57;
- }
- __pyx_t_3 = (__pyx_memoryview_check(__pyx_v_arg) != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
- __pyx_t_2 = (__pyx_t_3 != 0);
- if (__pyx_t_2) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
- __pyx_t_9 = 0;
- goto __pyx_L58;
- }
- /*else*/ {
- __Pyx_INCREF(Py_None);
- __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
- }
- __pyx_L58:;
- goto __pyx_L57;
+ goto __pyx_L56;
}
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
}
- __pyx_L57:;
- __pyx_v_itemsize = -1;
- __pyx_t_2 = (__pyx_v_dtype != Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L56:;
+ goto __pyx_L55;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
+ }
+ __pyx_L55:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_itemsize = __pyx_t_10;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L59_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_itemsize = __pyx_t_10;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L59_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L59_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L63_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_char(__pyx_t_9); if (unlikely((__pyx_t_11 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L61_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L61_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L61_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L65_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L65_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ goto __pyx_L63_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L63_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L65_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L69_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L69_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ goto __pyx_L67_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L69_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- break;
- case 'f':
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ goto __pyx_L67_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L67_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- goto __pyx_L59;
+ break;
+ case 'f':
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __pyx_L59:;
- goto __pyx_L56;
}
- __pyx_L56:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L73_bool_binop_done;
- }
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L73_bool_binop_done:;
+ goto __pyx_L71_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L71_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L72;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L72:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L77_bool_binop_done;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L77_bool_binop_done:;
+ goto __pyx_L75_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L75_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L76;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L76:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L81_bool_binop_done;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L81_bool_binop_done:;
+ goto __pyx_L79_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L79_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L80;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L80:;
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
}
- __pyx_L55_break:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L53:;
+ __pyx_L53_break:;
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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
__pyx_t_3 = ((3 < __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
__pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 3);
__Pyx_INCREF(__pyx_t_9);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_9);
__pyx_t_9 = 0;
- goto __pyx_L84;
+ goto __pyx_L82;
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_o_weighted_histo, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_o_weighted_histo, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_o_weighted_histo); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_o_weighted_histo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_9);
__pyx_t_9 = 0;
- goto __pyx_L84;
+ goto __pyx_L82;
}
/*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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L84:;
- if (0) {
- goto __pyx_L85;
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- /*else*/ {
- while (1) {
- if (!1) break;
- __pyx_t_2 = (__pyx_v_ndarray != ((PyObject*)Py_None));
+ __pyx_L82:;
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_8);
+ __pyx_t_8 = 0;
+ goto __pyx_L86;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_8);
__pyx_t_8 = 0;
- goto __pyx_L89;
- }
- __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_8);
- __pyx_t_8 = 0;
- goto __pyx_L90;
- }
- /*else*/ {
- __Pyx_INCREF(Py_None);
- __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
- }
- __pyx_L90:;
- goto __pyx_L89;
+ goto __pyx_L87;
}
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
}
- __pyx_L89:;
- __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L87:;
+ goto __pyx_L86;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
+ }
+ __pyx_L86:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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_ERR(0, 332, __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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 332, __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_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L90_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L90_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L90_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L94_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L94_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L94_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
+ }
+ break;
+ case 'f':
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L98_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 332, __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_int32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L93_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 = 323; __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 = 323; __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_L93_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_L93_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_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_L97_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 = 323; __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 = 323; __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_L97_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_L97_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- break;
- case 'f':
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L101_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 = 323; __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 = 323; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L101_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L104_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 = 323; __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 = 323; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L104_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L98_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L101_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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_ERR(0, 332, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L101_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- goto __pyx_L91;
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __pyx_L91:;
- goto __pyx_L88;
}
- __pyx_L88:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L107_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L104_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L104_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L107_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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, 2, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L106;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L106:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L111_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L108_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L108_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L111_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_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, 2, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L110;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L110:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L115_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L112_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L112_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L115_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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, 2, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L114;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L114:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L119_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L116_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L116_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L119_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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, 2, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L118;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L118:;
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L87_break;
}
- __pyx_L87_break:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 2, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+ goto __pyx_L84_break;
}
- __pyx_L85:;
- __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L84_break:;
+ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_14 == 0)) break;
+ if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __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__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __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);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __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;
+ __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
+ __pyx_t_16 = 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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 332, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
- if (likely(!__pyx_t_15)) {
+ if (likely(!__pyx_t_16)) {
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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
- __pyx_t_1 = __pyx_t_15(__pyx_t_9);
+ __pyx_t_1 = __pyx_t_16(__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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 332, __pyx_L1_error)
}
break;
}
@@ -7024,7 +8252,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7032,104 +8260,100 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_18);
#else
- __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
#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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_19);
__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_L126_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_L126_unpacking_failed;
+ __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L123_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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = NULL;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- goto __pyx_L127_unpacking_done;
- __pyx_L126_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_19 = NULL;
+ index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L123_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_20 = NULL;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ goto __pyx_L124_unpacking_done;
+ __pyx_L123_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L127_unpacking_done:;
+ __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_L124_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_XDECREF_SET(__pyx_v_src_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 = 323; __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
+ __pyx_t_18 = 0;
+ __pyx_t_3 = (__pyx_v_dst_type != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __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_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
+ if (__pyx_t_2) {
__pyx_v_match_found = 1;
- goto __pyx_L129;
+ goto __pyx_L126;
}
/*else*/ {
__pyx_v_match_found = 0;
- goto __pyx_L125_break;
+ goto __pyx_L122_break;
}
- __pyx_L129:;
- goto __pyx_L128;
+ __pyx_L126:;
}
- __pyx_L128:;
}
- __pyx_L125_break:;
+ __pyx_L122_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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L130;
+ __pyx_t_2 = (__pyx_v_match_found != 0);
+ if (__pyx_t_2) {
+ __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
}
- __pyx_L130:;
}
__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__18, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
+ __pyx_t_3 = ((!__pyx_t_2) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __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__19, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 332, __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 = 323; __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)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
@@ -7141,10 +8365,10 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
__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("chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dest_sig);
@@ -7164,9 +8388,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_4_histogramnd_from_lut_fused(CYTHON
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_0_0__pyx_mdef_16chistogramnd_lut_9_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_9_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_9_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_9_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_9_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -7176,9 +8400,6 @@ static PyObject *__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -7209,46 +8430,46 @@ static PyObject *__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -7263,50 +8484,50 @@ static PyObject *__pyx_fuse_0_0_0__pyx_pw_16chistogramnd_lut_9_histogramnd_from_
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_8_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_0_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -7320,7 +8541,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -7331,7 +8552,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -7342,7 +8563,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -7361,7 +8582,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -7369,9 +8590,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -7390,7 +8619,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -7398,9 +8627,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -7411,7 +8648,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -7422,14 +8659,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -7447,7 +8690,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -7467,9 +8710,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_8_histogramnd_from_lut_fused(CYTHON
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_0_1__pyx_mdef_16chistogramnd_lut_11_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_11_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_11_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_11_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_11_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -7479,9 +8722,6 @@ static PyObject *__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -7512,46 +8752,46 @@ static PyObject *__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -7566,50 +8806,50 @@ static PyObject *__pyx_fuse_0_0_1__pyx_pw_16chistogramnd_lut_11_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_10_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_0_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -7623,7 +8863,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -7634,7 +8874,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -7645,7 +8885,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -7664,7 +8904,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -7672,9 +8912,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -7693,7 +8941,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -7701,9 +8949,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -7714,7 +8970,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -7725,14 +8981,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -7750,7 +9012,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -7770,9 +9032,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_10_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_0_2__pyx_mdef_16chistogramnd_lut_13_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_13_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_13_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_13_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_13_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -7782,9 +9044,6 @@ static PyObject *__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -7815,46 +9074,46 @@ static PyObject *__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -7869,50 +9128,50 @@ static PyObject *__pyx_fuse_0_0_2__pyx_pw_16chistogramnd_lut_13_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_12_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_0_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -7926,7 +9185,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -7937,7 +9196,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -7948,7 +9207,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -7967,7 +9226,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -7975,9 +9234,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -7996,7 +9263,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -8004,9 +9271,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -8017,7 +9292,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -8028,14 +9303,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8053,7 +9334,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -8073,9 +9354,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_12_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_0_3__pyx_mdef_16chistogramnd_lut_15_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_15_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_15_histogramnd_from_lut_fused = {"__pyx_fuse_0_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_15_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_15_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -8085,9 +9366,6 @@ static PyObject *__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -8118,46 +9396,46 @@ static PyObject *__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -8172,50 +9450,50 @@ static PyObject *__pyx_fuse_0_0_3__pyx_pw_16chistogramnd_lut_15_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_14_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_0_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8229,7 +9507,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -8240,7 +9518,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -8251,7 +9529,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -8270,7 +9548,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -8278,9 +9556,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -8299,7 +9585,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -8307,9 +9593,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -8320,7 +9614,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -8331,14 +9625,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8356,7 +9656,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -8376,9 +9676,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_14_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_1_0__pyx_mdef_16chistogramnd_lut_17_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_17_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_17_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_17_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_17_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -8388,9 +9688,6 @@ static PyObject *__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -8421,46 +9718,46 @@ static PyObject *__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -8475,50 +9772,50 @@ static PyObject *__pyx_fuse_0_1_0__pyx_pw_16chistogramnd_lut_17_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_16_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_1_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8532,7 +9829,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -8543,7 +9840,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -8554,7 +9851,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -8573,7 +9870,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -8581,9 +9878,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -8602,7 +9907,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -8610,9 +9915,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -8623,7 +9936,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -8634,14 +9947,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8659,7 +9978,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -8679,9 +9998,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_16_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_1_1__pyx_mdef_16chistogramnd_lut_19_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_19_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_19_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_19_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_19_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -8691,9 +10010,6 @@ static PyObject *__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -8724,46 +10040,46 @@ static PyObject *__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -8778,50 +10094,50 @@ static PyObject *__pyx_fuse_0_1_1__pyx_pw_16chistogramnd_lut_19_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_18_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_1_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8835,7 +10151,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -8846,7 +10162,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -8857,7 +10173,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -8876,7 +10192,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -8884,9 +10200,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -8905,7 +10229,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -8913,9 +10237,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -8926,7 +10258,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -8937,14 +10269,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -8962,7 +10300,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -8982,9 +10320,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_18_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_1_2__pyx_mdef_16chistogramnd_lut_21_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_21_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_21_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_21_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_21_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -8994,9 +10332,6 @@ static PyObject *__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -9027,46 +10362,46 @@ static PyObject *__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -9081,50 +10416,50 @@ static PyObject *__pyx_fuse_0_1_2__pyx_pw_16chistogramnd_lut_21_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_20_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_1_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9138,7 +10473,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -9149,7 +10484,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -9160,7 +10495,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -9179,7 +10514,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -9187,9 +10522,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -9208,7 +10551,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -9216,9 +10559,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -9229,7 +10580,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -9240,14 +10591,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9265,7 +10622,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -9285,9 +10642,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_20_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_1_3__pyx_mdef_16chistogramnd_lut_23_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_23_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_23_histogramnd_from_lut_fused = {"__pyx_fuse_0_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_23_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_23_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -9297,9 +10654,6 @@ static PyObject *__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -9330,46 +10684,46 @@ static PyObject *__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -9384,50 +10738,50 @@ static PyObject *__pyx_fuse_0_1_3__pyx_pw_16chistogramnd_lut_23_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_22_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_1_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9441,7 +10795,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -9452,7 +10806,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -9463,7 +10817,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -9482,7 +10836,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -9490,9 +10844,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -9511,7 +10873,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -9519,9 +10881,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -9532,7 +10902,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -9543,14 +10913,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9568,7 +10944,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -9588,9 +10964,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_22_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_2_0__pyx_mdef_16chistogramnd_lut_25_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_25_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_25_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_25_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_25_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -9600,9 +10976,6 @@ static PyObject *__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -9633,46 +11006,46 @@ static PyObject *__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -9687,50 +11060,50 @@ static PyObject *__pyx_fuse_0_2_0__pyx_pw_16chistogramnd_lut_25_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_24_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_2_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9744,7 +11117,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -9755,7 +11128,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -9766,7 +11139,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -9785,7 +11158,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -9793,9 +11166,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -9814,7 +11195,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -9822,9 +11203,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -9835,7 +11224,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -9846,14 +11235,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -9871,7 +11266,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -9891,9 +11286,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_24_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_2_1__pyx_mdef_16chistogramnd_lut_27_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_27_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_27_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_27_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_27_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -9903,9 +11298,6 @@ static PyObject *__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -9936,46 +11328,46 @@ static PyObject *__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -9990,50 +11382,50 @@ static PyObject *__pyx_fuse_0_2_1__pyx_pw_16chistogramnd_lut_27_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_26_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_2_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10047,7 +11439,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -10058,7 +11450,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -10069,7 +11461,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -10088,7 +11480,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -10096,9 +11488,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -10117,7 +11517,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -10125,9 +11525,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -10138,7 +11546,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -10149,14 +11557,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10174,7 +11588,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -10194,9 +11608,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_26_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_2_2__pyx_mdef_16chistogramnd_lut_29_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_29_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_29_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_29_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_29_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -10206,9 +11620,6 @@ static PyObject *__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -10239,46 +11650,46 @@ static PyObject *__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -10293,50 +11704,50 @@ static PyObject *__pyx_fuse_0_2_2__pyx_pw_16chistogramnd_lut_29_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_28_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_2_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10350,7 +11761,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -10361,7 +11772,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -10372,7 +11783,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -10391,7 +11802,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -10399,9 +11810,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -10420,7 +11839,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -10428,9 +11847,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -10441,7 +11868,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -10452,14 +11879,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10477,7 +11910,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -10497,9 +11930,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_28_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_2_3__pyx_mdef_16chistogramnd_lut_31_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_31_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_31_histogramnd_from_lut_fused = {"__pyx_fuse_0_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_0_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_31_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_0_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_31_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -10509,9 +11942,6 @@ static PyObject *__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from
__pyx_t_5numpy_float64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -10542,46 +11972,46 @@ static PyObject *__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -10596,50 +12026,50 @@ static PyObject *__pyx_fuse_0_2_3__pyx_pw_16chistogramnd_lut_31_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsDouble(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_30_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_2_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10653,7 +12083,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -10664,7 +12094,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -10675,7 +12105,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -10694,7 +12124,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -10702,9 +12132,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -10723,7 +12161,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -10731,9 +12169,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -10744,7 +12190,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -10755,14 +12201,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10780,7 +12232,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -10800,9 +12252,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_30_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_0_0__pyx_mdef_16chistogramnd_lut_33_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_33_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_33_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_33_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_33_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -10812,9 +12264,6 @@ static PyObject *__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -10845,46 +12294,46 @@ static PyObject *__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -10899,50 +12348,50 @@ static PyObject *__pyx_fuse_1_0_0__pyx_pw_16chistogramnd_lut_33_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_32_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_0_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -10956,7 +12405,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -10967,7 +12416,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -10978,7 +12427,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -10997,7 +12446,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -11005,9 +12454,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -11026,7 +12483,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -11034,9 +12491,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -11047,7 +12512,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -11058,14 +12523,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11083,7 +12554,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -11103,9 +12574,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_32_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_0_1__pyx_mdef_16chistogramnd_lut_35_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_35_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_35_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_35_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_35_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -11115,9 +12586,6 @@ static PyObject *__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -11148,46 +12616,46 @@ static PyObject *__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -11202,50 +12670,50 @@ static PyObject *__pyx_fuse_1_0_1__pyx_pw_16chistogramnd_lut_35_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_34_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_0_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11259,7 +12727,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -11270,7 +12738,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -11281,7 +12749,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -11300,7 +12768,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -11308,9 +12776,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -11329,7 +12805,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -11337,9 +12813,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -11350,7 +12834,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -11361,14 +12845,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11386,7 +12876,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -11406,9 +12896,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_34_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_0_2__pyx_mdef_16chistogramnd_lut_37_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_37_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_37_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_37_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_37_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -11418,9 +12908,6 @@ static PyObject *__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -11451,46 +12938,46 @@ static PyObject *__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -11505,50 +12992,50 @@ static PyObject *__pyx_fuse_1_0_2__pyx_pw_16chistogramnd_lut_37_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_36_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_0_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11562,7 +13049,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -11573,7 +13060,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -11584,7 +13071,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -11603,7 +13090,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -11611,9 +13098,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -11632,7 +13127,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -11640,9 +13135,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -11653,7 +13156,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -11664,14 +13167,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11689,7 +13198,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -11709,9 +13218,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_36_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_0_3__pyx_mdef_16chistogramnd_lut_39_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_39_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_39_histogramnd_from_lut_fused = {"__pyx_fuse_1_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_39_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_39_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -11721,9 +13230,6 @@ static PyObject *__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -11754,46 +13260,46 @@ static PyObject *__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -11808,50 +13314,50 @@ static PyObject *__pyx_fuse_1_0_3__pyx_pw_16chistogramnd_lut_39_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_38_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_0_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11865,7 +13371,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -11876,7 +13382,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -11887,7 +13393,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -11906,7 +13412,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -11914,9 +13420,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -11935,7 +13449,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -11943,9 +13457,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -11956,7 +13478,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -11967,14 +13489,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -11992,7 +13520,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -12012,9 +13540,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_38_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_1_0__pyx_mdef_16chistogramnd_lut_41_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_41_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_41_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_41_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_41_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -12024,9 +13552,6 @@ static PyObject *__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -12057,46 +13582,46 @@ static PyObject *__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -12111,50 +13636,50 @@ static PyObject *__pyx_fuse_1_1_0__pyx_pw_16chistogramnd_lut_41_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_40_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_1_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12168,7 +13693,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -12179,7 +13704,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -12190,7 +13715,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -12209,7 +13734,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -12217,9 +13742,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -12238,7 +13771,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -12246,9 +13779,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -12259,7 +13800,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -12270,14 +13811,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12295,7 +13842,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -12315,9 +13862,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_40_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_1_1__pyx_mdef_16chistogramnd_lut_43_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_43_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_43_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_43_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_43_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -12327,9 +13874,6 @@ static PyObject *__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -12360,46 +13904,46 @@ static PyObject *__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -12414,50 +13958,50 @@ static PyObject *__pyx_fuse_1_1_1__pyx_pw_16chistogramnd_lut_43_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_42_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_1_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12471,7 +14015,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -12482,7 +14026,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -12493,7 +14037,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -12512,7 +14056,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -12520,9 +14064,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -12541,7 +14093,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -12549,9 +14101,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -12562,7 +14122,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -12573,14 +14133,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12598,7 +14164,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -12618,9 +14184,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_42_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_1_2__pyx_mdef_16chistogramnd_lut_45_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_45_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_45_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_45_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_45_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -12630,9 +14196,6 @@ static PyObject *__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -12663,46 +14226,46 @@ static PyObject *__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -12717,50 +14280,50 @@ static PyObject *__pyx_fuse_1_1_2__pyx_pw_16chistogramnd_lut_45_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_44_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_1_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12774,7 +14337,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -12785,7 +14348,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -12796,7 +14359,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -12815,7 +14378,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -12823,9 +14386,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -12844,7 +14415,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -12852,9 +14423,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -12865,7 +14444,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -12876,14 +14455,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -12901,7 +14486,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -12921,9 +14506,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_44_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_1_3__pyx_mdef_16chistogramnd_lut_47_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_47_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_47_histogramnd_from_lut_fused = {"__pyx_fuse_1_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_47_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_47_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -12933,9 +14518,6 @@ static PyObject *__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -12966,46 +14548,46 @@ static PyObject *__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -13020,50 +14602,50 @@ static PyObject *__pyx_fuse_1_1_3__pyx_pw_16chistogramnd_lut_47_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_46_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_1_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13077,7 +14659,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -13088,7 +14670,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -13099,7 +14681,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -13118,7 +14700,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -13126,9 +14708,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -13147,7 +14737,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -13155,9 +14745,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -13168,7 +14766,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -13179,14 +14777,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13204,7 +14808,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -13224,9 +14828,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_46_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_2_0__pyx_mdef_16chistogramnd_lut_49_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_49_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_49_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_49_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_49_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -13236,9 +14840,6 @@ static PyObject *__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -13269,46 +14870,46 @@ static PyObject *__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -13323,50 +14924,50 @@ static PyObject *__pyx_fuse_1_2_0__pyx_pw_16chistogramnd_lut_49_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_48_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_2_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13380,7 +14981,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -13391,7 +14992,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -13402,7 +15003,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -13421,7 +15022,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -13429,9 +15030,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -13450,7 +15059,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -13458,9 +15067,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -13471,7 +15088,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -13482,14 +15099,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13507,7 +15130,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -13527,9 +15150,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_48_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_2_1__pyx_mdef_16chistogramnd_lut_51_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_51_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_51_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_51_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_51_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -13539,9 +15162,6 @@ static PyObject *__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -13572,46 +15192,46 @@ static PyObject *__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -13626,50 +15246,50 @@ static PyObject *__pyx_fuse_1_2_1__pyx_pw_16chistogramnd_lut_51_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_50_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_2_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13683,7 +15303,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -13694,7 +15314,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -13705,7 +15325,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -13724,7 +15344,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -13732,9 +15352,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -13753,7 +15381,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -13761,9 +15389,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -13774,7 +15410,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -13785,14 +15421,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13810,7 +15452,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -13830,9 +15472,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_50_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_2_2__pyx_mdef_16chistogramnd_lut_53_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_53_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_53_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_53_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_53_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -13842,9 +15484,6 @@ static PyObject *__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -13875,46 +15514,46 @@ static PyObject *__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -13929,50 +15568,50 @@ static PyObject *__pyx_fuse_1_2_2__pyx_pw_16chistogramnd_lut_53_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_52_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_2_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -13986,7 +15625,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -13997,7 +15636,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -14008,7 +15647,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -14027,7 +15666,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -14035,9 +15674,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -14056,7 +15703,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -14064,9 +15711,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -14077,7 +15732,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -14088,14 +15743,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14113,7 +15774,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -14133,9 +15794,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_52_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_2_3__pyx_mdef_16chistogramnd_lut_55_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_55_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_55_histogramnd_from_lut_fused = {"__pyx_fuse_1_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_1_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_55_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_1_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_55_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -14145,9 +15806,6 @@ static PyObject *__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from
__pyx_t_5numpy_float32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_float32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -14178,46 +15836,46 @@ static PyObject *__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -14232,50 +15890,50 @@ static PyObject *__pyx_fuse_1_2_3__pyx_pw_16chistogramnd_lut_55_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_float32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __pyx_PyFloat_AsFloat(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __pyx_PyFloat_AsFloat(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_float32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_54_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_float32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_2_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14289,7 +15947,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -14300,7 +15958,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -14311,7 +15969,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -14330,7 +15988,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -14338,9 +15996,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -14359,7 +16025,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -14367,9 +16033,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -14380,7 +16054,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -14391,14 +16065,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14416,7 +16096,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -14436,9 +16116,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_54_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_0_0__pyx_mdef_16chistogramnd_lut_57_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_57_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_57_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_57_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_57_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -14448,9 +16128,6 @@ static PyObject *__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -14481,46 +16158,46 @@ static PyObject *__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -14535,50 +16212,50 @@ static PyObject *__pyx_fuse_2_0_0__pyx_pw_16chistogramnd_lut_57_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_56_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_0_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14592,7 +16269,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -14603,7 +16280,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -14614,7 +16291,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -14633,7 +16310,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -14641,9 +16318,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -14662,7 +16347,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -14670,9 +16355,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -14683,7 +16376,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -14694,14 +16387,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14719,7 +16418,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -14739,9 +16438,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_56_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_0_1__pyx_mdef_16chistogramnd_lut_59_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_59_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_59_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_59_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_59_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -14751,9 +16450,6 @@ static PyObject *__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -14784,46 +16480,46 @@ static PyObject *__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -14838,50 +16534,50 @@ static PyObject *__pyx_fuse_2_0_1__pyx_pw_16chistogramnd_lut_59_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_58_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_0_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -14895,7 +16591,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -14906,7 +16602,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -14917,7 +16613,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -14936,7 +16632,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -14944,9 +16640,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -14965,7 +16669,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -14973,9 +16677,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -14986,7 +16698,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -14997,14 +16709,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15022,7 +16740,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -15042,9 +16760,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_58_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_0_2__pyx_mdef_16chistogramnd_lut_61_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_61_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_61_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_61_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_61_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -15054,9 +16772,6 @@ static PyObject *__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -15087,46 +16802,46 @@ static PyObject *__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -15141,50 +16856,50 @@ static PyObject *__pyx_fuse_2_0_2__pyx_pw_16chistogramnd_lut_61_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_60_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_0_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15198,7 +16913,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -15209,7 +16924,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -15220,7 +16935,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -15239,7 +16954,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -15247,9 +16962,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -15268,7 +16991,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -15276,9 +16999,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -15289,7 +17020,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -15300,14 +17031,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15325,7 +17062,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -15345,9 +17082,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_60_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_0_3__pyx_mdef_16chistogramnd_lut_63_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_63_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_63_histogramnd_from_lut_fused = {"__pyx_fuse_2_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_63_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_63_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -15357,9 +17094,6 @@ static PyObject *__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -15390,46 +17124,46 @@ static PyObject *__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -15444,50 +17178,50 @@ static PyObject *__pyx_fuse_2_0_3__pyx_pw_16chistogramnd_lut_63_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_62_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_0_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15501,7 +17235,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -15512,7 +17246,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -15523,7 +17257,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -15542,7 +17276,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -15550,9 +17284,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -15571,7 +17313,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -15579,9 +17321,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -15592,7 +17342,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -15603,14 +17353,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15628,7 +17384,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -15648,9 +17404,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_62_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_1_0__pyx_mdef_16chistogramnd_lut_65_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_65_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_65_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_65_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_65_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -15660,9 +17416,6 @@ static PyObject *__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -15693,46 +17446,46 @@ static PyObject *__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -15747,50 +17500,50 @@ static PyObject *__pyx_fuse_2_1_0__pyx_pw_16chistogramnd_lut_65_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_64_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_1_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15804,7 +17557,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -15815,7 +17568,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -15826,7 +17579,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -15845,7 +17598,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -15853,9 +17606,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -15874,7 +17635,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -15882,9 +17643,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -15895,7 +17664,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -15906,14 +17675,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -15931,7 +17706,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -15951,9 +17726,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_64_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_1_1__pyx_mdef_16chistogramnd_lut_67_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_67_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_67_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_67_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_67_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -15963,9 +17738,6 @@ static PyObject *__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -15996,46 +17768,46 @@ static PyObject *__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -16050,50 +17822,50 @@ static PyObject *__pyx_fuse_2_1_1__pyx_pw_16chistogramnd_lut_67_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_66_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_1_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16107,7 +17879,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -16118,7 +17890,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -16129,7 +17901,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -16148,7 +17920,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -16156,9 +17928,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -16177,7 +17957,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -16185,9 +17965,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -16198,7 +17986,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -16209,14 +17997,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16234,7 +18028,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -16254,9 +18048,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_66_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_1_2__pyx_mdef_16chistogramnd_lut_69_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_69_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_69_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_69_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_69_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -16266,9 +18060,6 @@ static PyObject *__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -16299,46 +18090,46 @@ static PyObject *__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -16353,50 +18144,50 @@ static PyObject *__pyx_fuse_2_1_2__pyx_pw_16chistogramnd_lut_69_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_68_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_1_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16410,7 +18201,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -16421,7 +18212,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -16432,7 +18223,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -16451,7 +18242,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -16459,9 +18250,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -16480,7 +18279,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -16488,9 +18287,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -16501,7 +18308,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -16512,14 +18319,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16537,7 +18350,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -16557,9 +18370,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_68_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_1_3__pyx_mdef_16chistogramnd_lut_71_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_71_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_71_histogramnd_from_lut_fused = {"__pyx_fuse_2_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_71_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_71_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -16569,9 +18382,6 @@ static PyObject *__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -16602,46 +18412,46 @@ static PyObject *__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -16656,50 +18466,50 @@ static PyObject *__pyx_fuse_2_1_3__pyx_pw_16chistogramnd_lut_71_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_70_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_1_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16713,7 +18523,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -16724,7 +18534,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -16735,7 +18545,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -16754,7 +18564,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -16762,9 +18572,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -16783,7 +18601,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -16791,9 +18609,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -16804,7 +18630,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -16815,14 +18641,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -16840,7 +18672,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -16860,9 +18692,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_70_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_2_0__pyx_mdef_16chistogramnd_lut_73_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_73_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_73_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_73_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_73_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -16872,9 +18704,6 @@ static PyObject *__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -16905,46 +18734,46 @@ static PyObject *__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -16959,50 +18788,50 @@ static PyObject *__pyx_fuse_2_2_0__pyx_pw_16chistogramnd_lut_73_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_72_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_2_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17016,7 +18845,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -17027,7 +18856,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -17038,7 +18867,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -17057,7 +18886,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -17065,9 +18894,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -17086,7 +18923,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -17094,9 +18931,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -17107,7 +18952,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -17118,14 +18963,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17143,7 +18994,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -17163,9 +19014,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_72_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_2_1__pyx_mdef_16chistogramnd_lut_75_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_75_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_75_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_75_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_75_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -17175,9 +19026,6 @@ static PyObject *__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -17208,46 +19056,46 @@ static PyObject *__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -17262,50 +19110,50 @@ static PyObject *__pyx_fuse_2_2_1__pyx_pw_16chistogramnd_lut_75_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_74_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_2_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17319,7 +19167,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -17330,7 +19178,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -17341,7 +19189,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -17360,7 +19208,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -17368,9 +19216,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -17389,7 +19245,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -17397,9 +19253,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -17410,7 +19274,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -17421,14 +19285,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17446,7 +19316,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -17466,9 +19336,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_74_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_2_2__pyx_mdef_16chistogramnd_lut_77_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_77_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_77_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_77_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_77_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -17478,9 +19348,6 @@ static PyObject *__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -17511,46 +19378,46 @@ static PyObject *__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -17565,50 +19432,50 @@ static PyObject *__pyx_fuse_2_2_2__pyx_pw_16chistogramnd_lut_77_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_76_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_2_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17622,7 +19489,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -17633,7 +19500,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -17644,7 +19511,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -17663,7 +19530,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -17671,9 +19538,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -17692,7 +19567,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -17700,9 +19575,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -17713,7 +19596,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -17724,14 +19607,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17749,7 +19638,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -17769,9 +19658,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_76_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_2_3__pyx_mdef_16chistogramnd_lut_79_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_79_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_79_histogramnd_from_lut_fused = {"__pyx_fuse_2_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_2_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_79_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_2_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_79_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -17781,9 +19670,6 @@ static PyObject *__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from
__pyx_t_5numpy_int32_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int32_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -17814,46 +19700,46 @@ static PyObject *__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -17868,50 +19754,50 @@ static PyObject *__pyx_fuse_2_2_3__pyx_pw_16chistogramnd_lut_79_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int32(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int32(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_78_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int32_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_2_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -17925,7 +19811,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -17936,7 +19822,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -17947,7 +19833,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -17966,7 +19852,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -17974,9 +19860,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -17995,7 +19889,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -18003,9 +19897,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -18016,7 +19918,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -18027,14 +19929,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18052,7 +19960,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -18072,9 +19980,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_78_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_0_0__pyx_mdef_16chistogramnd_lut_81_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_81_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_81_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_81_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_81_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -18084,9 +19992,6 @@ static PyObject *__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -18117,46 +20022,46 @@ static PyObject *__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -18171,50 +20076,50 @@ static PyObject *__pyx_fuse_3_0_0__pyx_pw_16chistogramnd_lut_81_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_80_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_0_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18228,7 +20133,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -18239,7 +20144,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -18250,7 +20155,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -18269,7 +20174,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -18277,9 +20182,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -18298,7 +20211,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -18306,9 +20219,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -18319,7 +20240,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -18330,14 +20251,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18355,7 +20282,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -18375,9 +20302,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_80_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_0_1__pyx_mdef_16chistogramnd_lut_83_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_83_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_83_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_83_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_83_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -18387,9 +20314,6 @@ static PyObject *__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -18420,46 +20344,46 @@ static PyObject *__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -18474,50 +20398,50 @@ static PyObject *__pyx_fuse_3_0_1__pyx_pw_16chistogramnd_lut_83_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_82_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_0_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18531,7 +20455,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -18542,7 +20466,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -18553,7 +20477,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -18572,7 +20496,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -18580,9 +20504,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -18601,7 +20533,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -18609,9 +20541,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -18622,7 +20562,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -18633,14 +20573,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18658,7 +20604,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -18678,9 +20624,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_82_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_0_2__pyx_mdef_16chistogramnd_lut_85_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_85_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_85_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_85_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_85_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -18690,9 +20636,6 @@ static PyObject *__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -18723,46 +20666,46 @@ static PyObject *__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -18777,50 +20720,50 @@ static PyObject *__pyx_fuse_3_0_2__pyx_pw_16chistogramnd_lut_85_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_84_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_0_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18834,7 +20777,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -18845,7 +20788,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -18856,7 +20799,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -18875,7 +20818,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -18883,9 +20826,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -18904,7 +20855,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -18912,9 +20863,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -18925,7 +20884,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -18936,14 +20895,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -18961,7 +20926,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -18981,9 +20946,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_84_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_0_3__pyx_mdef_16chistogramnd_lut_87_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_87_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_87_histogramnd_from_lut_fused = {"__pyx_fuse_3_0_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_87_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_0_3__pyx_pw_4silx_4math_16chistogramnd_lut_87_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -18993,9 +20958,6 @@ static PyObject *__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -19026,46 +20988,46 @@ static PyObject *__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -19080,50 +21042,50 @@ static PyObject *__pyx_fuse_3_0_3__pyx_pw_16chistogramnd_lut_87_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_86_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__pyx_t_5numpy_int64_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
__pyx_t_5numpy_int64_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_0_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19137,7 +21099,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -19148,7 +21110,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -19159,7 +21121,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -19178,7 +21140,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -19186,9 +21148,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -19207,7 +21177,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -19215,9 +21185,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -19228,7 +21206,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -19239,14 +21217,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19264,7 +21248,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -19284,9 +21268,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_86_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_1_0__pyx_mdef_16chistogramnd_lut_89_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_89_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_89_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_89_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_89_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -19296,9 +21280,6 @@ static PyObject *__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -19329,46 +21310,46 @@ static PyObject *__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -19383,50 +21364,50 @@ static PyObject *__pyx_fuse_3_1_0__pyx_pw_16chistogramnd_lut_89_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_88_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_1_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19440,7 +21421,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -19451,7 +21432,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -19462,7 +21443,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -19481,7 +21462,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -19489,9 +21470,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -19510,7 +21499,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -19518,9 +21507,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -19531,7 +21528,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -19542,14 +21539,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19567,7 +21570,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -19587,9 +21590,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_88_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_1_1__pyx_mdef_16chistogramnd_lut_91_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_91_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_91_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_91_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_91_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -19599,9 +21602,6 @@ static PyObject *__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -19632,46 +21632,46 @@ static PyObject *__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -19686,50 +21686,50 @@ static PyObject *__pyx_fuse_3_1_1__pyx_pw_16chistogramnd_lut_91_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_90_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_1_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19743,7 +21743,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -19754,7 +21754,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -19765,7 +21765,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -19784,7 +21784,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -19792,9 +21792,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -19813,7 +21821,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -19821,9 +21829,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -19834,7 +21850,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -19845,14 +21861,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -19870,7 +21892,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -19890,9 +21912,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_90_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_1_2__pyx_mdef_16chistogramnd_lut_93_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_93_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_93_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_93_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_93_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -19902,9 +21924,6 @@ static PyObject *__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -19935,46 +21954,46 @@ static PyObject *__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -19989,50 +22008,50 @@ static PyObject *__pyx_fuse_3_1_2__pyx_pw_16chistogramnd_lut_93_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_92_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_1_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20046,7 +22065,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -20057,7 +22076,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -20068,7 +22087,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -20087,7 +22106,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -20095,9 +22114,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -20116,7 +22143,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -20124,9 +22151,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -20137,7 +22172,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -20148,14 +22183,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20173,7 +22214,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -20193,9 +22234,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_92_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_1_3__pyx_mdef_16chistogramnd_lut_95_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_95_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_95_histogramnd_from_lut_fused = {"__pyx_fuse_3_1_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_95_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_1_3__pyx_pw_4silx_4math_16chistogramnd_lut_95_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -20205,9 +22246,6 @@ static PyObject *__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -20238,46 +22276,46 @@ static PyObject *__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -20292,50 +22330,50 @@ static PyObject *__pyx_fuse_3_1_3__pyx_pw_16chistogramnd_lut_95_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_94_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int32_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int32_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_1_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20349,7 +22387,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -20360,7 +22398,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -20371,7 +22409,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -20390,7 +22428,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -20398,9 +22436,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -20419,7 +22465,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -20427,9 +22473,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -20440,7 +22494,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -20451,14 +22505,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20476,7 +22536,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -20496,9 +22556,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_94_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_2_0__pyx_mdef_16chistogramnd_lut_97_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_97_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_97_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_0_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_97_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_97_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -20508,9 +22568,6 @@ static PyObject *__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -20541,46 +22598,46 @@ static PyObject *__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -20595,50 +22652,50 @@ static PyObject *__pyx_fuse_3_2_0__pyx_pw_16chistogramnd_lut_97_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_96_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_2_0_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20652,7 +22709,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -20663,7 +22720,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -20674,7 +22731,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -20693,7 +22750,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -20701,9 +22758,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -20722,7 +22787,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -20730,9 +22795,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -20743,7 +22816,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -20754,14 +22827,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20779,7 +22858,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -20799,9 +22878,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_96_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_2_1__pyx_mdef_16chistogramnd_lut_99_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_99_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_99_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_1_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_99_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_99_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -20811,9 +22890,6 @@ static PyObject *__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -20844,46 +22920,46 @@ static PyObject *__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -20898,50 +22974,50 @@ static PyObject *__pyx_fuse_3_2_1__pyx_pw_16chistogramnd_lut_99_histogramnd_from
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_98_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_2_1_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -20955,7 +23031,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -20966,7 +23042,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -20977,7 +23053,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -20996,7 +23072,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -21004,9 +23080,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -21025,7 +23109,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -21033,9 +23117,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -21046,7 +23138,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -21057,14 +23149,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_float32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -21082,7 +23180,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -21102,9 +23200,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_98_histogramnd_from_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_2_2__pyx_mdef_16chistogramnd_lut_101_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_101_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_101_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_2_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_101_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_101_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -21114,9 +23212,6 @@ static PyObject *__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_fro
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -21147,46 +23242,46 @@ static PyObject *__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_fro
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -21201,50 +23296,50 @@ static PyObject *__pyx_fuse_3_2_2__pyx_pw_16chistogramnd_lut_101_histogramnd_fro
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_100_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_2_2_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -21258,7 +23353,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -21269,7 +23364,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -21280,7 +23375,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -21299,7 +23394,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -21307,9 +23402,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -21328,7 +23431,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -21336,9 +23439,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -21349,7 +23460,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -21360,14 +23471,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int32_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -21385,7 +23502,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -21405,9 +23522,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_100_histogramnd_from_lut_fused(CYTH
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_2_3__pyx_mdef_16chistogramnd_lut_103_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_4_histogramnd_from_lut_fused};
-static PyObject *__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_103_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_103_histogramnd_from_lut_fused = {"__pyx_fuse_3_2_3_histogramnd_from_lut_fused", (PyCFunction)__pyx_fuse_3_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_103_histogramnd_from_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_4_histogramnd_from_lut_fused};
+static PyObject *__pyx_fuse_3_2_3__pyx_pw_4silx_4math_16chistogramnd_lut_103_histogramnd_from_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_weights = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_i_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -21417,9 +23534,6 @@ static PyObject *__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_fro
__pyx_t_5numpy_int64_t __pyx_v_i_weight_min;
int __pyx_v_i_filt_max_weights;
__pyx_t_5numpy_int64_t __pyx_v_i_weight_max;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_from_lut_fused (wrapper)", 0);
@@ -21450,46 +23564,46 @@ static PyObject *__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_fro
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 1); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 2); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_weighted_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 3); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 4); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_min_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 5); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_min)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 6); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_filt_max_weights)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 7); __PYX_ERR(0, 332, __pyx_L3_error)
}
case 8:
if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_weight_max)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, 8); __PYX_ERR(0, 332, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_from_lut_fused") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
goto __pyx_L5_argtuple_error;
@@ -21504,50 +23618,50 @@ static PyObject *__pyx_fuse_3_2_3__pyx_pw_16chistogramnd_lut_103_histogramnd_fro
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
}
- __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == (npy_int64)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_weights = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_weights.memview)) __PYX_ERR(0, 332, __pyx_L3_error)
+ __pyx_v_i_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_i_lut.memview)) __PYX_ERR(0, 333, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[2]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 334, __pyx_L3_error)
+ __pyx_v_o_weighted_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[3]); if (unlikely(!__pyx_v_o_weighted_histo.memview)) __PYX_ERR(0, 335, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L3_error)
+ __pyx_v_i_filt_min_weights = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_i_filt_min_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
+ __pyx_v_i_weight_min = __Pyx_PyInt_As_npy_int64(values[6]); if (unlikely((__pyx_v_i_weight_min == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error)
+ __pyx_v_i_filt_max_weights = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_i_filt_max_weights == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 339, __pyx_L3_error)
+ __pyx_v_i_weight_max = __Pyx_PyInt_As_npy_int64(values[8]); if (unlikely((__pyx_v_i_weight_max == ((npy_int64)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_from_lut_fused", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_from_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_102_histogramnd_from_lut_fused(__pyx_self, __pyx_v_i_weights, __pyx_v_i_lut, __pyx_v_o_histo, __pyx_v_o_weighted_histo, __pyx_v_i_n_elems, __pyx_v_i_filt_min_weights, __pyx_v_i_weight_min, __pyx_v_i_filt_max_weights, __pyx_v_i_weight_max);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_weights, __Pyx_memviewslice __pyx_v_i_lut, __Pyx_memviewslice __pyx_v_o_histo, __Pyx_memviewslice __pyx_v_o_weighted_histo, int __pyx_v_i_n_elems, int __pyx_v_i_filt_min_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_min, int __pyx_v_i_filt_max_weights, __pyx_t_5numpy_int64_t __pyx_v_i_weight_max) {
int __pyx_v_i;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- int __pyx_t_3;
+ Py_ssize_t __pyx_t_3;
int __pyx_t_4;
int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- __pyx_t_5numpy_int16_t __pyx_t_9;
- int __pyx_t_10;
- int __pyx_t_11;
- __pyx_t_5numpy_int16_t __pyx_t_12;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_2_3_histogramnd_from_lut_fused", 0);
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -21561,7 +23675,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":333
+ /* "silx/math/chistogramnd_lut.pyx":342
* weights_t i_weight_max):
* with nogil:
* for i in range(i_n_elems): # <<<<<<<<<<<<<<
@@ -21572,7 +23686,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":334
+ /* "silx/math/chistogramnd_lut.pyx":343
* with nogil:
* for i in range(i_n_elems):
* if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
@@ -21583,7 +23697,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
__pyx_t_4 = (((*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_3 * __pyx_v_i_lut.strides[0]) ))) >= 0) != 0);
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":335
+ /* "silx/math/chistogramnd_lut.pyx":344
* for i in range(i_n_elems):
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
@@ -21602,7 +23716,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
__pyx_L10_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":336
+ /* "silx/math/chistogramnd_lut.pyx":345
* if (i_lut[i] >= 0):
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue # <<<<<<<<<<<<<<
@@ -21610,9 +23724,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
* continue
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":344
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0):
+ * if i_filt_min_weights and i_weights[i] < i_weight_min: # <<<<<<<<<<<<<<
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max:
+ */
}
- /* "chistogramnd_lut.pyx":337
+ /* "silx/math/chistogramnd_lut.pyx":346
* if i_filt_min_weights and i_weights[i] < i_weight_min:
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
@@ -21631,7 +23753,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
__pyx_L13_bool_binop_done:;
if (__pyx_t_4) {
- /* "chistogramnd_lut.pyx":338
+ /* "silx/math/chistogramnd_lut.pyx":347
* continue
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue # <<<<<<<<<<<<<<
@@ -21639,9 +23761,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa
*/
goto __pyx_L6_continue;
+
+ /* "silx/math/chistogramnd_lut.pyx":346
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ * if i_filt_max_weights and i_weights[i] > i_weight_max: # <<<<<<<<<<<<<<
+ * continue
+ * o_histo[i_lut[i]] += 1
+ */
}
- /* "chistogramnd_lut.pyx":339
+ /* "silx/math/chistogramnd_lut.pyx":348
* if i_filt_max_weights and i_weights[i] > i_weight_max:
* continue
* o_histo[i_lut[i]] += 1 # <<<<<<<<<<<<<<
@@ -21652,7 +23782,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
__pyx_t_9 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_8 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_9 * __pyx_v_o_histo.strides[0]) )) += 1;
- /* "chistogramnd_lut.pyx":340
+ /* "silx/math/chistogramnd_lut.pyx":349
* continue
* o_histo[i_lut[i]] += 1
* o_weighted_histo[i_lut[i]] += <cumul_t>i_weights[i] # noqa # <<<<<<<<<<<<<<
@@ -21663,14 +23793,20 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
__pyx_t_11 = __pyx_v_i;
__pyx_t_12 = (*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_i_lut.data + __pyx_t_11 * __pyx_v_i_lut.strides[0]) )));
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_weighted_histo.data + __pyx_t_12 * __pyx_v_o_weighted_histo.strides[0]) )) += ((__pyx_t_5numpy_int64_t)(*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_weights.data + __pyx_t_10 * __pyx_v_i_weights.strides[0]) ))));
- goto __pyx_L8;
+
+ /* "silx/math/chistogramnd_lut.pyx":343
+ * with nogil:
+ * for i in range(i_n_elems):
+ * if (i_lut[i] >= 0): # <<<<<<<<<<<<<<
+ * if i_filt_min_weights and i_weights[i] < i_weight_min:
+ * continue
+ */
}
- __pyx_L8:;
__pyx_L6_continue:;
}
}
- /* "chistogramnd_lut.pyx":332
+ /* "silx/math/chistogramnd_lut.pyx":341
* bint i_filt_max_weights,
* weights_t i_weight_max):
* with nogil: # <<<<<<<<<<<<<<
@@ -21688,7 +23824,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
}
}
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
@@ -21707,7 +23843,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
return __pyx_r;
}
-/* "chistogramnd_lut.pyx":352
+/* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -21716,17 +23852,14 @@ static PyObject *__pyx_pf_16chistogramnd_lut_102_histogramnd_from_lut_fused(CYTH
*/
/* Python wrapper */
-static PyObject *__pyx_pw_16chistogramnd_lut_7_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused[] = "_histogramnd_get_lut_fused(signatures, args, kwargs, defaults)";
-static PyMethodDef __pyx_mdef_16chistogramnd_lut_7_histogramnd_get_lut_fused = {"_histogramnd_get_lut_fused", (PyCFunction)__pyx_pw_16chistogramnd_lut_7_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_pw_16chistogramnd_lut_7_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_7_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused[] = "_histogramnd_get_lut_fused(signatures, args, kwargs, defaults)";
+static PyMethodDef __pyx_mdef_4silx_4math_16chistogramnd_lut_7_histogramnd_get_lut_fused = {"_histogramnd_get_lut_fused", (PyCFunction)__pyx_pw_4silx_4math_16chistogramnd_lut_7_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_pw_4silx_4math_16chistogramnd_lut_7_histogramnd_get_lut_fused(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);
@@ -21752,21 +23885,21 @@ static PyObject *__pyx_pw_16chistogramnd_lut_7_histogramnd_get_lut_fused(PyObjec
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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 1); __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -21783,30 +23916,30 @@ static PyObject *__pyx_pw_16chistogramnd_lut_7_histogramnd_get_lut_fused(PyObjec
}
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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused(__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_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused(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;
+ PyTypeObject *__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_int32_t_is_signed;
- int __pyx_v____pyx_int64_t_is_signed;
int __pyx_v____pyx_int16_t_is_signed;
+ int __pyx_v____pyx_int64_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;
@@ -21827,55 +23960,54 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
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;
+ long __pyx_t_11;
+ __Pyx_memviewslice __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ PyObject *(*__pyx_t_16)(PyObject *);
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;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *(*__pyx_t_20)(PyObject *);
+ int __pyx_t_21;
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused", 0);
__Pyx_INCREF(__pyx_v_kwargs);
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1 * 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __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_INCREF(Py_None);
- PyList_SET_ITEM(__pyx_t_1, 1, Py_None);
- __Pyx_GIVEREF(Py_None);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < 2; __pyx_temp++) {
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyList_SET_ITEM(__pyx_t_1, __pyx_temp, 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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __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_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
/*try:*/ {
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __pyx_v_ndarray = ((PyObject*)__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_ERR(0, 361, __pyx_L4_error)
+ __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
__pyx_t_1 = 0;
}
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -21883,16 +24015,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L11_try_end;
__pyx_L4_error:;
+ __Pyx_PyThreadState_assign
__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);
+ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
- __Pyx_AddTraceback("chistogramnd_lut.__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 = 352; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 361, __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_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)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;
@@ -21900,32 +24033,34 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
goto __pyx_L1_error;
__pyx_L5_exception_handled:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
__pyx_L11_try_end:;
}
- __pyx_v_itemsize = -1;
- __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1) < 0);
- __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1) < 0);
- __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1) < 0);
+ __pyx_v_itemsize = -1L;
+ __pyx_v____pyx_int16_t_is_signed = (((__pyx_t_5numpy_int16_t)-1L) < 0);
+ __pyx_v____pyx_int64_t_is_signed = (((__pyx_t_5numpy_int64_t)-1L) < 0);
+ __pyx_v____pyx_int32_t_is_signed = (((__pyx_t_5numpy_int32_t)-1L) < 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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
__pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
__Pyx_INCREF(__pyx_t_9);
@@ -21935,16 +24070,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_3 = (__Pyx_PyDict_Contains(__pyx_n_s_i_sample, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_i_sample, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_sample); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_i_sample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_v_arg = __pyx_t_9;
__pyx_t_9 = 0;
@@ -21953,656 +24088,615 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
/*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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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));
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L18;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_arg_base = __pyx_t_8;
+ __pyx_t_8 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __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 = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L18;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L18:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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_ERR(0, 361, __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_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 361, __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_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L22_bool_binop_done:;
+ if (__pyx_t_3) {
+ 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_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L26_bool_binop_done:;
+ if (__pyx_t_3) {
+ 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_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'f':
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L30_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __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_int32_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 = 352; __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 = 352; __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_int32_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_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __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_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 = 352; __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 = 352; __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_int64_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_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'f':
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float64_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 = 352; __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 = 352; __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);
- __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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L34_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 = 352; __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 = 352; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L34_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L30_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_float32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L33_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __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_ERR(0, 361, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L33_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- goto __pyx_L21;
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __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_L37_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L36_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L36_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L37_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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_float64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L36;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L36:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L41_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L40_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L40_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_float32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L41_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_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_float32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L40;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L40:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L45_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L44_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L44_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __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_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L45_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L44;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L44:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L49_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L48_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L48_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __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_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L49_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L48;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L48:;
- 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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
}
- __pyx_L17_break:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_L15:;
+ __pyx_L16_break:;
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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = ((5 < __pyx_t_10) != 0);
- if (__pyx_t_2) {
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_3 = ((5 < __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
__pyx_t_8 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 5);
__Pyx_INCREF(__pyx_t_8);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_8);
__pyx_t_8 = 0;
- goto __pyx_L52;
+ goto __pyx_L51;
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_2 = (__Pyx_PyDict_Contains(__pyx_n_s_o_lut, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_o_lut, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_o_lut); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_8 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_o_lut); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF_SET(__pyx_v_arg, __pyx_t_8);
__pyx_t_8 = 0;
- goto __pyx_L52;
+ goto __pyx_L51;
}
/*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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
__pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L52:;
- if (0) {
- goto __pyx_L53;
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- /*else*/ {
- while (1) {
- if (!1) break;
- __pyx_t_3 = (__pyx_v_ndarray != ((PyObject*)Py_None));
+ __pyx_L51:;
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_2 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
+ __pyx_t_9 = 0;
+ goto __pyx_L55;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
__pyx_t_9 = 0;
- goto __pyx_L57;
- }
- __pyx_t_3 = (__pyx_memoryview_check(__pyx_v_arg) != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF_SET(__pyx_v_arg_base, __pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
- __pyx_t_2 = (__pyx_t_3 != 0);
- if (__pyx_t_2) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_XDECREF_SET(__pyx_v_dtype, __pyx_t_9);
- __pyx_t_9 = 0;
- goto __pyx_L58;
- }
- /*else*/ {
- __Pyx_INCREF(Py_None);
- __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
- }
- __pyx_L58:;
- goto __pyx_L57;
+ goto __pyx_L56;
}
/*else*/ {
__Pyx_INCREF(Py_None);
__Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
}
- __pyx_L57:;
- __pyx_v_itemsize = -1;
- __pyx_t_2 = (__pyx_v_dtype != Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L56:;
+ goto __pyx_L55;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __Pyx_XDECREF_SET(__pyx_v_dtype, Py_None);
+ }
+ __pyx_L55:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_itemsize = __pyx_t_10;
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_9); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L59_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_itemsize = __pyx_t_10;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_kind); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ord, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L59_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L59_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L63_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_char(__pyx_t_9); if (unlikely((__pyx_t_11 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 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_2 = (((sizeof(__pyx_t_5numpy_int64_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L61_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L61_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int64_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L61_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int32_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L65_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L65_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ goto __pyx_L63_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int32_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L63_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L65_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- __pyx_t_2 = (((sizeof(__pyx_t_5numpy_int16_t)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L69_bool_binop_done;
- }
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
- if (__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L69_bool_binop_done;
- }
- __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ goto __pyx_L67_bool_binop_done;
+ }
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L69_bool_binop_done:;
- if (__pyx_t_3) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- break;
- case 'f':
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ goto __pyx_L67_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v____pyx_int16_t_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L67_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- goto __pyx_L59;
+ break;
+ case 'f':
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __pyx_L59:;
- goto __pyx_L56;
- }
- __pyx_L56:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L73_bool_binop_done;
}
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L73_bool_binop_done:;
+ goto __pyx_L71_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int64_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L71_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L72;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int64_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L72:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L77_bool_binop_done;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L77_bool_binop_done:;
+ goto __pyx_L75_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int32_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L75_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L76;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int32_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L76:;
- __pyx_t_2 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_2) {
- } else {
- __pyx_t_3 = __pyx_t_2;
- goto __pyx_L81_bool_binop_done;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
__pyx_t_3 = __pyx_t_2;
- __pyx_L81_bool_binop_done:;
+ goto __pyx_L79_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(__pyx_t_5numpy_int16_t))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L79_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
if (__pyx_t_3) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(__pyx_v_arg);
- __pyx_t_3 = (__pyx_v_memslice.memview != 0);
- if (__pyx_t_3) {
- __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L80;
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, __pyx_n_s_int16_t, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L80:;
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L55_break;
}
- __pyx_L55_break:;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 1, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
+ goto __pyx_L53_break;
}
- __pyx_L53:;
- __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L53_break:;
+ __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_v_candidates = ((PyObject*)__pyx_t_9);
__pyx_t_9 = 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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_8 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_12), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__pyx_t_9 = __pyx_t_8;
__pyx_t_8 = 0;
while (1) {
- __pyx_t_13 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_12, &__pyx_t_10, &__pyx_t_8, 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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_9, __pyx_t_13, &__pyx_t_10, &__pyx_t_8, NULL, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_14 == 0)) break;
+ if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_XDECREF_SET(__pyx_v_sig, __pyx_t_8);
__pyx_t_8 = 0;
__pyx_v_match_found = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
__Pyx_INCREF(__pyx_v_dest_sig);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig);
__Pyx_GIVEREF(__pyx_v_dest_sig);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_dest_sig);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
- __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_14 = 0;
- __pyx_t_15 = NULL;
+ __pyx_t_8 = __pyx_t_1; __Pyx_INCREF(__pyx_t_8); __pyx_t_15 = 0;
+ __pyx_t_16 = NULL;
} else {
- __pyx_t_14 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_15 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 361, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
- if (likely(!__pyx_t_15)) {
+ if (likely(!__pyx_t_16)) {
if (likely(PyList_CheckExact(__pyx_t_8))) {
- if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_8)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
} else {
- if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_14); __Pyx_INCREF(__pyx_t_1); __pyx_t_14++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
#else
- __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_8, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
- __pyx_t_1 = __pyx_t_15(__pyx_t_8);
+ __pyx_t_1 = __pyx_t_16(__pyx_t_8);
if (unlikely(!__pyx_t_1)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 361, __pyx_L1_error)
}
break;
}
@@ -22610,7 +24704,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -22618,104 +24712,100 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_18);
#else
- __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
#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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_19);
__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_L88_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_L88_unpacking_failed;
+ __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L86_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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = NULL;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- goto __pyx_L89_unpacking_done;
- __pyx_L88_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_19 = NULL;
+ index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L86_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_20 = NULL;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ goto __pyx_L87_unpacking_done;
+ __pyx_L86_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L89_unpacking_done:;
+ __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_L87_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_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
__pyx_t_17 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
+ __pyx_t_18 = 0;
__pyx_t_3 = (__pyx_v_dst_type != Py_None);
__pyx_t_2 = (__pyx_t_3 != 0);
if (__pyx_t_2) {
- __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
__pyx_v_match_found = 1;
- goto __pyx_L91;
+ goto __pyx_L89;
}
/*else*/ {
__pyx_v_match_found = 0;
- goto __pyx_L87_break;
+ goto __pyx_L85_break;
}
- __pyx_L91:;
- goto __pyx_L90;
+ __pyx_L89:;
}
- __pyx_L90:;
}
- __pyx_L87_break:;
+ __pyx_L85_break:;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_2 = (__pyx_v_match_found != 0);
if (__pyx_t_2) {
- __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L92;
+ __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_L92:;
}
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
__pyx_t_3 = ((!__pyx_t_2) != 0);
if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = ((__pyx_t_12 > 1) != 0);
+ __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
if (__pyx_t_3) {
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_Raise(__pyx_t_9, 0, 0, 0);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_signatures), PyList_GET_ITEM(__pyx_v_candidates, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
@@ -22727,10 +24817,10 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
__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("chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dest_sig);
@@ -22750,9 +24840,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_6_histogramnd_get_lut_fused(CYTHON_
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_0__pyx_mdef_16chistogramnd_lut_107_histogramnd_get_lut_fused = {"__pyx_fuse_0_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_107_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_107_histogramnd_get_lut_fused = {"__pyx_fuse_0_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_107_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_0_0__pyx_pw_4silx_4math_16chistogramnd_lut_107_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -22761,9 +24851,6 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -22793,41 +24880,41 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -22841,31 +24928,31 @@ static PyObject *__pyx_fuse_0_0__pyx_pw_16chistogramnd_lut_107_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_106_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -22879,19 +24966,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_0_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -22900,7 +24987,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -22909,7 +24996,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -22918,16 +25005,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -22936,7 +25023,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -22945,7 +25032,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -22956,7 +25043,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -22966,7 +25053,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -22976,7 +25063,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -22986,7 +25073,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -22995,7 +25082,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -23004,7 +25091,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -23018,7 +25105,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -23029,7 +25116,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -23038,7 +25125,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -23047,7 +25134,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -23056,7 +25143,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -23067,7 +25154,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -23077,7 +25164,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -23087,16 +25174,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -23104,9 +25191,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -23116,7 +25211,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -23125,7 +25220,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -23134,7 +25229,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -23142,17 +25237,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -23164,7 +25267,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -23173,20 +25276,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -23201,7 +25312,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -23211,7 +25322,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -23221,7 +25332,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -23230,13 +25341,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -23254,7 +25371,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -23264,7 +25381,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -23285,9 +25402,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_106_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_1__pyx_mdef_16chistogramnd_lut_109_histogramnd_get_lut_fused = {"__pyx_fuse_0_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_109_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_109_histogramnd_get_lut_fused = {"__pyx_fuse_0_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_109_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_0_1__pyx_pw_4silx_4math_16chistogramnd_lut_109_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -23296,9 +25413,6 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -23328,41 +25442,41 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -23376,31 +25490,31 @@ static PyObject *__pyx_fuse_0_1__pyx_pw_16chistogramnd_lut_109_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_108_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -23414,19 +25528,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_1_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -23435,7 +25549,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -23444,7 +25558,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -23453,16 +25567,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -23471,7 +25585,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -23480,7 +25594,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -23491,7 +25605,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -23501,7 +25615,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -23511,7 +25625,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -23521,7 +25635,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -23530,7 +25644,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -23539,7 +25653,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -23553,7 +25667,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -23564,7 +25678,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -23573,7 +25687,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -23582,7 +25696,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -23591,7 +25705,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -23602,7 +25716,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -23612,7 +25726,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -23622,16 +25736,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -23639,9 +25753,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -23651,7 +25773,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -23660,7 +25782,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -23669,7 +25791,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -23677,17 +25799,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -23699,7 +25829,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -23708,20 +25838,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -23736,7 +25874,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -23746,7 +25884,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -23756,7 +25894,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -23765,13 +25903,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -23789,7 +25933,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -23799,7 +25943,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -23820,9 +25964,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_108_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0_2__pyx_mdef_16chistogramnd_lut_111_histogramnd_get_lut_fused = {"__pyx_fuse_0_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_111_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_111_histogramnd_get_lut_fused = {"__pyx_fuse_0_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_111_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_0_2__pyx_pw_4silx_4math_16chistogramnd_lut_111_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -23831,9 +25975,6 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -23863,41 +26004,41 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -23911,31 +26052,31 @@ static PyObject *__pyx_fuse_0_2__pyx_pw_16chistogramnd_lut_111_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_110_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -23949,19 +26090,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_0_2_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -23970,7 +26111,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -23979,7 +26120,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -23988,16 +26129,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -24006,7 +26147,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -24015,7 +26156,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -24026,7 +26167,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -24036,7 +26177,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -24046,7 +26187,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -24056,7 +26197,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -24065,7 +26206,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -24074,7 +26215,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -24088,7 +26229,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -24099,7 +26240,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -24108,7 +26249,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -24117,7 +26258,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -24126,7 +26267,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -24137,7 +26278,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -24147,7 +26288,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -24157,16 +26298,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -24174,9 +26315,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -24186,7 +26335,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -24195,7 +26344,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -24204,7 +26353,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -24212,17 +26361,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -24234,7 +26391,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -24243,20 +26400,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -24271,7 +26436,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -24281,7 +26446,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -24291,7 +26456,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -24300,13 +26465,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -24324,7 +26495,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -24334,7 +26505,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -24355,9 +26526,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_110_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_0__pyx_mdef_16chistogramnd_lut_113_histogramnd_get_lut_fused = {"__pyx_fuse_1_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_113_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_113_histogramnd_get_lut_fused = {"__pyx_fuse_1_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_113_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_1_0__pyx_pw_4silx_4math_16chistogramnd_lut_113_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -24366,9 +26537,6 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -24398,41 +26566,41 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -24446,31 +26614,31 @@ static PyObject *__pyx_fuse_1_0__pyx_pw_16chistogramnd_lut_113_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_112_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -24484,19 +26652,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_0_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -24505,7 +26673,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -24514,7 +26682,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -24523,16 +26691,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -24541,7 +26709,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -24550,7 +26718,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -24561,7 +26729,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -24571,7 +26739,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -24581,7 +26749,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -24591,7 +26759,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -24600,7 +26768,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -24609,7 +26777,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -24623,7 +26791,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -24634,7 +26802,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -24643,7 +26811,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -24652,7 +26820,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -24661,7 +26829,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -24672,7 +26840,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -24682,7 +26850,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -24692,16 +26860,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -24709,9 +26877,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -24721,7 +26897,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -24730,7 +26906,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -24739,7 +26915,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -24747,17 +26923,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -24769,7 +26953,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -24778,20 +26962,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -24806,7 +26998,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -24816,7 +27008,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -24826,7 +27018,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -24835,13 +27027,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -24859,7 +27057,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -24869,7 +27067,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -24890,9 +27088,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_112_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_1__pyx_mdef_16chistogramnd_lut_115_histogramnd_get_lut_fused = {"__pyx_fuse_1_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_115_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_115_histogramnd_get_lut_fused = {"__pyx_fuse_1_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_115_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_1_1__pyx_pw_4silx_4math_16chistogramnd_lut_115_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -24901,9 +27099,6 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -24933,41 +27128,41 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -24981,31 +27176,31 @@ static PyObject *__pyx_fuse_1_1__pyx_pw_16chistogramnd_lut_115_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_114_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -25019,19 +27214,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_1_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -25040,7 +27235,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -25049,7 +27244,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -25058,16 +27253,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -25076,7 +27271,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -25085,7 +27280,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -25096,7 +27291,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -25106,7 +27301,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -25116,7 +27311,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -25126,7 +27321,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -25135,7 +27330,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -25144,7 +27339,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -25158,7 +27353,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -25169,7 +27364,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -25178,7 +27373,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -25187,7 +27382,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -25196,7 +27391,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -25207,7 +27402,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -25217,7 +27412,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -25227,16 +27422,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -25244,9 +27439,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -25256,7 +27459,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -25265,7 +27468,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -25274,7 +27477,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -25282,17 +27485,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -25304,7 +27515,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -25313,20 +27524,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -25341,7 +27560,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -25351,7 +27570,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -25361,7 +27580,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -25370,13 +27589,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -25394,7 +27619,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -25404,7 +27629,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -25425,9 +27650,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_114_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1_2__pyx_mdef_16chistogramnd_lut_117_histogramnd_get_lut_fused = {"__pyx_fuse_1_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_117_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_117_histogramnd_get_lut_fused = {"__pyx_fuse_1_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_117_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_1_2__pyx_pw_4silx_4math_16chistogramnd_lut_117_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -25436,9 +27661,6 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -25468,41 +27690,41 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -25516,31 +27738,31 @@ static PyObject *__pyx_fuse_1_2__pyx_pw_16chistogramnd_lut_117_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_116_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -25554,19 +27776,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_1_2_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -25575,7 +27797,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -25584,7 +27806,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -25593,16 +27815,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -25611,7 +27833,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -25620,7 +27842,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0.0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -25631,7 +27853,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -25641,7 +27863,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -25651,7 +27873,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -25661,7 +27883,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -25670,7 +27892,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -25679,7 +27901,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -25693,7 +27915,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -25704,7 +27926,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -25713,7 +27935,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -25722,7 +27944,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -25731,7 +27953,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -25742,7 +27964,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -25752,7 +27974,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_float32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -25762,16 +27984,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -25779,9 +28001,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -25791,7 +28021,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -25800,7 +28030,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -25809,7 +28039,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -25817,17 +28047,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -25839,7 +28077,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -25848,20 +28086,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -25876,7 +28122,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -25886,7 +28132,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -25896,7 +28142,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -25905,13 +28151,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -25929,7 +28181,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -25939,7 +28191,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -25960,9 +28212,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_116_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_0__pyx_mdef_16chistogramnd_lut_119_histogramnd_get_lut_fused = {"__pyx_fuse_2_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_119_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_119_histogramnd_get_lut_fused = {"__pyx_fuse_2_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_119_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_2_0__pyx_pw_4silx_4math_16chistogramnd_lut_119_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -25971,9 +28223,6 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -26003,41 +28252,41 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -26051,31 +28300,31 @@ static PyObject *__pyx_fuse_2_0__pyx_pw_16chistogramnd_lut_119_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_118_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -26089,19 +28338,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_0_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -26110,7 +28359,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -26119,7 +28368,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -26128,16 +28377,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -26146,7 +28395,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -26155,7 +28404,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -26166,7 +28415,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -26176,7 +28425,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -26186,7 +28435,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -26196,7 +28445,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -26205,7 +28454,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -26214,7 +28463,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -26228,7 +28477,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -26239,7 +28488,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -26248,7 +28497,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -26257,7 +28506,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -26266,7 +28515,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -26277,7 +28526,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -26287,7 +28536,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -26297,16 +28546,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -26314,9 +28563,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -26326,7 +28583,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -26335,7 +28592,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -26344,7 +28601,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -26352,17 +28609,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -26374,7 +28639,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -26383,20 +28648,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -26411,7 +28684,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -26421,7 +28694,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -26431,7 +28704,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -26440,13 +28713,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -26464,7 +28743,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -26474,7 +28753,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -26495,9 +28774,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_118_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_1__pyx_mdef_16chistogramnd_lut_121_histogramnd_get_lut_fused = {"__pyx_fuse_2_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_121_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_121_histogramnd_get_lut_fused = {"__pyx_fuse_2_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_121_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_2_1__pyx_pw_4silx_4math_16chistogramnd_lut_121_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -26506,9 +28785,6 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -26538,41 +28814,41 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -26586,31 +28862,31 @@ static PyObject *__pyx_fuse_2_1__pyx_pw_16chistogramnd_lut_121_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_120_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -26624,19 +28900,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_1_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -26645,7 +28921,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -26654,7 +28930,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -26663,16 +28939,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -26681,7 +28957,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -26690,7 +28966,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -26701,7 +28977,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -26711,7 +28987,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -26721,7 +28997,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -26731,7 +29007,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -26740,7 +29016,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -26749,7 +29025,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -26763,7 +29039,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -26774,7 +29050,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -26783,7 +29059,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -26792,7 +29068,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -26801,7 +29077,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -26812,7 +29088,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -26822,7 +29098,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -26832,16 +29108,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -26849,9 +29125,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -26861,7 +29145,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -26870,7 +29154,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -26879,7 +29163,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -26887,17 +29171,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -26909,7 +29201,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -26918,20 +29210,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -26946,7 +29246,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -26956,7 +29256,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -26966,7 +29266,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -26975,13 +29275,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -26999,7 +29305,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -27009,7 +29315,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -27030,9 +29336,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_120_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2_2__pyx_mdef_16chistogramnd_lut_123_histogramnd_get_lut_fused = {"__pyx_fuse_2_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_123_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_123_histogramnd_get_lut_fused = {"__pyx_fuse_2_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_123_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_2_2__pyx_pw_4silx_4math_16chistogramnd_lut_123_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -27041,9 +29347,6 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -27073,41 +29376,41 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -27121,31 +29424,31 @@ static PyObject *__pyx_fuse_2_2__pyx_pw_16chistogramnd_lut_123_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_122_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -27159,19 +29462,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_2_2_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -27180,7 +29483,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -27189,7 +29492,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -27198,16 +29501,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -27216,7 +29519,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -27225,7 +29528,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -27236,7 +29539,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -27246,7 +29549,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -27256,7 +29559,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -27266,7 +29569,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -27275,7 +29578,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -27284,7 +29587,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -27298,7 +29601,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -27309,7 +29612,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -27318,7 +29621,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -27327,7 +29630,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -27336,7 +29639,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -27347,7 +29650,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -27357,7 +29660,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -27367,16 +29670,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -27384,9 +29687,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -27396,7 +29707,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -27405,7 +29716,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -27414,7 +29725,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -27422,17 +29733,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -27444,7 +29763,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -27453,20 +29772,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -27481,7 +29808,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -27491,7 +29818,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -27501,7 +29828,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -27510,13 +29837,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -27534,7 +29867,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -27544,7 +29877,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -27565,9 +29898,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_122_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_0__pyx_mdef_16chistogramnd_lut_125_histogramnd_get_lut_fused = {"__pyx_fuse_3_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_0__pyx_pw_4silx_4math_16chistogramnd_lut_125_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_0__pyx_mdef_4silx_4math_16chistogramnd_lut_125_histogramnd_get_lut_fused = {"__pyx_fuse_3_0_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_0__pyx_pw_4silx_4math_16chistogramnd_lut_125_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_3_0__pyx_pw_4silx_4math_16chistogramnd_lut_125_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -27576,9 +29909,6 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -27608,41 +29938,41 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -27656,31 +29986,31 @@ static PyObject *__pyx_fuse_3_0__pyx_pw_16chistogramnd_lut_125_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_124_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -27694,19 +30024,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_0_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -27715,7 +30045,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -27724,7 +30054,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -27733,16 +30063,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -27751,7 +30081,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -27760,7 +30090,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -27771,7 +30101,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -27781,7 +30111,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -27791,7 +30121,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -27801,7 +30131,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -27810,7 +30140,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -27819,7 +30149,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -27833,7 +30163,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -27844,7 +30174,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -27853,7 +30183,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -27862,7 +30192,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -27871,7 +30201,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -27882,7 +30212,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -27892,7 +30222,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -27902,16 +30232,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -27919,9 +30249,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -27931,7 +30269,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -27940,7 +30278,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -27949,7 +30287,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -27957,17 +30295,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -27979,7 +30325,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -27988,20 +30334,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -28016,7 +30370,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -28026,7 +30380,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -28036,7 +30390,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -28045,13 +30399,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -28069,7 +30429,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -28079,7 +30439,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -28100,9 +30460,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_124_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_1__pyx_mdef_16chistogramnd_lut_127_histogramnd_get_lut_fused = {"__pyx_fuse_3_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_1__pyx_pw_4silx_4math_16chistogramnd_lut_127_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_1__pyx_mdef_4silx_4math_16chistogramnd_lut_127_histogramnd_get_lut_fused = {"__pyx_fuse_3_1_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_1__pyx_pw_4silx_4math_16chistogramnd_lut_127_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_3_1__pyx_pw_4silx_4math_16chistogramnd_lut_127_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -28111,9 +30471,6 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -28143,41 +30500,41 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -28191,31 +30548,31 @@ static PyObject *__pyx_fuse_3_1__pyx_pw_16chistogramnd_lut_127_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_126_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -28229,19 +30586,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_1_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -28250,7 +30607,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -28259,7 +30616,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -28268,16 +30625,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -28286,7 +30643,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -28295,7 +30652,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -28306,7 +30663,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -28316,7 +30673,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -28326,7 +30683,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -28336,7 +30693,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -28345,7 +30702,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -28354,7 +30711,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -28368,7 +30725,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -28379,7 +30736,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -28388,7 +30745,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -28397,7 +30754,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -28406,7 +30763,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -28417,7 +30774,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -28427,7 +30784,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -28437,16 +30794,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -28454,9 +30811,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -28466,7 +30831,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -28475,7 +30840,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -28484,7 +30849,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -28492,17 +30857,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -28514,7 +30887,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -28523,20 +30896,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -28551,7 +30932,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -28561,7 +30942,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -28571,7 +30952,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -28580,13 +30961,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -28604,7 +30991,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -28614,7 +31001,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -28635,9 +31022,9 @@ static PyObject *__pyx_pf_16chistogramnd_lut_126_histogramnd_get_lut_fused(CYTHO
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3_2__pyx_mdef_16chistogramnd_lut_129_histogramnd_get_lut_fused = {"__pyx_fuse_3_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_16chistogramnd_lut_6_histogramnd_get_lut_fused};
-static PyObject *__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3_2__pyx_pw_4silx_4math_16chistogramnd_lut_129_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3_2__pyx_mdef_4silx_4math_16chistogramnd_lut_129_histogramnd_get_lut_fused = {"__pyx_fuse_3_2_histogramnd_get_lut_fused", (PyCFunction)__pyx_fuse_3_2__pyx_pw_4silx_4math_16chistogramnd_lut_129_histogramnd_get_lut_fused, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_16chistogramnd_lut_6_histogramnd_get_lut_fused};
+static PyObject *__pyx_fuse_3_2__pyx_pw_4silx_4math_16chistogramnd_lut_129_histogramnd_get_lut_fused(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_i_sample = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_i_n_dims;
int __pyx_v_i_n_elems;
@@ -28646,9 +31033,6 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_l
__Pyx_memviewslice __pyx_v_o_lut = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_o_histo = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_last_bin_closed;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_histogramnd_get_lut_fused (wrapper)", 0);
@@ -28678,41 +31062,41 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_l
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_dims)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 1); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_elems)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 2); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_histo_range)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 3); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_i_n_bins)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 4); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_lut)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 5); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_o_histo)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 6); __PYX_ERR(0, 361, __pyx_L3_error)
}
case 7:
if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_last_bin_closed)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, 7); __PYX_ERR(0, 361, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_histogramnd_get_lut_fused") < 0)) __PYX_ERR(0, 361, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
goto __pyx_L5_argtuple_error;
@@ -28726,31 +31110,31 @@ static PyObject *__pyx_fuse_3_2__pyx_pw_16chistogramnd_lut_129_histogramnd_get_l
values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
}
- __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_i_sample = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_i_sample.memview)) __PYX_ERR(0, 361, __pyx_L3_error)
+ __pyx_v_i_n_dims = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_i_n_dims == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error)
+ __pyx_v_i_n_elems = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_i_n_elems == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
+ __pyx_v_i_histo_range = __Pyx_PyObject_to_MemoryviewSlice_ds_double(values[3]); if (unlikely(!__pyx_v_i_histo_range.memview)) __PYX_ERR(0, 364, __pyx_L3_error)
+ __pyx_v_i_n_bins = __Pyx_PyObject_to_MemoryviewSlice_ds_int(values[4]); if (unlikely(!__pyx_v_i_n_bins.memview)) __PYX_ERR(0, 365, __pyx_L3_error)
+ __pyx_v_o_lut = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(values[5]); if (unlikely(!__pyx_v_o_lut.memview)) __PYX_ERR(0, 366, __pyx_L3_error)
+ __pyx_v_o_histo = __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(values[6]); if (unlikely(!__pyx_v_o_histo.memview)) __PYX_ERR(0, 367, __pyx_L3_error)
+ __pyx_v_last_bin_closed = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_last_bin_closed == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 368, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_histogramnd_get_lut_fused", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 361, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.chistogramnd_lut._histogramnd_get_lut_fused", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
+ __pyx_r = __pyx_pf_4silx_4math_16chistogramnd_lut_128_histogramnd_get_lut_fused(__pyx_self, __pyx_v_i_sample, __pyx_v_i_n_dims, __pyx_v_i_n_elems, __pyx_v_i_histo_range, __pyx_v_i_n_bins, __pyx_v_o_lut, __pyx_v_o_histo, __pyx_v_last_bin_closed);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
+static PyObject *__pyx_pf_4silx_4math_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_i_sample, int __pyx_v_i_n_dims, int __pyx_v_i_n_elems, __Pyx_memviewslice __pyx_v_i_histo_range, __Pyx_memviewslice __pyx_v_i_n_bins, __Pyx_memviewslice __pyx_v_o_lut, __Pyx_memviewslice __pyx_v_o_histo, int __pyx_v_last_bin_closed) {
int __pyx_v_i;
long __pyx_v_elem_idx;
long __pyx_v_max_idx;
@@ -28764,19 +31148,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
- long __pyx_t_3;
- long __pyx_t_4;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
int __pyx_t_5;
- long __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- long __pyx_t_12;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
__Pyx_RefNannySetupContext("__pyx_fuse_3_2_histogramnd_get_lut_fused", 0);
- /* "chistogramnd_lut.pyx":362
+ /* "silx/math/chistogramnd_lut.pyx":371
*
* cdef:
* int i = 0 # <<<<<<<<<<<<<<
@@ -28785,7 +31169,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_i = 0;
- /* "chistogramnd_lut.pyx":363
+ /* "silx/math/chistogramnd_lut.pyx":372
* cdef:
* int i = 0
* long elem_idx = 0 # <<<<<<<<<<<<<<
@@ -28794,7 +31178,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = 0;
- /* "chistogramnd_lut.pyx":364
+ /* "silx/math/chistogramnd_lut.pyx":373
* int i = 0
* long elem_idx = 0
* long max_idx = 0 # <<<<<<<<<<<<<<
@@ -28803,16 +31187,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = 0;
- /* "chistogramnd_lut.pyx":365
+ /* "silx/math/chistogramnd_lut.pyx":374
* long elem_idx = 0
* long max_idx = 0
* long lut_idx = -1 # <<<<<<<<<<<<<<
*
* # computed bin index (i_sample -> grid)
*/
- __pyx_v_lut_idx = -1;
+ __pyx_v_lut_idx = -1L;
- /* "chistogramnd_lut.pyx":368
+ /* "silx/math/chistogramnd_lut.pyx":377
*
* # computed bin index (i_sample -> grid)
* long bin_idx = 0 # <<<<<<<<<<<<<<
@@ -28821,7 +31205,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":370
+ /* "silx/math/chistogramnd_lut.pyx":379
* long bin_idx = 0
*
* sample_t elem_coord = 0 # <<<<<<<<<<<<<<
@@ -28830,7 +31214,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_coord = 0;
- /* "chistogramnd_lut.pyx":376
+ /* "silx/math/chistogramnd_lut.pyx":385
* double[50] bins_range
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -28841,7 +31225,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":377
+ /* "silx/math/chistogramnd_lut.pyx":386
*
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i] # <<<<<<<<<<<<<<
@@ -28851,7 +31235,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_3 = (2 * __pyx_v_i);
(__pyx_v_g_min[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_3 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":378
+ /* "silx/math/chistogramnd_lut.pyx":387
* for i in range(i_n_dims):
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1] # <<<<<<<<<<<<<<
@@ -28861,7 +31245,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_4 = ((2 * __pyx_v_i) + 1);
(__pyx_v_g_max[__pyx_v_i]) = (*((double *) ( /* dim=0 */ (__pyx_v_i_histo_range.data + __pyx_t_4 * __pyx_v_i_histo_range.strides[0]) )));
- /* "chistogramnd_lut.pyx":379
+ /* "silx/math/chistogramnd_lut.pyx":388
* g_min[i] = i_histo_range[2*i]
* g_max[i] = i_histo_range[2*i+1]
* bins_range[i] = g_max[i] - g_min[i] # <<<<<<<<<<<<<<
@@ -28871,7 +31255,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
(__pyx_v_bins_range[__pyx_v_i]) = ((__pyx_v_g_max[__pyx_v_i]) - (__pyx_v_g_min[__pyx_v_i]));
}
- /* "chistogramnd_lut.pyx":381
+ /* "silx/math/chistogramnd_lut.pyx":390
* bins_range[i] = g_max[i] - g_min[i]
*
* elem_idx = 0 - i_n_dims # <<<<<<<<<<<<<<
@@ -28880,7 +31264,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (0 - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":382
+ /* "silx/math/chistogramnd_lut.pyx":391
*
* elem_idx = 0 - i_n_dims
* max_idx = i_n_elems * i_n_dims - i_n_dims # <<<<<<<<<<<<<<
@@ -28889,7 +31273,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_max_idx = ((__pyx_v_i_n_elems * __pyx_v_i_n_dims) - __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -28903,7 +31287,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
#endif
/*try:*/ {
- /* "chistogramnd_lut.pyx":385
+ /* "silx/math/chistogramnd_lut.pyx":394
*
* with nogil:
* while elem_idx < max_idx: # <<<<<<<<<<<<<<
@@ -28914,7 +31298,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_idx < __pyx_v_max_idx) != 0);
if (!__pyx_t_5) break;
- /* "chistogramnd_lut.pyx":386
+ /* "silx/math/chistogramnd_lut.pyx":395
* with nogil:
* while elem_idx < max_idx:
* elem_idx += i_n_dims # <<<<<<<<<<<<<<
@@ -28923,7 +31307,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_elem_idx = (__pyx_v_elem_idx + __pyx_v_i_n_dims);
- /* "chistogramnd_lut.pyx":387
+ /* "silx/math/chistogramnd_lut.pyx":396
* while elem_idx < max_idx:
* elem_idx += i_n_dims
* lut_idx += 1 # <<<<<<<<<<<<<<
@@ -28932,7 +31316,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_lut_idx = (__pyx_v_lut_idx + 1);
- /* "chistogramnd_lut.pyx":389
+ /* "silx/math/chistogramnd_lut.pyx":398
* lut_idx += 1
*
* bin_idx = 0 # <<<<<<<<<<<<<<
@@ -28941,7 +31325,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_v_bin_idx = 0;
- /* "chistogramnd_lut.pyx":391
+ /* "silx/math/chistogramnd_lut.pyx":400
* bin_idx = 0
*
* for i in range(i_n_dims): # <<<<<<<<<<<<<<
@@ -28952,7 +31336,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "chistogramnd_lut.pyx":392
+ /* "silx/math/chistogramnd_lut.pyx":401
*
* for i in range(i_n_dims):
* elem_coord = i_sample[elem_idx+i] # <<<<<<<<<<<<<<
@@ -28962,7 +31346,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_6 = (__pyx_v_elem_idx + __pyx_v_i);
__pyx_v_elem_coord = (*((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_i_sample.data + __pyx_t_6 * __pyx_v_i_sample.strides[0]) )));
- /* "chistogramnd_lut.pyx":399
+ /* "silx/math/chistogramnd_lut.pyx":408
* # 3. coordinate==maximum value and last_bin_closed is True
* # =====================
* if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
@@ -28972,16 +31356,16 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_min[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":400
+ /* "silx/math/chistogramnd_lut.pyx":409
* # =====================
* if elem_coord < g_min[i]:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":401
+ /* "silx/math/chistogramnd_lut.pyx":410
* if elem_coord < g_min[i]:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -28989,9 +31373,17 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
* # Here we make the assumption that most of the time
*/
goto __pyx_L11_break;
+
+ /* "silx/math/chistogramnd_lut.pyx":408
+ * # 3. coordinate==maximum value and last_bin_closed is True
+ * # =====================
+ * if elem_coord < g_min[i]: # <<<<<<<<<<<<<<
+ * bin_idx = -1
+ * break
+ */
}
- /* "chistogramnd_lut.pyx":408
+ /* "silx/math/chistogramnd_lut.pyx":417
* # than coordinates higher or equal to the max
* # (two tests)
* if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
@@ -29001,7 +31393,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_elem_coord < (__pyx_v_g_max[__pyx_v_i])) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -29010,7 +31402,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_7 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":410
+ /* "silx/math/chistogramnd_lut.pyx":419
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
* (((elem_coord - g_min[i]) * i_n_bins[i]) / # <<<<<<<<<<<<<<
@@ -29019,7 +31411,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_8 = __pyx_v_i;
- /* "chistogramnd_lut.pyx":409
+ /* "silx/math/chistogramnd_lut.pyx":418
* # (two tests)
* if elem_coord < g_max[i]:
* bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa # <<<<<<<<<<<<<<
@@ -29027,17 +31419,25 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
* bins_range[i]))
*/
__pyx_v_bin_idx = ((long)((__pyx_v_bin_idx * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_7 * __pyx_v_i_n_bins.strides[0]) )))) + (((__pyx_v_elem_coord - (__pyx_v_g_min[__pyx_v_i])) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_8 * __pyx_v_i_n_bins.strides[0]) )))) / (__pyx_v_bins_range[__pyx_v_i]))));
+
+ /* "silx/math/chistogramnd_lut.pyx":417
+ * # than coordinates higher or equal to the max
+ * # (two tests)
+ * if elem_coord < g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = <long>(bin_idx * i_n_bins[i] + # noqa
+ * (((elem_coord - g_min[i]) * i_n_bins[i]) /
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":416
+ /* "silx/math/chistogramnd_lut.pyx":425
* # put it in the last bin
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
*/
+ /*else*/ {
__pyx_t_9 = (__pyx_v_last_bin_closed != 0);
if (__pyx_t_9) {
} else {
@@ -29049,7 +31449,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_L15_bool_binop_done:;
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":417
+ /* "silx/math/chistogramnd_lut.pyx":426
* # else : discard
* if last_bin_closed and elem_coord == g_max[i]:
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1 # <<<<<<<<<<<<<<
@@ -29058,20 +31458,28 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_10 = __pyx_v_i;
__pyx_v_bin_idx = (((__pyx_v_bin_idx + 1) * (*((int *) ( /* dim=0 */ (__pyx_v_i_n_bins.data + __pyx_t_10 * __pyx_v_i_n_bins.strides[0]) )))) - 1);
+
+ /* "silx/math/chistogramnd_lut.pyx":425
+ * # put it in the last bin
+ * # else : discard
+ * if last_bin_closed and elem_coord == g_max[i]: # <<<<<<<<<<<<<<
+ * bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "chistogramnd_lut.pyx":419
+ /* "silx/math/chistogramnd_lut.pyx":428
* bin_idx = (bin_idx + 1) * i_n_bins[i] - 1
* else:
* bin_idx = -1 # <<<<<<<<<<<<<<
* break
*
*/
- __pyx_v_bin_idx = -1;
+ /*else*/ {
+ __pyx_v_bin_idx = -1L;
- /* "chistogramnd_lut.pyx":420
+ /* "silx/math/chistogramnd_lut.pyx":429
* else:
* bin_idx = -1
* break # <<<<<<<<<<<<<<
@@ -29086,7 +31494,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
}
__pyx_L11_break:;
- /* "chistogramnd_lut.pyx":422
+ /* "silx/math/chistogramnd_lut.pyx":431
* break
*
* o_lut[lut_idx] = bin_idx # <<<<<<<<<<<<<<
@@ -29096,7 +31504,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_11 = __pyx_v_lut_idx;
*((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_o_lut.data + __pyx_t_11 * __pyx_v_o_lut.strides[0]) )) = __pyx_v_bin_idx;
- /* "chistogramnd_lut.pyx":423
+ /* "silx/math/chistogramnd_lut.pyx":432
*
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0: # <<<<<<<<<<<<<<
@@ -29106,7 +31514,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_t_5 = ((__pyx_v_bin_idx >= 0) != 0);
if (__pyx_t_5) {
- /* "chistogramnd_lut.pyx":424
+ /* "silx/math/chistogramnd_lut.pyx":433
* o_lut[lut_idx] = bin_idx
* if bin_idx >= 0:
* o_histo[bin_idx] += 1 # <<<<<<<<<<<<<<
@@ -29115,13 +31523,19 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
*/
__pyx_t_12 = __pyx_v_bin_idx;
*((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_o_histo.data + __pyx_t_12 * __pyx_v_o_histo.strides[0]) )) += 1;
- goto __pyx_L17;
+
+ /* "silx/math/chistogramnd_lut.pyx":432
+ *
+ * o_lut[lut_idx] = bin_idx
+ * if bin_idx >= 0: # <<<<<<<<<<<<<<
+ * o_histo[bin_idx] += 1
+ *
+ */
}
- __pyx_L17:;
}
}
- /* "chistogramnd_lut.pyx":384
+ /* "silx/math/chistogramnd_lut.pyx":393
* max_idx = i_n_elems * i_n_dims - i_n_dims
*
* with nogil: # <<<<<<<<<<<<<<
@@ -29139,7 +31553,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
}
}
- /* "chistogramnd_lut.pyx":426
+ /* "silx/math/chistogramnd_lut.pyx":435
* o_histo[bin_idx] += 1
*
* return 0 # <<<<<<<<<<<<<<
@@ -29149,7 +31563,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
__pyx_r = __pyx_int_0;
goto __pyx_L0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
@@ -29169,7 +31583,7 @@ static PyObject *__pyx_pf_16chistogramnd_lut_128_histogramnd_get_lut_fused(CYTHO
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -29210,16 +31624,13 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
@@ -29232,7 +31643,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L0;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -29241,7 +31652,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_endian_detector = 1;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -29250,7 +31661,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -29259,7 +31670,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -29269,7 +31680,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -29277,22 +31688,30 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
+ /*else*/ {
__pyx_v_copy_shape = 0;
}
__pyx_L4:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -29306,7 +31725,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L6_bool_binop_done;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -29316,23 +31735,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__24, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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;}
+ __PYX_ERR(1, 218, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -29346,7 +31781,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L9_bool_binop_done;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -29356,23 +31791,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__25, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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;}
+ __PYX_ERR(1, 222, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -29381,7 +31832,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -29390,7 +31841,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
@@ -29400,7 +31851,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = (__pyx_v_copy_shape != 0);
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
* # 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) # <<<<<<<<<<<<<<
@@ -29409,7 +31860,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
* # 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 # <<<<<<<<<<<<<<
@@ -29418,7 +31869,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231
* 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): # <<<<<<<<<<<<<<
@@ -29429,7 +31880,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -29438,7 +31889,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -29447,20 +31898,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ * 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.
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
* 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
*/
+ /*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
* else:
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -29471,7 +31930,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L11:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -29480,7 +31939,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->suboffsets = NULL;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -29489,7 +31948,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -29498,28 +31957,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
- * cdef list stack
+ * cdef int offset
*/
__pyx_v_f = NULL;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -29528,7 +31987,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
@@ -29546,7 +32005,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -29558,17 +32017,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
+ /*else*/ {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -29577,7 +32044,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L14:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -29587,7 +32054,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -29597,7 +32064,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
@@ -29617,7 +32084,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L20_next_or:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
@@ -29633,43 +32100,51 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__26, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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;}
- }
+ __PYX_ERR(1, 259, __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)
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
*/
- switch (__pyx_v_t) {
+ }
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
* (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"
*/
+ switch (__pyx_v_t) {
case NPY_BYTE:
- __pyx_v_f = __pyx_k_b;
+ __pyx_v_f = ((char *)"b");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -29677,10 +32152,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_USHORT: f = "H"
*/
case NPY_UBYTE:
- __pyx_v_f = __pyx_k_B;
+ __pyx_v_f = ((char *)"B");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -29688,10 +32163,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_INT: f = "i"
*/
case NPY_SHORT:
- __pyx_v_f = __pyx_k_h;
+ __pyx_v_f = ((char *)"h");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -29699,10 +32174,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_UINT: f = "I"
*/
case NPY_USHORT:
- __pyx_v_f = __pyx_k_H;
+ __pyx_v_f = ((char *)"H");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -29710,10 +32185,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONG: f = "l"
*/
case NPY_INT:
- __pyx_v_f = __pyx_k_i;
+ __pyx_v_f = ((char *)"i");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -29721,10 +32196,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONG: f = "L"
*/
case NPY_UINT:
- __pyx_v_f = __pyx_k_I;
+ __pyx_v_f = ((char *)"I");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -29732,10 +32207,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGLONG: f = "q"
*/
case NPY_LONG:
- __pyx_v_f = __pyx_k_l;
+ __pyx_v_f = ((char *)"l");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -29743,10 +32218,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONGLONG: f = "Q"
*/
case NPY_ULONG:
- __pyx_v_f = __pyx_k_L;
+ __pyx_v_f = ((char *)"L");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -29754,10 +32229,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_FLOAT: f = "f"
*/
case NPY_LONGLONG:
- __pyx_v_f = __pyx_k_q;
+ __pyx_v_f = ((char *)"q");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -29765,10 +32240,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_DOUBLE: f = "d"
*/
case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k_Q;
+ __pyx_v_f = ((char *)"Q");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -29776,10 +32251,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGDOUBLE: f = "g"
*/
case NPY_FLOAT:
- __pyx_v_f = __pyx_k_f;
+ __pyx_v_f = ((char *)"f");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -29787,10 +32262,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CFLOAT: f = "Zf"
*/
case NPY_DOUBLE:
- __pyx_v_f = __pyx_k_d;
+ __pyx_v_f = ((char *)"d");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -29798,10 +32273,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CDOUBLE: f = "Zd"
*/
case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k_g;
+ __pyx_v_f = ((char *)"g");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -29809,10 +32284,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
case NPY_CFLOAT:
- __pyx_v_f = __pyx_k_Zf;
+ __pyx_v_f = ((char *)"Zf");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -29820,10 +32295,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_OBJECT: f = "O"
*/
case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k_Zd;
+ __pyx_v_f = ((char *)"Zd");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -29831,10 +32306,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* else:
*/
case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k_Zg;
+ __pyx_v_f = ((char *)"Zg");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -29842,37 +32317,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
case NPY_OBJECT:
- __pyx_v_f = __pyx_k_O;
+ __pyx_v_f = ((char *)"O");
break;
default:
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __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_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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;}
+ __PYX_ERR(1, 278, __pyx_L1_error)
break;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -29881,7 +32356,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->format = __pyx_v_f;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -29890,19 +32365,27 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
* 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));
+ /*else*/ {
+ __pyx_v_info->format = ((char *)malloc(0xFF));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
* else:
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -29911,7 +32394,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->format[0]) = '^';
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -29920,17 +32403,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_offset = 0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285
* 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
__pyx_v_f = __pyx_t_7;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
@@ -29940,7 +32423,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
(__pyx_v_f[0]) = '\x00';
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -29972,7 +32455,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -29996,7 +32479,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -30006,7 +32489,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -30014,11 +32497,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
- goto __pyx_L3;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
}
- __pyx_L3:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -30028,7 +32517,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -30036,11 +32525,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
*
*/
free(__pyx_v_info->strides);
- goto __pyx_L4;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
+ * 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_L4:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -30052,7 +32547,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -30064,12 +32559,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -30077,13 +32569,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -30102,7 +32594,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -30114,12 +32606,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -30127,13 +32616,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -30152,7 +32641,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -30164,12 +32653,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -30177,13 +32663,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -30202,7 +32688,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -30214,12 +32700,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -30227,13 +32710,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
* 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_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_ERR(1, 780, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -30252,7 +32735,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -30264,12 +32747,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -30277,13 +32757,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
* 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_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_ERR(1, 783, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -30302,7 +32782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -30329,22 +32809,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ *
+ * cdef dtype child
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
@@ -30352,7 +32829,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -30361,33 +32838,38 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
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_ERR(1, 794, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 794, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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
+ /* "../../../../../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;};
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 795, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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;}
+ 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_ERR(1, 795, __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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -30396,7 +32878,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -30404,60 +32886,68 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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;}
+ __PYX_ERR(1, 796, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __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_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __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;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __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_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __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
+ /* "../../../../../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__27, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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;}
+ __PYX_ERR(1, 799, __pyx_L1_error)
+
+ /* "../../../../../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")
+ *
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -30477,7 +32967,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__pyx_L8_next_or:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
+ /* "../../../../../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)): # <<<<<<<<<<<<<<
@@ -30493,23 +32983,39 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
+
+ /* "../../../../../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")
+ */
if (__pyx_t_6) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__28, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 803, __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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -30517,24 +33023,24 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* 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_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __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
+ /* "../../../../../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;
+ (__pyx_v_f[0]) = 0x78;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -30543,7 +33049,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_f = (__pyx_v_f + 1);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -30554,7 +33060,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
(__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -30564,7 +33070,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -30574,19 +33080,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __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
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -30596,357 +33102,365 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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;}
+ __PYX_ERR(1, 823, __pyx_L1_error)
+
+ /* "../../../../../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.")
+ *
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __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
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 104;
+ (__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 105;
+ (__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 108;
+ (__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 113;
+ (__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 102;
+ (__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 100;
+ (__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 103;
+ (__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __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[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __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[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __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
+ /* "../../../../../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;}
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_ERR(1, 844, __pyx_L1_error)
}
__pyx_L15:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -30954,23 +33468,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../../../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:
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
+ /* "../../../../../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;}
+ /*else*/ {
+ __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_ERR(1, 849, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -30980,7 +33502,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -30990,7 +33512,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_r = __pyx_v_f;
goto __pyx_L0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -31015,7 +33537,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -31030,7 +33552,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
int __pyx_t_2;
__Pyx_RefNannySetupContext("set_array_base", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -31041,7 +33563,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
@@ -31049,20 +33571,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
+
+ /* "../../../../../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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ /* "../../../../../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)
*/
+ /*else*/ {
Py_INCREF(__pyx_v_base);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -31073,7 +33603,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
}
__pyx_L3:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ /* "../../../../../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) # <<<<<<<<<<<<<<
@@ -31082,7 +33612,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
Py_XDECREF(__pyx_v_arr->base);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
* baseptr = <PyObject*>base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
@@ -31091,7 +33621,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
__pyx_v_arr->base = __pyx_v_baseptr;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -31103,7 +33633,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -31117,7 +33647,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -31127,7 +33657,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -31138,21 +33668,31 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "../../../../../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:
+ */
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
* return None
* else:
* return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
*/
+ /*else*/ {
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -31167,7 +33707,397 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":987
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":988
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 989, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":993
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":994
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 995, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":999
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -31183,9 +34113,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -31213,12 +34140,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -31232,7 +34159,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -31246,14 +34173,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __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;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -31265,19 +34192,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __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(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __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;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -31294,7 +34221,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -31306,19 +34233,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -31327,12 +34251,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
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_ERR(2, 127, __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_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -31341,7 +34265,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -31351,21 +34275,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__30, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __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;}
+ __PYX_ERR(2, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -31375,95 +34307,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __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;}
+ __PYX_ERR(2, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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);
+ 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_ERR(2, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -31473,43 +34418,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__32, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -31519,42 +34473,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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;}
+ __PYX_ERR(2, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -31563,7 +34525,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -31571,19 +34533,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -31592,7 +34554,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -31604,20 +34566,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -31626,7 +34596,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -31638,34 +34608,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __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_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -31674,7 +34652,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -31683,19 +34661,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -31705,7 +34683,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -31714,7 +34692,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -31724,21 +34702,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__33, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -31748,7 +34734,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -31757,7 +34743,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -31765,30 +34751,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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;}
+ __PYX_ERR(2, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
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_ERR(2, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -31797,7 +34771,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -31806,14 +34780,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -31826,7 +34812,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -31837,7 +34823,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -31851,14 +34837,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -31869,16 +34855,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -31887,18 +34870,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -31906,21 +34889,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -31928,11 +34919,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -31942,21 +34940,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__34, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __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;}
+ __PYX_ERR(2, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -31966,7 +34972,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -31976,7 +34982,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -31986,7 +34992,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -31996,7 +35002,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -32006,7 +35012,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -32015,7 +35021,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -32025,7 +35031,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -32034,7 +35040,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -32044,7 +35050,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -32053,22 +35059,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -32081,7 +35095,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -32111,7 +35125,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -32124,18 +35138,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -32145,7 +35159,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -32153,10 +35167,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -32166,7 +35188,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -32176,7 +35198,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -32184,32 +35206,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -32221,84 +35256,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
/* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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;
}
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+/* "View.MemoryView":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -32306,15 +35385,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -32328,24 +35407,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -32353,16 +35429,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __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_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -32382,7 +35458,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -32396,24 +35472,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -32421,16 +35494,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __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_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -32450,7 +35523,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -32464,35 +35537,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __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;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -32512,7 +35582,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -32529,12 +35599,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -32544,96 +35611,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __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_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __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_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __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_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __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_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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
+ /* "View.MemoryView":248
* 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;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -32644,7 +35719,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -32656,7 +35731,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -32679,7 +35754,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -32691,9 +35766,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -32715,7 +35787,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -32726,25 +35798,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -32757,7 +35829,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -32771,7 +35843,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -32785,19 +35857,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -32809,7 +35881,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -32824,7 +35896,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -32838,7 +35910,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -32847,7 +35919,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -32856,7 +35928,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -32866,7 +35938,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -32874,21 +35946,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -32901,7 +35979,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -32915,9 +35993,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -32942,7 +36017,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -32951,7 +36026,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -32963,43 +36038,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -33012,7 +36082,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -33021,14 +36091,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -33041,16 +36111,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -33060,7 +36130,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -33069,90 +36139,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -33161,7 +36318,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -33170,7 +36327,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -33182,8 +36339,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -33191,7 +36346,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -33204,19 +36359,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -33227,41 +36387,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -33273,8 +36536,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -33294,12 +36557,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -33308,7 +36568,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -33320,25 +36580,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __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;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -33347,7 +36609,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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;}
+ else __PYX_ERR(2, 389, __pyx_L1_error)
}
break;
}
@@ -33358,18 +36620,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __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_ERR(2, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -33379,7 +36641,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -33389,8 +36651,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -33409,7 +36671,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -33423,14 +36685,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -33442,12 +36704,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -33458,7 +36717,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -33469,20 +36728,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -33490,39 +36757,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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;}
+ __PYX_ERR(2, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __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_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __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
+ /* "View.MemoryView":402
*
* 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;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -33530,25 +36797,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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;}
+ /*else*/ {
+ __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_ERR(2, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -33556,14 +36831,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_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_ERR(2, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -33586,7 +36861,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -33600,14 +36875,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -33616,24 +36891,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -33641,111 +36913,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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;}
+ __PYX_ERR(2, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __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_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __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
+ /* "View.MemoryView":411
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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_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_ERR(2, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __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_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_ERR(2, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __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_ERR(2, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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;}
+ /*else*/ {
+ __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_ERR(2, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -33770,7 +37058,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -33790,24 +37078,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -33815,81 +37100,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -33906,12 +37202,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -33919,11 +37225,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -33935,7 +37247,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -33957,7 +37269,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -33974,55 +37286,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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;}
+ __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_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -34043,7 +37352,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -34052,7 +37361,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -34070,12 +37379,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -34084,7 +37390,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -34093,7 +37399,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -34103,7 +37409,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -34112,7 +37418,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -34122,17 +37428,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* 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;}
+ PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -34140,22 +37454,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -34164,7 +37486,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -34174,7 +37496,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -34182,24 +37504,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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;}
+ /*else*/ {
+ __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_ERR(2, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -34209,21 +37539,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -34233,7 +37569,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -34246,8 +37582,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -34261,6 +37599,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -34278,7 +37617,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -34299,7 +37638,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -34313,33 +37652,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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_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_ERR(2, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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_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_ERR(2, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -34360,7 +37696,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -34381,41 +37717,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -34423,26 +37755,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __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_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -34452,38 +37786,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -34491,14 +37853,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -34511,51 +37881,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__35, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __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;}
+ __PYX_ERR(2, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -34563,7 +37944,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -34589,7 +37970,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -34610,31 +37991,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -34645,53 +38024,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __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_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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;}
+ 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_ERR(2, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __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_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -34701,66 +38088,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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;}
+ 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_ERR(2, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 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_ERR(2, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -34769,9 +38176,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -34788,7 +38195,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -34799,7 +38206,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -34813,14 +38220,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -34835,7 +38242,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -34845,7 +38252,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -34854,22 +38261,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -34879,7 +38294,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -34888,22 +38303,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -34913,7 +38336,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -34922,22 +38345,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -34947,7 +38378,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -34956,22 +38387,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -34981,7 +38420,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -34991,7 +38430,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -35001,7 +38440,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -35011,7 +38450,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -35020,7 +38459,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -35033,7 +38472,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -35051,78 +38490,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __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;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __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
+ /* "View.MemoryView":541
+ * def T(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;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -35137,49 +38573,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -35190,77 +38626,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__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_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __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_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -35269,102 +38704,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __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;}
+ __PYX_ERR(2, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__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_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __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_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -35373,110 +38815,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__48, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -35485,55 +38930,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -35548,55 +38990,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__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_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -35611,51 +39050,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __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_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __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_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __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;
@@ -35663,11 +39099,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -35684,156 +39120,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_int_1);
__pyx_v_result = __pyx_int_1;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -35842,18 +39237,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -35864,8 +39258,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -35878,20 +39272,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -35901,7 +39295,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -35910,9 +39304,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -35922,8 +39324,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -35936,7 +39338,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -35950,25 +39352,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -35976,54 +39375,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __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;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -36044,7 +39443,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -36058,24 +39457,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -36083,27 +39479,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 0, __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_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -36123,7 +39519,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -36137,48 +39533,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -36197,8 +39590,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -36211,49 +39604,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -36271,8 +39661,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -36285,26 +39675,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -36313,7 +39700,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -36322,17 +39709,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(2, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -36340,14 +39727,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -36365,7 +39752,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -36379,14 +39766,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -36394,12 +39781,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -36408,7 +39792,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -36417,17 +39801,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(2, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -36435,13 +39819,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -36460,7 +39844,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -36475,40 +39859,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -36517,7 +39898,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -36529,7 +39910,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -36551,7 +39932,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -36565,18 +39946,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -36590,7 +39971,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -36619,12 +40000,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -36635,49 +40013,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -36686,7 +40072,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -36695,7 +40081,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -36708,25 +40094,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __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;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -36735,7 +40123,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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;}
+ else __PYX_ERR(2, 665, __pyx_L1_error)
}
break;
}
@@ -36745,13 +40133,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -36762,7 +40150,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -36772,27 +40160,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __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_ERR(2, 668, __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__37);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__37);
- __Pyx_GIVEREF(__pyx_slice__37);
+ __Pyx_INCREF(__pyx_slice__49);
+ __Pyx_GIVEREF(__pyx_slice__49);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__49);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -36800,22 +40188,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__38); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__50); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -36823,17 +40219,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -36846,29 +40250,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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_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_ERR(2, 675, __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_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __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;}
+ __PYX_ERR(2, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -36887,18 +40299,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -36909,17 +40321,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -36929,29 +40341,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __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__39);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__39);
- __Pyx_GIVEREF(__pyx_slice__39);
+ __Pyx_INCREF(__pyx_slice__51);
+ __Pyx_GIVEREF(__pyx_slice__51);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__51);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -36961,32 +40379,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -37012,76 +40430,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -37090,7 +40515,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -37129,12 +40554,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -37144,7 +40566,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -37153,7 +40575,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -37164,36 +40586,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ __PYX_ERR(2, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -37201,20 +40623,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -37225,7 +40655,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -37235,7 +40665,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -37245,7 +40675,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -37254,7 +40684,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -37263,7 +40693,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -37275,25 +40705,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __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;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -37302,7 +40734,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ else __PYX_ERR(2, 732, __pyx_L1_error)
}
break;
}
@@ -37313,7 +40745,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -37323,27 +40755,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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;}
+ __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_ERR(2, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -37354,7 +40794,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -37363,7 +40803,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -37372,16 +40812,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -37389,24 +40829,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -37415,20 +40863,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -37437,20 +40885,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -37459,55 +40907,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __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
+ /* "View.MemoryView":751
*
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __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
+ /* "View.MemoryView":752
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __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
+ /* "View.MemoryView":754
* 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;}
+ __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_ERR(2, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -37518,7 +40966,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -37528,18 +40976,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -37548,73 +40996,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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_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_ERR(2, 763, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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_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_ERR(2, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -37636,7 +41092,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -37651,11 +41107,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -37665,7 +41118,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -37675,7 +41128,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -37683,11 +41136,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -37701,28 +41160,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -37734,7 +41207,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -37752,19 +41225,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -37774,7 +41253,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -37784,7 +41263,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -37793,7 +41272,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -37803,7 +41282,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -37811,13 +41290,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -37827,7 +41320,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -37837,7 +41330,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -37845,38 +41338,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -37884,24 +41400,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -37911,7 +41435,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -37921,7 +41445,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -37930,7 +41454,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -37940,7 +41464,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -37948,13 +41472,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -37964,7 +41502,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -37972,49 +41510,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -38024,7 +41585,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -38032,11 +41593,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -38045,7 +41612,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -38055,7 +41622,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -38063,11 +41630,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -38077,7 +41650,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -38085,11 +41658,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -38098,7 +41677,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -38107,7 +41686,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -38118,7 +41697,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -38128,7 +41707,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -38136,23 +41715,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -38162,7 +41749,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -38172,7 +41759,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -38182,7 +41769,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -38190,39 +41777,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -38232,7 +41849,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -38256,7 +41873,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -38276,21 +41893,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -38300,7 +41914,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -38310,7 +41924,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -38318,28 +41932,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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;}
+ __PYX_ERR(2, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
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_ERR(2, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -38347,20 +41949,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -38369,7 +41979,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -38379,7 +41989,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -38387,13 +41997,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -38403,7 +42019,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -38412,7 +42028,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -38422,35 +42038,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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;}
+ __PYX_ERR(2, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -38460,32 +42090,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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;}
+ __PYX_ERR(2, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -38494,7 +42132,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -38504,7 +42142,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -38512,11 +42150,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -38526,7 +42170,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -38545,7 +42189,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -38568,11 +42212,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -38582,7 +42223,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -38592,7 +42233,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -38602,7 +42243,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -38613,7 +42254,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -38622,7 +42263,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -38634,7 +42275,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -38646,7 +42287,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -38664,20 +42305,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -38687,7 +42334,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -38711,7 +42358,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -38724,17 +42371,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -38743,7 +42390,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -38755,7 +42402,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -38768,12 +42415,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -38783,7 +42427,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -38791,30 +42435,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -38833,7 +42485,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -38847,12 +42499,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -38862,32 +42511,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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;}
+ /*else*/ {
+ __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_ERR(2, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -38908,36 +42565,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -38946,11 +42603,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -38961,7 +42618,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -38971,7 +42628,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -38979,16 +42637,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -38997,7 +42653,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -39008,35 +42664,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -39045,7 +42709,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -39054,14 +42718,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -39069,7 +42733,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -39079,7 +42743,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -39089,7 +42753,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -39098,7 +42762,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -39107,7 +42771,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -39116,7 +42780,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -39125,7 +42789,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -39134,66 +42798,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -39201,7 +42927,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -39210,7 +42936,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -39222,7 +42948,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -39238,12 +42964,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -39258,36 +42985,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -39296,19 +43020,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -39319,7 +43051,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -39330,7 +43062,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -39338,7 +43070,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -39355,10 +43087,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -39368,7 +43100,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -39378,7 +43110,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -39388,7 +43120,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -39397,7 +43129,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -39406,7 +43138,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -39417,59 +43149,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -39481,7 +43194,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -39494,12 +43207,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -39508,7 +43218,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -39516,13 +43226,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -39541,7 +43251,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -39559,23 +43269,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -39585,7 +43292,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -39594,20 +43301,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -39618,7 +43333,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -39627,20 +43342,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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_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_ERR(2, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -39659,7 +43374,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -39671,7 +43386,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -39681,7 +43396,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -39690,21 +43405,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -39717,7 +43440,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -39734,7 +43457,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -39743,7 +43466,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -39752,17 +43475,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -39772,7 +43495,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -39781,7 +43504,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -39789,11 +43512,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -39804,7 +43535,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -39814,7 +43545,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -39823,7 +43554,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -39831,11 +43562,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -39845,7 +43584,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -39854,21 +43593,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -39881,7 +43628,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -39901,7 +43648,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -39910,7 +43657,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -39919,7 +43666,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -39928,7 +43675,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -39937,7 +43684,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -39947,7 +43694,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -39967,7 +43714,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -39981,9 +43728,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -39991,22 +43746,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -40015,7 +43778,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -40024,7 +43787,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -40035,22 +43798,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -40059,7 +43830,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -40068,7 +43839,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -40080,7 +43851,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -40091,7 +43862,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -40101,7 +43872,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -40110,7 +43881,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -40121,7 +43892,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -40137,7 +43908,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -40147,7 +43918,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -40158,7 +43929,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -40168,7 +43939,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -40178,7 +43949,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -40191,7 +43962,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -40206,7 +43977,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -40216,7 +43987,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -40227,7 +43998,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -40236,7 +44007,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -40245,21 +44016,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -40268,7 +44047,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -40280,7 +44059,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -40290,7 +44069,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -40303,7 +44082,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -40322,11 +44101,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -40336,7 +44112,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -40345,7 +44121,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -40354,7 +44130,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -40364,19 +44140,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -40385,7 +44167,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -40395,7 +44177,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -40406,7 +44188,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -40415,17 +44197,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -40434,7 +44216,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -40445,7 +44227,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -40455,53 +44237,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -40511,7 +44307,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -40535,7 +44331,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -40550,62 +44346,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __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_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __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_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __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_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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;}
+ __PYX_ERR(2, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -40628,7 +44421,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -40644,33 +44437,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __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_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __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_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -40680,26 +44470,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(2, 1242, __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;}
+ __PYX_ERR(2, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -40724,7 +44534,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -40741,16 +44551,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -40760,18 +44567,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -40781,39 +44588,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;}
+ __PYX_ERR(2, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(2, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -40838,7 +44673,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -40863,11 +44698,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -40876,7 +44708,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -40886,7 +44718,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -40895,7 +44727,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -40904,7 +44736,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -40913,7 +44745,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -40923,7 +44755,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -40931,10 +44763,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -40944,7 +44784,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -40952,11 +44792,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -40972,7 +44819,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -40983,7 +44830,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -40993,7 +44840,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -41003,7 +44850,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -41012,7 +44859,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -41020,25 +44867,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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;}
+ /*else*/ {
+ __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_ERR(2, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -41048,62 +44909,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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_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_ERR(2, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -41111,11 +44984,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -41125,51 +45004,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
*
- * 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)
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -41178,7 +45072,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -41187,7 +45081,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -41196,7 +45090,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -41205,7 +45099,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -41214,7 +45108,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -41223,12 +45117,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -41242,28 +45150,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -41272,7 +45186,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -41281,7 +45195,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -41290,7 +45204,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -41299,7 +45213,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -41309,7 +45223,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -41333,21 +45247,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -41356,87 +45270,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -41444,7 +45358,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -41455,7 +45369,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -41465,7 +45379,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -41473,11 +45387,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -41488,7 +45408,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41503,7 +45423,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -41512,7 +45432,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41527,7 +45447,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41543,7 +45463,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -41554,7 +45474,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -41564,7 +45484,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -41574,7 +45494,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -41582,36 +45502,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -41621,7 +45565,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41633,7 +45577,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -41643,7 +45587,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -41652,7 +45596,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -41661,7 +45605,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -41670,7 +45614,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -41681,7 +45625,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41697,7 +45641,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -41706,7 +45650,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -41715,7 +45659,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -41725,7 +45669,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -41736,7 +45680,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -41745,7 +45689,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -41754,22 +45698,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -41778,7 +45730,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -41790,7 +45742,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -41800,6 +45752,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -41811,12 +45764,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -41867,7 +45822,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -41876,7 +45831,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -41918,7 +45873,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd_lut.array", /*tp_name*/
+ "silx.math.chistogramnd_lut.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -41927,8 +45882,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -42023,7 +45979,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd_lut.Enum", /*tp_name*/
+ "silx.math.chistogramnd_lut.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -42032,8 +45988,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -42094,10 +46051,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -42175,39 +46133,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -42219,15 +46177,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -42269,7 +46227,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd_lut.memoryview", /*tp_name*/
+ "silx.math.chistogramnd_lut.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -42278,8 +46236,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -42379,7 +46338,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -42387,13 +46346,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "chistogramnd_lut._memoryviewslice", /*tp_name*/
+ "silx.math.chistogramnd_lut._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -42402,8 +46361,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -42480,6 +46440,7 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_15_05_2016, __pyx_k_15_05_2016, sizeof(__pyx_k_15_05_2016), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
{&__pyx_kp_s_At_least_one_of_the_following_pa, __pyx_k_At_least_one_of_the_following_pa, sizeof(__pyx_k_At_least_one_of_the_following_pa), 0, 0, 1, 0},
{&__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},
@@ -42489,7 +46450,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_D_Naudet, __pyx_k_D_Naudet, sizeof(__pyx_k_D_Naudet), 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_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
{&__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},
@@ -42503,6 +46463,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
{&__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},
@@ -42518,8 +46479,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_Type_not_supported_sample_0, __pyx_k_Type_not_supported_sample_0, sizeof(__pyx_k_Type_not_supported_sample_0), 0, 0, 1, 0},
{&__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__14, __pyx_k__14, sizeof(__pyx_k__14), 0, 0, 1, 0},
- {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
+ {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
+ {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
{&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
{&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
{&__pyx_n_s_arange, __pyx_k_arange, sizeof(__pyx_k_arange), 0, 0, 1, 1},
@@ -42532,7 +46493,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_bins_range, __pyx_k_bins_range, sizeof(__pyx_k_bins_range), 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_chistogramnd_lut, __pyx_k_chistogramnd_lut, sizeof(__pyx_k_chistogramnd_lut), 0, 0, 1, 1},
{&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 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},
@@ -42545,6 +46505,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
{&__pyx_n_s_elem_coord, __pyx_k_elem_coord, sizeof(__pyx_k_elem_coord), 0, 0, 1, 1},
{&__pyx_n_s_elem_idx, __pyx_k_elem_idx, sizeof(__pyx_k_elem_idx), 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_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
{&__pyx_n_s_equal, __pyx_k_equal, sizeof(__pyx_k_equal), 0, 0, 1, 1},
@@ -42670,7 +46631,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_n_s_max_idx, __pyx_k_max_idx, sizeof(__pyx_k_max_idx), 0, 0, 1, 1},
{&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
- {&__pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
{&__pyx_n_s_n_bins, __pyx_k_n_bins, sizeof(__pyx_k_n_bins), 0, 0, 1, 1},
{&__pyx_n_s_n_bins_c, __pyx_k_n_bins_c, sizeof(__pyx_k_n_bins_c), 0, 0, 1, 1},
@@ -42685,13 +46645,15 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_ndmin, __pyx_k_ndmin, sizeof(__pyx_k_ndmin), 0, 0, 1, 1},
+ {&__pyx_n_s_newbyteorder, __pyx_k_newbyteorder, sizeof(__pyx_k_newbyteorder), 0, 0, 1, 1},
{&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
+ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
{&__pyx_n_s_o_histo, __pyx_k_o_histo, sizeof(__pyx_k_o_histo), 0, 0, 1, 1},
{&__pyx_n_s_o_lut, __pyx_k_o_lut, sizeof(__pyx_k_o_lut), 0, 0, 1, 1},
{&__pyx_n_s_o_weighted_histo, __pyx_k_o_weighted_histo, sizeof(__pyx_k_o_weighted_histo), 0, 0, 1, 1},
{&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
- {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
{&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
{&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
{&__pyx_n_s_prod, __pyx_k_prod, sizeof(__pyx_k_prod), 0, 0, 1, 1},
@@ -42708,6 +46670,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_sample_type, __pyx_k_sample_type, sizeof(__pyx_k_sample_type), 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_silx_math_chistogramnd_lut, __pyx_k_silx_math_chistogramnd_lut, sizeof(__pyx_k_silx_math_chistogramnd_lut), 0, 0, 1, 1},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
@@ -42727,6 +46690,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_w_c, __pyx_k_w_c, sizeof(__pyx_k_w_c), 0, 0, 1, 1},
{&__pyx_n_s_w_dtype, __pyx_k_w_dtype, sizeof(__pyx_k_w_dtype), 0, 0, 1, 1},
{&__pyx_n_s_w_h_c, __pyx_k_w_h_c, sizeof(__pyx_k_w_h_c), 0, 0, 1, 1},
@@ -42734,31 +46698,23 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_weight_min, __pyx_k_weight_min, sizeof(__pyx_k_weight_min), 0, 0, 1, 1},
{&__pyx_n_s_weighted_histo, __pyx_k_weighted_histo, sizeof(__pyx_k_weighted_histo), 0, 0, 1, 1},
{&__pyx_n_s_weights, __pyx_k_weights, sizeof(__pyx_k_weights), 0, 0, 1, 1},
- {&__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_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __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 = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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 = 190; __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 = 323; __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 = 323; __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 = 323; __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 = 323; __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;}
- #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;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 118, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 185, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 195, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 332, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -42768,478 +46724,611 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "chistogramnd_lut.pyx":108
+ /* "silx/math/chistogramnd_lut.pyx":108
*
* if n_dims == 1:
* if histo_range.shape == (2,): # <<<<<<<<<<<<<<
* pass
* elif histo_range.shape == (1, 2):
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_2); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "chistogramnd_lut.pyx":110
+ /* "silx/math/chistogramnd_lut.pyx":110
* if histo_range.shape == (2,):
* pass
* elif histo_range.shape == (1, 2): # <<<<<<<<<<<<<<
* histo_range.reshape(-1)
* else:
*/
- __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "chistogramnd_lut.pyx":111
+ /* "silx/math/chistogramnd_lut.pyx":111
* pass
* elif histo_range.shape == (1, 2):
* histo_range.reshape(-1) # <<<<<<<<<<<<<<
* else:
* err_histo_range = True
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "chistogramnd_lut.pyx":133
+ /* "silx/math/chistogramnd_lut.pyx":133
* n_bins = np.tile(n_bins, n_dims)
* elif n_bins.shape != (n_dims,):
* raise ValueError('n_bins must be either a scalar (same number ' # <<<<<<<<<<<<<<
* 'of bins for all dimensions) or '
* 'an array (number of bins for each '
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_n_bins_must_be_either_a_scalar_s); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_n_bins_must_be_either_a_scalar_s); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "chistogramnd_lut.pyx":142
+ /* "silx/math/chistogramnd_lut.pyx":142
* # also testing for negative/null values
* if np.any(np.equal(n_bins, None)) or np.any(n_bins <= 0):
* raise ValueError('<n_bins> : only positive values allowed.') # <<<<<<<<<<<<<<
*
* sample_type = sample.dtype
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_n_bins_only_positive_values_all); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_n_bins_only_positive_values_all); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 142, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "chistogramnd_lut.pyx":189
+ /* "silx/math/chistogramnd_lut.pyx":160
+ * histo = np.zeros(n_bins, dtype=np.uint32)
+ *
+ * dtype = sample.dtype.newbyteorder("N") # <<<<<<<<<<<<<<
+ * sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ * dtype=dtype)
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "silx/math/chistogramnd_lut.pyx":165
+ *
+ * histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
+ * dtype=histo_range.dtype.newbyteorder("N")) # <<<<<<<<<<<<<<
+ *
+ * n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "silx/math/chistogramnd_lut.pyx":172
+ * lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
+ * histo_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ * dtype=histo.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "silx/math/chistogramnd_lut.pyx":194
*
* edges = []
* histo_range = histo_range.reshape(-1) # <<<<<<<<<<<<<<
* for i_dim in range(n_dims):
* dim_edges = np.zeros(n_bins[i_dim] + 1)
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 194, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "chistogramnd_lut.pyx":194
+ /* "silx/math/chistogramnd_lut.pyx":199
* rng_min = histo_range[2 * i_dim]
* rng_max = histo_range[2 * i_dim + 1]
* dim_edges[:-1] = (rng_min + np.arange(n_bins[i_dim]) * # <<<<<<<<<<<<<<
* ((rng_max - rng_min) / n_bins[i_dim]))
* dim_edges[-1] = rng_max
*/
- __pyx_slice__7 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__7);
- __Pyx_GIVEREF(__pyx_slice__7);
+ __pyx_slice__10 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__10);
+ __Pyx_GIVEREF(__pyx_slice__10);
- /* "chistogramnd_lut.pyx":220
+ /* "silx/math/chistogramnd_lut.pyx":225
* if histo is None and weighted_histo is None:
* if shape is None:
* raise ValueError('At least one of the following parameters has to ' # <<<<<<<<<<<<<<
* 'be provided : <shape> or <histo> or '
* '<weighted_histo>')
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_At_least_one_of_the_following_pa); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_At_least_one_of_the_following_pa); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 225, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
- /* "chistogramnd_lut.pyx":226
+ /* "silx/math/chistogramnd_lut.pyx":231
* if shape is not None:
* if histo is not None and list(histo.shape) != list(shape):
* raise ValueError('The <shape> value does not match' # <<<<<<<<<<<<<<
* 'the <histo> shape.')
*
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_The_shape_value_does_not_matchth); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_The_shape_value_does_not_matchth); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 231, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
- /* "chistogramnd_lut.pyx":231
+ /* "silx/math/chistogramnd_lut.pyx":236
* if(weighted_histo is not None and
* list(weighted_histo.shape) != list(shape)):
* raise ValueError('The <shape> value does not match' # <<<<<<<<<<<<<<
* 'the <weighted_histo> shape.')
* else:
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_The_shape_value_does_not_matchth_2); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_The_shape_value_does_not_matchth_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
- /* "chistogramnd_lut.pyx":248
+ /* "silx/math/chistogramnd_lut.pyx":253
* if weighted_histo is not None:
* if histo.shape != weighted_histo.shape:
* raise ValueError('The <histo> shape does not match' # <<<<<<<<<<<<<<
* 'the <weighted_histo> shape.')
* else:
*/
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_The_histo_shape_does_not_matchth); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__11);
- __Pyx_GIVEREF(__pyx_tuple__11);
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_The_histo_shape_does_not_matchth); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 253, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
- /* "chistogramnd_lut.pyx":262
+ /* "silx/math/chistogramnd_lut.pyx":267
* elif weighted_histo is not None:
* if weighted_histo.dtype != dtype:
* raise ValueError('Provided <dtype> and <weighted_histo>\'s dtype' # <<<<<<<<<<<<<<
* ' do not match.')
* dtype = weighted_histo.dtype
*/
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Provided_dtype_and_weighted_hist); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Provided_dtype_and_weighted_hist); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
- /* "chistogramnd_lut.pyx":270
+ /* "silx/math/chistogramnd_lut.pyx":275
*
* if histo_lut.size != weights.size:
* raise ValueError('The LUT and weights arrays must have the same ' # <<<<<<<<<<<<<<
* 'number of elements.')
*
*/
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_The_LUT_and_weights_arrays_must); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__13);
- __Pyx_GIVEREF(__pyx_tuple__13);
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_The_LUT_and_weights_arrays_must); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 275, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
- /* "chistogramnd_lut.pyx":323
- * @cython.nonecheck(False)
- * @cython.cdivision(True)
- * def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
- * lut_t[:] i_lut,
- * np.uint32_t[:] o_histo,
+ /* "silx/math/chistogramnd_lut.pyx":279
+ *
+ * w_c = np.ascontiguousarray(weights.reshape((weights.size,)),
+ * dtype=weights.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)),
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s__16); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/chistogramnd_lut.pyx":282
+ *
+ * h_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ * dtype=histo.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)),
+ */
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/chistogramnd_lut.pyx":285
+ *
+ * w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)),
+ * dtype=weighted_histo.dtype.newbyteorder('N')) # noqa # <<<<<<<<<<<<<<
+ *
+ * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)),
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__19);
__Pyx_GIVEREF(__pyx_tuple__19);
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":288
+ *
+ * h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)),
+ * histo_lut.dtype.newbyteorder('N')) # <<<<<<<<<<<<<<
+ *
+ * rc = 0
+ */
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+
+ /* "silx/math/chistogramnd_lut.pyx":332
+ * @cython.nonecheck(False)
+ * @cython.cdivision(True)
+ * def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
+ * lut_t[:] i_lut,
+ * np.uint32_t[:] o_histo,
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s__21); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
* int i_n_dims,
* int i_n_elems,
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s__14); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s__16); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s__21); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s__23); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__24 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__25 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__26 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ /* "../../../../../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__27 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 799, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__28 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__28);
- __Pyx_GIVEREF(__pyx_tuple__28);
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 803, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
+ /* "../../../../../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__29 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 823, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
- /* "View.MemoryView":127
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 989, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
+
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
+ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(2, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__40);
+ __Pyx_GIVEREF(__pyx_tuple__40);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(2, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__42);
+ __Pyx_GIVEREF(__pyx_tuple__42);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
+ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__44);
+ __Pyx_GIVEREF(__pyx_tuple__44);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__34 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
+ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__35 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
+ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(2, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__46);
+ __Pyx_GIVEREF(__pyx_tuple__46);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__36);
- __Pyx_GIVEREF(__pyx_tuple__36);
+ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__48 = PyTuple_New(1); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(2, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__48);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__48, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__48);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__37 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__37)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__37);
- __Pyx_GIVEREF(__pyx_slice__37);
+ __pyx_slice__49 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__49)) __PYX_ERR(2, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__49);
+ __Pyx_GIVEREF(__pyx_slice__49);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__38 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__38);
- __Pyx_GIVEREF(__pyx_slice__38);
+ __pyx_slice__50 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) __PYX_ERR(2, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__50);
+ __Pyx_GIVEREF(__pyx_slice__50);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__39);
- __Pyx_GIVEREF(__pyx_slice__39);
+ __pyx_slice__51 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__51)) __PYX_ERR(2, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__51);
+ __Pyx_GIVEREF(__pyx_slice__51);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__40);
- __Pyx_GIVEREF(__pyx_tuple__40);
+ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
- /* "chistogramnd_lut.pyx":58
+ /* "silx/math/chistogramnd_lut.pyx":58
*
*
* def histogramnd_get_lut(sample, # <<<<<<<<<<<<<<
* histo_range,
* n_bins,
*/
- __pyx_tuple__41 = PyTuple_Pack(25, __pyx_n_s_sample, __pyx_n_s_histo_range, __pyx_n_s_n_bins, __pyx_n_s_last_bin_closed, __pyx_n_s_s_shape, __pyx_n_s_n_dims, __pyx_n_s_i_histo_range, __pyx_n_s_err_histo_range, __pyx_n_s_sample_type, __pyx_n_s_n_elem, __pyx_n_s_lut_dtype, __pyx_n_s_lut, __pyx_n_s_histo, __pyx_n_s_sample_c, __pyx_n_s_histo_range_c, __pyx_n_s_n_bins_c, __pyx_n_s_lut_c, __pyx_n_s_histo_c, __pyx_n_s_rc, __pyx_n_s_ex, __pyx_n_s_edges, __pyx_n_s_i_dim, __pyx_n_s_dim_edges, __pyx_n_s_rng_min, __pyx_n_s_rng_max); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
- __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 25, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_histogramnd_get_lut, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__53 = PyTuple_Pack(26, __pyx_n_s_sample, __pyx_n_s_histo_range, __pyx_n_s_n_bins, __pyx_n_s_last_bin_closed, __pyx_n_s_s_shape, __pyx_n_s_n_dims, __pyx_n_s_i_histo_range, __pyx_n_s_err_histo_range, __pyx_n_s_sample_type, __pyx_n_s_n_elem, __pyx_n_s_lut_dtype, __pyx_n_s_lut, __pyx_n_s_histo, __pyx_n_s_dtype, __pyx_n_s_sample_c, __pyx_n_s_histo_range_c, __pyx_n_s_n_bins_c, __pyx_n_s_lut_c, __pyx_n_s_histo_c, __pyx_n_s_rc, __pyx_n_s_ex, __pyx_n_s_edges, __pyx_n_s_i_dim, __pyx_n_s_dim_edges, __pyx_n_s_rng_min, __pyx_n_s_rng_max); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__53);
+ __Pyx_GIVEREF(__pyx_tuple__53);
+ __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(4, 0, 26, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_histogramnd_get_lut, 58, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 58, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":206
+ /* "silx/math/chistogramnd_lut.pyx":211
*
*
* def histogramnd_from_lut(weights, # <<<<<<<<<<<<<<
* histo_lut,
* histo=None,
*/
- __pyx_tuple__43 = PyTuple_Pack(17, __pyx_n_s_weights, __pyx_n_s_histo_lut, __pyx_n_s_histo, __pyx_n_s_weighted_histo, __pyx_n_s_shape, __pyx_n_s_dtype, __pyx_n_s_weight_min, __pyx_n_s_weight_max, __pyx_n_s_w_dtype, __pyx_n_s_w_c, __pyx_n_s_h_c, __pyx_n_s_w_h_c, __pyx_n_s_h_lut_c, __pyx_n_s_rc, __pyx_n_s_filt_min_weights, __pyx_n_s_filt_max_weights, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
- __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_histogramnd_from_lut, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__55 = PyTuple_Pack(17, __pyx_n_s_weights, __pyx_n_s_histo_lut, __pyx_n_s_histo, __pyx_n_s_weighted_histo, __pyx_n_s_shape, __pyx_n_s_dtype, __pyx_n_s_weight_min, __pyx_n_s_weight_max, __pyx_n_s_w_dtype, __pyx_n_s_w_c, __pyx_n_s_h_c, __pyx_n_s_w_h_c, __pyx_n_s_h_lut_c, __pyx_n_s_rc, __pyx_n_s_filt_min_weights, __pyx_n_s_filt_max_weights, __pyx_n_s_ex); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 211, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__55);
+ __Pyx_GIVEREF(__pyx_tuple__55);
+ __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_histogramnd_from_lut, 211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 211, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
* lut_t[:] i_lut,
* np.uint32_t[:] o_histo,
*/
- __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_i_weights, __pyx_n_s_i_lut, __pyx_n_s_o_histo, __pyx_n_s_o_weighted_histo, __pyx_n_s_i_n_elems, __pyx_n_s_i_filt_min_weights, __pyx_n_s_i_weight_min, __pyx_n_s_i_filt_max_weights, __pyx_n_s_i_weight_max, __pyx_n_s_i); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
- __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(9, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_histogramnd_from_lut_fused, 323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__57 = PyTuple_Pack(10, __pyx_n_s_i_weights, __pyx_n_s_i_lut, __pyx_n_s_o_histo, __pyx_n_s_o_weighted_histo, __pyx_n_s_i_n_elems, __pyx_n_s_i_filt_min_weights, __pyx_n_s_i_weight_min, __pyx_n_s_i_filt_max_weights, __pyx_n_s_i_weight_max, __pyx_n_s_i); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 332, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__57);
+ __Pyx_GIVEREF(__pyx_tuple__57);
+ __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(9, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_histogramnd_from_lut_fused, 332, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 332, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
* int i_n_dims,
* int i_n_elems,
*/
- __pyx_tuple__47 = PyTuple_Pack(17, __pyx_n_s_i_sample, __pyx_n_s_i_n_dims, __pyx_n_s_i_n_elems, __pyx_n_s_i_histo_range, __pyx_n_s_i_n_bins, __pyx_n_s_o_lut, __pyx_n_s_o_histo, __pyx_n_s_last_bin_closed, __pyx_n_s_i, __pyx_n_s_elem_idx, __pyx_n_s_max_idx, __pyx_n_s_lut_idx, __pyx_n_s_bin_idx, __pyx_n_s_elem_coord, __pyx_n_s_g_min, __pyx_n_s_g_max, __pyx_n_s_bins_range); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__47);
- __Pyx_GIVEREF(__pyx_tuple__47);
- __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_histogramnd_get_lut_fused, 352, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__59 = PyTuple_Pack(17, __pyx_n_s_i_sample, __pyx_n_s_i_n_dims, __pyx_n_s_i_n_elems, __pyx_n_s_i_histo_range, __pyx_n_s_i_n_bins, __pyx_n_s_o_lut, __pyx_n_s_o_histo, __pyx_n_s_last_bin_closed, __pyx_n_s_i, __pyx_n_s_elem_idx, __pyx_n_s_max_idx, __pyx_n_s_lut_idx, __pyx_n_s_bin_idx, __pyx_n_s_elem_coord, __pyx_n_s_g_min, __pyx_n_s_g_max, __pyx_n_s_bins_range); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 361, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__59);
+ __Pyx_GIVEREF(__pyx_tuple__59);
+ __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(8, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_histogramnd_get_lut_fused, 361, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 361, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
+ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__61);
+ __Pyx_GIVEREF(__pyx_tuple__61);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__50);
- __Pyx_GIVEREF(__pyx_tuple__50);
+ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__62);
+ __Pyx_GIVEREF(__pyx_tuple__62);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__51);
- __Pyx_GIVEREF(__pyx_tuple__51);
+ __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(2, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__63);
+ __Pyx_GIVEREF(__pyx_tuple__63);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__52);
- __Pyx_GIVEREF(__pyx_tuple__52);
+ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__64);
+ __Pyx_GIVEREF(__pyx_tuple__64);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
+ __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(2, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__65);
+ __Pyx_GIVEREF(__pyx_tuple__65);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -43248,13 +47337,13 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_32768 = PyInt_FromLong(32768L); if (unlikely(!__pyx_int_32768)) {__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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_32768 = PyInt_FromLong(32768L); if (unlikely(!__pyx_int_32768)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -43273,9 +47362,7 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
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;
+ static PyThread_type_lock __pyx_t_6[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -43287,17 +47374,24 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_chistogramnd_lut(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -43312,34 +47406,34 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_chistogramnd_lut) {
- 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 (__pyx_module_is_main_silx__math__chistogramnd_lut) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "chistogramnd_lut")) {
- if (unlikely(PyDict_SetItemString(modules, "chistogramnd_lut", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.chistogramnd_lut")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.chistogramnd_lut", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -43349,10 +47443,13 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
/*--- 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_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -43363,18 +47460,18 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __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",
@@ -43383,543 +47480,573 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
#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;}
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "chistogramnd_lut.pyx":25
+ /* "silx/math/chistogramnd_lut.pyx":25
* # ############################################################################*[inserted by cython to avoid comment closer]/
*
* __authors__ = ["D. Naudet"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
* __date__ = "15/05/2016"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_D_Naudet);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_D_Naudet);
__Pyx_GIVEREF(__pyx_kp_s_D_Naudet);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_D_Naudet);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":26
+ /* "silx/math/chistogramnd_lut.pyx":26
*
* __authors__ = ["D. Naudet"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
* __date__ = "15/05/2016"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":27
+ /* "silx/math/chistogramnd_lut.pyx":27
* __authors__ = ["D. Naudet"]
* __license__ = "MIT"
* __date__ = "15/05/2016" # <<<<<<<<<<<<<<
*
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_05_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_05_2016) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
- /* "chistogramnd_lut.pyx":32
+ /* "silx/math/chistogramnd_lut.pyx":32
* cimport numpy as np # noqa
* cimport cython
* import numpy as np # <<<<<<<<<<<<<<
*
* ctypedef fused sample_t:
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":58
+ /* "silx/math/chistogramnd_lut.pyx":58
*
*
* def histogramnd_get_lut(sample, # <<<<<<<<<<<<<<
* histo_range,
* n_bins,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16chistogramnd_lut_1histogramnd_get_lut, NULL, __pyx_n_s_chistogramnd_lut); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_16chistogramnd_lut_1histogramnd_get_lut, NULL, __pyx_n_s_silx_math_chistogramnd_lut); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_get_lut, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_get_lut, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":206
+ /* "silx/math/chistogramnd_lut.pyx":211
*
*
* def histogramnd_from_lut(weights, # <<<<<<<<<<<<<<
* histo_lut,
* histo=None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_16chistogramnd_lut_3histogramnd_from_lut, NULL, __pyx_n_s_chistogramnd_lut); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_16chistogramnd_lut_3histogramnd_from_lut, NULL, __pyx_n_s_silx_math_chistogramnd_lut); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_from_lut, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_from_lut, __pyx_t_1) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "chistogramnd_lut.pyx":323
+ /* "silx/math/chistogramnd_lut.pyx":332
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_from_lut_fused(weights_t[:] i_weights, # <<<<<<<<<<<<<<
* lut_t[:] i_lut,
* np.uint32_t[:] o_histo,
*/
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_0__pyx_mdef_16chistogramnd_lut_9_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_9_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_1__pyx_mdef_16chistogramnd_lut_11_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_11_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_2__pyx_mdef_16chistogramnd_lut_13_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_13_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_3__pyx_mdef_16chistogramnd_lut_15_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_15_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_0__pyx_mdef_16chistogramnd_lut_17_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_17_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_1__pyx_mdef_16chistogramnd_lut_19_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_19_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_2__pyx_mdef_16chistogramnd_lut_21_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_21_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_3__pyx_mdef_16chistogramnd_lut_23_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_23_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_0__pyx_mdef_16chistogramnd_lut_25_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_25_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_1__pyx_mdef_16chistogramnd_lut_27_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_27_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_2__pyx_mdef_16chistogramnd_lut_29_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_29_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_3__pyx_mdef_16chistogramnd_lut_31_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_31_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float64_t_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_0__pyx_mdef_16chistogramnd_lut_33_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_33_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_1__pyx_mdef_16chistogramnd_lut_35_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_35_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_2__pyx_mdef_16chistogramnd_lut_37_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_37_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_3__pyx_mdef_16chistogramnd_lut_39_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_39_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_0__pyx_mdef_16chistogramnd_lut_41_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_41_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_1__pyx_mdef_16chistogramnd_lut_43_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_43_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_2__pyx_mdef_16chistogramnd_lut_45_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_45_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_3__pyx_mdef_16chistogramnd_lut_47_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_47_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_0__pyx_mdef_16chistogramnd_lut_49_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_49_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_1__pyx_mdef_16chistogramnd_lut_51_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_51_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_2__pyx_mdef_16chistogramnd_lut_53_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_53_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_3__pyx_mdef_16chistogramnd_lut_55_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_55_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_float32_t_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_0__pyx_mdef_16chistogramnd_lut_57_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_57_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_1__pyx_mdef_16chistogramnd_lut_59_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_59_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_2__pyx_mdef_16chistogramnd_lut_61_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_61_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_3__pyx_mdef_16chistogramnd_lut_63_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_63_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_0__pyx_mdef_16chistogramnd_lut_65_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_65_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_1__pyx_mdef_16chistogramnd_lut_67_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_67_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_2__pyx_mdef_16chistogramnd_lut_69_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_69_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_3__pyx_mdef_16chistogramnd_lut_71_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_71_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_0__pyx_mdef_16chistogramnd_lut_73_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_73_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_1__pyx_mdef_16chistogramnd_lut_75_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_75_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_2__pyx_mdef_16chistogramnd_lut_77_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_77_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_3__pyx_mdef_16chistogramnd_lut_79_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_79_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int32_t_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_0__pyx_mdef_16chistogramnd_lut_81_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_81_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_1__pyx_mdef_16chistogramnd_lut_83_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_83_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_2__pyx_mdef_16chistogramnd_lut_85_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_85_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_3__pyx_mdef_16chistogramnd_lut_87_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0_3__pyx_mdef_4silx_4math_16chistogramnd_lut_87_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int64_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_0__pyx_mdef_16chistogramnd_lut_89_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_89_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_1__pyx_mdef_16chistogramnd_lut_91_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_91_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_2__pyx_mdef_16chistogramnd_lut_93_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_93_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_3__pyx_mdef_16chistogramnd_lut_95_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1_3__pyx_mdef_4silx_4math_16chistogramnd_lut_95_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int32_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_0__pyx_mdef_16chistogramnd_lut_97_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_97_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_float64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_float64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_1__pyx_mdef_16chistogramnd_lut_99_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_99_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_float32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_float32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_2__pyx_mdef_16chistogramnd_lut_101_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_101_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_int32_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_int32_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_3__pyx_mdef_16chistogramnd_lut_103_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2_3__pyx_mdef_4silx_4math_16chistogramnd_lut_103_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_int64_t, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_int64_t_int16_t_int64_t, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_16chistogramnd_lut_5_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_FusedFunction_NewEx(&__pyx_mdef_4silx_4math_16chistogramnd_lut_5_histogramnd_from_lut_fused, 0, __pyx_n_s_histogramnd_from_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_empty_tuple);
((__pyx_FusedFunctionObject *) __pyx_t_2)->__signatures__ = __pyx_t_1;
__Pyx_GIVEREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_from_lut_fused, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_from_lut_fused, __pyx_t_2) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "chistogramnd_lut.pyx":352
+ /* "silx/math/chistogramnd_lut.pyx":361
* @cython.nonecheck(False)
* @cython.cdivision(True)
* def _histogramnd_get_lut_fused(sample_t[:] i_sample, # <<<<<<<<<<<<<<
* int i_n_dims,
* int i_n_elems,
*/
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0__pyx_mdef_16chistogramnd_lut_107_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_0__pyx_mdef_4silx_4math_16chistogramnd_lut_107_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int64_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int64_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1__pyx_mdef_16chistogramnd_lut_109_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_1__pyx_mdef_4silx_4math_16chistogramnd_lut_109_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int32_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int32_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2__pyx_mdef_16chistogramnd_lut_111_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0_2__pyx_mdef_4silx_4math_16chistogramnd_lut_111_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int16_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float64_t_int16_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0__pyx_mdef_16chistogramnd_lut_113_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_0__pyx_mdef_4silx_4math_16chistogramnd_lut_113_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int64_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int64_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1__pyx_mdef_16chistogramnd_lut_115_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_1__pyx_mdef_4silx_4math_16chistogramnd_lut_115_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int32_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int32_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2__pyx_mdef_16chistogramnd_lut_117_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1_2__pyx_mdef_4silx_4math_16chistogramnd_lut_117_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int16_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_float32_t_int16_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0__pyx_mdef_16chistogramnd_lut_119_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_0__pyx_mdef_4silx_4math_16chistogramnd_lut_119_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int64_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int64_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1__pyx_mdef_16chistogramnd_lut_121_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_1__pyx_mdef_4silx_4math_16chistogramnd_lut_121_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int32_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int32_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2__pyx_mdef_16chistogramnd_lut_123_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2_2__pyx_mdef_4silx_4math_16chistogramnd_lut_123_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int16_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int32_t_int16_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0__pyx_mdef_16chistogramnd_lut_125_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_0__pyx_mdef_4silx_4math_16chistogramnd_lut_125_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int64_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int64_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1__pyx_mdef_16chistogramnd_lut_127_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_1__pyx_mdef_4silx_4math_16chistogramnd_lut_127_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int32_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int32_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2__pyx_mdef_16chistogramnd_lut_129_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3_2__pyx_mdef_4silx_4math_16chistogramnd_lut_129_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
- if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int16_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_kp_s_int64_t_int16_t, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_mdef_16chistogramnd_lut_7_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_FusedFunction_NewEx(&__pyx_mdef_4silx_4math_16chistogramnd_lut_7_histogramnd_get_lut_fused, 0, __pyx_n_s_histogramnd_get_lut_fused, NULL, __pyx_n_s_silx_math_chistogramnd_lut, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_empty_tuple);
((__pyx_FusedFunctionObject *) __pyx_t_4)->__signatures__ = __pyx_t_3;
__Pyx_GIVEREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_get_lut_fused, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_histogramnd_get_lut_fused, __pyx_t_4) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "chistogramnd_lut.pyx":1
+ /* "silx/math/chistogramnd_lut.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* # /[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __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_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __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;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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_t_5 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 207, __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;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__49, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 282, __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
+ /* "View.MemoryView":283
*
* 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__50, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 283, __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
+ /* "View.MemoryView":284
* 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__51, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 284, __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
+ /* "View.MemoryView":287
*
*
* 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__52, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 287, __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
+ /* "View.MemoryView":288
*
* 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__53, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_6[0] = PyThread_allocate_lock();
+ __pyx_t_6[1] = PyThread_allocate_lock();
+ __pyx_t_6[2] = PyThread_allocate_lock();
+ __pyx_t_6[3] = PyThread_allocate_lock();
+ __pyx_t_6[4] = PyThread_allocate_lock();
+ __pyx_t_6[5] = PyThread_allocate_lock();
+ __pyx_t_6[6] = PyThread_allocate_lock();
+ __pyx_t_6[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 535, __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;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(2, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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_t_5 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 981, __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;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_5) < 0) __PYX_ERR(2, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "__pyxutil":2
+ /* "View.MemoryView":1391
*
- * cdef extern from *: # <<<<<<<<<<<<<<
- * void __pyx_PyErr_Clear "PyErr_Clear" ()
- * __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(object)
+ * @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 ---*/
@@ -43933,11 +48060,11 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init chistogramnd_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.chistogramnd_lut", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init chistogramnd_lut");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.chistogramnd_lut");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -43948,7 +48075,8 @@ PyMODINIT_FUNC PyInit_chistogramnd_lut(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -43965,6 +48093,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -43978,6 +48107,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -44003,6 +48133,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -44016,6 +48147,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -44117,6 +48249,7 @@ bad:
return -1;
}
+/* GetItemInt */
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
@@ -44125,8 +48258,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -44139,8 +48273,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -44152,9 +48287,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -44178,10 +48314,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -44195,9 +48330,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -44212,7 +48348,146 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -44231,7 +48506,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -44250,7 +48526,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -44262,6 +48539,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -44269,21 +48551,114 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -44293,27 +48668,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -44352,6 +48722,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -44385,10 +48756,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -44448,7 +48822,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -44468,23 +48842,18 @@ bad:
}
#endif
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -44494,16 +48863,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -44514,7 +48895,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -44532,7 +48913,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -44556,11 +48937,128 @@ bad:
return -1;
}
-static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
- PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* SliceObject */
+ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(PyObject* obj, PyObject* value,
+ Py_ssize_t cstart, Py_ssize_t cstop,
PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_USE_TYPE_SLOTS
PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
@@ -44591,10 +49089,9 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
if (cstart < 0) cstart = 0;
}
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
goto bad;
+ PyErr_Clear();
}
}
return ms->sq_ass_slice(obj, cstart, cstop, value);
@@ -44637,7 +49134,7 @@ static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
Py_XDECREF(owned_stop);
if (unlikely(!py_slice)) goto bad;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_USE_TYPE_SLOTS
result = mp->mp_ass_subscript(obj, py_slice, value);
#else
result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
@@ -44654,16 +49151,17 @@ bad:
return -1;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+/* SetItemInt */
+ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
int r;
if (!j) return -1;
r = PyObject_SetItem(o, j, v);
Py_DECREF(j);
return r;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
+ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
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)))) {
@@ -44681,10 +49179,9 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return -1;
+ PyErr_Clear();
}
}
return m->sq_ass_item(o, i, v);
@@ -44702,8 +49199,143 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* UnicodeAsUCS4 */
+ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
+ Py_ssize_t length;
+ #if CYTHON_PEP393_ENABLED
+ length = PyUnicode_GET_LENGTH(x);
+ if (likely(length == 1)) {
+ return PyUnicode_READ_CHAR(x, 0);
+ }
+ #else
+ length = PyUnicode_GET_SIZE(x);
+ if (likely(length == 1)) {
+ return PyUnicode_AS_UNICODE(x)[0];
+ }
+ #if Py_UNICODE_SIZE == 2
+ else if (PyUnicode_GET_SIZE(x) == 2) {
+ Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
+ if (high_val >= 0xD800 && high_val <= 0xDBFF) {
+ Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
+ if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
+ return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
+ }
+ }
+ }
+ #endif
+ #endif
+ PyErr_Format(PyExc_ValueError,
+ "only single character unicode strings can be converted to Py_UCS4, "
+ "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
+ return (Py_UCS4)-1;
+}
+
+/* object_ord */
+ static long __Pyx__PyObject_Ord(PyObject* c) {
+ Py_ssize_t size;
+ if (PyBytes_Check(c)) {
+ size = PyBytes_GET_SIZE(c);
+ if (likely(size == 1)) {
+ return (unsigned char) PyBytes_AS_STRING(c)[0];
+ }
+#if PY_MAJOR_VERSION < 3
+ } else if (PyUnicode_Check(c)) {
+ return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ } else if (PyByteArray_Check(c)) {
+ size = PyByteArray_GET_SIZE(c);
+ if (likely(size == 1)) {
+ return (unsigned char) PyByteArray_AS_STRING(c)[0];
+ }
+#endif
+ } else {
+ PyErr_Format(PyExc_TypeError,
+ "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
+ return (long)(Py_UCS4)-1;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "ord() expected a character, but string of length %zd found", size);
+ return (long)(Py_UCS4)-1;
+}
+
+/* IterFinish */
+ static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
@@ -44736,8 +49368,14 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -44751,11 +49389,12 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+/* PyObjectCallMethod0 */
+ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
PyObject *method, *result = NULL;
method = __Pyx_PyObject_GetAttrStr(obj, method_name);
if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_UNPACK_METHODS
if (likely(PyMethod_Check(method))) {
PyObject *self = PyMethod_GET_SELF(method);
if (likely(self)) {
@@ -44772,18 +49411,21 @@ bad:
return result;
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+/* UnpackItemEndCheck */
+ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
@@ -44794,11 +49436,13 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
return 0;
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* UnpackTupleError */
+ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
if (t == Py_None) {
__Pyx_RaiseNoneNotIterableError();
} else if (PyTuple_GET_SIZE(t) < index) {
@@ -44808,7 +49452,8 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
}
}
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+/* UnpackTuple2 */
+ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
int is_tuple, int has_known_size, int decref_tuple) {
Py_ssize_t index;
PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
@@ -44854,7 +49499,8 @@ bad:
return -1;
}
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+/* dict_iter */
+ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
is_dict = is_dict || likely(PyDict_CheckExact(iterable));
*p_source_is_dict = is_dict;
@@ -44881,8 +49527,9 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di
}
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) {
+static CYTHON_INLINE int __Pyx_dict_iter_next(
+ PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
if (source_is_dict) {
@@ -44948,7 +49595,8 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t ori
return 1;
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -45497,7 +50145,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -45553,7 +50202,6 @@ no_fail:
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
@@ -45632,7 +50280,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -45644,7 +50293,8 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -45670,7 +50320,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -45707,7 +50358,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -45790,14 +50442,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -45809,13 +50463,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -45835,41 +50496,60 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -45890,9 +50570,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -45909,7 +50594,8 @@ bad:
return -1;
}
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+/* FetchCommonType */
+ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -45947,7 +50633,8 @@ bad:
goto done;
}
-static PyObject *
+/* CythonFunction */
+ static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
@@ -46100,15 +50787,25 @@ __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
+ int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
+ #else
+ op->defaults_tuple = PySequence_ITEM(res, 0);
+ if (unlikely(!op->defaults_tuple)) result = -1;
+ else {
+ op->defaults_kwdict = PySequence_ITEM(res, 1);
+ if (unlikely(!op->defaults_kwdict)) result = -1;
+ }
+ #endif
Py_DECREF(res);
- return 0;
+ return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
@@ -46218,9 +50915,6 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(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}
@@ -46295,7 +50989,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
- PyMem_Free(m->defaults);
+ PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
@@ -46356,37 +51050,40 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
+ PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
- switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
+ switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0)
+ 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) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 0)
+ if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%zd given)",
+ "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 1)
- return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+ if (likely(size == 1)) {
+ PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
+ if (unlikely(!arg0)) return NULL;
+ result = (*meth)(self, arg0);
+ Py_DECREF(arg0);
+ return result;
+ }
PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%zd given)",
+ "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
@@ -46401,11 +51098,32 @@ static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject
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);
+static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
+}
+static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
+ PyObject *result;
+ __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
+ if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
+ Py_ssize_t argc;
+ PyObject *new_args;
+ PyObject *self;
+ argc = PyTuple_GET_SIZE(args);
+ new_args = PyTuple_GetSlice(args, 1, argc);
+ if (unlikely(!new_args))
+ return NULL;
+ self = PyTuple_GetItem(args, 0);
+ if (unlikely(!self)) {
+ Py_DECREF(new_args);
+ return NULL;
+ }
+ result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
+ Py_DECREF(new_args);
+ } else {
+ result = __Pyx_CyFunction_Call(func, args, kw);
+ }
+ return result;
}
-#endif
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
@@ -46425,7 +51143,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
0,
0,
- __Pyx_CyFunction_Call,
+ __Pyx_CyFunction_CallAsMethod,
0,
0,
0,
@@ -46466,10 +51184,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
#endif
};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
- __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
+static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL) {
return -1;
@@ -46478,7 +51193,7 @@ static int __Pyx_CyFunction_init(void) {
}
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);
+ m->defaults = PyObject_Malloc(size);
if (!m->defaults)
return PyErr_NoMemory();
memset(m->defaults, 0, size);
@@ -46501,7 +51216,8 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
Py_INCREF(dict);
}
-static PyObject *
+/* FusedFunction */
+ static PyObject *
__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
PyObject *qualname, PyObject *self,
PyObject *module, PyObject *globals,
@@ -46601,8 +51317,15 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
if (!list)
return NULL;
for (i = 0; i < n; i++) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject *item = PyTuple_GET_ITEM(idx, i);
+#else
+ PyObject *item = PySequence_ITEM(idx, i);
+#endif
string = _obj_to_str(item);
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_DECREF(item);
+#endif
if (!string || PyList_Append(list, string) < 0)
goto __pyx_err;
Py_DECREF(string);
@@ -46641,30 +51364,13 @@ 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);
+ return __Pyx_CyFunction_CallAsMethod(func, args, kw);
} else {
- result = __Pyx_CyFunction_Call(func, args, kw);
+ return __Pyx_CyFunction_Call(func, args, kw);
}
- return result;
}
static PyObject *
__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
@@ -46683,11 +51389,18 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
if (!new_args)
return NULL;
self = binding_func->self;
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_INCREF(self);
+#endif
Py_INCREF(self);
PyTuple_SET_ITEM(new_args, 0, self);
for (i = 0; i < argc; i++) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject *item = PyTuple_GET_ITEM(args, i);
Py_INCREF(item);
+#else
+ PyObject *item = PySequence_ITEM(args, i); if (unlikely(!item)) goto bad;
+#endif
PyTuple_SET_ITEM(new_args, i + 1, item);
}
args = new_args;
@@ -46696,33 +51409,57 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
return NULL;
}
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
self = PyTuple_GET_ITEM(args, 0);
+#else
+ self = PySequence_ITEM(args, 0); if (unlikely(!self)) return NULL;
+#endif
}
- 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 (self && !is_classmethod && !is_staticmethod) {
+ int is_instance = PyObject_IsInstance(self, binding_func->type);
+ if (unlikely(!is_instance)) {
+ 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 bad;
+ } else if (unlikely(is_instance == -1)) {
+ goto bad;
+ }
}
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_XDECREF(self);
+ self = NULL;
+#endif
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);
+ PyObject *tup;
+ if (is_staticmethod && binding_func->func.flags & __Pyx_CYFUNCTION_CCLASS) {
+ tup = PyTuple_Pack(3, args,
+ kw == NULL ? Py_None : kw,
+ binding_func->func.defaults_tuple);
+ if (unlikely(!tup)) goto bad;
+ new_func = (__pyx_FusedFunctionObject *) __Pyx_CyFunction_CallMethod(
+ func, binding_func->__signatures__, tup, NULL);
+ } else {
+ tup = PyTuple_Pack(4, binding_func->__signatures__, args,
+ kw == NULL ? Py_None : kw,
+ binding_func->func.defaults_tuple);
+ if (unlikely(!tup)) goto bad;
+ new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
+ }
Py_DECREF(tup);
- if (!new_func)
- goto __pyx_err;
+ if (unlikely(!new_func))
+ goto bad;
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:
+bad:
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_XDECREF(self);
+#endif
Py_XDECREF(new_args);
Py_XDECREF((PyObject *) new_func);
return result;
@@ -46804,13 +51541,14 @@ static int __pyx_FusedFunction_init(void) {
return 0;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -46883,7 +51621,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -46956,14 +51695,110 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, 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
+
+
+ /* MemviewSliceIsContig */
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
+}
+
+/* Capsule */
+ 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;
+}
+
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -47003,7 +51838,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -47184,7 +52020,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float64_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) };
@@ -47206,7 +52043,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_float32_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) };
@@ -47228,7 +52066,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -47250,7 +52089,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -47272,7 +52112,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_int16_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -47294,103 +52135,8 @@ __pyx_fail:
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
-
-
- static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_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_STRIDED) };
@@ -47412,313 +52158,30 @@ __pyx_fail:
return result;
}
-#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;
-}
-
-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 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 CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) {
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -47740,7 +52203,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -47762,22 +52226,27 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -47788,7 +52257,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
+/* Print */
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
PyObject *f = PySys_GetObject((char *)"stdout");
if (!f) {
@@ -47893,163 +52363,27 @@ bad:
}
#endif
-#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
-static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
- if (!f) {
- if (!(f = __Pyx_GetStdout()))
- return -1;
- }
- Py_INCREF(f);
- if (PyFile_SoftSpace(f, 0)) {
- if (PyFile_WriteString(" ", f) < 0)
- goto error;
- }
- if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
- goto error;
- if (PyFile_WriteString("\n", f) < 0)
- goto error;
- Py_DECREF(f);
- return 0;
-error:
- Py_DECREF(f);
- return -1;
- /* the line below is just to avoid C compiler
- * warnings about unused functions */
- return __Pyx_Print(f, NULL, 0);
-}
-#else
-static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
- int res;
- PyObject* arg_tuple = PyTuple_Pack(1, o);
- if (unlikely(!arg_tuple))
- return -1;
- res = __Pyx_Print(stream, arg_tuple, 1);
- Py_DECREF(arg_tuple);
- return res;
-}
-#endif
-
-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_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -48060,7 +52394,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -48079,60 +52414,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
}
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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) {
+ static CYTHON_INLINE float __Pyx_c_abs_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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) {
@@ -48150,24 +52511,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
case 1:
return a;
case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_absf(a);
+ r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
@@ -48180,7 +52549,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#endif
#endif
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -48199,60 +52569,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
}
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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) {
+ static CYTHON_INLINE double __Pyx_c_abs_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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) {
@@ -48270,24 +52666,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
case 1:
return a;
case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_abs(a);
+ r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
@@ -48300,64 +52704,39 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#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;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
} 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);
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
- *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);
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
+ }
}
-static __Pyx_memviewslice
+/* MemviewSliceCopyTemplate */
+ 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,
@@ -48423,20 +52802,809 @@ no_fail:
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);
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
#endif
- return cobj;
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE npy_int32 __Pyx_PyInt_As_npy_int32(PyObject *x) {
+ const npy_int32 neg_one = (npy_int32) -1, const_zero = (npy_int32) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int32) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, digits[0])
+ case 2:
+ if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 2 * PyLong_SHIFT) {
+ return (npy_int32) (((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 3 * PyLong_SHIFT) {
+ return (npy_int32) (((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) >= 4 * PyLong_SHIFT) {
+ return (npy_int32) (((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (npy_int32) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(npy_int32) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int32) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int32) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int32, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int32, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(npy_int32) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(npy_int32) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int32) ((((((npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(npy_int32) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int32) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int32) ((((((((npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(npy_int32) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int32) (((npy_int32)-1)*(((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int32) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int32, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int32) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int32) ((((((((((npy_int32)digits[3]) << PyLong_SHIFT) | (npy_int32)digits[2]) << PyLong_SHIFT) | (npy_int32)digits[1]) << PyLong_SHIFT) | (npy_int32)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(npy_int32) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int32) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int32, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ npy_int32 val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (npy_int32) -1;
+ }
+ } else {
+ npy_int32 val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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 CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE npy_int64 __Pyx_PyInt_As_npy_int64(PyObject *x) {
+ const npy_int64 neg_one = (npy_int64) -1, const_zero = (npy_int64) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int64) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, digits[0])
+ case 2:
+ if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) >= 2 * PyLong_SHIFT) {
+ return (npy_int64) (((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) >= 3 * PyLong_SHIFT) {
+ return (npy_int64) (((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) >= 4 * PyLong_SHIFT) {
+ return (npy_int64) (((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (npy_int64) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(npy_int64) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int64) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (npy_int64) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(npy_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(npy_int64, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(npy_int64) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int64) (((npy_int64)-1)*(((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(npy_int64) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
+ return (npy_int64) ((((((npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(npy_int64) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int64) (((npy_int64)-1)*(((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(npy_int64) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
+ return (npy_int64) ((((((((npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(npy_int64) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int64) (((npy_int64)-1)*(((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(npy_int64) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(npy_int64, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(npy_int64) - 1 > 4 * PyLong_SHIFT) {
+ return (npy_int64) ((((((((((npy_int64)digits[3]) << PyLong_SHIFT) | (npy_int64)digits[2]) << PyLong_SHIFT) | (npy_int64)digits[1]) << PyLong_SHIFT) | (npy_int64)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(npy_int64) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int64, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(npy_int64) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(npy_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ npy_int64 val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (npy_int64) -1;
+ }
+ } else {
+ npy_int64 val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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;
+}
+
+/* PrintOne */
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
+static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
+ if (!f) {
+ if (!(f = __Pyx_GetStdout()))
+ return -1;
+ }
+ Py_INCREF(f);
+ if (PyFile_SoftSpace(f, 0)) {
+ if (PyFile_WriteString(" ", f) < 0)
+ goto error;
+ }
+ if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
+ goto error;
+ if (PyFile_WriteString("\n", f) < 0)
+ goto error;
+ Py_DECREF(f);
+ return 0;
+error:
+ Py_DECREF(f);
+ return -1;
+ /* the line below is just to avoid C compiler
+ * warnings about unused functions */
+ return __Pyx_Print(f, NULL, 0);
+}
+#else
+static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
+ int res;
+ PyObject* arg_tuple = PyTuple_Pack(1, o);
+ if (unlikely(!arg_tuple))
+ return -1;
+ res = __Pyx_Print(stream, arg_tuple, 1);
+ Py_DECREF(arg_tuple);
+ return res;
+}
+#endif
+
+/* BytesContains */
+ 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);
+ return memchr(char_start, (unsigned char)character, (size_t)length) != NULL;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (char) -1;
+ }
+ } else {
+ char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -48453,36 +53621,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -48491,7 +53752,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -48514,7 +53775,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -48530,7 +53791,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -48545,7 +53807,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-#ifndef __PYX_HAVE_RT_ImportModule
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
@@ -48562,7 +53825,8 @@ bad:
}
#endif
-#ifndef __PYX_HAVE_RT_ImportType
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
@@ -48608,14 +53872,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif
if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling",
- module_name, class_name);
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
goto bad;
}
return (PyTypeObject *)result;
@@ -48626,7 +53890,8 @@ bad:
}
#endif
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -48664,7 +53929,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -48705,7 +53970,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -48726,8 +53991,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -48735,9 +54002,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -48746,11 +54014,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -48775,18 +54046,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/histogramnd/chistogramnd_lut.pyx b/silx/math/chistogramnd_lut.pyx
index e1ceb7e..25167f6 100644
--- a/silx/math/histogramnd/chistogramnd_lut.pyx
+++ b/silx/math/chistogramnd_lut.pyx
@@ -149,6 +149,7 @@ def histogramnd_get_lut(sample,
lut_dtype = np.int16
elif n_bins.prod(dtype=np.uint64) < 2**31:
lut_dtype = np.int32
+
else:
lut_dtype = np.int64
@@ -156,15 +157,19 @@ def histogramnd_get_lut(sample,
lut = np.zeros(n_elem, dtype=lut_dtype)
histo = np.zeros(n_bins, dtype=np.uint32)
- sample_c = np.ascontiguousarray(sample.reshape((sample.size,)))
+ dtype = sample.dtype.newbyteorder("N")
+ sample_c = np.ascontiguousarray(sample.reshape((sample.size,)),
+ dtype=dtype)
- histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)))
+ histo_range_c = np.ascontiguousarray(histo_range.reshape((histo_range.size,)),
+ dtype=histo_range.dtype.newbyteorder("N"))
n_bins_c = np.ascontiguousarray(n_bins.reshape((n_bins.size,)),
dtype=np.int32)
lut_c = np.ascontiguousarray(lut.reshape((lut.size,)))
- histo_c = np.ascontiguousarray(histo.reshape((histo.size,)))
+ histo_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ dtype=histo.dtype.newbyteorder('N'))
rc = 0
@@ -270,13 +275,17 @@ def histogramnd_from_lut(weights,
raise ValueError('The LUT and weights arrays must have the same '
'number of elements.')
- w_c = np.ascontiguousarray(weights.reshape((weights.size,)))
+ w_c = np.ascontiguousarray(weights.reshape((weights.size,)),
+ dtype=weights.dtype.newbyteorder('N'))
- h_c = np.ascontiguousarray(histo.reshape((histo.size,)))
+ h_c = np.ascontiguousarray(histo.reshape((histo.size,)),
+ dtype=histo.dtype.newbyteorder('N'))
- w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,))) # noqa
+ w_h_c = np.ascontiguousarray(weighted_histo.reshape((weighted_histo.size,)),
+ dtype=weighted_histo.dtype.newbyteorder('N')) # noqa
- h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)))
+ h_lut_c = np.ascontiguousarray(histo_lut.reshape((histo_lut.size,)),
+ histo_lut.dtype.newbyteorder('N'))
rc = 0
diff --git a/silx/math/combo/combo.c b/silx/math/combo.c
index caab878..7f0654d 100644
--- a/silx/math/combo/combo.c
+++ b/silx/math/combo.c
@@ -1,28 +1,31 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "silx/math/include/isnan.h"
+ ],
+ "include_dirs": [
+ "silx/math/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.combo"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +44,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +56,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +272,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +293,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +332,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +358,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +442,14 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__combo
-#define __PYX_HAVE_API__combo
+#define __PYX_HAVE__silx__math__combo
+#define __PYX_HAVE_API__silx__math__combo
+#include <float.h>
#include "isnan.h"
#include "pythread.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +459,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +467,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +511,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +529,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +558,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +638,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -421,9 +646,10 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "combo.pyx",
+ "silx/math/combo.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +659,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +695,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +733,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -561,6 +790,22 @@ struct __pyx_defaults18;
typedef struct __pyx_defaults18 __pyx_defaults18;
struct __pyx_defaults19;
typedef struct __pyx_defaults19 __pyx_defaults19;
+struct __pyx_defaults20;
+typedef struct __pyx_defaults20 __pyx_defaults20;
+struct __pyx_defaults21;
+typedef struct __pyx_defaults21 __pyx_defaults21;
+struct __pyx_defaults22;
+typedef struct __pyx_defaults22 __pyx_defaults22;
+struct __pyx_defaults23;
+typedef struct __pyx_defaults23 __pyx_defaults23;
+struct __pyx_defaults24;
+typedef struct __pyx_defaults24 __pyx_defaults24;
+struct __pyx_defaults25;
+typedef struct __pyx_defaults25 __pyx_defaults25;
+struct __pyx_defaults26;
+typedef struct __pyx_defaults26 __pyx_defaults26;
+struct __pyx_defaults27;
+typedef struct __pyx_defaults27 __pyx_defaults27;
struct __pyx_defaults {
int __pyx_arg_min_positive;
};
@@ -621,8 +866,32 @@ struct __pyx_defaults18 {
struct __pyx_defaults19 {
int __pyx_arg_min_positive;
};
+struct __pyx_defaults20 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults21 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults22 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults23 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults24 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults25 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults26 {
+ int __pyx_arg_min_positive;
+};
+struct __pyx_defaults27 {
+ int __pyx_arg_min_positive;
+};
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -631,6 +900,7 @@ struct __pyx_defaults19 {
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -646,7 +916,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -659,7 +929,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -682,7 +952,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -699,7 +969,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -719,7 +1003,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -731,6 +1015,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -747,19 +1034,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -782,18 +1069,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -808,18 +1096,23 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectSetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
PyTypeObject* tp = Py_TYPE(obj);
@@ -836,28 +1129,86 @@ static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
-static CYTHON_INLINE int __Pyx_PyDict_Contains(PyObject* item, PyObject* dict, int eq) {
+/* PyDictContains.proto */
+static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
int result = PyDict_Contains(dict, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
-#if PY_MAJOR_VERSION >= 3
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
PyObject *value;
value = PyDict_GetItemWithError(d, key);
@@ -877,50 +1228,94 @@ static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
#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) : \
+/* UnicodeAsUCS4.proto */
+static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);
+
+/* object_ord.proto */
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyObject_Ord(c)\
+ (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
+#else
+#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
+#endif
+static long __Pyx__PyObject_Ord(PyObject* c);
+
+/* SetItemInt.proto */
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
+/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** value1, PyObject** value2,
int is_tuple, int has_known_size, int decref_tuple);
+/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -936,12 +1331,19 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -967,56 +1369,70 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact);
-
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* ArgTypeTest.proto */
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact);
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -1025,10 +1441,8 @@ 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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1044,12 +1458,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -1062,33 +1479,44 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
+/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
#define __Pyx_CYFUNCTION_CCLASS 0x04
-#define __Pyx_CyFunction_GetClosure(f) \
+#define __Pyx_CyFunction_GetClosure(f)\
(((__pyx_CyFunctionObject *) (f))->func_closure)
-#define __Pyx_CyFunction_GetClassObj(f) \
+#define __Pyx_CyFunction_GetClassObj(f)\
(((__pyx_CyFunctionObject *) (f))->func_classobj)
-#define __Pyx_CyFunction_Defaults(type, f) \
+#define __Pyx_CyFunction_Defaults(type, f)\
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
-#define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
+#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
PyCFunctionObject func;
@@ -1112,7 +1540,7 @@ typedef struct {
PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
-#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1128,20 +1556,22 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
PyObject *dict);
-static int __Pyx_CyFunction_init(void);
+static int __pyx_CyFunction_init(void);
+/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
+/* FusedFunction.proto */
typedef struct {
__pyx_CyFunctionObject func;
PyObject *__signatures__;
PyObject *type;
PyObject *self;
} __pyx_FusedFunctionObject;
-#define __pyx_FusedFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
+#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,
@@ -1153,9 +1583,10 @@ static PyTypeObject *__pyx_FusedFunctionType = NULL;
static int __pyx_FusedFunction_init(void);
#define __Pyx_FusedFunction_USED
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1167,11 +1598,53 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
+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;
+
+/* None.proto */
+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};
+
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1182,146 +1655,170 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *);
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_char(PyObject *);
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed__char(PyObject *);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_short(PyObject *);
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_short(PyObject *);
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *);
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_int(PyObject *);
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *);
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_long(PyObject *);
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(PyObject *);
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(PyObject *);
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_long(PyObject *);
-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};
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(PyObject *);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
-
-static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
-
-static PyObject *__pyx_memview_get_float(const char *itemp);
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
-static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
-
-static PyObject *__pyx_memview_get_double(const char *itemp);
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__char(signed char value);
-static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *);
-
-static PyObject *__pyx_memview_get_signed_char(const char *itemp);
-static int __pyx_memview_set_signed_char(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_signed__char(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_signed__char(const char *itemp, PyObject *obj);
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__short(signed short value);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);
-static CYTHON_INLINE signed short __Pyx_PyInt_As_signed__short(PyObject *);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_short(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_short(const char *itemp, PyObject *obj);
-static PyObject *__pyx_memview_get_signed_short(const char *itemp);
-static int __pyx_memview_set_signed_short(const char *itemp, PyObject *obj);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__int(signed int value);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_As_signed__int(PyObject *);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-static PyObject *__pyx_memview_get_signed_int(const char *itemp);
-static int __pyx_memview_set_signed_int(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj);
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__long(signed long value);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj);
-static CYTHON_INLINE signed long __Pyx_PyInt_As_signed__long(PyObject *);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);
-static PyObject *__pyx_memview_get_signed_long(const char *itemp);
-static int __pyx_memview_set_signed_long(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_PY_LONG_LONG(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_PY_LONG_LONG(const char *itemp, PyObject *obj);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);
-static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
-
-static PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
-static int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value);
-static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
-
-static PyObject *__pyx_memview_get_unsigned_short(const char *itemp);
-static int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_short(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj);
-static PyObject *__pyx_memview_get_unsigned_int(const char *itemp);
-static int __pyx_memview_set_unsigned_int(const char *itemp, PyObject *obj);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_int(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_int(const char *itemp, PyObject *obj);
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
-static PyObject *__pyx_memview_get_unsigned_PY_LONG_LONG(const char *itemp);
-static int __pyx_memview_set_unsigned_PY_LONG_LONG(const char *itemp, PyObject *obj);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_long(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_long(const char *itemp, PyObject *obj);
-static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
- char order, int ndim);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);
-static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_PY_LONG_LONG(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_unsigned_PY_LONG_LONG(const char *itemp, PyObject *obj);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* BytesContains.proto */
+static CYTHON_INLINE int __Pyx_BytesContains(PyObject* bytes, char character);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+/* CIntFromPy.proto */
+static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1336,16 +1833,21 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* Module declarations from 'cython' */
-/* Module declarations from 'combo' */
+/* Module declarations from 'libc.float' */
+
+/* Module declarations from 'silx.math.combo' */
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 double __pyx_v_4silx_4math_5combo_INFINITY;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1380,256 +1882,195 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_signed_char = { "signed char", NULL, sizeof(signed char), { 0 }, 0, IS_UNSIGNED(signed char) ? 'U' : 'I', IS_UNSIGNED(signed char), 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_signed_short = { "signed short", NULL, sizeof(signed short), { 0 }, 0, IS_UNSIGNED(signed short) ? 'U' : 'I', IS_UNSIGNED(signed short), 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_signed_int = { "signed int", NULL, sizeof(signed int), { 0 }, 0, IS_UNSIGNED(signed int) ? 'U' : 'I', IS_UNSIGNED(signed int), 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_signed_long = { "signed long", NULL, sizeof(signed long), { 0 }, 0, IS_UNSIGNED(signed long) ? 'U' : 'I', IS_UNSIGNED(signed long), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_signed__char = { "signed char", NULL, sizeof(signed char), { 0 }, 0, IS_UNSIGNED(signed char) ? 'U' : 'I', IS_UNSIGNED(signed char), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_short = { "short", NULL, sizeof(short), { 0 }, 0, IS_UNSIGNED(short) ? 'U' : 'I', IS_UNSIGNED(short), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, IS_UNSIGNED(long) ? 'U' : 'I', IS_UNSIGNED(long), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_PY_LONG_LONG = { "long long", NULL, sizeof(PY_LONG_LONG), { 0 }, 0, IS_UNSIGNED(PY_LONG_LONG) ? 'U' : 'I', IS_UNSIGNED(PY_LONG_LONG), 0 };
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 };
static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_short = { "unsigned short", NULL, sizeof(unsigned short), { 0 }, 0, IS_UNSIGNED(unsigned short) ? 'U' : 'I', IS_UNSIGNED(unsigned short), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_int = { "unsigned int", NULL, sizeof(unsigned int), { 0 }, 0, IS_UNSIGNED(unsigned int) ? 'U' : 'I', IS_UNSIGNED(unsigned int), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_long = { "unsigned long", NULL, sizeof(unsigned long), { 0 }, 0, IS_UNSIGNED(unsigned long) ? 'U' : 'I', IS_UNSIGNED(unsigned long), 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_PY_LONG_LONG = { "unsigned long long", NULL, sizeof(unsigned PY_LONG_LONG), { 0 }, 0, IS_UNSIGNED(unsigned PY_LONG_LONG) ? 'U' : 'I', IS_UNSIGNED(unsigned PY_LONG_LONG), 0 };
-#define __Pyx_MODULE_NAME "combo"
-int __pyx_module_is_main_combo = 0;
+#define __Pyx_MODULE_NAME "silx.math.combo"
+int __pyx_module_is_main_silx__math__combo = 0;
-/* Implementation of 'combo' */
+/* Implementation of 'silx.math.combo' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_IndexError;
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_range;
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_lambda_funcdef_5combo_13_MinMaxResult_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minimum, PyObject *__pyx_v_min_pos, PyObject *__pyx_v_maximum, PyObject *__pyx_v_argmin, PyObject *__pyx_v_argmin_pos, PyObject *__pyx_v_argmax); /* proto */
-static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_5combo__min_max(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_5combo_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
-static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
-static PyObject *__pyx_pf_5combo_2min_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_min_positive); /* 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_O[] = "O";
-static char __pyx_k_c[] = "c";
-static char __pyx_k__3[] = "()";
-static char __pyx_k__5[] = "|";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_doc[] = "doc";
-static char __pyx_k_key[] = "key";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_ord[] = "ord";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_args[] = "args";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_init[] = "__init__";
-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_ndim[] = "ndim";
-static char __pyx_k_pack[] = "pack";
-static char __pyx_k_self[] = "self";
-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_class[] = "__class__";
-static char __pyx_k_combo[] = "combo";
-static char __pyx_k_doc_2[] = "__doc__";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_flags[] = "flags";
-static char __pyx_k_float[] = "float";
-static char __pyx_k_index[] = "index";
-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_split[] = "split";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_strip[] = "strip";
-static char __pyx_k_value[] = "value";
-static char __pyx_k_argmax[] = "_argmax";
-static char __pyx_k_argmin[] = "_argmin";
-static char __pyx_k_double[] = "double";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_kwargs[] = "kwargs";
-static char __pyx_k_length[] = "length";
-static char __pyx_k_minpos[] = "minpos";
-static char __pyx_k_module[] = "__module__";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_object[] = "object";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_getitem[] = "__getitem__";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_maximum[] = "_maximum";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_min_max[] = "_min_max";
-static char __pyx_k_min_pos[] = "min_pos";
-static char __pyx_k_minimum[] = "_minimum";
-static char __pyx_k_ndarray[] = "ndarray";
-static char __pyx_k_prepare[] = "__prepare__";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_argmax_2[] = "argmax";
-static char __pyx_k_argmin_2[] = "argmin";
-static char __pyx_k_defaults[] = "defaults";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_property[] = "property";
-static char __pyx_k_qualname[] = "__qualname__";
-static char __pyx_k_T_Vincent[] = "T. Vincent";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_max_index[] = "max_index";
-static char __pyx_k_maximum_2[] = "maximum";
-static char __pyx_k_metaclass[] = "__metaclass__";
-static char __pyx_k_min_index[] = "min_index";
-static char __pyx_k_min_max_2[] = "min_max";
-static char __pyx_k_minimum_2[] = "minimum";
-static char __pyx_k_20_12_2016[] = "20/12/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_argmin_pos[] = "argmin_pos";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_signatures[] = "signatures";
-static char __pyx_k_signed_int[] = "signed int";
-static char __pyx_k_ImportError[] = "ImportError";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_signed_char[] = "signed char";
-static char __pyx_k_signed_long[] = "signed long";
-static char __pyx_k_MinMaxResult[] = "_MinMaxResult";
-static char __pyx_k_min_positive[] = "_min_positive";
-static char __pyx_k_signed_short[] = "signed short";
-static char __pyx_k_unsigned_int[] = "unsigned int";
-static char __pyx_k_min_pos_index[] = "min_pos_index";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_unsigned_char[] = "unsigned char";
-static char __pyx_k_AttributeError[] = "AttributeError";
-static char __pyx_k_min_positive_2[] = "min_positive";
-static char __pyx_k_unsigned_short[] = "unsigned short";
-static char __pyx_k_Zero_size_array[] = "Zero-size array";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_argmin_positive[] = "_argmin_positive";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_min_max_line_195[] = "min_max (line 195)";
-static char __pyx_k_argmin_positive_2[] = "argmin_positive";
-static char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
-static char __pyx_k_Index_out_of_range[] = "Index out of range";
-static char __pyx_k_strided_and_direct[] = "<strided and direct>";
-static char __pyx_k_unsigned_long_long[] = "unsigned long long";
-static char __pyx_k_MinMaxResult___init[] = "_MinMaxResult.__init__";
-static char __pyx_k_MinMaxResult_lambda[] = "_MinMaxResult.<lambda>";
-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_MinMaxResult___getitem[] = "_MinMaxResult.__getitem__";
-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_Maximum_value_of_the_array[] = "Maximum value of the array";
-static char __pyx_k_Minimum_value_of_the_array[] = "Minimum value of the array";
-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_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_Index_of_the_first_occurence_of[] = "Index of the first occurence of the minimum value";
-static char __pyx_k_Object_storing_result_from_func[] = "Object storing result from :func:`min_max`";
-static char __pyx_k_Strictly_positive_minimum_value[] = "Strictly positive minimum value\n\n It is None if no value is strictly positive.\n ";
-static char __pyx_k_mntdirect__tmp_14_days_tvincent[] = "/mntdirect/_tmp_14_days/tvincent/combo.pyx";
-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_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
-static char __pyx_k_Index_of_the_strictly_positive_m[] = "Index of the strictly positive minimum value.\n\n It is None if no value is strictly positive.\n It is the index of the first occurence.";
-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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_Returns_min_max_and_optionally_s[] = "Returns min, max and optionally strictly positive min of data.\n\n It also computes the indices of first occurence of min/max.\n\n NaNs are ignored while computing min/max unless all data is NaNs,\n in which case returned min/max are NaNs.\n\n Examples:\n\n >>> import numpy\n >>> data = numpy.arange(10)\n\n Usage as a function returning min and max:\n\n >>> min_, max_ = min_max(data)\n\n Usage as a function returning a result object to access all information:\n\n >>> result = min_max(data) # Do not get positive min\n >>> result.minimum, result.argmin\n 0, 0\n >>> result.maximum, result.argmax\n 9, 10\n >>> result.min_positive, result.argmin_positive # Not computed\n None, None\n\n Getting strictly positive min information:\n\n >>> result = min_max(data, min_positive=True)\n >>> result.min_positive, result.argmin_positive # Computed\n 1, 1\n\n :param data: Array-like dataset\n :param bool min_positive: True to compute the positive min and argmin\n Default: False.\n :returns: An object with minimum, maximum and min_positive attributes\n and the indices of first occurence in the flattened data:\n argmin, argmax and argmin_positive attributes.\n If all data is <= 0 or min_positive argument is False, then\n min_positive and argmin_positive are None.\n :raises: ValueError if data is empty\n ";
-static char __pyx_k_This_module_provides_combination[] = "This module provides combination of statistics as single operation.\n\nFor now it provides min/max (and optionally positive min) and indices\nof first occurences (i.e., argmin/argmax) in a single pass.\n";
-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_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
-static char __pyx_k_Index_of_the_first_occurence_of_2[] = "Index of the first occurence of the maximum value";
-static PyObject *__pyx_kp_s_20_12_2016;
+static const char __pyx_k_N[] = "N";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_f[] = "f";
+static const char __pyx_k__3[] = "()";
+static const char __pyx_k__5[] = "|";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_doc[] = "doc";
+static const char __pyx_k_int[] = "int";
+static const char __pyx_k_key[] = "key";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_zip[] = "zip";
+static const char __pyx_k_args[] = "args";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_copy[] = "copy";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_init[] = "__init__";
+static const char __pyx_k_kind[] = "kind";
+static const char __pyx_k_long[] = "long";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_self[] = "self";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_doc_2[] = "__doc__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_float[] = "float";
+static const char __pyx_k_index[] = "index";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_ravel[] = "ravel";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_short[] = "short";
+static const char __pyx_k_split[] = "split";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_strip[] = "strip";
+static const char __pyx_k_value[] = "value";
+static const char __pyx_k_argmax[] = "_argmax";
+static const char __pyx_k_argmin[] = "_argmin";
+static const char __pyx_k_double[] = "double";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_finite[] = "finite";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_kwargs[] = "kwargs";
+static const char __pyx_k_length[] = "length";
+static const char __pyx_k_minpos[] = "minpos";
+static const char __pyx_k_module[] = "__module__";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_object[] = "object";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_getitem[] = "__getitem__";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_maximum[] = "_maximum";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_min_max[] = "_min_max";
+static const char __pyx_k_min_pos[] = "min_pos";
+static const char __pyx_k_minimum[] = "_minimum";
+static const char __pyx_k_ndarray[] = "ndarray";
+static const char __pyx_k_prepare[] = "__prepare__";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_argmax_2[] = "argmax";
+static const char __pyx_k_argmin_2[] = "argmin";
+static const char __pyx_k_defaults[] = "defaults";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_property[] = "property";
+static const char __pyx_k_qualname[] = "__qualname__";
+static const char __pyx_k_T_Vincent[] = "T. Vincent";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_long_long[] = "long long";
+static const char __pyx_k_max_index[] = "max_index";
+static const char __pyx_k_maximum_2[] = "maximum";
+static const char __pyx_k_metaclass[] = "__metaclass__";
+static const char __pyx_k_min_index[] = "min_index";
+static const char __pyx_k_min_max_2[] = "min_max";
+static const char __pyx_k_minimum_2[] = "minimum";
+static const char __pyx_k_16_08_2017[] = "16/08/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_argmin_pos[] = "argmin_pos";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_signatures[] = "signatures";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_signed_char[] = "signed char";
+static const char __pyx_k_MinMaxResult[] = "_MinMaxResult";
+static const char __pyx_k_min_positive[] = "_min_positive";
+static const char __pyx_k_newbyteorder[] = "newbyteorder";
+static const char __pyx_k_unsigned_int[] = "unsigned int";
+static const char __pyx_k_min_pos_index[] = "min_pos_index";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_unsigned_char[] = "unsigned char";
+static const char __pyx_k_unsigned_long[] = "unsigned long";
+static const char __pyx_k_AttributeError[] = "AttributeError";
+static const char __pyx_k_finite_min_max[] = "_finite_min_max";
+static const char __pyx_k_min_positive_2[] = "min_positive";
+static const char __pyx_k_unsigned_short[] = "unsigned short";
+static const char __pyx_k_Zero_size_array[] = "Zero-size array";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_argmin_positive[] = "_argmin_positive";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_silx_math_combo[] = "silx.math.combo";
+static const char __pyx_k_min_max_line_267[] = "min_max (line 267)";
+static const char __pyx_k_argmin_positive_2[] = "argmin_positive";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_Index_out_of_range[] = "Index out of range";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_unsigned_long_long[] = "unsigned long long";
+static const char __pyx_k_MinMaxResult___init[] = "_MinMaxResult.__init__";
+static const char __pyx_k_MinMaxResult_lambda[] = "_MinMaxResult.<lambda>";
+static const char __pyx_k_native_endian_dtype[] = "native_endian_dtype";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MinMaxResult___getitem[] = "_MinMaxResult.__getitem__";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_Maximum_value_of_the_array[] = "Maximum value of the array";
+static const char __pyx_k_Minimum_value_of_the_array[] = "Minimum value of the array";
+static const char __pyx_k_No_matching_signature_found[] = "No matching signature found";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_Expected_at_least_d_arguments[] = "Expected at least %d arguments";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_Object_storing_result_from_func[] = "Object storing result from :func:`min_max`";
+static const char __pyx_k_Strictly_positive_minimum_value[] = "Strictly positive minimum value\n\n It is None if no value is strictly positive.\n ";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/combo.pyx";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Function_call_with_ambiguous_arg[] = "Function call with ambiguous argument types";
+static const char __pyx_k_Index_of_the_first_occurrence_of[] = "Index of the first occurrence of the minimum value";
+static const char __pyx_k_Index_of_the_strictly_positive_m[] = "Index of the strictly positive minimum value.\n\n It is None if no value is strictly positive.\n It is the index of the first occurrence.";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_Returns_min_max_and_optionally_s[] = "Returns min, max and optionally strictly positive min of data.\n\n It also computes the indices of first occurrence of min/max.\n\n NaNs are ignored while computing min/max unless all data is NaNs,\n in which case returned min/max are NaNs.\n\n Examples:\n\n >>> import numpy\n >>> data = numpy.arange(10)\n\n Usage as a function returning min and max:\n\n >>> min_, max_ = min_max(data)\n\n Usage as a function returning a result object to access all information:\n\n >>> result = min_max(data) # Do not get positive min\n >>> result.minimum, result.argmin\n 0, 0\n >>> result.maximum, result.argmax\n 9, 10\n >>> result.min_positive, result.argmin_positive # Not computed\n None, None\n\n Getting strictly positive min information:\n\n >>> result = min_max(data, min_positive=True)\n >>> result.min_positive, result.argmin_positive # Computed\n 1, 1\n\n If *finite* is True, min/max information is computed only from finite data.\n Then, all result fields (include minimum and maximum) can be None\n when all data is infinity or NaN.\n\n :param data: Array-like dataset\n :param bool min_positive: True to compute the positive min and argmin\n Default: False.\n :param bool finite: True to compute min/max from finite data only\n Default: False.\n :returns: An object with minimum, maximum and min_positive attributes\n and the indices of first occurrence in the flattened data:\n argmin, argmax and argmin_positive attributes.\n If all data is <= 0 or min_positive argument is False, then\n min_positive and argmin_positive are None.\n :raises: ValueError if data is empty\n ";
+static const char __pyx_k_This_module_provides_combination[] = "This module provides combination of statistics as single operation.\n\nFor now it provides min/max (and optionally positive min) and indices\nof first occurrences (i.e., argmin/argmax) in a single pass.\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Index_of_the_first_occurrence_of_2[] = "Index of the first occurrence of the maximum value";
+static PyObject *__pyx_kp_s_16_08_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_s_Can_only_create_a_buffer_that_is;
@@ -1640,8 +2081,8 @@ static PyObject *__pyx_kp_s_Expected_at_least_d_arguments;
static PyObject *__pyx_kp_s_Function_call_with_ambiguous_arg;
static PyObject *__pyx_n_s_ImportError;
static PyObject *__pyx_n_s_IndexError;
-static PyObject *__pyx_kp_s_Index_of_the_first_occurence_of;
-static PyObject *__pyx_kp_s_Index_of_the_first_occurence_of_2;
+static PyObject *__pyx_kp_s_Index_of_the_first_occurrence_of;
+static PyObject *__pyx_kp_s_Index_of_the_first_occurrence_of_2;
static PyObject *__pyx_kp_s_Index_of_the_strictly_positive_m;
static PyObject *__pyx_kp_s_Index_out_of_range;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
@@ -1657,6 +2098,7 @@ static PyObject *__pyx_n_s_MinMaxResult___getitem;
static PyObject *__pyx_n_s_MinMaxResult___init;
static PyObject *__pyx_n_s_MinMaxResult_lambda;
static PyObject *__pyx_kp_s_Minimum_value_of_the_array;
+static PyObject *__pyx_n_s_N;
static PyObject *__pyx_kp_s_No_matching_signature_found;
static PyObject *__pyx_n_b_O;
static PyObject *__pyx_kp_s_Object_storing_result_from_func;
@@ -1679,15 +2121,16 @@ static PyObject *__pyx_n_s_argmin_pos;
static PyObject *__pyx_n_s_argmin_positive;
static PyObject *__pyx_n_s_argmin_positive_2;
static PyObject *__pyx_n_s_args;
+static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_ascontiguousarray;
static PyObject *__pyx_n_s_authors;
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_combo;
static PyObject *__pyx_kp_s_contiguous_and_direct;
static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_defaults;
@@ -1696,8 +2139,12 @@ static PyObject *__pyx_n_s_doc_2;
static PyObject *__pyx_n_s_double;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_f;
+static PyObject *__pyx_n_s_finite;
+static PyObject *__pyx_n_s_finite_min_max;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float;
static PyObject *__pyx_n_s_format;
@@ -1709,6 +2156,7 @@ static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
+static PyObject *__pyx_n_s_int;
static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_key;
@@ -1716,6 +2164,8 @@ static PyObject *__pyx_n_s_kind;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_length;
static PyObject *__pyx_n_s_license;
+static PyObject *__pyx_n_s_long;
+static PyObject *__pyx_kp_s_long_long;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max_index;
static PyObject *__pyx_n_s_maximum;
@@ -1725,7 +2175,7 @@ static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_min_index;
static PyObject *__pyx_n_s_min_max;
static PyObject *__pyx_n_s_min_max_2;
-static PyObject *__pyx_kp_u_min_max_line_195;
+static PyObject *__pyx_kp_u_min_max_line_267;
static PyObject *__pyx_n_s_min_pos;
static PyObject *__pyx_n_s_min_pos_index;
static PyObject *__pyx_n_s_min_positive;
@@ -1733,17 +2183,17 @@ static PyObject *__pyx_n_s_min_positive_2;
static PyObject *__pyx_n_s_minimum;
static PyObject *__pyx_n_s_minimum_2;
static PyObject *__pyx_n_s_minpos;
-static PyObject *__pyx_kp_s_mntdirect__tmp_14_days_tvincent;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_n_s_native_endian_dtype;
static PyObject *__pyx_n_s_ndarray;
static PyObject *__pyx_n_s_ndim;
+static PyObject *__pyx_n_s_newbyteorder;
static PyObject *__pyx_n_s_numpy;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
-static PyObject *__pyx_n_s_ord;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_property;
@@ -1754,11 +2204,10 @@ static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_ravel;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_short;
static PyObject *__pyx_n_s_signatures;
static PyObject *__pyx_kp_s_signed_char;
-static PyObject *__pyx_kp_s_signed_int;
-static PyObject *__pyx_kp_s_signed_long;
-static PyObject *__pyx_kp_s_signed_short;
+static PyObject *__pyx_n_s_silx_math_combo;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_start;
@@ -1775,24 +2224,101 @@ static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_kp_s_unsigned_char;
static PyObject *__pyx_kp_s_unsigned_int;
+static PyObject *__pyx_kp_s_unsigned_long;
static PyObject *__pyx_kp_s_unsigned_long_long;
static PyObject *__pyx_kp_s_unsigned_short;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_value;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_zip;
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minimum, PyObject *__pyx_v_min_pos, PyObject *__pyx_v_maximum, PyObject *__pyx_v_argmin, PyObject *__pyx_v_argmin_pos, PyObject *__pyx_v_argmax); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo__min_max(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_4silx_4math_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_70__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_72__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_74__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_76__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_78__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_80__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_24_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_82__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_26_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_84__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_28_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_2_finite_min_max(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_4silx_4math_5combo_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_32_finite_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_92__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_34_finite_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive); /* proto */
+static PyObject *__pyx_pf_4silx_4math_5combo_4min_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_min_positive, int __pyx_v_finite); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__2;
+static PyObject *__pyx_k__21;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__26;
-static PyObject *__pyx_slice__27;
-static PyObject *__pyx_slice__28;
+static PyObject *__pyx_slice__38;
+static PyObject *__pyx_slice__39;
+static PyObject *__pyx_slice__40;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
@@ -1804,27 +2330,40 @@ 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__32;
+static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__38;
-static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
-static PyObject *__pyx_codeobj__31;
-static PyObject *__pyx_codeobj__33;
-static PyObject *__pyx_codeobj__35;
-static PyObject *__pyx_codeobj__37;
-
-/* "combo.pyx":72
+static PyObject *__pyx_tuple__44;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__53;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_codeobj__43;
+static PyObject *__pyx_codeobj__45;
+static PyObject *__pyx_codeobj__47;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+
+/* "silx/math/combo.pyx":81
*
* minimum = property(
* lambda self: self._minimum, # <<<<<<<<<<<<<<
@@ -1833,29 +2372,26 @@ static PyObject *__pyx_codeobj__37;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_4lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_4lambda1 = {"lambda1", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_4lambda1, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_4lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_4lambda(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_4lambda = {"lambda", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_4lambda, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_4lambda(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda1(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda1", 0);
+ __Pyx_RefNannySetupContext("lambda", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minimum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minimum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -1864,7 +2400,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda1(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -1872,7 +2408,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda1(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":75
+/* "silx/math/combo.pyx":84
* doc="Minimum value of the array")
* maximum = property(
* lambda self: self._maximum, # <<<<<<<<<<<<<<
@@ -1881,29 +2417,26 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda1(CYTHON_UNUS
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_5lambda2(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_5lambda2 = {"lambda2", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_5lambda2, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_5lambda2(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_5lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_5lambda1 = {"lambda1", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_5lambda1, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_5lambda1(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda2(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda1(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda2", 0);
+ __Pyx_RefNannySetupContext("lambda1", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maximum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maximum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -1912,7 +2445,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda2(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -1920,38 +2453,35 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda2(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":79
+/* "silx/math/combo.pyx":88
*
* argmin = property(
* lambda self: self._argmin, # <<<<<<<<<<<<<<
- * doc="Index of the first occurence of the minimum value")
+ * doc="Index of the first occurrence of the minimum value")
* argmax = property(
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_6lambda3(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_6lambda3 = {"lambda3", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_6lambda3, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_6lambda3(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_6lambda2(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_6lambda2 = {"lambda2", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_6lambda2, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_6lambda2(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda3(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda2 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda2(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda3", 0);
+ __Pyx_RefNannySetupContext("lambda2", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -1960,7 +2490,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda3(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda2", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -1968,38 +2498,35 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda3(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":82
- * doc="Index of the first occurence of the minimum value")
+/* "silx/math/combo.pyx":91
+ * doc="Index of the first occurrence of the minimum value")
* argmax = property(
* lambda self: self._argmax, # <<<<<<<<<<<<<<
- * doc="Index of the first occurence of the maximum value")
+ * doc="Index of the first occurrence of the maximum value")
*
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_7lambda4(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_7lambda4 = {"lambda4", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_7lambda4, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_7lambda4(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_7lambda3(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_7lambda3 = {"lambda3", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_7lambda3, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_7lambda3(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda3 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda3(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda3(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda4", 0);
+ __Pyx_RefNannySetupContext("lambda3", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmax); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2008,7 +2535,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda3", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2016,7 +2543,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":86
+/* "silx/math/combo.pyx":95
*
* min_positive = property(
* lambda self: self._min_positive, # <<<<<<<<<<<<<<
@@ -2025,29 +2552,26 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda4(CYTHON_UNUS
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_8lambda5(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_8lambda5 = {"lambda5", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_8lambda5, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_8lambda5(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_8lambda4(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_8lambda4 = {"lambda4", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_8lambda4, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_8lambda4(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda4 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda4(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda4(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda5", 0);
+ __Pyx_RefNannySetupContext("lambda4", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2056,7 +2580,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2064,7 +2588,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":92
+/* "silx/math/combo.pyx":101
* """)
* argmin_positive = property(
* lambda self: self._argmin_positive, # <<<<<<<<<<<<<<
@@ -2073,29 +2597,26 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda5(CYTHON_UNUS
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_9lambda6(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_9lambda6 = {"lambda6", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_9lambda6, METH_O, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_9lambda6(PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_9lambda5(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_9lambda5 = {"lambda5", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_9lambda5, METH_O, 0};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_9lambda5(PyObject *__pyx_self, PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0);
- __pyx_r = __pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(__pyx_self, ((PyObject *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("lambda5 (wrapper)", 0);
+ __pyx_r = __pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda5(__pyx_self, ((PyObject *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
+static PyObject *__pyx_lambda_funcdef_4silx_4math_5combo_13_MinMaxResult_lambda5(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("lambda6", 0);
+ __Pyx_RefNannySetupContext("lambda5", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmin_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_argmin_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -2104,7 +2625,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(CYTHON_UNUS
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.lambda5", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2112,7 +2633,7 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(CYTHON_UNUS
return __pyx_r;
}
-/* "combo.pyx":61
+/* "silx/math/combo.pyx":70
* """Object storing result from :func:`min_max`"""
*
* def __init__(self, minimum, min_pos, maximum, # <<<<<<<<<<<<<<
@@ -2121,9 +2642,10 @@ static PyObject *__pyx_lambda_funcdef_5combo_13_MinMaxResult_lambda6(CYTHON_UNUS
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_1__init__ = {"__init__", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_5combo_13_MinMaxResult___init__[] = "_MinMaxResult.__init__(self, minimum, min_pos, maximum, argmin, argmin_pos, argmax)";
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_1__init__ = {"__init__", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_13_MinMaxResult___init__};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_minimum = 0;
PyObject *__pyx_v_min_pos = 0;
@@ -2131,9 +2653,6 @@ static PyObject *__pyx_pw_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self,
PyObject *__pyx_v_argmin = 0;
PyObject *__pyx_v_argmin_pos = 0;
PyObject *__pyx_v_argmax = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
@@ -2162,36 +2681,36 @@ static PyObject *__pyx_pw_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self,
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_minimum_2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 1); __PYX_ERR(0, 70, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_pos)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 2); __PYX_ERR(0, 70, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_maximum_2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 3); __PYX_ERR(0, 70, __pyx_L3_error)
}
case 4:
if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_argmin_2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 4); __PYX_ERR(0, 70, __pyx_L3_error)
}
case 5:
if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_argmin_pos)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 5); __PYX_ERR(0, 70, __pyx_L3_error)
}
case 6:
if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_argmax_2)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, 6); __PYX_ERR(0, 70, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
goto __pyx_L5_argtuple_error;
@@ -2214,82 +2733,79 @@ static PyObject *__pyx_pw_5combo_13_MinMaxResult_1__init__(PyObject *__pyx_self,
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._MinMaxResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_13_MinMaxResult___init__(__pyx_self, __pyx_v_self, __pyx_v_minimum, __pyx_v_min_pos, __pyx_v_maximum, __pyx_v_argmin, __pyx_v_argmin_pos, __pyx_v_argmax);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_13_MinMaxResult___init__(__pyx_self, __pyx_v_self, __pyx_v_minimum, __pyx_v_min_pos, __pyx_v_maximum, __pyx_v_argmin, __pyx_v_argmin_pos, __pyx_v_argmax);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minimum, PyObject *__pyx_v_min_pos, PyObject *__pyx_v_maximum, PyObject *__pyx_v_argmin, PyObject *__pyx_v_argmin_pos, PyObject *__pyx_v_argmax) {
+static PyObject *__pyx_pf_4silx_4math_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_minimum, PyObject *__pyx_v_min_pos, PyObject *__pyx_v_maximum, PyObject *__pyx_v_argmin, PyObject *__pyx_v_argmin_pos, PyObject *__pyx_v_argmax) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__init__", 0);
- /* "combo.pyx":63
+ /* "silx/math/combo.pyx":72
* def __init__(self, minimum, min_pos, maximum,
* argmin, argmin_pos, argmax):
* self._minimum = minimum # <<<<<<<<<<<<<<
* self._min_positive = min_pos
* self._maximum = maximum
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minimum, __pyx_v_minimum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_minimum, __pyx_v_minimum) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
- /* "combo.pyx":64
+ /* "silx/math/combo.pyx":73
* argmin, argmin_pos, argmax):
* self._minimum = minimum
* self._min_positive = min_pos # <<<<<<<<<<<<<<
* self._maximum = maximum
*
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_min_positive, __pyx_v_min_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_min_positive, __pyx_v_min_pos) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
- /* "combo.pyx":65
+ /* "silx/math/combo.pyx":74
* self._minimum = minimum
* self._min_positive = min_pos
* self._maximum = maximum # <<<<<<<<<<<<<<
*
* self._argmin = argmin
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maximum, __pyx_v_maximum) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_maximum, __pyx_v_maximum) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
- /* "combo.pyx":67
+ /* "silx/math/combo.pyx":76
* self._maximum = maximum
*
* self._argmin = argmin # <<<<<<<<<<<<<<
* self._argmin_positive = argmin_pos
* self._argmax = argmax
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmin, __pyx_v_argmin) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmin, __pyx_v_argmin) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
- /* "combo.pyx":68
+ /* "silx/math/combo.pyx":77
*
* self._argmin = argmin
* self._argmin_positive = argmin_pos # <<<<<<<<<<<<<<
* self._argmax = argmax
*
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmin_positive, __pyx_v_argmin_pos) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmin_positive, __pyx_v_argmin_pos) < 0) __PYX_ERR(0, 77, __pyx_L1_error)
- /* "combo.pyx":69
+ /* "silx/math/combo.pyx":78
* self._argmin = argmin
* self._argmin_positive = argmin_pos
* self._argmax = argmax # <<<<<<<<<<<<<<
*
* minimum = property(
*/
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmax, __pyx_v_argmax) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_argmax, __pyx_v_argmax) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
- /* "combo.pyx":61
+ /* "silx/math/combo.pyx":70
* """Object storing result from :func:`min_max`"""
*
* def __init__(self, minimum, min_pos, maximum, # <<<<<<<<<<<<<<
@@ -2301,7 +2817,7 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_AddTraceback("combo._MinMaxResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2309,8 +2825,8 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject
return __pyx_r;
}
-/* "combo.pyx":98
- * It is the index of the first occurence.""")
+/* "silx/math/combo.pyx":107
+ * It is the index of the first occurrence.""")
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* if key == 0:
@@ -2318,14 +2834,12 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult___init__(CYTHON_UNUSED PyObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_5combo_13_MinMaxResult_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_5combo_13_MinMaxResult_3__getitem__, METH_VARARGS|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_5combo_13_MinMaxResult_2__getitem__[] = "_MinMaxResult.__getitem__(self, key)";
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_13_MinMaxResult_3__getitem__ = {"__getitem__", (PyCFunction)__pyx_pw_4silx_4math_5combo_13_MinMaxResult_3__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_13_MinMaxResult_2__getitem__};
+static PyObject *__pyx_pw_4silx_4math_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_key = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
@@ -2349,11 +2863,11 @@ static PyObject *__pyx_pw_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_se
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 107, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 107, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2366,42 +2880,40 @@ static PyObject *__pyx_pw_5combo_13_MinMaxResult_3__getitem__(PyObject *__pyx_se
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 107, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._MinMaxResult.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_13_MinMaxResult_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_13_MinMaxResult_2__getitem__(__pyx_self, __pyx_v_self, __pyx_v_key);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pf_4silx_4math_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
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("__getitem__", 0);
- /* "combo.pyx":99
+ /* "silx/math/combo.pyx":108
*
* def __getitem__(self, key):
* if key == 0: # <<<<<<<<<<<<<<
* return self.minimum
* elif key == 1:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 108, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "combo.pyx":100
+ /* "silx/math/combo.pyx":109
* def __getitem__(self, key):
* if key == 0:
* return self.minimum # <<<<<<<<<<<<<<
@@ -2409,26 +2921,35 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyOb
* return self.maximum
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minimum_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_minimum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":108
+ *
+ * def __getitem__(self, key):
+ * if key == 0: # <<<<<<<<<<<<<<
+ * return self.minimum
+ * elif key == 1:
+ */
}
- /* "combo.pyx":101
+ /* "silx/math/combo.pyx":110
* if key == 0:
* return self.minimum
* elif key == 1: # <<<<<<<<<<<<<<
* return self.maximum
* else:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 110, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 110, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "combo.pyx":102
+ /* "silx/math/combo.pyx":111
* return self.minimum
* elif key == 1:
* return self.maximum # <<<<<<<<<<<<<<
@@ -2436,30 +2957,38 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyOb
* raise IndexError("Index out of range")
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maximum_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_maximum_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":110
+ * if key == 0:
+ * return self.minimum
+ * elif key == 1: # <<<<<<<<<<<<<<
+ * return self.maximum
+ * else:
+ */
}
- /*else*/ {
- /* "combo.pyx":104
+ /* "silx/math/combo.pyx":113
* return self.maximum
* else:
* raise IndexError("Index out of range") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 113, __pyx_L1_error)
}
- /* "combo.pyx":98
- * It is the index of the first occurence.""")
+ /* "silx/math/combo.pyx":107
+ * It is the index of the first occurrence.""")
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* if key == 0:
@@ -2469,7 +2998,7 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyOb
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("combo._MinMaxResult.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._MinMaxResult.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2477,26 +3006,23 @@ static PyObject *__pyx_pf_5combo_13_MinMaxResult_2__getitem__(CYTHON_UNUSED PyOb
return __pyx_r;
}
-/* "combo.pyx":110
+/* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_1_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5combo__min_max[] = "See :func:`min_max` for documentation.";
-static PyMethodDef __pyx_mdef_5combo_1_min_max = {"_min_max", (PyCFunction)__pyx_pw_5combo_1_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_pw_5combo_1_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_5combo_1_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_5combo__min_max[] = "_min_max(signatures, args, kwargs, defaults)\n:func:`min_max` implementation including infinite values\n\n See :func:`min_max` for documentation.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_1_min_max = {"_min_max", (PyCFunction)__pyx_pw_4silx_4math_5combo_1_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_pw_4silx_4math_5combo_1_min_max(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);
@@ -2528,16 +3054,16 @@ static PyObject *__pyx_pw_5combo_1_min_max(PyObject *__pyx_self, PyObject *__pyx
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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 2); __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, 3); __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_fused_cpdef") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -2554,35 +3080,37 @@ static PyObject *__pyx_pw_5combo_1_min_max(PyObject *__pyx_self, PyObject *__pyx
}
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 = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__pyx_fused_cpdef", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo__min_max(__pyx_self, __pyx_v_signatures, __pyx_v_args, __pyx_v_kwargs, __pyx_v_defaults);
+ __pyx_r = __pyx_pf_4silx_4math_5combo__min_max(__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_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_signatures, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs, CYTHON_UNUSED PyObject *__pyx_v_defaults) {
+static PyObject *__pyx_pf_4silx_4math_5combo__min_max(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;
+ PyTypeObject *__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_signed_short_is_signed;
- int __pyx_v_signed_long_is_signed;
- int __pyx_v_signed_int_is_signed;
+ int __pyx_v_long_is_signed;
+ int __pyx_v_long_long_is_signed;
+ int __pyx_v_unsigned_short_is_signed;
+ int __pyx_v_short_is_signed;
+ int __pyx_v_int_is_signed;
int __pyx_v_unsigned_long_long_is_signed;
int __pyx_v_signed_char_is_signed;
- int __pyx_v_unsigned_short_is_signed;
- int __pyx_v_unsigned_int_is_signed;
+ int __pyx_v_unsigned_long_is_signed;
int __pyx_v_unsigned_char_is_signed;
+ int __pyx_v_unsigned_int_is_signed;
PyObject *__pyx_v_arg = NULL;
PyObject *__pyx_v_dtype = NULL;
PyObject *__pyx_v_arg_base = NULL;
@@ -2603,52 +3131,50 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
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;
+ long __pyx_t_11;
+ __Pyx_memviewslice __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ PyObject *(*__pyx_t_16)(PyObject *);
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;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *(*__pyx_t_20)(PyObject *);
+ int __pyx_t_21;
__Pyx_RefNannySetupContext("_min_max", 0);
__Pyx_INCREF(__pyx_v_kwargs);
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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);
+ PyList_SET_ITEM(__pyx_t_1, 0, 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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_6);
/*try:*/ {
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_numpy, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __pyx_v_ndarray = ((PyObject*)__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_ERR(0, 119, __pyx_L4_error)
+ __pyx_v_ndarray = ((PyTypeObject*)__pyx_t_1);
__pyx_t_1 = 0;
}
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -2656,16 +3182,17 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
goto __pyx_L11_try_end;
__pyx_L4_error:;
+ __Pyx_PyThreadState_assign
__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);
+ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
if (__pyx_t_7) {
- __Pyx_AddTraceback("combo.__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 = 110; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ __Pyx_AddTraceback("silx.math.combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 119, __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_XDECREF_SET(__pyx_v_ndarray, ((PyTypeObject*)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;
@@ -2673,37 +3200,41 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
goto __pyx_L1_error;
__pyx_L5_exception_handled:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_XGIVEREF(__pyx_t_6);
__Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
__pyx_L11_try_end:;
}
- __pyx_v_itemsize = -1;
- __pyx_v_signed_short_is_signed = (((signed short)-1) < 0);
- __pyx_v_signed_long_is_signed = (((signed long)-1) < 0);
- __pyx_v_signed_int_is_signed = (((signed int)-1) < 0);
- __pyx_v_unsigned_long_long_is_signed = (((unsigned PY_LONG_LONG)-1) < 0);
- __pyx_v_signed_char_is_signed = (((signed char)-1) < 0);
- __pyx_v_unsigned_short_is_signed = (((unsigned short)-1) < 0);
- __pyx_v_unsigned_int_is_signed = (((unsigned int)-1) < 0);
- __pyx_v_unsigned_char_is_signed = (((unsigned char)-1) < 0);
+ __pyx_v_itemsize = -1L;
+ __pyx_v_long_is_signed = (((long)-1L) < 0);
+ __pyx_v_long_long_is_signed = (((PY_LONG_LONG)-1L) < 0);
+ __pyx_v_unsigned_short_is_signed = (((unsigned short)-1L) < 0);
+ __pyx_v_short_is_signed = (((short)-1L) < 0);
+ __pyx_v_int_is_signed = (((int)-1L) < 0);
+ __pyx_v_unsigned_long_long_is_signed = (((unsigned PY_LONG_LONG)-1L) < 0);
+ __pyx_v_signed_char_is_signed = (((signed char)-1L) < 0);
+ __pyx_v_unsigned_long_is_signed = (((unsigned long)-1L) < 0);
+ __pyx_v_unsigned_char_is_signed = (((unsigned char)-1L) < 0);
+ __pyx_v_unsigned_int_is_signed = (((unsigned int)-1L) < 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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __pyx_L1_error)
}
__pyx_t_9 = PyTuple_GET_ITEM(((PyObject*)__pyx_v_args), 0);
__Pyx_INCREF(__pyx_t_9);
@@ -2713,16 +3244,16 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
}
if (unlikely(__pyx_v_kwargs == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_data, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __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)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__pyx_v_arg = __pyx_t_9;
__pyx_t_9 = 0;
@@ -2731,644 +3262,708 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
/*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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyString_Format(__pyx_kp_s_Expected_at_least_d_arguments, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
__pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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));
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L18;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg, __pyx_v_ndarray);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_arg_base = __pyx_t_8;
+ __pyx_t_8 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __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 = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ goto __pyx_L18;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L18:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 119, __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_2 = (((sizeof(signed char)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_signed_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L22_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_signed_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(short)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L26_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L26_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(int)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L30_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_8); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __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(signed char)) == __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 = 110; __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 = 110; __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_signed_char_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_kp_s_signed_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(signed short)) == __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 = 110; __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 = 110; __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_signed_short_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_kp_s_signed_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(signed int)) == __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 = 110; __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 = 110; __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_signed_int_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_kp_s_signed_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(signed long)) == __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 = 110; __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 = 110; __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_signed_long_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_kp_s_signed_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(unsigned char)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L39_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 = 110; __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 = 110; __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_L39_bool_binop_done;
- }
- __pyx_t_3 = ((!((__pyx_v_unsigned_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L39_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(unsigned short)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L43_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 = 110; __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 = 110; __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_L43_bool_binop_done;
- }
- __pyx_t_3 = ((!((__pyx_v_unsigned_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L43_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(unsigned int)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L47_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 = 110; __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 = 110; __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_L47_bool_binop_done;
- }
- __pyx_t_3 = ((!((__pyx_v_unsigned_int_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L47_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(unsigned PY_LONG_LONG)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L51_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 = 110; __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 = 110; __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_L51_bool_binop_done;
- }
- __pyx_t_3 = ((!((__pyx_v_unsigned_long_long_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L51_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'f':
- __pyx_t_3 = (((sizeof(float)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L55_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 = 110; __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 = 110; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L55_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- __pyx_t_3 = (((sizeof(double)) == __pyx_v_itemsize) != 0);
- if (__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L58_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 = 110; __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 = 110; __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);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L58_bool_binop_done:;
- if (__pyx_t_2) {
- if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- break;
- case 'c':
- break;
- case 'O':
- break;
- default: break;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L30_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_int_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L30_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(long)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L34_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L34_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_long_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L34_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(PY_LONG_LONG)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L38_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L38_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_long_long_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L38_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(unsigned char)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L42_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L42_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_unsigned_char_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L42_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(unsigned short)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L46_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L46_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_unsigned_short_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L46_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(unsigned int)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L50_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L50_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_unsigned_int_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L50_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(unsigned long)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L54_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L54_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_unsigned_long_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L54_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(unsigned PY_LONG_LONG)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L58_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L58_bool_binop_done;
+ }
+ __pyx_t_2 = ((!((__pyx_v_unsigned_long_long_is_signed ^ __pyx_v_dtype_signed) != 0)) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L58_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'f':
+ __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L62_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L62_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- goto __pyx_L21;
+ __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L65_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L65_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
}
- __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_L61_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L68_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L68_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(float))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L61_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__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_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L60;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L60:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L65_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L72_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(double))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L72_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(double))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L65_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__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_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L64;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L64:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L69_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L76_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(signed char))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L76_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_signed__char(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_signed_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(signed char))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L69_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_char(__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_kp_s_signed_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L68;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L68:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L73_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L80_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(short))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L80_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_short(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(signed short))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L73_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_short(__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_kp_s_signed_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L72;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L72:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L77_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L84_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(int))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L84_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_int(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(signed int))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L77_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_int(__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_kp_s_signed_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L76;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L76:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L81_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L88_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(long))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L88_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(signed long))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L81_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_long(__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_kp_s_signed_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L80;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L80:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L85_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L92_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(PY_LONG_LONG))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L92_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(unsigned char))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L85_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__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_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L84;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L84:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L89_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L96_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned char))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L96_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_char, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(unsigned short))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L89_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(__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_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L88;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L88:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L93_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L100_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned short))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L100_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_short, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(unsigned int))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L93_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(__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_kp_s_unsigned_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L92;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L92:;
- __pyx_t_3 = ((__pyx_v_itemsize == -1) != 0);
- if (!__pyx_t_3) {
- } else {
- __pyx_t_2 = __pyx_t_3;
- goto __pyx_L97_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L104_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned int))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L104_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_int, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_t_3 = ((__pyx_v_itemsize == (sizeof(unsigned PY_LONG_LONG))) != 0);
- __pyx_t_2 = __pyx_t_3;
- __pyx_L97_bool_binop_done:;
- if (__pyx_t_2) {
- __pyx_v_memslice = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(__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_kp_s_unsigned_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
- }
- /*else*/ {
- PyErr_Clear();
- }
- goto __pyx_L96;
+ /*else*/ {
+ PyErr_Clear();
}
- __pyx_L96:;
- 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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17_break;
}
- __pyx_L17_break:;
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L108_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned long))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L108_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_long(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L112_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(unsigned PY_LONG_LONG))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L112_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_kp_s_unsigned_long_long, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ }
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ goto __pyx_L16_break;
}
- __pyx_L15:;
- __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_L16_break:;
+ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_14 == 0)) break;
+ if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_sig, __pyx_n_s_strip); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __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__6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __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);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __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;
+ __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_15 = 0;
+ __pyx_t_16 = 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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 119, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
for (;;) {
- if (likely(!__pyx_t_15)) {
+ if (likely(!__pyx_t_16)) {
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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
#endif
}
} else {
- __pyx_t_1 = __pyx_t_15(__pyx_t_9);
+ __pyx_t_1 = __pyx_t_16(__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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 119, __pyx_L1_error)
}
break;
}
@@ -3376,7 +3971,7 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
}
if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -3384,104 +3979,100 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_16 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyTuple_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
} else {
- __pyx_t_16 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_17 = PyList_GET_ITEM(sequence, 1);
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
}
- __Pyx_INCREF(__pyx_t_16);
__Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_18);
#else
- __pyx_t_16 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
#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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_19);
__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_L104_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_L104_unpacking_failed;
+ __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L119_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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_19 = NULL;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- goto __pyx_L105_unpacking_done;
- __pyx_L104_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
- __pyx_t_19 = NULL;
+ index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L119_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_20 = NULL;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ goto __pyx_L120_unpacking_done;
+ __pyx_L119_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __pyx_t_20 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L105_unpacking_done:;
+ __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_L120_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_XDECREF_SET(__pyx_v_src_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 = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
+ __pyx_t_18 = 0;
+ __pyx_t_3 = (__pyx_v_dst_type != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __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_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_3) {
+ if (__pyx_t_2) {
__pyx_v_match_found = 1;
- goto __pyx_L107;
+ goto __pyx_L122;
}
/*else*/ {
__pyx_v_match_found = 0;
- goto __pyx_L103_break;
+ goto __pyx_L118_break;
}
- __pyx_L107:;
- goto __pyx_L106;
+ __pyx_L122:;
}
- __pyx_L106:;
}
- __pyx_L103_break:;
+ __pyx_L118_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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L108;
+ __pyx_t_2 = (__pyx_v_match_found != 0);
+ if (__pyx_t_2) {
+ __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 119, __pyx_L1_error)
}
- __pyx_L108:;
}
__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__7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
+ __pyx_t_3 = ((!__pyx_t_2) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __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__8, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 119, __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 = 110; __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)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__pyx_r = __pyx_t_8;
__pyx_t_8 = 0;
@@ -3493,10 +4084,10 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
__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("combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_AddTraceback("silx.math.combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_dest_sig);
@@ -3515,30 +4106,27 @@ static PyObject *__pyx_pf_5combo__min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -3548,7 +4136,7 @@ static PyObject *__pyx_pf_5combo_46__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3557,21 +4145,18 @@ static PyObject *__pyx_pf_5combo_46__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_0__pyx_pw_5combo_5_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_0__pyx_mdef_5combo_5_min_max = {"__pyx_fuse_0_min_max", (PyCFunction)__pyx_fuse_0__pyx_pw_5combo_5_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_0__pyx_pw_5combo_5_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_0__pyx_pw_4silx_4math_5combo_7_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0__pyx_mdef_4silx_4math_5combo_7_min_max = {"__pyx_fuse_0_min_max", (PyCFunction)__pyx_fuse_0__pyx_pw_4silx_4math_5combo_7_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_0__pyx_pw_4silx_4math_5combo_7_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self);
+ __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -3593,7 +4178,7 @@ static PyObject *__pyx_fuse_0__pyx_pw_5combo_5_min_max(PyObject *__pyx_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -3603,29 +4188,29 @@ static PyObject *__pyx_fuse_0__pyx_pw_5combo_5_min_max(PyObject *__pyx_self, PyO
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_float(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_float(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_4_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_6_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
float __pyx_v_value;
float __pyx_v_minimum;
float __pyx_v_maximum;
@@ -3640,14 +4225,14 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- unsigned int __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
+ size_t __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
@@ -3655,14 +4240,12 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
- Py_ssize_t __pyx_t_19;
- PyObject *__pyx_t_20 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_19 = NULL;
+ int __pyx_t_20;
+ PyObject *__pyx_t_21 = NULL;
__Pyx_RefNannySetupContext("__pyx_fuse_0_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -3671,7 +4254,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -3680,7 +4263,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -3689,7 +4272,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -3698,20 +4281,20 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -3721,21 +4304,29 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -3749,17 +4340,17 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -3768,7 +4359,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -3777,25 +4368,25 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0.0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0.0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -3803,43 +4394,51 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0.0;
}
__pyx_L7:;
- /* "combo.pyx":137
+ /* "silx/math/combo.pyx":149
* if _number in cython.floating:
* # For floating, loop until first not NaN value
* for index in range(length): # <<<<<<<<<<<<<<
* value = data[index]
* if not isnan(value):
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":138
+ /* "silx/math/combo.pyx":150
* # For floating, loop until first not NaN value
* for index in range(length):
* value = data[index] # <<<<<<<<<<<<<<
* if not isnan(value):
* minimum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":139
+ /* "silx/math/combo.pyx":151
* for index in range(length):
* value = data[index]
* if not isnan(value): # <<<<<<<<<<<<<<
@@ -3849,7 +4448,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((!(isnan(__pyx_v_value) != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":140
+ /* "silx/math/combo.pyx":152
* value = data[index]
* if not isnan(value):
* minimum = value # <<<<<<<<<<<<<<
@@ -3858,7 +4457,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":141
+ /* "silx/math/combo.pyx":153
* if not isnan(value):
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -3867,7 +4466,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_index = __pyx_v_index;
- /* "combo.pyx":142
+ /* "silx/math/combo.pyx":154
* minimum = value
* min_index = index
* maximum = value # <<<<<<<<<<<<<<
@@ -3876,7 +4475,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":143
+ /* "silx/math/combo.pyx":155
* min_index = index
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -3885,7 +4484,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_max_index = __pyx_v_index;
- /* "combo.pyx":144
+ /* "silx/math/combo.pyx":156
* maximum = value
* max_index = index
* break # <<<<<<<<<<<<<<
@@ -3893,11 +4492,19 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if not min_positive:
*/
goto __pyx_L11_break;
+
+ /* "silx/math/combo.pyx":151
+ * for index in range(length):
+ * value = data[index]
+ * if not isnan(value): # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
}
__pyx_L11_break:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -3907,28 +4514,28 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -3938,7 +4545,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -3947,7 +4554,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -3955,10 +4562,18 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -3968,7 +4583,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -3977,7 +4592,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -3985,36 +4600,51 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -4024,7 +4654,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -4033,7 +4663,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -4041,10 +4671,18 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L19;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -4054,7 +4692,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -4063,7 +4701,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -4071,11 +4709,18 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L19;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L19:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -4085,7 +4730,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > 0.0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -4094,7 +4739,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -4103,7 +4748,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -4111,32 +4756,40 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* # Loop until the end
*/
goto __pyx_L18_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L18_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_10 = __pyx_v_index;
- __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_10)) )));
+ __pyx_t_11 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_11)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -4146,7 +4799,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -4155,7 +4808,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -4163,21 +4816,29 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -4186,56 +4847,64 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L24;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L24:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0.0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L26_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L26_bool_binop_done:;
+ __pyx_t_3 = (0.0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L25;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L25:;
}
__pyx_L23:;
}
@@ -4243,7 +4912,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_L13:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -4261,7 +4930,7 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -4269,12 +4938,12 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_13 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -4282,36 +4951,36 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_index,
*/
if (((__pyx_v_min_pos > 0.0) != 0)) {
- __pyx_t_14 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- __pyx_t_13 = __pyx_t_14;
- __pyx_t_14 = 0;
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_14 = __pyx_t_15;
+ __pyx_t_15 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_13 = Py_None;
+ __pyx_t_14 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_14 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -4319,79 +4988,108 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*
*/
if (((__pyx_v_min_pos > 0.0) != 0)) {
- __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
- __pyx_t_16 = __pyx_t_17;
- __pyx_t_17 = 0;
+ __pyx_t_18 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_17 = __pyx_t_18;
+ __pyx_t_18 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_16 = Py_None;
+ __pyx_t_17 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_17);
- __pyx_t_18 = NULL;
- __pyx_t_19 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
- __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
- if (likely(__pyx_t_18)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
- __Pyx_INCREF(__pyx_t_18);
+ __pyx_t_18 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_19 = NULL;
+ __pyx_t_20 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_19)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_19);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_11, function);
- __pyx_t_19 = 1;
+ __Pyx_DECREF_SET(__pyx_t_12, function);
+ __pyx_t_20 = 1;
}
}
- __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_20);
- if (__pyx_t_18) {
- PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
- __Pyx_GIVEREF(__pyx_t_17);
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_17 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_19, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_20, 6+__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_19, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_20, 6+__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_21 = PyTuple_New(6+__pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_21);
+ if (__pyx_t_19) {
+ __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19); __pyx_t_19 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_20, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_20, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_21, 2+__pyx_t_20, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_21, 3+__pyx_t_20, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_21, 4+__pyx_t_20, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_18);
+ PyTuple_SET_ITEM(__pyx_t_21, 5+__pyx_t_20, __pyx_t_18);
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_18 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
__Pyx_XDECREF(__pyx_t_14);
@@ -4399,8 +5097,9 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_18);
- __Pyx_XDECREF(__pyx_t_20);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_XDECREF(__pyx_t_21);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -4409,30 +5108,27 @@ static PyObject *__pyx_pf_5combo_4_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -4442,7 +5138,7 @@ static PyObject *__pyx_pf_5combo_48__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -4451,21 +5147,18 @@ static PyObject *__pyx_pf_5combo_48__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_1__pyx_pw_5combo_7_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_1__pyx_mdef_5combo_7_min_max = {"__pyx_fuse_1_min_max", (PyCFunction)__pyx_fuse_1__pyx_pw_5combo_7_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_1__pyx_pw_5combo_7_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_1__pyx_pw_4silx_4math_5combo_9_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1__pyx_mdef_4silx_4math_5combo_9_min_max = {"__pyx_fuse_1_min_max", (PyCFunction)__pyx_fuse_1__pyx_pw_4silx_4math_5combo_9_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_1__pyx_pw_4silx_4math_5combo_9_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self);
+ __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -4487,7 +5180,7 @@ static PyObject *__pyx_fuse_1__pyx_pw_5combo_7_min_max(PyObject *__pyx_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4497,29 +5190,29 @@ static PyObject *__pyx_fuse_1__pyx_pw_5combo_7_min_max(PyObject *__pyx_self, PyO
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_6_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_8_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
double __pyx_v_value;
double __pyx_v_minimum;
double __pyx_v_maximum;
@@ -4534,14 +5227,14 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- unsigned int __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
+ size_t __pyx_t_11;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
PyObject *__pyx_t_14 = NULL;
@@ -4549,14 +5242,12 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
PyObject *__pyx_t_18 = NULL;
- Py_ssize_t __pyx_t_19;
- PyObject *__pyx_t_20 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_19 = NULL;
+ int __pyx_t_20;
+ PyObject *__pyx_t_21 = NULL;
__Pyx_RefNannySetupContext("__pyx_fuse_1_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -4565,7 +5256,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -4574,7 +5265,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -4583,7 +5274,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -4592,20 +5283,20 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -4615,21 +5306,29 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -4643,17 +5342,17 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -4662,7 +5361,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -4671,25 +5370,25 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0.0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0.0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -4697,43 +5396,51 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0.0;
}
__pyx_L7:;
- /* "combo.pyx":137
+ /* "silx/math/combo.pyx":149
* if _number in cython.floating:
* # For floating, loop until first not NaN value
* for index in range(length): # <<<<<<<<<<<<<<
* value = data[index]
* if not isnan(value):
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":138
+ /* "silx/math/combo.pyx":150
* # For floating, loop until first not NaN value
* for index in range(length):
* value = data[index] # <<<<<<<<<<<<<<
* if not isnan(value):
* minimum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":139
+ /* "silx/math/combo.pyx":151
* for index in range(length):
* value = data[index]
* if not isnan(value): # <<<<<<<<<<<<<<
@@ -4743,7 +5450,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((!(isnan(__pyx_v_value) != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":140
+ /* "silx/math/combo.pyx":152
* value = data[index]
* if not isnan(value):
* minimum = value # <<<<<<<<<<<<<<
@@ -4752,7 +5459,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":141
+ /* "silx/math/combo.pyx":153
* if not isnan(value):
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -4761,7 +5468,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_index = __pyx_v_index;
- /* "combo.pyx":142
+ /* "silx/math/combo.pyx":154
* minimum = value
* min_index = index
* maximum = value # <<<<<<<<<<<<<<
@@ -4770,7 +5477,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":143
+ /* "silx/math/combo.pyx":155
* min_index = index
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -4779,7 +5486,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_max_index = __pyx_v_index;
- /* "combo.pyx":144
+ /* "silx/math/combo.pyx":156
* maximum = value
* max_index = index
* break # <<<<<<<<<<<<<<
@@ -4787,11 +5494,19 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if not min_positive:
*/
goto __pyx_L11_break;
+
+ /* "silx/math/combo.pyx":151
+ * for index in range(length):
+ * value = data[index]
+ * if not isnan(value): # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
}
__pyx_L11_break:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -4801,28 +5516,28 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -4832,7 +5547,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -4841,7 +5556,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -4849,10 +5564,18 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -4862,7 +5585,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -4871,7 +5594,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -4879,36 +5602,51 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -4918,7 +5656,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -4927,7 +5665,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -4935,10 +5673,18 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L19;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -4948,7 +5694,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -4957,7 +5703,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -4965,11 +5711,18 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L19;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L19:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -4979,7 +5732,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > 0.0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -4988,7 +5741,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -4997,7 +5750,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -5005,32 +5758,40 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* # Loop until the end
*/
goto __pyx_L18_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L18_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_10 = __pyx_v_index;
- __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_10)) )));
+ __pyx_t_11 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_11)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -5040,7 +5801,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -5049,7 +5810,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -5057,21 +5818,29 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -5080,56 +5849,64 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L24;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L24:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0.0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L26_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L26_bool_binop_done:;
+ __pyx_t_3 = (0.0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L25;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L25:;
}
__pyx_L23:;
}
@@ -5137,7 +5914,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_L13:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -5155,7 +5932,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -5163,12 +5940,12 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- __pyx_t_12 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_13 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -5176,7 +5953,921 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_index,
*/
if (((__pyx_v_min_pos > 0.0) != 0)) {
- __pyx_t_14 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_14 = __pyx_t_15;
+ __pyx_t_15 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_14 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":201
+ * return _MinMaxResult(minimum,
+ * min_pos if min_pos > 0 else None,
+ * maximum, # <<<<<<<<<<<<<<
+ * min_index,
+ * min_pos_index if min_pos > 0 else None,
+ */
+ __pyx_t_15 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+
+ /* "silx/math/combo.pyx":202
+ * min_pos if min_pos > 0 else None,
+ * maximum,
+ * min_index, # <<<<<<<<<<<<<<
+ * min_pos_index if min_pos > 0 else None,
+ * max_index)
+ */
+ __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+
+ /* "silx/math/combo.pyx":203
+ * maximum,
+ * min_index,
+ * min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
+ * max_index)
+ *
+ */
+ if (((__pyx_v_min_pos > 0.0) != 0)) {
+ __pyx_t_18 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_17 = __pyx_t_18;
+ __pyx_t_18 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_17 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":204
+ * min_index,
+ * min_pos_index if min_pos > 0 else None,
+ * max_index) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_18 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ __pyx_t_19 = NULL;
+ __pyx_t_20 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_19)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_19);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
+ __pyx_t_20 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_19, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_20, 6+__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_19, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_20, 6+__pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_21 = PyTuple_New(6+__pyx_t_20); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_21);
+ if (__pyx_t_19) {
+ __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19); __pyx_t_19 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_21, 0+__pyx_t_20, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_21, 1+__pyx_t_20, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_21, 2+__pyx_t_20, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_21, 3+__pyx_t_20, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_21, 4+__pyx_t_20, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_18);
+ PyTuple_SET_ITEM(__pyx_t_21, 5+__pyx_t_20, __pyx_t_18);
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_18 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":119
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation including infinite values
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_XDECREF(__pyx_t_21);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __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_pf_4silx_4math_5combo_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__defaults__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_fuse_2__pyx_pw_4silx_4math_5combo_11_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_2__pyx_mdef_4silx_4math_5combo_11_min_max = {"__pyx_fuse_2_min_max", (PyCFunction)__pyx_fuse_2__pyx_pw_4silx_4math_5combo_11_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_2__pyx_pw_4silx_4math_5combo_11_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_min_positive;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
+ PyObject* values[2] = {0,0};
+ __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self);
+ 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_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_positive_2);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __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_data = __Pyx_PyObject_to_MemoryviewSlice_dc_signed__char(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
+ if (values[1]) {
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
+ } else {
+ __pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_5combo_10_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ signed char __pyx_v_value;
+ signed char __pyx_v_minimum;
+ signed char __pyx_v_maximum;
+ unsigned int __pyx_v_length;
+ unsigned int __pyx_v_index;
+ unsigned int __pyx_v_min_index;
+ unsigned int __pyx_v_min_pos_index;
+ unsigned int __pyx_v_max_index;
+ long __pyx_v_min_pos;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
+ unsigned int __pyx_t_6;
+ unsigned int __pyx_t_7;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_2_min_max", 0);
+
+ /* "silx/math/combo.pyx":127
+ * _number value, minimum, minpos, maximum
+ * unsigned int length
+ * unsigned int index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ */
+ __pyx_v_index = 0;
+
+ /* "silx/math/combo.pyx":128
+ * unsigned int length
+ * unsigned int index = 0
+ * unsigned int min_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0
+ */
+ __pyx_v_min_index = 0;
+
+ /* "silx/math/combo.pyx":129
+ * unsigned int index = 0
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int max_index = 0
+ *
+ */
+ __pyx_v_min_pos_index = 0;
+
+ /* "silx/math/combo.pyx":130
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0 # <<<<<<<<<<<<<<
+ *
+ * length = len(data)
+ */
+ __pyx_v_max_index = 0;
+
+ /* "silx/math/combo.pyx":132
+ * unsigned int max_index = 0
+ *
+ * length = len(data) # <<<<<<<<<<<<<<
+ *
+ * if length == 0:
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_signed__char, (int (*)(char *, PyObject *)) __pyx_memview_set_signed__char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_length = __pyx_t_2;
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_length == 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":135
+ *
+ * if length == 0:
+ * raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ }
+
+ /* "silx/math/combo.pyx":137
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # Init starting values
+ * value = data[0]
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "silx/math/combo.pyx":139
+ * with nogil:
+ * # Init starting values
+ * value = data[0] # <<<<<<<<<<<<<<
+ * minimum = value
+ * maximum = value
+ */
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_4)) )));
+
+ /* "silx/math/combo.pyx":140
+ * # Init starting values
+ * value = data[0]
+ * minimum = value # <<<<<<<<<<<<<<
+ * maximum = value
+ * if min_positive and value > 0:
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":141
+ * value = data[0]
+ * minimum = value
+ * maximum = value # <<<<<<<<<<<<<<
+ * if min_positive and value > 0:
+ * min_pos = value
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_L8_bool_binop_done:;
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":143
+ * maximum = value
+ * if min_positive and value > 0:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * else:
+ * min_pos = 0
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
+ goto __pyx_L7;
+ }
+
+ /* "silx/math/combo.pyx":145
+ * min_pos = value
+ * else:
+ * min_pos = 0 # <<<<<<<<<<<<<<
+ *
+ * if _number in cython.floating:
+ */
+ /*else*/ {
+ __pyx_v_min_pos = 0;
+ }
+ __pyx_L7:;
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
+ __pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":159
+ *
+ * if not min_positive:
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":160
+ * if not min_positive:
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_8)) )));
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":162
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * elif value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":163
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * elif value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L13;
+ }
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":165
+ * max_index = index
+ * elif value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":166
+ * elif value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+ __pyx_L13:;
+ }
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
+ goto __pyx_L10;
+ }
+
+ /* "silx/math/combo.pyx":170
+ * else:
+ * # Loop until min_pos is defined
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":171
+ * # Loop until min_pos is defined
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_9)) )));
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":173
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * elif value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":174
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * elif value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L16;
+ }
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":176
+ * max_index = index
+ * elif value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":177
+ * elif value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if value > 0:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+ __pyx_L16:;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":180
+ *
+ * if value > 0:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ * break
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":181
+ * if value > 0:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":182
+ * min_pos = value
+ * min_pos_index = index
+ * break # <<<<<<<<<<<<<<
+ *
+ * # Loop until the end
+ */
+ goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+ }
+ __pyx_L15_break:;
+
+ /* "silx/math/combo.pyx":185
+ *
+ * # Loop until the end
+ * for index in range(index+1, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":186
+ * # Loop until the end
+ * for index in range(index+1, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_10)) )));
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":188
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * else:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":189
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * else:
+ * if value < minimum:
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L20;
+ }
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ /*else*/ {
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":192
+ * else:
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":193
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if 0 < value < min_pos:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = (0 < __pyx_v_value);
+ if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
+
+ /* "silx/math/combo.pyx":196
+ *
+ * if 0 < value < min_pos:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ *
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ *
+ * return _MinMaxResult(minimum,
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+ }
+ __pyx_L20:;
+ }
+ }
+ __pyx_L10:;
+ }
+
+ /* "silx/math/combo.pyx":137
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # Init starting values
+ * value = data[0]
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "silx/math/combo.pyx":199
+ * min_pos_index = index
+ *
+ * return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
+ * min_pos if min_pos > 0 else None,
+ * maximum,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_signed__char(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+
+ /* "silx/math/combo.pyx":200
+ *
+ * return _MinMaxResult(minimum,
+ * min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
+ * maximum,
+ * min_index,
+ */
+ if (((__pyx_v_min_pos > 0) != 0)) {
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
__pyx_t_13 = __pyx_t_14;
__pyx_t_14 = 0;
@@ -5185,35 +6876,35 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_14 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyInt_From_signed__char(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
* max_index)
*
*/
- if (((__pyx_v_min_pos > 0.0) != 0)) {
- __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (((__pyx_v_min_pos > 0) != 0)) {
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
__pyx_t_16 = __pyx_t_17;
__pyx_t_17 = 0;
@@ -5222,18 +6913,18 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_17);
__pyx_t_18 = NULL;
__pyx_t_19 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_11))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
__pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
if (likely(__pyx_t_18)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
@@ -5243,43 +6934,73 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_19 = 1;
}
}
- __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_20);
- if (__pyx_t_18) {
- PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __Pyx_GIVEREF(__pyx_t_18); __pyx_t_18 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
- __Pyx_GIVEREF(__pyx_t_17);
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_17 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
__Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
@@ -5294,7 +7015,7 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__Pyx_XDECREF(__pyx_t_17);
__Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_20);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -5303,30 +7024,27 @@ static PyObject *__pyx_pf_5combo_6_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_68__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -5336,7 +7054,7 @@ static PyObject *__pyx_pf_5combo_50__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -5345,21 +7063,18 @@ static PyObject *__pyx_pf_5combo_50__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_2__pyx_pw_5combo_9_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_2__pyx_mdef_5combo_9_min_max = {"__pyx_fuse_2_min_max", (PyCFunction)__pyx_fuse_2__pyx_pw_5combo_9_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_2__pyx_pw_5combo_9_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_3__pyx_pw_4silx_4math_5combo_13_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_3__pyx_mdef_4silx_4math_5combo_13_min_max = {"__pyx_fuse_3_min_max", (PyCFunction)__pyx_fuse_3__pyx_pw_4silx_4math_5combo_13_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_3__pyx_pw_4silx_4math_5combo_13_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self);
+ __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -5381,7 +7096,7 @@ static PyObject *__pyx_fuse_2__pyx_pw_5combo_9_min_max(PyObject *__pyx_self, PyO
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -5391,32 +7106,32 @@ static PyObject *__pyx_fuse_2__pyx_pw_5combo_9_min_max(PyObject *__pyx_self, PyO
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_char(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_short(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_8_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_12_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
- signed char __pyx_v_value;
- signed char __pyx_v_minimum;
- signed char __pyx_v_maximum;
+static PyObject *__pyx_pf_4silx_4math_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ short __pyx_v_value;
+ short __pyx_v_minimum;
+ short __pyx_v_maximum;
unsigned int __pyx_v_length;
unsigned int __pyx_v_index;
unsigned int __pyx_v_min_index;
@@ -5428,13 +7143,13 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -5442,14 +7157,12 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_2_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_3_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -5458,7 +7171,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -5467,7 +7180,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -5476,7 +7189,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -5485,20 +7198,20 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_signed_char, (int (*)(char *, PyObject *)) __pyx_memview_set_signed_char, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_short, (int (*)(char *, PyObject *)) __pyx_memview_set_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -5508,21 +7221,29 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -5536,17 +7257,17 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((short *) ( /* dim=0 */ ((char *) (((short *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -5555,7 +7276,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -5564,25 +7285,25 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -5590,22 +7311,30 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -5615,28 +7344,28 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((short *) ( /* dim=0 */ ((char *) (((short *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -5646,7 +7375,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -5655,7 +7384,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -5663,10 +7392,18 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -5676,7 +7413,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -5685,7 +7422,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -5693,36 +7430,51 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((short *) ( /* dim=0 */ ((char *) (((short *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -5732,7 +7484,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -5741,7 +7493,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -5749,10 +7501,18 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -5762,7 +7522,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -5771,7 +7531,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -5779,11 +7539,18 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -5793,7 +7560,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -5802,7 +7569,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -5811,7 +7578,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -5819,32 +7586,40 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((signed char *) ( /* dim=0 */ ((char *) (((signed char *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((short *) ( /* dim=0 */ ((char *) (((short *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -5854,7 +7629,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -5863,7 +7638,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -5871,21 +7646,29 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -5894,56 +7677,64 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -5951,7 +7742,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -5969,7 +7760,7 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -5977,12 +7768,12 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_signed__char(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_short(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -5990,36 +7781,36 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_signed__char(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_short(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -6027,79 +7818,108 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -6107,8 +7927,9 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -6117,30 +7938,27 @@ static PyObject *__pyx_pf_5combo_8_min_max(CYTHON_UNUSED PyObject *__pyx_self, _
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_70__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -6150,7 +7968,7 @@ static PyObject *__pyx_pf_5combo_52__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6159,21 +7977,18 @@ static PyObject *__pyx_pf_5combo_52__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_3__pyx_pw_5combo_11_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_3__pyx_mdef_5combo_11_min_max = {"__pyx_fuse_3_min_max", (PyCFunction)__pyx_fuse_3__pyx_pw_5combo_11_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_3__pyx_pw_5combo_11_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_4__pyx_pw_4silx_4math_5combo_15_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_4__pyx_mdef_4silx_4math_5combo_15_min_max = {"__pyx_fuse_4_min_max", (PyCFunction)__pyx_fuse_4__pyx_pw_4silx_4math_5combo_15_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_4__pyx_pw_4silx_4math_5combo_15_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self);
+ __pyx_defaults16 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -6195,7 +8010,7 @@ static PyObject *__pyx_fuse_3__pyx_pw_5combo_11_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -6205,32 +8020,32 @@ static PyObject *__pyx_fuse_3__pyx_pw_5combo_11_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_short(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_int(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_10_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_14_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
- signed short __pyx_v_value;
- signed short __pyx_v_minimum;
- signed short __pyx_v_maximum;
+static PyObject *__pyx_pf_4silx_4math_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ int __pyx_v_value;
+ int __pyx_v_minimum;
+ int __pyx_v_maximum;
unsigned int __pyx_v_length;
unsigned int __pyx_v_index;
unsigned int __pyx_v_min_index;
@@ -6242,13 +8057,13 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -6256,14 +8071,12 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_3_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_4_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -6272,7 +8085,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -6281,7 +8094,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -6290,7 +8103,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -6299,20 +8112,20 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_signed_short, (int (*)(char *, PyObject *)) __pyx_memview_set_signed_short, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_int, (int (*)(char *, PyObject *)) __pyx_memview_set_int, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -6322,21 +8135,29 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -6350,17 +8171,17 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((signed short *) ( /* dim=0 */ ((char *) (((signed short *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -6369,7 +8190,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -6378,25 +8199,25 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -6404,22 +8225,30 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -6429,28 +8258,28 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((signed short *) ( /* dim=0 */ ((char *) (((signed short *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -6460,7 +8289,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -6469,7 +8298,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -6477,10 +8306,18 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -6490,7 +8327,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -6499,7 +8336,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -6507,36 +8344,51 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((signed short *) ( /* dim=0 */ ((char *) (((signed short *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -6546,7 +8398,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -6555,7 +8407,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -6563,10 +8415,18 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -6576,7 +8436,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -6585,7 +8445,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -6593,11 +8453,18 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -6607,7 +8474,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -6616,7 +8483,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -6625,7 +8492,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -6633,32 +8500,40 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((signed short *) ( /* dim=0 */ ((char *) (((signed short *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((int *) ( /* dim=0 */ ((char *) (((int *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -6668,7 +8543,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -6677,7 +8552,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -6685,21 +8560,29 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -6708,56 +8591,64 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -6765,7 +8656,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -6783,7 +8674,7 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -6791,12 +8682,12 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_signed__short(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -6804,36 +8695,36 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_signed__short(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -6841,79 +8732,108 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -6921,8 +8841,9 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -6931,30 +8852,27 @@ static PyObject *__pyx_pf_5combo_10_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_72__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -6964,7 +8882,7 @@ static PyObject *__pyx_pf_5combo_54__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -6973,21 +8891,18 @@ static PyObject *__pyx_pf_5combo_54__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_4__pyx_pw_5combo_13_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_4__pyx_mdef_5combo_13_min_max = {"__pyx_fuse_4_min_max", (PyCFunction)__pyx_fuse_4__pyx_pw_5combo_13_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_4__pyx_pw_5combo_13_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_5__pyx_pw_4silx_4math_5combo_17_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_5__pyx_mdef_4silx_4math_5combo_17_min_max = {"__pyx_fuse_5_min_max", (PyCFunction)__pyx_fuse_5__pyx_pw_4silx_4math_5combo_17_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_5__pyx_pw_4silx_4math_5combo_17_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self);
+ __pyx_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -7009,7 +8924,7 @@ static PyObject *__pyx_fuse_4__pyx_pw_5combo_13_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -7019,32 +8934,32 @@ static PyObject *__pyx_fuse_4__pyx_pw_5combo_13_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_int(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_long(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_12_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_16_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
- signed int __pyx_v_value;
- signed int __pyx_v_minimum;
- signed int __pyx_v_maximum;
+static PyObject *__pyx_pf_4silx_4math_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ long __pyx_v_value;
+ long __pyx_v_minimum;
+ long __pyx_v_maximum;
unsigned int __pyx_v_length;
unsigned int __pyx_v_index;
unsigned int __pyx_v_min_index;
@@ -7056,13 +8971,13 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -7070,14 +8985,12 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_4_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_5_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -7086,7 +8999,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -7095,7 +9008,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -7104,7 +9017,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -7113,20 +9026,20 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_signed_int, (int (*)(char *, PyObject *)) __pyx_memview_set_signed_int, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -7136,21 +9049,29 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -7164,17 +9085,17 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((signed int *) ( /* dim=0 */ ((char *) (((signed int *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -7183,7 +9104,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -7192,25 +9113,25 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -7218,22 +9139,30 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -7243,28 +9172,28 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((signed int *) ( /* dim=0 */ ((char *) (((signed int *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -7274,7 +9203,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -7283,7 +9212,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -7291,10 +9220,18 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -7304,7 +9241,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -7313,7 +9250,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -7321,36 +9258,51 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((signed int *) ( /* dim=0 */ ((char *) (((signed int *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -7360,7 +9312,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -7369,7 +9321,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -7377,10 +9329,18 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -7390,7 +9350,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -7399,7 +9359,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -7407,11 +9367,18 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -7421,7 +9388,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -7430,7 +9397,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -7439,7 +9406,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -7447,32 +9414,40 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((signed int *) ( /* dim=0 */ ((char *) (((signed int *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -7482,7 +9457,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -7491,7 +9466,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -7499,21 +9474,29 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -7522,56 +9505,64 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -7579,7 +9570,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -7597,7 +9588,7 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -7605,12 +9596,12 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_signed__int(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -7618,36 +9609,36 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_signed__int(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -7655,79 +9646,108 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -7735,8 +9755,9 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -7745,30 +9766,27 @@ static PyObject *__pyx_pf_5combo_12_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_74__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -7778,7 +9796,7 @@ static PyObject *__pyx_pf_5combo_56__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -7787,21 +9805,18 @@ static PyObject *__pyx_pf_5combo_56__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_5__pyx_pw_5combo_15_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_5__pyx_mdef_5combo_15_min_max = {"__pyx_fuse_5_min_max", (PyCFunction)__pyx_fuse_5__pyx_pw_5combo_15_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_5__pyx_pw_5combo_15_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_6__pyx_pw_4silx_4math_5combo_19_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_6__pyx_mdef_4silx_4math_5combo_19_min_max = {"__pyx_fuse_6_min_max", (PyCFunction)__pyx_fuse_6__pyx_pw_4silx_4math_5combo_19_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_6__pyx_pw_4silx_4math_5combo_19_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self);
+ __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -7823,7 +9838,7 @@ static PyObject *__pyx_fuse_5__pyx_pw_5combo_15_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -7833,50 +9848,50 @@ static PyObject *__pyx_fuse_5__pyx_pw_5combo_15_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_signed_long(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_14_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_18_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
- signed long __pyx_v_value;
- signed long __pyx_v_minimum;
- signed long __pyx_v_maximum;
+static PyObject *__pyx_pf_4silx_4math_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ PY_LONG_LONG __pyx_v_value;
+ PY_LONG_LONG __pyx_v_minimum;
+ PY_LONG_LONG __pyx_v_maximum;
unsigned int __pyx_v_length;
unsigned int __pyx_v_index;
unsigned int __pyx_v_min_index;
unsigned int __pyx_v_min_pos_index;
unsigned int __pyx_v_max_index;
- long __pyx_v_min_pos;
+ PY_LONG_LONG __pyx_v_min_pos;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -7884,14 +9899,12 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_5_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_6_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -7900,7 +9913,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -7909,7 +9922,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -7918,7 +9931,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -7927,20 +9940,20 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_signed_long, (int (*)(char *, PyObject *)) __pyx_memview_set_signed_long, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -7950,21 +9963,29 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -7978,17 +9999,17 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((signed long *) ( /* dim=0 */ ((char *) (((signed long *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -7997,7 +10018,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -8006,25 +10027,25 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -8032,22 +10053,30 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -8057,28 +10086,28 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((signed long *) ( /* dim=0 */ ((char *) (((signed long *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -8088,7 +10117,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -8097,7 +10126,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -8105,10 +10134,18 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -8118,7 +10155,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -8127,7 +10164,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -8135,36 +10172,51 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((signed long *) ( /* dim=0 */ ((char *) (((signed long *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -8174,7 +10226,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -8183,7 +10235,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -8191,10 +10243,18 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -8204,7 +10264,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -8213,7 +10273,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -8221,11 +10281,18 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -8235,7 +10302,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -8244,7 +10311,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -8253,7 +10320,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -8261,32 +10328,40 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((signed long *) ( /* dim=0 */ ((char *) (((signed long *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -8296,7 +10371,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -8305,7 +10380,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -8313,21 +10388,29 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -8336,56 +10419,64 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -8393,7 +10484,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -8411,7 +10502,7 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -8419,12 +10510,12 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_signed__long(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -8432,36 +10523,36 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_signed__long(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -8469,79 +10560,108 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -8549,8 +10669,9 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -8559,30 +10680,27 @@ static PyObject *__pyx_pf_5combo_14_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_76__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -8592,7 +10710,7 @@ static PyObject *__pyx_pf_5combo_58__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -8601,21 +10719,18 @@ static PyObject *__pyx_pf_5combo_58__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_6__pyx_pw_5combo_17_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_6__pyx_mdef_5combo_17_min_max = {"__pyx_fuse_6_min_max", (PyCFunction)__pyx_fuse_6__pyx_pw_5combo_17_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_6__pyx_pw_5combo_17_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_7__pyx_pw_4silx_4math_5combo_21_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_7__pyx_mdef_4silx_4math_5combo_21_min_max = {"__pyx_fuse_7_min_max", (PyCFunction)__pyx_fuse_7__pyx_pw_4silx_4math_5combo_21_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_7__pyx_pw_4silx_4math_5combo_21_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults16 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self);
+ __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -8637,7 +10752,7 @@ static PyObject *__pyx_fuse_6__pyx_pw_5combo_17_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -8647,29 +10762,29 @@ static PyObject *__pyx_fuse_6__pyx_pw_5combo_17_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_16_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_20_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
unsigned char __pyx_v_value;
unsigned char __pyx_v_minimum;
unsigned char __pyx_v_maximum;
@@ -8684,13 +10799,13 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -8698,14 +10813,12 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_6_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_7_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -8714,7 +10827,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -8723,7 +10836,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -8732,7 +10845,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -8741,20 +10854,20 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_char, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_char, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -8764,21 +10877,29 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -8792,17 +10913,17 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -8811,7 +10932,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -8820,25 +10941,25 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -8846,22 +10967,30 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -8871,28 +11000,28 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -8902,7 +11031,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -8911,7 +11040,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -8919,10 +11048,18 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -8932,7 +11069,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -8941,7 +11078,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -8949,36 +11086,51 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -8988,7 +11140,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -8997,7 +11149,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -9005,10 +11157,18 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -9018,7 +11178,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -9027,7 +11187,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -9035,11 +11195,18 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -9049,7 +11216,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -9058,7 +11225,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -9067,7 +11234,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -9075,32 +11242,40 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned char *) ( /* dim=0 */ ((char *) (((unsigned char *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -9110,7 +11285,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -9119,7 +11294,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -9127,21 +11302,29 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -9150,56 +11333,64 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -9207,7 +11398,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -9225,7 +11416,7 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -9233,12 +11424,12 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_unsigned_char(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_unsigned_char(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -9246,36 +11437,36 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_unsigned_char(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_char(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -9283,79 +11474,108 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -9363,8 +11583,9 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -9373,30 +11594,27 @@ static PyObject *__pyx_pf_5combo_16_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_78__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -9406,7 +11624,7 @@ static PyObject *__pyx_pf_5combo_60__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -9415,21 +11633,18 @@ static PyObject *__pyx_pf_5combo_60__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_7__pyx_pw_5combo_19_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_7__pyx_mdef_5combo_19_min_max = {"__pyx_fuse_7_min_max", (PyCFunction)__pyx_fuse_7__pyx_pw_5combo_19_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_7__pyx_pw_5combo_19_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_8__pyx_pw_4silx_4math_5combo_23_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_8__pyx_mdef_4silx_4math_5combo_23_min_max = {"__pyx_fuse_8_min_max", (PyCFunction)__pyx_fuse_8__pyx_pw_4silx_4math_5combo_23_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_8__pyx_pw_4silx_4math_5combo_23_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self);
+ __pyx_defaults20 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -9451,7 +11666,7 @@ static PyObject *__pyx_fuse_7__pyx_pw_5combo_19_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9461,29 +11676,29 @@ static PyObject *__pyx_fuse_7__pyx_pw_5combo_19_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_18_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_22_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
unsigned short __pyx_v_value;
unsigned short __pyx_v_minimum;
unsigned short __pyx_v_maximum;
@@ -9498,13 +11713,13 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -9512,14 +11727,12 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_7_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_8_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -9528,7 +11741,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -9537,7 +11750,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -9546,7 +11759,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -9555,20 +11768,20 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_short, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_short, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_short, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_short, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -9578,21 +11791,29 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -9606,17 +11827,17 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -9625,7 +11846,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -9634,25 +11855,25 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -9660,22 +11881,30 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -9685,28 +11914,28 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -9716,7 +11945,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -9725,7 +11954,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -9733,10 +11962,18 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -9746,7 +11983,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -9755,7 +11992,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -9763,36 +12000,51 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -9802,7 +12054,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -9811,7 +12063,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -9819,10 +12071,18 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -9832,7 +12092,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -9841,7 +12101,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -9849,11 +12109,18 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -9863,7 +12130,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -9872,7 +12139,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -9881,7 +12148,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -9889,32 +12156,40 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned short *) ( /* dim=0 */ ((char *) (((unsigned short *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -9924,7 +12199,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -9933,7 +12208,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -9941,21 +12216,29 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -9964,56 +12247,64 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -10021,7 +12312,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -10039,7 +12330,7 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -10047,12 +12338,12 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_unsigned_short(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_unsigned_short(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -10060,36 +12351,36 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_unsigned_short(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_short(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -10097,79 +12388,108 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -10177,8 +12497,9 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -10187,30 +12508,27 @@ static PyObject *__pyx_pf_5combo_18_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_80__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -10220,7 +12538,7 @@ static PyObject *__pyx_pf_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -10229,21 +12547,18 @@ static PyObject *__pyx_pf_5combo_62__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_8__pyx_pw_5combo_21_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_8__pyx_mdef_5combo_21_min_max = {"__pyx_fuse_8_min_max", (PyCFunction)__pyx_fuse_8__pyx_pw_5combo_21_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_8__pyx_pw_5combo_21_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_9__pyx_pw_4silx_4math_5combo_25_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_9__pyx_mdef_4silx_4math_5combo_25_min_max = {"__pyx_fuse_9_min_max", (PyCFunction)__pyx_fuse_9__pyx_pw_4silx_4math_5combo_25_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_9__pyx_pw_4silx_4math_5combo_25_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self);
+ __pyx_defaults21 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -10265,7 +12580,7 @@ static PyObject *__pyx_fuse_8__pyx_pw_5combo_21_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -10275,29 +12590,29 @@ static PyObject *__pyx_fuse_8__pyx_pw_5combo_21_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_20_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_24_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_24_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
unsigned int __pyx_v_value;
unsigned int __pyx_v_minimum;
unsigned int __pyx_v_maximum;
@@ -10312,13 +12627,13 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -10326,14 +12641,12 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_8_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_9_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -10342,7 +12655,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -10351,7 +12664,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -10360,7 +12673,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -10369,20 +12682,20 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_int, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_int, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_int, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_int, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -10392,21 +12705,29 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -10420,17 +12741,17 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -10439,7 +12760,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -10448,25 +12769,25 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -10474,22 +12795,30 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -10499,28 +12828,28 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -10530,7 +12859,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -10539,7 +12868,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -10547,10 +12876,18 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -10560,7 +12897,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -10569,7 +12906,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -10577,36 +12914,51 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -10616,7 +12968,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -10625,7 +12977,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -10633,10 +12985,18 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -10646,7 +13006,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -10655,7 +13015,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -10663,11 +13023,18 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -10677,7 +13044,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -10686,7 +13053,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -10695,7 +13062,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -10703,32 +13070,40 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned int *) ( /* dim=0 */ ((char *) (((unsigned int *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -10738,7 +13113,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -10747,7 +13122,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -10755,21 +13130,29 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -10778,56 +13161,64 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -10835,7 +13226,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -10853,7 +13244,7 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -10861,12 +13252,12 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_unsigned_int(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_unsigned_int(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -10874,36 +13265,36 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_unsigned_int(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -10911,79 +13302,108 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -10991,8 +13411,9 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
- __Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -11001,30 +13422,941 @@ static PyObject *__pyx_pf_5combo_20_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+static PyObject *__pyx_pf_4silx_4math_5combo_82__defaults__(CYTHON_UNUSED PyObject *__pyx_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("__defaults__", 0);
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_fuse_10__pyx_pw_4silx_4math_5combo_27_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_10__pyx_mdef_4silx_4math_5combo_27_min_max = {"__pyx_fuse_10_min_max", (PyCFunction)__pyx_fuse_10__pyx_pw_4silx_4math_5combo_27_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_10__pyx_pw_4silx_4math_5combo_27_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_min_positive;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
+ PyObject* values[2] = {0,0};
+ __pyx_defaults22 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self);
+ 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_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_positive_2);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __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_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_long(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
+ if (values[1]) {
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
+ } else {
+ __pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_5combo_26_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_5combo_26_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ unsigned long __pyx_v_value;
+ unsigned long __pyx_v_minimum;
+ unsigned long __pyx_v_maximum;
+ unsigned int __pyx_v_length;
+ unsigned int __pyx_v_index;
+ unsigned int __pyx_v_min_index;
+ unsigned int __pyx_v_min_pos_index;
+ unsigned int __pyx_v_max_index;
+ unsigned long __pyx_v_min_pos;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
+ unsigned int __pyx_t_6;
+ unsigned int __pyx_t_7;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_10_min_max", 0);
+
+ /* "silx/math/combo.pyx":127
+ * _number value, minimum, minpos, maximum
+ * unsigned int length
+ * unsigned int index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ */
+ __pyx_v_index = 0;
+
+ /* "silx/math/combo.pyx":128
+ * unsigned int length
+ * unsigned int index = 0
+ * unsigned int min_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0
+ */
+ __pyx_v_min_index = 0;
+
+ /* "silx/math/combo.pyx":129
+ * unsigned int index = 0
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int max_index = 0
+ *
+ */
+ __pyx_v_min_pos_index = 0;
+
+ /* "silx/math/combo.pyx":130
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0 # <<<<<<<<<<<<<<
+ *
+ * length = len(data)
+ */
+ __pyx_v_max_index = 0;
+
+ /* "silx/math/combo.pyx":132
+ * unsigned int max_index = 0
+ *
+ * length = len(data) # <<<<<<<<<<<<<<
+ *
+ * if length == 0:
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_long, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_long, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_length = __pyx_t_2;
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_length == 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":135
+ *
+ * if length == 0:
+ * raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ }
+
+ /* "silx/math/combo.pyx":137
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # Init starting values
+ * value = data[0]
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "silx/math/combo.pyx":139
+ * with nogil:
+ * # Init starting values
+ * value = data[0] # <<<<<<<<<<<<<<
+ * minimum = value
+ * maximum = value
+ */
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((unsigned long *) ( /* dim=0 */ ((char *) (((unsigned long *) __pyx_v_data.data) + __pyx_t_4)) )));
+
+ /* "silx/math/combo.pyx":140
+ * # Init starting values
+ * value = data[0]
+ * minimum = value # <<<<<<<<<<<<<<
+ * maximum = value
+ * if min_positive and value > 0:
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":141
+ * value = data[0]
+ * minimum = value
+ * maximum = value # <<<<<<<<<<<<<<
+ * if min_positive and value > 0:
+ * min_pos = value
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_L8_bool_binop_done:;
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":143
+ * maximum = value
+ * if min_positive and value > 0:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * else:
+ * min_pos = 0
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
+ goto __pyx_L7;
+ }
+
+ /* "silx/math/combo.pyx":145
+ * min_pos = value
+ * else:
+ * min_pos = 0 # <<<<<<<<<<<<<<
+ *
+ * if _number in cython.floating:
+ */
+ /*else*/ {
+ __pyx_v_min_pos = 0;
+ }
+ __pyx_L7:;
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
+ __pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":159
+ *
+ * if not min_positive:
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":160
+ * if not min_positive:
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned long *) ( /* dim=0 */ ((char *) (((unsigned long *) __pyx_v_data.data) + __pyx_t_8)) )));
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":162
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * elif value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":163
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * elif value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L13;
+ }
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":165
+ * max_index = index
+ * elif value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":166
+ * elif value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+ __pyx_L13:;
+ }
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
+ goto __pyx_L10;
+ }
+
+ /* "silx/math/combo.pyx":170
+ * else:
+ * # Loop until min_pos is defined
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":171
+ * # Loop until min_pos is defined
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned long *) ( /* dim=0 */ ((char *) (((unsigned long *) __pyx_v_data.data) + __pyx_t_9)) )));
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":173
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * elif value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":174
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * elif value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L16;
+ }
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":176
+ * max_index = index
+ * elif value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":177
+ * elif value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if value > 0:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+ __pyx_L16:;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":180
+ *
+ * if value > 0:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ * break
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":181
+ * if value > 0:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":182
+ * min_pos = value
+ * min_pos_index = index
+ * break # <<<<<<<<<<<<<<
+ *
+ * # Loop until the end
+ */
+ goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+ }
+ __pyx_L15_break:;
+
+ /* "silx/math/combo.pyx":185
+ *
+ * # Loop until the end
+ * for index in range(index+1, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
+
+ /* "silx/math/combo.pyx":186
+ * # Loop until the end
+ * for index in range(index+1, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned long *) ( /* dim=0 */ ((char *) (((unsigned long *) __pyx_v_data.data) + __pyx_t_10)) )));
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":188
+ * value = data[index]
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * else:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":189
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * else:
+ * if value < minimum:
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ goto __pyx_L20;
+ }
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ /*else*/ {
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":192
+ * else:
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":193
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if 0 < value < min_pos:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = (0 < __pyx_v_value);
+ if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
+
+ /* "silx/math/combo.pyx":196
+ *
+ * if 0 < value < min_pos:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ *
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ *
+ * return _MinMaxResult(minimum,
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+ }
+ __pyx_L20:;
+ }
+ }
+ __pyx_L10:;
+ }
+
+ /* "silx/math/combo.pyx":137
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * # Init starting values
+ * value = data[0]
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "silx/math/combo.pyx":199
+ * min_pos_index = index
+ *
+ * return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
+ * min_pos if min_pos > 0 else None,
+ * maximum,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_unsigned_long(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+
+ /* "silx/math/combo.pyx":200
+ *
+ * return _MinMaxResult(minimum,
+ * min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
+ * maximum,
+ * min_index,
+ */
+ if (((__pyx_v_min_pos > 0) != 0)) {
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_long(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_13 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":201
+ * return _MinMaxResult(minimum,
+ * min_pos if min_pos > 0 else None,
+ * maximum, # <<<<<<<<<<<<<<
+ * min_index,
+ * min_pos_index if min_pos > 0 else None,
+ */
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_long(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+
+ /* "silx/math/combo.pyx":202
+ * min_pos if min_pos > 0 else None,
+ * maximum,
+ * min_index, # <<<<<<<<<<<<<<
+ * min_pos_index if min_pos > 0 else None,
+ * max_index)
+ */
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+
+ /* "silx/math/combo.pyx":203
+ * maximum,
+ * min_index,
+ * min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
+ * max_index)
+ *
+ */
+ if (((__pyx_v_min_pos > 0) != 0)) {
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_16 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":204
+ * min_index,
+ * min_pos_index if min_pos > 0 else None,
+ * max_index) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":119
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation including infinite values
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __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_pf_4silx_4math_5combo_84__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__defaults__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_INCREF(Py_None);
__Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
__pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
@@ -11034,7 +14366,7 @@ static PyObject *__pyx_pf_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_se
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -11043,21 +14375,18 @@ static PyObject *__pyx_pf_5combo_64__defaults__(CYTHON_UNUSED PyObject *__pyx_se
}
/* Python wrapper */
-static PyObject *__pyx_fuse_9__pyx_pw_5combo_23_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_fuse_9__pyx_mdef_5combo_23_min_max = {"__pyx_fuse_9_min_max", (PyCFunction)__pyx_fuse_9__pyx_pw_5combo_23_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo__min_max};
-static PyObject *__pyx_fuse_9__pyx_pw_5combo_23_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_fuse_11__pyx_pw_4silx_4math_5combo_29_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_11__pyx_mdef_4silx_4math_5combo_29_min_max = {"__pyx_fuse_11_min_max", (PyCFunction)__pyx_fuse_11__pyx_pw_4silx_4math_5combo_29_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo__min_max};
+static PyObject *__pyx_fuse_11__pyx_pw_4silx_4math_5combo_29_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_min_max (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
PyObject* values[2] = {0,0};
- __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self);
+ __pyx_defaults23 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self);
if (unlikely(__pyx_kwds)) {
Py_ssize_t kw_args;
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
@@ -11079,7 +14408,7 @@ static PyObject *__pyx_fuse_9__pyx_pw_5combo_23_min_max(PyObject *__pyx_self, Py
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_min_max") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11089,29 +14418,29 @@ static PyObject *__pyx_fuse_9__pyx_pw_5combo_23_min_max(PyObject *__pyx_self, Py
default: goto __pyx_L5_argtuple_error;
}
}
- __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(values[0]); if (unlikely(!__pyx_v_data.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_data = __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 119, __pyx_L3_error)
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L3_error)
} else {
__pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5combo_22_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_28_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_28_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
unsigned PY_LONG_LONG __pyx_v_value;
unsigned PY_LONG_LONG __pyx_v_minimum;
unsigned PY_LONG_LONG __pyx_v_maximum;
@@ -11126,13 +14455,13 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_1 = NULL;
Py_ssize_t __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
- unsigned int __pyx_t_5;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
unsigned int __pyx_t_6;
unsigned int __pyx_t_7;
- unsigned int __pyx_t_8;
- unsigned int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
+ size_t __pyx_t_8;
+ size_t __pyx_t_9;
+ size_t __pyx_t_10;
PyObject *__pyx_t_11 = NULL;
PyObject *__pyx_t_12 = NULL;
PyObject *__pyx_t_13 = NULL;
@@ -11140,14 +14469,12 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
PyObject *__pyx_t_15 = NULL;
PyObject *__pyx_t_16 = NULL;
PyObject *__pyx_t_17 = NULL;
- Py_ssize_t __pyx_t_18;
- PyObject *__pyx_t_19 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_fuse_9_min_max", 0);
+ PyObject *__pyx_t_18 = NULL;
+ int __pyx_t_19;
+ PyObject *__pyx_t_20 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_11_min_max", 0);
- /* "combo.pyx":115
+ /* "silx/math/combo.pyx":127
* _number value, minimum, minpos, maximum
* unsigned int length
* unsigned int index = 0 # <<<<<<<<<<<<<<
@@ -11156,7 +14483,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_index = 0;
- /* "combo.pyx":116
+ /* "silx/math/combo.pyx":128
* unsigned int length
* unsigned int index = 0
* unsigned int min_index = 0 # <<<<<<<<<<<<<<
@@ -11165,7 +14492,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_index = 0;
- /* "combo.pyx":117
+ /* "silx/math/combo.pyx":129
* unsigned int index = 0
* unsigned int min_index = 0
* unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
@@ -11174,7 +14501,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = 0;
- /* "combo.pyx":118
+ /* "silx/math/combo.pyx":130
* unsigned int min_index = 0
* unsigned int min_pos_index = 0
* unsigned int max_index = 0 # <<<<<<<<<<<<<<
@@ -11183,20 +14510,20 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_max_index = 0;
- /* "combo.pyx":120
+ /* "silx/math/combo.pyx":132
* unsigned int max_index = 0
*
* length = len(data) # <<<<<<<<<<<<<<
*
* if length == 0:
*/
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_unsigned_PY_LONG_LONG, (int (*)(char *, PyObject *)) __pyx_memview_set_unsigned_PY_LONG_LONG, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 132, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_length = __pyx_t_2;
- /* "combo.pyx":122
+ /* "silx/math/combo.pyx":134
* length = len(data)
*
* if length == 0: # <<<<<<<<<<<<<<
@@ -11206,21 +14533,29 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_length == 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 135, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":134
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -11234,17 +14569,17 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
#endif
/*try:*/ {
- /* "combo.pyx":127
+ /* "silx/math/combo.pyx":139
* with nogil:
* # Init starting values
* value = data[0] # <<<<<<<<<<<<<<
* minimum = value
* maximum = value
*/
- __pyx_t_2 = 0;
- __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_2)) )));
+ __pyx_t_4 = 0;
+ __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_4)) )));
- /* "combo.pyx":128
+ /* "silx/math/combo.pyx":140
* # Init starting values
* value = data[0]
* minimum = value # <<<<<<<<<<<<<<
@@ -11253,7 +14588,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":129
+ /* "silx/math/combo.pyx":141
* value = data[0]
* minimum = value
* maximum = value # <<<<<<<<<<<<<<
@@ -11262,25 +14597,25 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":130
+ /* "silx/math/combo.pyx":142
* minimum = value
* maximum = value
* if min_positive and value > 0: # <<<<<<<<<<<<<<
* min_pos = value
* else:
*/
- __pyx_t_4 = (__pyx_v_min_positive != 0);
- if (__pyx_t_4) {
+ __pyx_t_5 = (__pyx_v_min_positive != 0);
+ if (__pyx_t_5) {
} else {
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_3 = __pyx_t_5;
goto __pyx_L8_bool_binop_done;
}
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- __pyx_t_3 = __pyx_t_4;
+ __pyx_t_5 = ((__pyx_v_value > 0) != 0);
+ __pyx_t_3 = __pyx_t_5;
__pyx_L8_bool_binop_done:;
if (__pyx_t_3) {
- /* "combo.pyx":131
+ /* "silx/math/combo.pyx":143
* maximum = value
* if min_positive and value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -11288,22 +14623,30 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_pos = 0
*/
__pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":142
+ * minimum = value
+ * maximum = value
+ * if min_positive and value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "combo.pyx":133
+ /* "silx/math/combo.pyx":145
* min_pos = value
* else:
* min_pos = 0 # <<<<<<<<<<<<<<
*
* if _number in cython.floating:
*/
+ /*else*/ {
__pyx_v_min_pos = 0;
}
__pyx_L7:;
- /* "combo.pyx":146
+ /* "silx/math/combo.pyx":158
* break
*
* if not min_positive: # <<<<<<<<<<<<<<
@@ -11313,28 +14656,28 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":147
+ /* "silx/math/combo.pyx":159
*
* if not min_positive:
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":148
+ /* "silx/math/combo.pyx":160
* if not min_positive:
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_7 = __pyx_v_index;
- __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_7)) )));
+ __pyx_t_8 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_8)) )));
- /* "combo.pyx":149
+ /* "silx/math/combo.pyx":161
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -11344,7 +14687,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":150
+ /* "silx/math/combo.pyx":162
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -11353,7 +14696,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":151
+ /* "silx/math/combo.pyx":163
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -11361,10 +14704,18 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":161
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L13;
}
- /* "combo.pyx":152
+ /* "silx/math/combo.pyx":164
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -11374,7 +14725,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":153
+ /* "silx/math/combo.pyx":165
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -11383,7 +14734,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":154
+ /* "silx/math/combo.pyx":166
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -11391,36 +14742,51 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* else:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L13;
+
+ /* "silx/math/combo.pyx":164
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L13:;
}
+
+ /* "silx/math/combo.pyx":158
+ * break
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(index, length):
+ * value = data[index]
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "combo.pyx":158
+ /* "silx/math/combo.pyx":170
* else:
* # Loop until min_pos is defined
* for index in range(index, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = __pyx_v_index; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ /*else*/ {
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = __pyx_v_index; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":159
+ /* "silx/math/combo.pyx":171
* # Loop until min_pos is defined
* for index in range(index, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_8 = __pyx_v_index;
- __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_8)) )));
+ __pyx_t_9 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_9)) )));
- /* "combo.pyx":160
+ /* "silx/math/combo.pyx":172
* for index in range(index, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -11430,7 +14796,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":161
+ /* "silx/math/combo.pyx":173
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -11439,7 +14805,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":162
+ /* "silx/math/combo.pyx":174
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -11447,10 +14813,18 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* minimum = value
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":172
+ * for index in range(index, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L16;
}
- /* "combo.pyx":163
+ /* "silx/math/combo.pyx":175
* maximum = value
* max_index = index
* elif value < minimum: # <<<<<<<<<<<<<<
@@ -11460,7 +14834,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":164
+ /* "silx/math/combo.pyx":176
* max_index = index
* elif value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -11469,7 +14843,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":165
+ /* "silx/math/combo.pyx":177
* elif value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
@@ -11477,11 +14851,18 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value > 0:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L16;
+
+ /* "silx/math/combo.pyx":175
+ * maximum = value
+ * max_index = index
+ * elif value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
__pyx_L16:;
- /* "combo.pyx":167
+ /* "silx/math/combo.pyx":179
* min_index = index
*
* if value > 0: # <<<<<<<<<<<<<<
@@ -11491,7 +14872,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > 0) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":168
+ /* "silx/math/combo.pyx":180
*
* if value > 0:
* min_pos = value # <<<<<<<<<<<<<<
@@ -11500,7 +14881,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":169
+ /* "silx/math/combo.pyx":181
* if value > 0:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
@@ -11509,7 +14890,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- /* "combo.pyx":170
+ /* "silx/math/combo.pyx":182
* min_pos = value
* min_pos_index = index
* break # <<<<<<<<<<<<<<
@@ -11517,32 +14898,40 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* # Loop until the end
*/
goto __pyx_L15_break;
+
+ /* "silx/math/combo.pyx":179
+ * min_index = index
+ *
+ * if value > 0: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
}
__pyx_L15_break:;
- /* "combo.pyx":173
+ /* "silx/math/combo.pyx":185
*
* # Loop until the end
* for index in range(index+1, length): # <<<<<<<<<<<<<<
* value = data[index]
* if value > maximum:
*/
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_t_6 = (__pyx_v_index + 1); __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_index = __pyx_t_6;
+ __pyx_t_6 = __pyx_v_length;
+ for (__pyx_t_7 = (__pyx_v_index + 1); __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
+ __pyx_v_index = __pyx_t_7;
- /* "combo.pyx":174
+ /* "silx/math/combo.pyx":186
* # Loop until the end
* for index in range(index+1, length):
* value = data[index] # <<<<<<<<<<<<<<
* if value > maximum:
* maximum = value
*/
- __pyx_t_9 = __pyx_v_index;
- __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_9)) )));
+ __pyx_t_10 = __pyx_v_index;
+ __pyx_v_value = (*((unsigned PY_LONG_LONG *) ( /* dim=0 */ ((char *) (((unsigned PY_LONG_LONG *) __pyx_v_data.data) + __pyx_t_10)) )));
- /* "combo.pyx":175
+ /* "silx/math/combo.pyx":187
* for index in range(index+1, length):
* value = data[index]
* if value > maximum: # <<<<<<<<<<<<<<
@@ -11552,7 +14941,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":176
+ /* "silx/math/combo.pyx":188
* value = data[index]
* if value > maximum:
* maximum = value # <<<<<<<<<<<<<<
@@ -11561,7 +14950,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_maximum = __pyx_v_value;
- /* "combo.pyx":177
+ /* "silx/math/combo.pyx":189
* if value > maximum:
* maximum = value
* max_index = index # <<<<<<<<<<<<<<
@@ -11569,21 +14958,29 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* if value < minimum:
*/
__pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":187
+ * for index in range(index+1, length):
+ * value = data[index]
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
goto __pyx_L20;
}
- /*else*/ {
- /* "combo.pyx":179
+ /* "silx/math/combo.pyx":191
* max_index = index
* else:
* if value < minimum: # <<<<<<<<<<<<<<
* minimum = value
* min_index = index
*/
+ /*else*/ {
__pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
if (__pyx_t_3) {
- /* "combo.pyx":180
+ /* "silx/math/combo.pyx":192
* else:
* if value < minimum:
* minimum = value # <<<<<<<<<<<<<<
@@ -11592,56 +14989,64 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_minimum = __pyx_v_value;
- /* "combo.pyx":181
+ /* "silx/math/combo.pyx":193
* if value < minimum:
* minimum = value
* min_index = index # <<<<<<<<<<<<<<
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
*/
__pyx_v_min_index = __pyx_v_index;
- goto __pyx_L21;
+
+ /* "silx/math/combo.pyx":191
+ * max_index = index
+ * else:
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
}
- __pyx_L21:;
- /* "combo.pyx":183
+ /* "silx/math/combo.pyx":195
* min_index = index
*
- * if value > 0 and value < min_pos: # <<<<<<<<<<<<<<
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
* min_pos = value
* min_pos_index = index
*/
- __pyx_t_4 = ((__pyx_v_value > 0) != 0);
- if (__pyx_t_4) {
- } else {
- __pyx_t_3 = __pyx_t_4;
- goto __pyx_L23_bool_binop_done;
- }
- __pyx_t_4 = ((__pyx_v_value < __pyx_v_min_pos) != 0);
- __pyx_t_3 = __pyx_t_4;
- __pyx_L23_bool_binop_done:;
+ __pyx_t_3 = (0 < __pyx_v_value);
if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (__pyx_t_5) {
- /* "combo.pyx":184
+ /* "silx/math/combo.pyx":196
*
- * if value > 0 and value < min_pos:
+ * if 0 < value < min_pos:
* min_pos = value # <<<<<<<<<<<<<<
* min_pos_index = index
*
*/
__pyx_v_min_pos = __pyx_v_value;
- /* "combo.pyx":185
- * if value > 0 and value < min_pos:
+ /* "silx/math/combo.pyx":197
+ * if 0 < value < min_pos:
* min_pos = value
* min_pos_index = index # <<<<<<<<<<<<<<
*
* return _MinMaxResult(minimum,
*/
__pyx_v_min_pos_index = __pyx_v_index;
- goto __pyx_L22;
+
+ /* "silx/math/combo.pyx":195
+ * min_index = index
+ *
+ * if 0 < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
}
- __pyx_L22:;
}
__pyx_L20:;
}
@@ -11649,7 +15054,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_L10:;
}
- /* "combo.pyx":125
+ /* "silx/math/combo.pyx":137
* raise ValueError('Zero-size array')
*
* with nogil: # <<<<<<<<<<<<<<
@@ -11667,7 +15072,7 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
}
}
- /* "combo.pyx":187
+ /* "silx/math/combo.pyx":199
* min_pos_index = index
*
* return _MinMaxResult(minimum, # <<<<<<<<<<<<<<
@@ -11675,12 +15080,12 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* maximum,
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_minimum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
- /* "combo.pyx":188
+ /* "silx/math/combo.pyx":200
*
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -11688,36 +15093,36 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
* min_index,
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_13 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_min_pos); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- __pyx_t_12 = __pyx_t_13;
- __pyx_t_13 = 0;
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_min_pos); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_12 = Py_None;
+ __pyx_t_13 = Py_None;
}
- /* "combo.pyx":189
+ /* "silx/math/combo.pyx":201
* return _MinMaxResult(minimum,
* min_pos if min_pos > 0 else None,
* maximum, # <<<<<<<<<<<<<<
* min_index,
* min_pos_index if min_pos > 0 else None,
*/
- __pyx_t_13 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_maximum); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
- /* "combo.pyx":190
+ /* "silx/math/combo.pyx":202
* min_pos if min_pos > 0 else None,
* maximum,
* min_index, # <<<<<<<<<<<<<<
* min_pos_index if min_pos > 0 else None,
* max_index)
*/
- __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
- /* "combo.pyx":191
+ /* "silx/math/combo.pyx":203
* maximum,
* min_index,
* min_pos_index if min_pos > 0 else None, # <<<<<<<<<<<<<<
@@ -11725,79 +15130,108 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
if (((__pyx_v_min_pos > 0) != 0)) {
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_15 = __pyx_t_16;
- __pyx_t_16 = 0;
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_16 = __pyx_t_17;
+ __pyx_t_17 = 0;
} else {
__Pyx_INCREF(Py_None);
- __pyx_t_15 = Py_None;
+ __pyx_t_16 = Py_None;
}
- /* "combo.pyx":192
+ /* "silx/math/combo.pyx":204
* min_index,
* min_pos_index if min_pos > 0 else None,
* max_index) # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- __pyx_t_17 = NULL;
- __pyx_t_18 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
- __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_10);
- if (likely(__pyx_t_17)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_17);
+ __pyx_t_17 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = NULL;
+ __pyx_t_19 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
+ __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_11);
+ if (likely(__pyx_t_18)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_18);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_10, function);
- __pyx_t_18 = 1;
- }
- }
- __pyx_t_19 = PyTuple_New(6+__pyx_t_18); if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_19);
- if (__pyx_t_17) {
- PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_17); __Pyx_GIVEREF(__pyx_t_17); __pyx_t_17 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_11);
- __Pyx_GIVEREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_12);
- __Pyx_GIVEREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_19, 2+__pyx_t_18, __pyx_t_13);
- __Pyx_GIVEREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_19, 3+__pyx_t_18, __pyx_t_14);
- __Pyx_GIVEREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_19, 4+__pyx_t_18, __pyx_t_15);
- __Pyx_GIVEREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_19, 5+__pyx_t_18, __pyx_t_16);
- __Pyx_GIVEREF(__pyx_t_16);
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- __pyx_t_13 = 0;
- __pyx_t_14 = 0;
- __pyx_t_15 = 0;
- __pyx_t_16 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_19, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF_SET(__pyx_t_11, function);
+ __pyx_t_19 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_11)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_18, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_11, __pyx_temp+1-__pyx_t_19, 6+__pyx_t_19); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_20 = PyTuple_New(6+__pyx_t_19); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ if (__pyx_t_18) {
+ __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_18); __pyx_t_18 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_19, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_19, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_20, 2+__pyx_t_19, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_20, 3+__pyx_t_19, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_20, 4+__pyx_t_19, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_20, 5+__pyx_t_19, __pyx_t_17);
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_10);
__Pyx_XDECREF(__pyx_t_11);
__Pyx_XDECREF(__pyx_t_12);
__Pyx_XDECREF(__pyx_t_13);
@@ -11805,8 +15239,1416 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_15);
__Pyx_XDECREF(__pyx_t_16);
__Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_AddTraceback("silx.math.combo._min_max", __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;
+}
+
+/* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4silx_4math_5combo_3_finite_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_5combo_2_finite_min_max[] = "_finite_min_max(signatures, args, kwargs, defaults)\n:func:`min_max` implementation for floats skipping infinite values\n\n See :func:`min_max` for documentation.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_3_finite_min_max = {"_finite_min_max", (PyCFunction)__pyx_pw_4silx_4math_5combo_3_finite_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_2_finite_min_max};
+static PyObject *__pyx_pw_4silx_4math_5combo_3_finite_min_max(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;
+ 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};
+ values[1] = __pyx_k__21;
+ 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 (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ 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_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_5combo_2_finite_min_max(__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_4silx_4math_5combo_2_finite_min_max(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;
+ PyTypeObject *__pyx_v_ndarray = 0;
+ PyObject *__pyx_v_numpy = NULL;
+ __Pyx_memviewslice __pyx_v_memslice;
+ Py_ssize_t __pyx_v_itemsize;
+ CYTHON_UNUSED int __pyx_v_dtype_signed;
+ char __pyx_v_kind;
+ 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;
+ long __pyx_t_11;
+ __Pyx_memviewslice __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ PyObject *(*__pyx_t_16)(PyObject *);
+ PyObject *__pyx_t_17 = NULL;
+ PyObject *__pyx_t_18 = NULL;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *(*__pyx_t_20)(PyObject *);
+ int __pyx_t_21;
+ __Pyx_RefNannySetupContext("_finite_min_max", 0);
+ __Pyx_INCREF(__pyx_v_kwargs);
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyList_SET_ITEM(__pyx_t_1, 0, 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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF_SET(__pyx_v_kwargs, __pyx_t_1);
+ __pyx_t_1 = 0;
+ }
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_6);
+ /*try:*/ {
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __pyx_L4_error)
+ __pyx_v_ndarray = ((PyTypeObject*)__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_PyThreadState_assign
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_7) {
+ __Pyx_AddTraceback("silx.math.combo.__pyx_fused_cpdef", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 210, __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, ((PyTypeObject*)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_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ goto __pyx_L1_error;
+ __pyx_L5_exception_handled:;
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ __pyx_L11_try_end:;
+ }
+ __pyx_v_itemsize = -1L;
+ if (unlikely(__pyx_v_args == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_data, ((PyObject*)__pyx_v_kwargs), Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_9 = __Pyx_PyDict_GetItem(((PyObject*)__pyx_v_kwargs), __pyx_n_s_data); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_10 = PyTuple_GET_SIZE(((PyObject*)__pyx_v_args)); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_L14:;
+ while (1) {
+ __pyx_t_2 = (__pyx_v_ndarray != ((PyTypeObject*)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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L18;
+ }
+ __pyx_t_2 = __pyx_memoryview_check(__pyx_v_arg);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_base); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_arg_base = __pyx_t_8;
+ __pyx_t_8 = 0;
+ __pyx_t_3 = __Pyx_TypeCheck(__pyx_v_arg_base, __pyx_v_ndarray);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg_base, __pyx_n_s_dtype); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_v_dtype = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L19;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L19:;
+ goto __pyx_L18;
+ }
+ /*else*/ {
+ __Pyx_INCREF(Py_None);
+ __pyx_v_dtype = Py_None;
+ }
+ __pyx_L18:;
+ __pyx_v_itemsize = -1L;
+ __pyx_t_2 = (__pyx_v_dtype != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_dtype, __pyx_n_s_itemsize); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __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_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_11 = __Pyx_PyObject_Ord(__pyx_t_8); if (unlikely(__pyx_t_11 == (long)(Py_UCS4)-1)) __PYX_ERR(0, 210, __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':
+ break;
+ case 'f':
+ __pyx_t_2 = (((sizeof(float)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L22_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L22_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_t_2 = (((sizeof(double)) == __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L25_bool_binop_done;
+ }
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_arg, __pyx_n_s_ndim); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = ((((Py_ssize_t)__pyx_t_10) == 1) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L25_bool_binop_done:;
+ if (__pyx_t_3) {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ break;
+ case 'c':
+ break;
+ case 'O':
+ break;
+ default: break;
+ }
+ }
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L28_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(float))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L28_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_float(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_float, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == -1L) != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L32_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_itemsize == (sizeof(double))) != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L32_bool_binop_done:;
+ if (__pyx_t_3) {
+ __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_v_arg);
+ __pyx_v_memslice = __pyx_t_12;
+ __pyx_t_3 = (__pyx_v_memslice.memview != 0);
+ if (__pyx_t_3) {
+ __PYX_XDEC_MEMVIEW((&__pyx_v_memslice), 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, __pyx_n_s_double, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ /*else*/ {
+ PyErr_Clear();
+ }
+ }
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_dest_sig, 0, Py_None, long, 1, __Pyx_PyInt_From_long, 1, 0, 0) < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ goto __pyx_L16_break;
+ }
+ __pyx_L16_break:;
+ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_9 = __Pyx_dict_iterator(((PyObject*)__pyx_v_signatures), 1, ((PyObject *)NULL), (&__pyx_t_13), (&__pyx_t_7)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __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_14 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_13, &__pyx_t_10, &__pyx_t_9, NULL, NULL, __pyx_t_7);
+ if (unlikely(__pyx_t_14 == 0)) break;
+ if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __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_ERR(0, 210, __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__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __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_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_dest_sig);
+ __Pyx_GIVEREF(__pyx_v_dest_sig);
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __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_ERR(0, 210, __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_15 = 0;
+ __pyx_t_16 = NULL;
+ } else {
+ __pyx_t_15 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_16 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 210, __pyx_L1_error)
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_16)) {
+ if (likely(PyList_CheckExact(__pyx_t_9))) {
+ if (__pyx_t_15 >= PyList_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ #endif
+ } else {
+ if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_15); __Pyx_INCREF(__pyx_t_1); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ #else
+ __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ #endif
+ }
+ } else {
+ __pyx_t_1 = __pyx_t_16(__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_ERR(0, 210, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_1);
+ }
+ if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
+ PyObject* sequence = __pyx_t_1;
+ #if !CYTHON_COMPILING_IN_PYPY
+ Py_ssize_t size = Py_SIZE(sequence);
+ #else
+ Py_ssize_t size = PySequence_Size(sequence);
+ #endif
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(0, 210, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_17 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_17 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_18 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_17);
+ __Pyx_INCREF(__pyx_t_18);
+ #else
+ __pyx_t_17 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __pyx_t_18 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ #endif
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_19);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_20 = Py_TYPE(__pyx_t_19)->tp_iternext;
+ index = 0; __pyx_t_17 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_17)) goto __pyx_L39_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_17);
+ index = 1; __pyx_t_18 = __pyx_t_20(__pyx_t_19); if (unlikely(!__pyx_t_18)) goto __pyx_L39_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_20(__pyx_t_19), 2) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_20 = NULL;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ goto __pyx_L40_unpacking_done;
+ __pyx_L39_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
+ __pyx_t_20 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_L40_unpacking_done:;
+ }
+ __Pyx_XDECREF_SET(__pyx_v_src_type, __pyx_t_17);
+ __pyx_t_17 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_dst_type, __pyx_t_18);
+ __pyx_t_18 = 0;
+ __pyx_t_3 = (__pyx_v_dst_type != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+ __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_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_2) {
+ __pyx_v_match_found = 1;
+ goto __pyx_L42;
+ }
+ /*else*/ {
+ __pyx_v_match_found = 0;
+ goto __pyx_L38_break;
+ }
+ __pyx_L42:;
+ }
+ }
+ __pyx_L38_break:;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = (__pyx_v_match_found != 0);
+ if (__pyx_t_2) {
+ __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_candidates, __pyx_v_sig); if (unlikely(__pyx_t_21 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ }
+ }
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_2 = (__pyx_v_candidates != Py_None) && (PyList_GET_SIZE(__pyx_v_candidates) != 0);
+ __pyx_t_3 = ((!__pyx_t_2) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(0, 210, __pyx_L1_error)
+ }
+ __pyx_t_13 = PyList_GET_SIZE(__pyx_v_candidates); if (unlikely(__pyx_t_13 == -1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_t_3 = ((__pyx_t_13 > 1) != 0);
+ if (__pyx_t_3) {
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(0, 210, __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_ERR(0, 210, __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)) __PYX_ERR(0, 210, __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_17);
+ __Pyx_XDECREF(__pyx_t_18);
__Pyx_XDECREF(__pyx_t_19);
- __Pyx_AddTraceback("combo._min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.__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_pf_4silx_4math_5combo_90__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__defaults__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_fuse_0__pyx_pw_4silx_4math_5combo_33_finite_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_0__pyx_mdef_4silx_4math_5combo_33_finite_min_max = {"__pyx_fuse_0_finite_min_max", (PyCFunction)__pyx_fuse_0__pyx_pw_4silx_4math_5combo_33_finite_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_2_finite_min_max};
+static PyObject *__pyx_fuse_0__pyx_pw_4silx_4math_5combo_33_finite_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_min_positive;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_finite_min_max (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
+ PyObject* values[2] = {0,0};
+ __pyx_defaults26 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_self);
+ 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_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_positive_2);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_finite_min_max") < 0)) __PYX_ERR(0, 210, __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_data = __Pyx_PyObject_to_MemoryviewSlice_dc_float(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 210, __pyx_L3_error)
+ if (values[1]) {
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error)
+ } else {
+ __pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_finite_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.combo._finite_min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_5combo_32_finite_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_5combo_32_finite_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ float __pyx_v_value;
+ float __pyx_v_minimum;
+ float __pyx_v_maximum;
+ unsigned int __pyx_v_length;
+ unsigned int __pyx_v_index;
+ unsigned int __pyx_v_min_index;
+ unsigned int __pyx_v_min_pos_index;
+ unsigned int __pyx_v_max_index;
+ double __pyx_v_min_pos;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ unsigned int __pyx_t_4;
+ unsigned int __pyx_t_5;
+ size_t __pyx_t_6;
+ size_t __pyx_t_7;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ PyObject *__pyx_t_18 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_0_finite_min_max", 0);
+
+ /* "silx/math/combo.pyx":218
+ * cython.floating value, minimum, minpos, maximum
+ * unsigned int length
+ * unsigned int index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ */
+ __pyx_v_index = 0;
+
+ /* "silx/math/combo.pyx":219
+ * unsigned int length
+ * unsigned int index = 0
+ * unsigned int min_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0
+ */
+ __pyx_v_min_index = 0;
+
+ /* "silx/math/combo.pyx":220
+ * unsigned int index = 0
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int max_index = 0
+ *
+ */
+ __pyx_v_min_pos_index = 0;
+
+ /* "silx/math/combo.pyx":221
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0 # <<<<<<<<<<<<<<
+ *
+ * length = len(data)
+ */
+ __pyx_v_max_index = 0;
+
+ /* "silx/math/combo.pyx":223
+ * unsigned int max_index = 0
+ *
+ * length = len(data) # <<<<<<<<<<<<<<
+ *
+ * if length == 0:
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_float, (int (*)(char *, PyObject *)) __pyx_memview_set_float, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_length = __pyx_t_2;
+
+ /* "silx/math/combo.pyx":225
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_length == 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":226
+ *
+ * if length == 0:
+ * raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 226, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":225
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ }
+
+ /* "silx/math/combo.pyx":228
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "silx/math/combo.pyx":229
+ *
+ * with nogil:
+ * minimum = INFINITY # <<<<<<<<<<<<<<
+ * maximum = -INFINITY
+ * min_pos = INFINITY
+ */
+ __pyx_v_minimum = __pyx_v_4silx_4math_5combo_INFINITY;
+
+ /* "silx/math/combo.pyx":230
+ * with nogil:
+ * minimum = INFINITY
+ * maximum = -INFINITY # <<<<<<<<<<<<<<
+ * min_pos = INFINITY
+ *
+ */
+ __pyx_v_maximum = (-__pyx_v_4silx_4math_5combo_INFINITY);
+
+ /* "silx/math/combo.pyx":231
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ * min_pos = INFINITY # <<<<<<<<<<<<<<
+ *
+ * if not min_positive:
+ */
+ __pyx_v_min_pos = __pyx_v_4silx_4math_5combo_INFINITY;
+
+ /* "silx/math/combo.pyx":233
+ * min_pos = INFINITY
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(length):
+ * value = data[index]
+ */
+ __pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":234
+ *
+ * if not min_positive:
+ * for index in range(length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if isfinite(value):
+ */
+ __pyx_t_4 = __pyx_v_length;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_index = __pyx_t_5;
+
+ /* "silx/math/combo.pyx":235
+ * if not min_positive:
+ * for index in range(length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if isfinite(value):
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_6)) )));
+
+ /* "silx/math/combo.pyx":236
+ * for index in range(length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_3 = (isfinite(__pyx_v_value) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":237
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":238
+ * if isfinite(value):
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * if value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":239
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * if value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":237
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":240
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":241
+ * max_index = index
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":242
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":240
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":236
+ * for index in range(length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ }
+ }
+
+ /* "silx/math/combo.pyx":233
+ * min_pos = INFINITY
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(length):
+ * value = data[index]
+ */
+ goto __pyx_L7;
+ }
+
+ /* "silx/math/combo.pyx":245
+ *
+ * else:
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if isfinite(value):
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_length;
+ for (__pyx_t_5 = __pyx_v_index; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_index = __pyx_t_5;
+
+ /* "silx/math/combo.pyx":246
+ * else:
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if isfinite(value):
+ * if value > maximum:
+ */
+ __pyx_t_7 = __pyx_v_index;
+ __pyx_v_value = (*((float *) ( /* dim=0 */ ((char *) (((float *) __pyx_v_data.data) + __pyx_t_7)) )));
+
+ /* "silx/math/combo.pyx":247
+ * for index in range(index, length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_3 = (isfinite(__pyx_v_value) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":248
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":249
+ * if isfinite(value):
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * if value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":250
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * if value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":248
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":251
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":252
+ * max_index = index
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":253
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if 0. < value < min_pos:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":251
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":255
+ * min_index = index
+ *
+ * if 0. < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = (0. < __pyx_v_value);
+ if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_8 = (__pyx_t_3 != 0);
+ if (__pyx_t_8) {
+
+ /* "silx/math/combo.pyx":256
+ *
+ * if 0. < value < min_pos:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ *
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":257
+ * if 0. < value < min_pos:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":255
+ * min_index = index
+ *
+ * if 0. < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":247
+ * for index in range(index, length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ }
+ }
+ }
+ __pyx_L7:;
+ }
+
+ /* "silx/math/combo.pyx":228
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "silx/math/combo.pyx":259
+ * min_pos_index = index
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None, # <<<<<<<<<<<<<<
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if ((isfinite(__pyx_v_minimum) != 0)) {
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = __pyx_t_11;
+ __pyx_t_11 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_10 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":260
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ * min_pos if isfinite(min_pos) else None, # <<<<<<<<<<<<<<
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None,
+ */
+ if ((isfinite(__pyx_v_min_pos) != 0)) {
+ __pyx_t_12 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 260, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_11 = __pyx_t_12;
+ __pyx_t_12 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_11 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":261
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None, # <<<<<<<<<<<<<<
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None,
+ */
+ if ((isfinite(__pyx_v_maximum) != 0)) {
+ __pyx_t_13 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 261, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_12 = __pyx_t_13;
+ __pyx_t_13 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_12 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":262
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None, # <<<<<<<<<<<<<<
+ * min_pos_index if isfinite(min_pos) else None,
+ * max_index if isfinite(maximum) else None)
+ */
+ if ((isfinite(__pyx_v_minimum) != 0)) {
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_13 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":263
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None, # <<<<<<<<<<<<<<
+ * max_index if isfinite(maximum) else None)
+ *
+ */
+ if ((isfinite(__pyx_v_min_pos) != 0)) {
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_14 = __pyx_t_15;
+ __pyx_t_15 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_14 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":264
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None,
+ * max_index if isfinite(maximum) else None) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if ((isfinite(__pyx_v_maximum) != 0)) {
+ __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_15 = __pyx_t_16;
+ __pyx_t_16 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_15 = Py_None;
+ }
+ __pyx_t_16 = NULL;
+ __pyx_t_17 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_16)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_17 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_16, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_17, 6+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_16, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_17, 6+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_18 = PyTuple_New(6+__pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__pyx_t_16) {
+ __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_16); __pyx_t_16 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_17, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_17, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_18, 2+__pyx_t_17, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_18, 3+__pyx_t_17, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_18, 4+__pyx_t_17, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_18, 5+__pyx_t_17, __pyx_t_15);
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_AddTraceback("silx.math.combo._finite_min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data, 1);
@@ -11815,34 +16657,810 @@ static PyObject *__pyx_pf_5combo_22_min_max(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-/* "combo.pyx":195
+static PyObject *__pyx_pf_4silx_4math_5combo_92__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__defaults__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self)->__pyx_arg_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("silx.math.combo.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* Python wrapper */
+static PyObject *__pyx_fuse_1__pyx_pw_4silx_4math_5combo_35_finite_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_fuse_1__pyx_mdef_4silx_4math_5combo_35_finite_min_max = {"__pyx_fuse_1_finite_min_max", (PyCFunction)__pyx_fuse_1__pyx_pw_4silx_4math_5combo_35_finite_min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_2_finite_min_max};
+static PyObject *__pyx_fuse_1__pyx_pw_4silx_4math_5combo_35_finite_min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ __Pyx_memviewslice __pyx_v_data = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_min_positive;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_finite_min_max (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
+ PyObject* values[2] = {0,0};
+ __pyx_defaults27 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_self);
+ 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_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_positive_2);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_finite_min_max") < 0)) __PYX_ERR(0, 210, __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_data = __Pyx_PyObject_to_MemoryviewSlice_dc_double(values[0]); if (unlikely(!__pyx_v_data.memview)) __PYX_ERR(0, 210, __pyx_L3_error)
+ if (values[1]) {
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L3_error)
+ } else {
+ __pyx_v_min_positive = __pyx_dynamic_args->__pyx_arg_min_positive;
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_finite_min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 210, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.combo._finite_min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_5combo_34_finite_min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_5combo_34_finite_min_max(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_data, int __pyx_v_min_positive) {
+ double __pyx_v_value;
+ double __pyx_v_minimum;
+ double __pyx_v_maximum;
+ unsigned int __pyx_v_length;
+ unsigned int __pyx_v_index;
+ unsigned int __pyx_v_min_index;
+ unsigned int __pyx_v_min_pos_index;
+ unsigned int __pyx_v_max_index;
+ double __pyx_v_min_pos;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ unsigned int __pyx_t_4;
+ unsigned int __pyx_t_5;
+ size_t __pyx_t_6;
+ size_t __pyx_t_7;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ int __pyx_t_17;
+ PyObject *__pyx_t_18 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_fuse_1_finite_min_max", 0);
+
+ /* "silx/math/combo.pyx":218
+ * cython.floating value, minimum, minpos, maximum
+ * unsigned int length
+ * unsigned int index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ */
+ __pyx_v_index = 0;
+
+ /* "silx/math/combo.pyx":219
+ * unsigned int length
+ * unsigned int index = 0
+ * unsigned int min_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0
+ */
+ __pyx_v_min_index = 0;
+
+ /* "silx/math/combo.pyx":220
+ * unsigned int index = 0
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0 # <<<<<<<<<<<<<<
+ * unsigned int max_index = 0
+ *
+ */
+ __pyx_v_min_pos_index = 0;
+
+ /* "silx/math/combo.pyx":221
+ * unsigned int min_index = 0
+ * unsigned int min_pos_index = 0
+ * unsigned int max_index = 0 # <<<<<<<<<<<<<<
*
+ * length = len(data)
+ */
+ __pyx_v_max_index = 0;
+
+ /* "silx/math/combo.pyx":223
+ * unsigned int max_index = 0
*
- * def min_max(data not None, bint min_positive=False): # <<<<<<<<<<<<<<
+ * length = len(data) # <<<<<<<<<<<<<<
+ *
+ * if length == 0:
+ */
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 223, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_length = __pyx_t_2;
+
+ /* "silx/math/combo.pyx":225
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_length == 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":226
+ *
+ * if length == 0:
+ * raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 226, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":225
+ * length = len(data)
+ *
+ * if length == 0: # <<<<<<<<<<<<<<
+ * raise ValueError('Zero-size array')
+ *
+ */
+ }
+
+ /* "silx/math/combo.pyx":228
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ #endif
+ /*try:*/ {
+
+ /* "silx/math/combo.pyx":229
+ *
+ * with nogil:
+ * minimum = INFINITY # <<<<<<<<<<<<<<
+ * maximum = -INFINITY
+ * min_pos = INFINITY
+ */
+ __pyx_v_minimum = __pyx_v_4silx_4math_5combo_INFINITY;
+
+ /* "silx/math/combo.pyx":230
+ * with nogil:
+ * minimum = INFINITY
+ * maximum = -INFINITY # <<<<<<<<<<<<<<
+ * min_pos = INFINITY
+ *
+ */
+ __pyx_v_maximum = (-__pyx_v_4silx_4math_5combo_INFINITY);
+
+ /* "silx/math/combo.pyx":231
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ * min_pos = INFINITY # <<<<<<<<<<<<<<
+ *
+ * if not min_positive:
+ */
+ __pyx_v_min_pos = __pyx_v_4silx_4math_5combo_INFINITY;
+
+ /* "silx/math/combo.pyx":233
+ * min_pos = INFINITY
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(length):
+ * value = data[index]
+ */
+ __pyx_t_3 = ((!(__pyx_v_min_positive != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":234
+ *
+ * if not min_positive:
+ * for index in range(length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if isfinite(value):
+ */
+ __pyx_t_4 = __pyx_v_length;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_index = __pyx_t_5;
+
+ /* "silx/math/combo.pyx":235
+ * if not min_positive:
+ * for index in range(length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if isfinite(value):
+ * if value > maximum:
+ */
+ __pyx_t_6 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_6)) )));
+
+ /* "silx/math/combo.pyx":236
+ * for index in range(length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_3 = (isfinite(__pyx_v_value) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":237
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":238
+ * if isfinite(value):
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * if value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":239
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * if value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":237
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":240
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":241
+ * max_index = index
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":242
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":240
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":236
+ * for index in range(length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ }
+ }
+
+ /* "silx/math/combo.pyx":233
+ * min_pos = INFINITY
+ *
+ * if not min_positive: # <<<<<<<<<<<<<<
+ * for index in range(length):
+ * value = data[index]
+ */
+ goto __pyx_L7;
+ }
+
+ /* "silx/math/combo.pyx":245
+ *
+ * else:
+ * for index in range(index, length): # <<<<<<<<<<<<<<
+ * value = data[index]
+ * if isfinite(value):
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_length;
+ for (__pyx_t_5 = __pyx_v_index; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_index = __pyx_t_5;
+
+ /* "silx/math/combo.pyx":246
+ * else:
+ * for index in range(index, length):
+ * value = data[index] # <<<<<<<<<<<<<<
+ * if isfinite(value):
+ * if value > maximum:
+ */
+ __pyx_t_7 = __pyx_v_index;
+ __pyx_v_value = (*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data.data) + __pyx_t_7)) )));
+
+ /* "silx/math/combo.pyx":247
+ * for index in range(index, length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ __pyx_t_3 = (isfinite(__pyx_v_value) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":248
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value > __pyx_v_maximum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":249
+ * if isfinite(value):
+ * if value > maximum:
+ * maximum = value # <<<<<<<<<<<<<<
+ * max_index = index
+ * if value < minimum:
+ */
+ __pyx_v_maximum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":250
+ * if value > maximum:
+ * maximum = value
+ * max_index = index # <<<<<<<<<<<<<<
+ * if value < minimum:
+ * minimum = value
+ */
+ __pyx_v_max_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":248
+ * value = data[index]
+ * if isfinite(value):
+ * if value > maximum: # <<<<<<<<<<<<<<
+ * maximum = value
+ * max_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":251
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ __pyx_t_3 = ((__pyx_v_value < __pyx_v_minimum) != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/combo.pyx":252
+ * max_index = index
+ * if value < minimum:
+ * minimum = value # <<<<<<<<<<<<<<
+ * min_index = index
+ *
+ */
+ __pyx_v_minimum = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":253
+ * if value < minimum:
+ * minimum = value
+ * min_index = index # <<<<<<<<<<<<<<
+ *
+ * if 0. < value < min_pos:
+ */
+ __pyx_v_min_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":251
+ * maximum = value
+ * max_index = index
+ * if value < minimum: # <<<<<<<<<<<<<<
+ * minimum = value
+ * min_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":255
+ * min_index = index
+ *
+ * if 0. < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ __pyx_t_3 = (0. < __pyx_v_value);
+ if (__pyx_t_3) {
+ __pyx_t_3 = (__pyx_v_value < __pyx_v_min_pos);
+ }
+ __pyx_t_8 = (__pyx_t_3 != 0);
+ if (__pyx_t_8) {
+
+ /* "silx/math/combo.pyx":256
+ *
+ * if 0. < value < min_pos:
+ * min_pos = value # <<<<<<<<<<<<<<
+ * min_pos_index = index
+ *
+ */
+ __pyx_v_min_pos = __pyx_v_value;
+
+ /* "silx/math/combo.pyx":257
+ * if 0. < value < min_pos:
+ * min_pos = value
+ * min_pos_index = index # <<<<<<<<<<<<<<
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ */
+ __pyx_v_min_pos_index = __pyx_v_index;
+
+ /* "silx/math/combo.pyx":255
+ * min_index = index
+ *
+ * if 0. < value < min_pos: # <<<<<<<<<<<<<<
+ * min_pos = value
+ * min_pos_index = index
+ */
+ }
+
+ /* "silx/math/combo.pyx":247
+ * for index in range(index, length):
+ * value = data[index]
+ * if isfinite(value): # <<<<<<<<<<<<<<
+ * if value > maximum:
+ * maximum = value
+ */
+ }
+ }
+ }
+ __pyx_L7:;
+ }
+
+ /* "silx/math/combo.pyx":228
+ * raise ValueError('Zero-size array')
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * minimum = INFINITY
+ * maximum = -INFINITY
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L6;
+ }
+ __pyx_L6:;
+ }
+ }
+
+ /* "silx/math/combo.pyx":259
+ * min_pos_index = index
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None, # <<<<<<<<<<<<<<
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_MinMaxResult); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if ((isfinite(__pyx_v_minimum) != 0)) {
+ __pyx_t_11 = PyFloat_FromDouble(__pyx_v_minimum); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __pyx_t_10 = __pyx_t_11;
+ __pyx_t_11 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_10 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":260
+ *
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ * min_pos if isfinite(min_pos) else None, # <<<<<<<<<<<<<<
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None,
+ */
+ if ((isfinite(__pyx_v_min_pos) != 0)) {
+ __pyx_t_12 = PyFloat_FromDouble(__pyx_v_min_pos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 260, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __pyx_t_11 = __pyx_t_12;
+ __pyx_t_12 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_11 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":261
+ * return _MinMaxResult(minimum if isfinite(minimum) else None,
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None, # <<<<<<<<<<<<<<
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None,
+ */
+ if ((isfinite(__pyx_v_maximum) != 0)) {
+ __pyx_t_13 = PyFloat_FromDouble(__pyx_v_maximum); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 261, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __pyx_t_12 = __pyx_t_13;
+ __pyx_t_13 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_12 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":262
+ * min_pos if isfinite(min_pos) else None,
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None, # <<<<<<<<<<<<<<
+ * min_pos_index if isfinite(min_pos) else None,
+ * max_index if isfinite(maximum) else None)
+ */
+ if ((isfinite(__pyx_v_minimum) != 0)) {
+ __pyx_t_14 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_index); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __pyx_t_13 = __pyx_t_14;
+ __pyx_t_14 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_13 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":263
+ * maximum if isfinite(maximum) else None,
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None, # <<<<<<<<<<<<<<
+ * max_index if isfinite(maximum) else None)
+ *
+ */
+ if ((isfinite(__pyx_v_min_pos) != 0)) {
+ __pyx_t_15 = __Pyx_PyInt_From_unsigned_int(__pyx_v_min_pos_index); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __pyx_t_14 = __pyx_t_15;
+ __pyx_t_15 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_14 = Py_None;
+ }
+
+ /* "silx/math/combo.pyx":264
+ * min_index if isfinite(minimum) else None,
+ * min_pos_index if isfinite(min_pos) else None,
+ * max_index if isfinite(maximum) else None) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if ((isfinite(__pyx_v_maximum) != 0)) {
+ __pyx_t_16 = __Pyx_PyInt_From_unsigned_int(__pyx_v_max_index); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+ __pyx_t_15 = __pyx_t_16;
+ __pyx_t_16 = 0;
+ } else {
+ __Pyx_INCREF(Py_None);
+ __pyx_t_15 = Py_None;
+ }
+ __pyx_t_16 = NULL;
+ __pyx_t_17 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_16)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_17 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_16, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_17, 6+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[7] = {__pyx_t_16, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_17, 6+__pyx_t_17); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_18 = PyTuple_New(6+__pyx_t_17); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ if (__pyx_t_16) {
+ __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_16); __pyx_t_16 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_17, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_17, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_18, 2+__pyx_t_17, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_18, 3+__pyx_t_17, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_18, 4+__pyx_t_17, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_18, 5+__pyx_t_17, __pyx_t_15);
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_AddTraceback("silx.math.combo._finite_min_max", __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;
+}
+
+/* "silx/math/combo.pyx":267
+ *
+ *
+ * def min_max(data not None, bint min_positive=False, bint finite=False): # <<<<<<<<<<<<<<
* """Returns min, max and optionally strictly positive min of data.
*
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5combo_3min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5combo_2min_max[] = "Returns min, max and optionally strictly positive min of data.\n\n It also computes the indices of first occurence of min/max.\n\n NaNs are ignored while computing min/max unless all data is NaNs,\n in which case returned min/max are NaNs.\n\n Examples:\n\n >>> import numpy\n >>> data = numpy.arange(10)\n\n Usage as a function returning min and max:\n\n >>> min_, max_ = min_max(data)\n\n Usage as a function returning a result object to access all information:\n\n >>> result = min_max(data) # Do not get positive min\n >>> result.minimum, result.argmin\n 0, 0\n >>> result.maximum, result.argmax\n 9, 10\n >>> result.min_positive, result.argmin_positive # Not computed\n None, None\n\n Getting strictly positive min information:\n\n >>> result = min_max(data, min_positive=True)\n >>> result.min_positive, result.argmin_positive # Computed\n 1, 1\n\n :param data: Array-like dataset\n :param bool min_positive: True to compute the positive min and argmin\n Default: False.\n :returns: An object with minimum, maximum and min_positive attributes\n and the indices of first occurence in the flattened data:\n argmin, argmax and argmin_positive attributes.\n If all data is <= 0 or min_positive argument is False, then\n min_positive and argmin_positive are None.\n :raises: ValueError if data is empty\n ";
-static PyMethodDef __pyx_mdef_5combo_3min_max = {"min_max", (PyCFunction)__pyx_pw_5combo_3min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5combo_2min_max};
-static PyObject *__pyx_pw_5combo_3min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_5combo_5min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_5combo_4min_max[] = "min_max(data, bool min_positive=False, bool finite=False)\nReturns min, max and optionally strictly positive min of data.\n\n It also computes the indices of first occurrence of min/max.\n\n NaNs are ignored while computing min/max unless all data is NaNs,\n in which case returned min/max are NaNs.\n\n Examples:\n\n >>> import numpy\n >>> data = numpy.arange(10)\n\n Usage as a function returning min and max:\n\n >>> min_, max_ = min_max(data)\n\n Usage as a function returning a result object to access all information:\n\n >>> result = min_max(data) # Do not get positive min\n >>> result.minimum, result.argmin\n 0, 0\n >>> result.maximum, result.argmax\n 9, 10\n >>> result.min_positive, result.argmin_positive # Not computed\n None, None\n\n Getting strictly positive min information:\n\n >>> result = min_max(data, min_positive=True)\n >>> result.min_positive, result.argmin_positive # Computed\n 1, 1\n\n If *finite* is True, min/max information is computed only from finite data.\n Then, all result fields (include minimum and maximum) can be None\n when all data is infinity or NaN.\n\n :param data: Array-like dataset\n :param bool min_positive: True to compute the positive min and argmin\n Default: False.\n :param bool finite: True to compute min/max from finite data only\n Default: False.\n :returns: An object with minimum, maximum and min_positive attributes\n and the indices of first occurrence in the flattened data:\n argmin, argmax and argmin_positive attributes.\n If all data is <= 0 or min_positive argument is False, then\n min_positive and argmin_positive are None.\n :raises: ValueError if data is empty\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_5combo_5min_max = {"min_max", (PyCFunction)__pyx_pw_4silx_4math_5combo_5min_max, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_5combo_4min_max};
+static PyObject *__pyx_pw_4silx_4math_5combo_5min_max(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
int __pyx_v_min_positive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_finite;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("min_max (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,0};
- PyObject* values[2] = {0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_min_positive_2,&__pyx_n_s_finite,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;
@@ -11858,12 +17476,18 @@ static PyObject *__pyx_pw_5combo_3min_max(PyObject *__pyx_self, PyObject *__pyx_
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_min_positive_2);
if (value) { values[1] = value; kw_args--; }
}
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_finite);
+ if (value) { values[2] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "min_max") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "min_max") < 0)) __PYX_ERR(0, 267, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
break;
@@ -11872,23 +17496,28 @@ static PyObject *__pyx_pw_5combo_3min_max(PyObject *__pyx_self, PyObject *__pyx_
}
__pyx_v_data = values[0];
if (values[1]) {
- __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_min_positive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_min_positive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L3_error)
} else {
__pyx_v_min_positive = ((int)0);
}
+ if (values[2]) {
+ __pyx_v_finite = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_finite == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 267, __pyx_L3_error)
+ } else {
+ __pyx_v_finite = ((int)0);
+ }
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("min_max", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("min_max", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 267, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("combo.min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "data"); __PYX_ERR(0, 267, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_5combo_2min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive);
+ __pyx_r = __pyx_pf_4silx_4math_5combo_4min_max(__pyx_self, __pyx_v_data, __pyx_v_min_positive, __pyx_v_finite);
/* function exit code */
goto __pyx_L0;
@@ -11899,7 +17528,8 @@ static PyObject *__pyx_pw_5combo_3min_max(PyObject *__pyx_self, PyObject *__pyx_
return __pyx_r;
}
-static PyObject *__pyx_pf_5combo_2min_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_min_positive) {
+static PyObject *__pyx_pf_4silx_4math_5combo_4min_max(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, int __pyx_v_min_positive, int __pyx_v_finite) {
+ PyObject *__pyx_v_native_endian_dtype = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -11907,110 +17537,270 @@ static PyObject *__pyx_pf_5combo_2min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
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;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
__Pyx_RefNannySetupContext("min_max", 0);
+ __Pyx_INCREF(__pyx_v_data);
- /* "combo.pyx":238
+ /* "silx/math/combo.pyx":316
* :raises: ValueError if data is empty
* """
- * return _min_max(numpy.ascontiguousarray(data).ravel(), min_positive) # <<<<<<<<<<<<<<
+ * data = numpy.array(data, copy=False) # <<<<<<<<<<<<<<
+ * native_endian_dtype = data.dtype.newbyteorder('N')
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
*/
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/combo.pyx":317
+ * """
+ * data = numpy.array(data, copy=False)
+ * native_endian_dtype = data.dtype.newbyteorder('N') # <<<<<<<<<<<<<<
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ * if finite and data.dtype.kind == 'f':
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_newbyteorder); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_native_endian_dtype = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "silx/math/combo.pyx":318
+ * data = numpy.array(data, copy=False)
+ * native_endian_dtype = data.dtype.newbyteorder('N')
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel() # <<<<<<<<<<<<<<
+ * if finite and data.dtype.kind == 'f':
+ * return _finite_min_max(data, min_positive)
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_data);
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_v_native_endian_dtype) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __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_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ravel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
__Pyx_INCREF(__pyx_t_5);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- if (!__pyx_t_5) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ if (__pyx_t_5) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ravel); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "silx/math/combo.pyx":319
+ * native_endian_dtype = data.dtype.newbyteorder('N')
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ * if finite and data.dtype.kind == 'f': # <<<<<<<<<<<<<<
+ * return _finite_min_max(data, min_positive)
+ * else:
+ */
+ __pyx_t_7 = (__pyx_v_finite != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_kind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_f, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "silx/math/combo.pyx":320
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ * if finite and data.dtype.kind == 'f':
+ * return _finite_min_max(data, min_positive) # <<<<<<<<<<<<<<
+ * else:
+ * return _min_max(data, min_positive)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_finite_min_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_min_positive); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_data, __pyx_t_5};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_data, __pyx_t_5};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_v_data);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- }
- if (__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- } else {
- __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/combo.pyx":319
+ * native_endian_dtype = data.dtype.newbyteorder('N')
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ * if finite and data.dtype.kind == 'f': # <<<<<<<<<<<<<<
+ * return _finite_min_max(data, min_positive)
+ * else:
+ */
}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_min_positive); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = NULL;
- __pyx_t_8 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
- __pyx_t_8 = 1;
+
+ /* "silx/math/combo.pyx":322
+ * return _finite_min_max(data, min_positive)
+ * else:
+ * return _min_max(data, min_positive) # <<<<<<<<<<<<<<
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_min_max); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_min_positive); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_8 = 1;
+ }
}
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_data, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_data, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_8, __pyx_v_data);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_8, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
}
- __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- }
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_3 = 0;
- __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
- /* "combo.pyx":195
+ /* "silx/math/combo.pyx":267
*
*
- * def min_max(data not None, bint min_positive=False): # <<<<<<<<<<<<<<
+ * def min_max(data not None, bint min_positive=False, bint finite=False): # <<<<<<<<<<<<<<
* """Returns min, max and optionally strictly positive min of data.
*
*/
@@ -12022,17 +17812,17 @@ static PyObject *__pyx_pf_5combo_2min_max(CYTHON_UNUSED PyObject *__pyx_self, Py
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("combo.min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.combo.min_max", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_native_endian_dtype);
+ __Pyx_XDECREF(__pyx_v_data);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12048,9 +17838,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -12078,12 +17865,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -12097,7 +17884,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -12111,14 +17898,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -12130,19 +17917,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12159,7 +17946,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -12171,19 +17958,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -12192,12 +17976,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -12206,7 +17990,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -12216,21 +18000,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__19, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -12240,95 +18032,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -12338,43 +18143,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -12384,42 +18198,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -12428,7 +18250,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -12436,19 +18258,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -12457,7 +18279,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -12469,20 +18291,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -12491,7 +18321,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -12503,34 +18333,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -12539,7 +18377,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -12548,19 +18386,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -12570,7 +18408,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -12579,7 +18417,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -12589,21 +18427,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__22, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -12613,7 +18459,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -12622,7 +18468,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -12630,30 +18476,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -12662,7 +18496,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -12671,14 +18505,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12691,7 +18537,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -12702,7 +18548,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12716,14 +18562,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -12734,16 +18580,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -12752,18 +18595,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12771,21 +18614,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12793,11 +18644,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -12807,21 +18665,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__23, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -12831,7 +18697,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -12841,7 +18707,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -12851,7 +18717,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -12861,7 +18727,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -12871,7 +18737,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -12880,7 +18746,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -12890,7 +18756,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -12899,7 +18765,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -12909,7 +18775,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -12918,22 +18784,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -12946,7 +18820,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12976,7 +18850,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -12989,18 +18863,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -13010,7 +18884,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -13018,10 +18892,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -13031,7 +18913,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -13041,7 +18923,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -13049,32 +18931,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -13086,84 +18981,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -13171,15 +19110,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -13193,24 +19132,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -13218,16 +19154,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -13247,7 +19183,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -13261,24 +19197,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -13286,16 +19219,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -13315,7 +19248,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -13329,35 +19262,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -13377,7 +19307,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13394,12 +19324,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -13409,96 +19336,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -13509,7 +19444,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -13521,7 +19456,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13544,7 +19479,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13556,9 +19491,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -13580,7 +19512,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -13591,25 +19523,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -13622,7 +19554,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13636,7 +19568,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13650,19 +19582,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -13674,7 +19606,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13689,7 +19621,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13703,7 +19635,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -13712,7 +19644,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -13721,7 +19653,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -13731,7 +19663,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -13739,21 +19671,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13766,7 +19704,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -13780,9 +19718,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -13807,7 +19742,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -13816,7 +19751,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -13828,43 +19763,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -13877,7 +19807,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -13886,14 +19816,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -13906,16 +19836,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -13925,7 +19855,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -13934,90 +19864,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -14026,7 +20043,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -14035,7 +20052,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -14047,8 +20064,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -14056,7 +20071,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -14069,19 +20084,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -14092,41 +20112,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -14138,8 +20261,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -14159,12 +20282,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -14173,7 +20293,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -14185,25 +20305,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -14212,7 +20334,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -14223,18 +20345,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -14244,7 +20366,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -14254,8 +20376,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -14274,7 +20396,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -14288,14 +20410,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -14307,12 +20429,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -14323,7 +20442,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -14334,20 +20453,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14355,39 +20482,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -14395,25 +20522,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -14421,14 +20556,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -14451,7 +20586,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14465,14 +20600,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -14481,24 +20616,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14506,111 +20638,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14635,7 +20783,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14655,24 +20803,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -14680,81 +20825,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -14771,12 +20927,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -14784,11 +20950,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -14800,7 +20972,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14822,7 +20994,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14839,55 +21011,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14908,7 +21077,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -14917,7 +21086,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -14935,12 +21104,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -14949,7 +21115,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -14958,7 +21124,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -14968,7 +21134,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -14977,7 +21143,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -14987,17 +21153,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -15005,22 +21179,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -15029,7 +21211,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -15039,7 +21221,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -15047,24 +21229,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -15074,21 +21264,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -15098,7 +21294,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -15111,8 +21307,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -15126,6 +21324,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -15143,7 +21342,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -15164,7 +21363,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -15178,33 +21377,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -15225,7 +21421,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15246,41 +21442,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -15288,26 +21480,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -15317,38 +21511,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -15356,14 +21578,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -15376,51 +21606,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__24, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -15428,7 +21669,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15454,7 +21695,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15475,31 +21716,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -15510,53 +21749,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -15566,66 +21813,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -15634,9 +21901,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15653,7 +21920,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -15664,7 +21931,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15678,14 +21945,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -15700,7 +21967,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15710,7 +21977,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -15719,22 +21986,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15744,7 +22019,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -15753,22 +22028,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -15778,7 +22061,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -15787,22 +22070,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -15812,7 +22103,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -15821,22 +22112,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -15846,7 +22145,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -15856,7 +22155,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -15866,7 +22165,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -15876,7 +22175,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -15885,7 +22184,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -15898,7 +22197,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15916,78 +22215,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -16002,49 +22298,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -16055,77 +22351,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16134,102 +22429,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16238,110 +22540,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__37, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16350,55 +22655,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -16413,55 +22715,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -16476,51 +22775,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -16528,11 +22824,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -16549,156 +22845,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -16707,18 +22962,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16729,8 +22983,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16743,20 +22997,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -16766,7 +23020,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -16775,9 +23029,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -16787,8 +23049,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16801,7 +23063,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16815,25 +23077,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -16841,54 +23100,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16909,7 +23168,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16923,24 +23182,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -16948,27 +23204,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16988,7 +23244,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -17002,48 +23258,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -17062,8 +23315,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -17076,49 +23329,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -17136,8 +23386,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -17150,26 +23400,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -17178,7 +23425,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -17187,17 +23434,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -17205,14 +23452,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -17230,7 +23477,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -17244,14 +23491,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -17259,12 +23506,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -17273,7 +23517,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -17282,17 +23526,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -17300,13 +23544,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -17325,7 +23569,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -17340,40 +23584,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -17382,7 +23623,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -17394,7 +23635,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -17416,7 +23657,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17430,18 +23671,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17455,7 +23696,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17484,12 +23725,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -17500,49 +23738,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -17551,7 +23797,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -17560,7 +23806,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17573,25 +23819,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -17600,7 +23848,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -17610,13 +23858,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -17627,7 +23875,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -17637,27 +23885,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__26);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
- __Pyx_GIVEREF(__pyx_slice__26);
+ __Pyx_INCREF(__pyx_slice__38);
+ __Pyx_GIVEREF(__pyx_slice__38);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__38);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -17665,22 +23913,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__39); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -17688,17 +23944,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -17711,29 +23975,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -17752,18 +24024,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17774,17 +24046,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -17794,29 +24066,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__28);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__28);
- __Pyx_GIVEREF(__pyx_slice__28);
+ __Pyx_INCREF(__pyx_slice__40);
+ __Pyx_GIVEREF(__pyx_slice__40);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__40);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -17826,32 +24104,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17877,76 +24155,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -17955,7 +24240,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -17994,12 +24279,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -18009,7 +24291,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -18018,7 +24300,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -18029,36 +24311,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -18066,20 +24348,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -18090,7 +24380,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -18100,7 +24390,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -18110,7 +24400,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -18119,7 +24409,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -18128,7 +24418,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -18140,25 +24430,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -18167,7 +24459,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -18178,7 +24470,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -18188,27 +24480,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -18219,7 +24519,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -18228,7 +24528,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -18237,16 +24537,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -18254,24 +24554,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -18280,20 +24588,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -18302,20 +24610,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -18324,55 +24632,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -18383,7 +24691,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -18393,18 +24701,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -18413,73 +24721,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -18501,7 +24817,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -18516,11 +24832,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -18530,7 +24843,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -18540,7 +24853,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18548,11 +24861,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -18566,28 +24885,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -18599,7 +24932,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -18617,19 +24950,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -18639,7 +24978,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -18649,7 +24988,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18658,7 +24997,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -18668,7 +25007,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -18676,13 +25015,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -18692,7 +25045,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -18702,7 +25055,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18710,38 +25063,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18749,24 +25125,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -18776,7 +25160,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18786,7 +25170,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -18795,7 +25179,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18805,7 +25189,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -18813,13 +25197,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -18829,7 +25227,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -18837,49 +25235,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -18889,7 +25310,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -18897,11 +25318,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -18910,7 +25337,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -18920,7 +25347,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -18928,11 +25355,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -18942,7 +25375,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -18950,11 +25383,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -18963,7 +25402,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -18972,7 +25411,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -18983,7 +25422,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -18993,7 +25432,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -19001,23 +25440,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -19027,7 +25474,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -19037,7 +25484,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -19047,7 +25494,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -19055,39 +25502,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -19097,7 +25574,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -19121,7 +25598,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -19141,21 +25618,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -19165,7 +25639,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -19175,7 +25649,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -19183,28 +25657,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -19212,20 +25674,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -19234,7 +25704,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -19244,7 +25714,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -19252,13 +25722,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -19268,7 +25744,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -19277,7 +25753,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -19287,35 +25763,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -19325,32 +25815,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -19359,7 +25857,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -19369,7 +25867,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -19377,11 +25875,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -19391,7 +25895,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -19410,7 +25914,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19433,11 +25937,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -19447,7 +25948,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -19457,7 +25958,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -19467,7 +25968,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -19478,7 +25979,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -19487,7 +25988,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -19499,7 +26000,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -19511,7 +26012,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -19529,20 +26030,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -19552,7 +26059,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19576,7 +26083,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19589,17 +26096,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -19608,7 +26115,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19620,7 +26127,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19633,12 +26140,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -19648,7 +26152,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -19656,30 +26160,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19698,7 +26210,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19712,12 +26224,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -19727,32 +26236,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19773,36 +26290,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -19811,11 +26328,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -19826,7 +26343,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -19836,7 +26353,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -19844,16 +26362,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -19862,7 +26378,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -19873,35 +26389,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -19910,7 +26434,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -19919,14 +26443,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -19934,7 +26458,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -19944,7 +26468,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -19954,7 +26478,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -19963,7 +26487,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -19972,7 +26496,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -19981,7 +26505,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -19990,7 +26514,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -19999,66 +26523,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -20066,7 +26652,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -20075,7 +26661,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -20087,7 +26673,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -20103,12 +26689,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -20123,36 +26710,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -20161,19 +26745,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -20184,7 +26776,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -20195,7 +26787,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -20203,7 +26795,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -20220,10 +26812,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -20233,7 +26825,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -20243,7 +26835,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -20253,7 +26845,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -20262,7 +26854,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -20271,7 +26863,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -20282,59 +26874,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -20346,7 +26919,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -20359,12 +26932,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20373,7 +26943,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20381,13 +26951,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -20406,7 +26976,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20424,23 +26994,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -20450,7 +27017,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -20459,20 +27026,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -20483,7 +27058,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -20492,20 +27067,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20524,7 +27099,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20536,7 +27111,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -20546,7 +27121,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -20555,21 +27130,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20582,7 +27165,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20599,7 +27182,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -20608,7 +27191,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -20617,17 +27200,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20637,7 +27220,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20646,7 +27229,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20654,11 +27237,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20669,7 +27260,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20679,7 +27270,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20688,7 +27279,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20696,11 +27287,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -20710,7 +27309,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -20719,21 +27318,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20746,7 +27353,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20766,7 +27373,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -20775,7 +27382,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -20784,7 +27391,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -20793,7 +27400,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -20802,7 +27409,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -20812,7 +27419,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -20832,7 +27439,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -20846,9 +27453,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -20856,22 +27471,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -20880,7 +27503,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20889,7 +27512,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20900,22 +27523,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -20924,7 +27555,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20933,7 +27564,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20945,7 +27576,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20956,7 +27587,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20966,7 +27597,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -20975,7 +27606,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20986,7 +27617,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -21002,7 +27633,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -21012,7 +27643,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21023,7 +27654,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -21033,7 +27664,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -21043,7 +27674,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -21056,7 +27687,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -21071,7 +27702,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -21081,7 +27712,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -21092,7 +27723,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -21101,7 +27732,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -21110,21 +27741,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -21133,7 +27772,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -21145,7 +27784,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -21155,7 +27794,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -21168,7 +27807,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -21187,11 +27826,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -21201,7 +27837,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -21210,7 +27846,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -21219,7 +27855,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -21229,19 +27865,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -21250,7 +27892,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -21260,7 +27902,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21271,7 +27913,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -21280,17 +27922,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -21299,7 +27941,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21310,7 +27952,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -21320,53 +27962,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -21376,7 +28032,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -21400,7 +28056,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21415,62 +28071,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21493,7 +28146,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21509,33 +28162,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -21545,26 +28195,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21589,7 +28259,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21606,16 +28276,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -21625,18 +28292,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -21646,39 +28313,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21703,7 +28398,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -21728,11 +28423,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -21741,7 +28433,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -21751,7 +28443,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -21760,7 +28452,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -21769,7 +28461,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -21778,7 +28470,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -21788,7 +28480,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21796,10 +28488,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -21809,7 +28509,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -21817,11 +28517,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21837,7 +28544,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21848,7 +28555,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -21858,7 +28565,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -21868,7 +28575,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -21877,7 +28584,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -21885,25 +28592,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -21913,62 +28634,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -21976,11 +28709,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -21990,51 +28729,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
*
- * 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)
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -22043,7 +28797,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22052,7 +28806,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -22061,7 +28815,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -22070,7 +28824,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -22079,7 +28833,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -22088,12 +28842,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -22107,28 +28875,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22137,7 +28911,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -22146,7 +28920,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -22155,7 +28929,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -22164,7 +28938,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -22174,7 +28948,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -22198,21 +28972,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -22221,87 +28995,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -22309,7 +29083,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -22320,7 +29094,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -22330,7 +29104,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -22338,11 +29112,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -22353,7 +29133,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22368,7 +29148,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -22377,7 +29157,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22392,7 +29172,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22408,7 +29188,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -22419,7 +29199,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22429,7 +29209,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -22439,7 +29219,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -22447,36 +29227,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -22486,7 +29290,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22498,7 +29302,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22508,7 +29312,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22517,7 +29321,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -22526,7 +29330,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -22535,7 +29339,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22546,7 +29350,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22562,7 +29366,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -22571,7 +29375,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -22580,7 +29384,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22590,7 +29394,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -22601,7 +29405,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -22610,7 +29414,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -22619,22 +29423,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -22643,7 +29455,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -22655,7 +29467,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22665,6 +29477,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -22676,12 +29489,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -22732,7 +29547,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -22741,7 +29556,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -22783,7 +29598,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "combo.array", /*tp_name*/
+ "silx.math.combo.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -22792,8 +29607,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -22888,7 +29704,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "combo.Enum", /*tp_name*/
+ "silx.math.combo.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -22897,8 +29713,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -22959,10 +29776,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -23040,39 +29858,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -23084,15 +29902,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -23134,7 +29952,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "combo.memoryview", /*tp_name*/
+ "silx.math.combo.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -23143,8 +29961,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -23244,7 +30063,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -23252,13 +30071,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "combo._memoryviewslice", /*tp_name*/
+ "silx.math.combo._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -23267,8 +30086,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -23344,7 +30164,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_20_12_2016, __pyx_k_20_12_2016, sizeof(__pyx_k_20_12_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_16_08_2017, __pyx_k_16_08_2017, sizeof(__pyx_k_16_08_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_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},
@@ -23355,8 +30176,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_Index_of_the_first_occurence_of, __pyx_k_Index_of_the_first_occurence_of, sizeof(__pyx_k_Index_of_the_first_occurence_of), 0, 0, 1, 0},
- {&__pyx_kp_s_Index_of_the_first_occurence_of_2, __pyx_k_Index_of_the_first_occurence_of_2, sizeof(__pyx_k_Index_of_the_first_occurence_of_2), 0, 0, 1, 0},
+ {&__pyx_kp_s_Index_of_the_first_occurrence_of, __pyx_k_Index_of_the_first_occurrence_of, sizeof(__pyx_k_Index_of_the_first_occurrence_of), 0, 0, 1, 0},
+ {&__pyx_kp_s_Index_of_the_first_occurrence_of_2, __pyx_k_Index_of_the_first_occurrence_of_2, sizeof(__pyx_k_Index_of_the_first_occurrence_of_2), 0, 0, 1, 0},
{&__pyx_kp_s_Index_of_the_strictly_positive_m, __pyx_k_Index_of_the_strictly_positive_m, sizeof(__pyx_k_Index_of_the_strictly_positive_m), 0, 0, 1, 0},
{&__pyx_kp_s_Index_out_of_range, __pyx_k_Index_out_of_range, sizeof(__pyx_k_Index_out_of_range), 0, 0, 1, 0},
{&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
@@ -23372,6 +30193,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_MinMaxResult___init, __pyx_k_MinMaxResult___init, sizeof(__pyx_k_MinMaxResult___init), 0, 0, 1, 1},
{&__pyx_n_s_MinMaxResult_lambda, __pyx_k_MinMaxResult_lambda, sizeof(__pyx_k_MinMaxResult_lambda), 0, 0, 1, 1},
{&__pyx_kp_s_Minimum_value_of_the_array, __pyx_k_Minimum_value_of_the_array, sizeof(__pyx_k_Minimum_value_of_the_array), 0, 0, 1, 0},
+ {&__pyx_n_s_N, __pyx_k_N, sizeof(__pyx_k_N), 0, 0, 1, 1},
{&__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_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
{&__pyx_kp_s_Object_storing_result_from_func, __pyx_k_Object_storing_result_from_func, sizeof(__pyx_k_Object_storing_result_from_func), 0, 0, 1, 0},
@@ -23394,15 +30216,16 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_argmin_positive, __pyx_k_argmin_positive, sizeof(__pyx_k_argmin_positive), 0, 0, 1, 1},
{&__pyx_n_s_argmin_positive_2, __pyx_k_argmin_positive_2, sizeof(__pyx_k_argmin_positive_2), 0, 0, 1, 1},
{&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
+ {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 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_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_combo, __pyx_k_combo, sizeof(__pyx_k_combo), 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_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 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},
@@ -23411,8 +30234,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_double, __pyx_k_double, sizeof(__pyx_k_double), 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_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 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_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
+ {&__pyx_n_s_finite, __pyx_k_finite, sizeof(__pyx_k_finite), 0, 0, 1, 1},
+ {&__pyx_n_s_finite_min_max, __pyx_k_finite_min_max, sizeof(__pyx_k_finite_min_max), 0, 0, 1, 1},
{&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
{&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1},
{&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
@@ -23424,6 +30251,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
+ {&__pyx_n_s_int, __pyx_k_int, sizeof(__pyx_k_int), 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_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
@@ -23431,6 +30259,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
{&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
{&__pyx_n_s_license, __pyx_k_license, sizeof(__pyx_k_license), 0, 0, 1, 1},
+ {&__pyx_n_s_long, __pyx_k_long, sizeof(__pyx_k_long), 0, 0, 1, 1},
+ {&__pyx_kp_s_long_long, __pyx_k_long_long, sizeof(__pyx_k_long_long), 0, 0, 1, 0},
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
{&__pyx_n_s_max_index, __pyx_k_max_index, sizeof(__pyx_k_max_index), 0, 0, 1, 1},
{&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1},
@@ -23440,7 +30270,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_min_index, __pyx_k_min_index, sizeof(__pyx_k_min_index), 0, 0, 1, 1},
{&__pyx_n_s_min_max, __pyx_k_min_max, sizeof(__pyx_k_min_max), 0, 0, 1, 1},
{&__pyx_n_s_min_max_2, __pyx_k_min_max_2, sizeof(__pyx_k_min_max_2), 0, 0, 1, 1},
- {&__pyx_kp_u_min_max_line_195, __pyx_k_min_max_line_195, sizeof(__pyx_k_min_max_line_195), 0, 1, 0, 0},
+ {&__pyx_kp_u_min_max_line_267, __pyx_k_min_max_line_267, sizeof(__pyx_k_min_max_line_267), 0, 1, 0, 0},
{&__pyx_n_s_min_pos, __pyx_k_min_pos, sizeof(__pyx_k_min_pos), 0, 0, 1, 1},
{&__pyx_n_s_min_pos_index, __pyx_k_min_pos_index, sizeof(__pyx_k_min_pos_index), 0, 0, 1, 1},
{&__pyx_n_s_min_positive, __pyx_k_min_positive, sizeof(__pyx_k_min_positive), 0, 0, 1, 1},
@@ -23448,17 +30278,17 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_minimum, __pyx_k_minimum, sizeof(__pyx_k_minimum), 0, 0, 1, 1},
{&__pyx_n_s_minimum_2, __pyx_k_minimum_2, sizeof(__pyx_k_minimum_2), 0, 0, 1, 1},
{&__pyx_n_s_minpos, __pyx_k_minpos, sizeof(__pyx_k_minpos), 0, 0, 1, 1},
- {&__pyx_kp_s_mntdirect__tmp_14_days_tvincent, __pyx_k_mntdirect__tmp_14_days_tvincent, sizeof(__pyx_k_mntdirect__tmp_14_days_tvincent), 0, 0, 1, 0},
{&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
{&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 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_native_endian_dtype, __pyx_k_native_endian_dtype, sizeof(__pyx_k_native_endian_dtype), 0, 0, 1, 1},
{&__pyx_n_s_ndarray, __pyx_k_ndarray, sizeof(__pyx_k_ndarray), 0, 0, 1, 1},
{&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_newbyteorder, __pyx_k_newbyteorder, sizeof(__pyx_k_newbyteorder), 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_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
- {&__pyx_n_s_ord, __pyx_k_ord, sizeof(__pyx_k_ord), 0, 0, 1, 1},
{&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
{&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
{&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
@@ -23469,11 +30299,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_ravel, __pyx_k_ravel, sizeof(__pyx_k_ravel), 0, 0, 1, 1},
{&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_short, __pyx_k_short, sizeof(__pyx_k_short), 0, 0, 1, 1},
{&__pyx_n_s_signatures, __pyx_k_signatures, sizeof(__pyx_k_signatures), 0, 0, 1, 1},
{&__pyx_kp_s_signed_char, __pyx_k_signed_char, sizeof(__pyx_k_signed_char), 0, 0, 1, 0},
- {&__pyx_kp_s_signed_int, __pyx_k_signed_int, sizeof(__pyx_k_signed_int), 0, 0, 1, 0},
- {&__pyx_kp_s_signed_long, __pyx_k_signed_long, sizeof(__pyx_k_signed_long), 0, 0, 1, 0},
- {&__pyx_kp_s_signed_short, __pyx_k_signed_short, sizeof(__pyx_k_signed_short), 0, 0, 1, 0},
+ {&__pyx_n_s_silx_math_combo, __pyx_k_silx_math_combo, sizeof(__pyx_k_silx_math_combo), 0, 0, 1, 1},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
@@ -23490,33 +30319,28 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
{&__pyx_kp_s_unsigned_char, __pyx_k_unsigned_char, sizeof(__pyx_k_unsigned_char), 0, 0, 1, 0},
{&__pyx_kp_s_unsigned_int, __pyx_k_unsigned_int, sizeof(__pyx_k_unsigned_int), 0, 0, 1, 0},
+ {&__pyx_kp_s_unsigned_long, __pyx_k_unsigned_long, sizeof(__pyx_k_unsigned_long), 0, 0, 1, 0},
{&__pyx_kp_s_unsigned_long_long, __pyx_k_unsigned_long_long, sizeof(__pyx_k_unsigned_long_long), 0, 0, 1, 0},
{&__pyx_kp_s_unsigned_short, __pyx_k_unsigned_short, sizeof(__pyx_k_unsigned_short), 0, 0, 1, 0},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
- {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 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_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __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 = 110; __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 = 110; __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 = 110; __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 = 110; __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __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 = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 67, __pyx_L1_error)
+ __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 80, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 113, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 135, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 149, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -23526,298 +30350,386 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "combo.pyx":104
+ /* "silx/math/combo.pyx":113
* return self.maximum
* else:
* raise IndexError("Index out of range") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Index_out_of_range); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Index_out_of_range); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "combo.pyx":123
+ /* "silx/math/combo.pyx":135
*
* if length == 0:
* raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
*
* with nogil:
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__16);
__Pyx_GIVEREF(__pyx_tuple__16);
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":127
+ /* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s__3); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__5); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_matching_signature_found); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Function_call_with_ambiguous_arg); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+
+ /* "silx/math/combo.pyx":226
+ *
+ * if length == 0:
+ * raise ValueError('Zero-size array') # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Zero_size_array); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+
+ /* "silx/math/combo.pyx":317
+ * """
+ * data = numpy.array(data, copy=False)
+ * native_endian_dtype = data.dtype.newbyteorder('N') # <<<<<<<<<<<<<<
+ * data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ * if finite and data.dtype.kind == 'f':
+ */
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_N); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__23 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__24 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__37 = PyTuple_New(1); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__37, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__26);
- __Pyx_GIVEREF(__pyx_slice__26);
+ __pyx_slice__38 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__38)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__38);
+ __Pyx_GIVEREF(__pyx_slice__38);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__27);
- __Pyx_GIVEREF(__pyx_slice__27);
+ __pyx_slice__39 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__39)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__39);
+ __Pyx_GIVEREF(__pyx_slice__39);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__28);
- __Pyx_GIVEREF(__pyx_slice__28);
+ __pyx_slice__40 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__40)) __PYX_ERR(1, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__40);
+ __Pyx_GIVEREF(__pyx_slice__40);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
- /* "combo.pyx":61
+ /* "silx/math/combo.pyx":70
* """Object storing result from :func:`min_max`"""
*
* def __init__(self, minimum, min_pos, maximum, # <<<<<<<<<<<<<<
* argmin, argmin_pos, argmax):
* self._minimum = minimum
*/
- __pyx_tuple__30 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_minimum_2, __pyx_n_s_min_pos, __pyx_n_s_maximum_2, __pyx_n_s_argmin_2, __pyx_n_s_argmin_pos, __pyx_n_s_argmax_2); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__30);
- __Pyx_GIVEREF(__pyx_tuple__30);
- __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__tmp_14_days_tvincent, __pyx_n_s_init, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__42 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_minimum_2, __pyx_n_s_min_pos, __pyx_n_s_maximum_2, __pyx_n_s_argmin_2, __pyx_n_s_argmin_pos, __pyx_n_s_argmax_2); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__42);
+ __Pyx_GIVEREF(__pyx_tuple__42);
+ __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(7, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_init, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 70, __pyx_L1_error)
- /* "combo.pyx":98
- * It is the index of the first occurence.""")
+ /* "silx/math/combo.pyx":107
+ * It is the index of the first occurrence.""")
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* if key == 0:
* return self.minimum
*/
- __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__32);
- __Pyx_GIVEREF(__pyx_tuple__32);
- __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__tmp_14_days_tvincent, __pyx_n_s_getitem, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 107, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__44);
+ __Pyx_GIVEREF(__pyx_tuple__44);
+ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_getitem, 107, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 107, __pyx_L1_error)
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
- __pyx_tuple__34 = PyTuple_Pack(12, __pyx_n_s_data, __pyx_n_s_min_positive_2, __pyx_n_s_value, __pyx_n_s_minimum_2, __pyx_n_s_minpos, __pyx_n_s_maximum_2, __pyx_n_s_length, __pyx_n_s_index, __pyx_n_s_min_index, __pyx_n_s_min_pos_index, __pyx_n_s_max_index, __pyx_n_s_min_pos); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__34);
- __Pyx_GIVEREF(__pyx_tuple__34);
- __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__tmp_14_days_tvincent, __pyx_n_s_min_max, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__46 = PyTuple_Pack(12, __pyx_n_s_data, __pyx_n_s_min_positive_2, __pyx_n_s_value, __pyx_n_s_minimum_2, __pyx_n_s_minpos, __pyx_n_s_maximum_2, __pyx_n_s_length, __pyx_n_s_index, __pyx_n_s_min_index, __pyx_n_s_min_pos_index, __pyx_n_s_max_index, __pyx_n_s_min_pos); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__46);
+ __Pyx_GIVEREF(__pyx_tuple__46);
+ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_min_max, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 119, __pyx_L1_error)
- /* "combo.pyx":195
+ /* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+ __pyx_tuple__48 = PyTuple_Pack(12, __pyx_n_s_data, __pyx_n_s_min_positive_2, __pyx_n_s_value, __pyx_n_s_minimum_2, __pyx_n_s_minpos, __pyx_n_s_maximum_2, __pyx_n_s_length, __pyx_n_s_index, __pyx_n_s_min_index, __pyx_n_s_min_pos_index, __pyx_n_s_max_index, __pyx_n_s_min_pos); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__48);
+ __Pyx_GIVEREF(__pyx_tuple__48);
+ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_finite_min_max, 210, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 210, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":267
*
*
- * def min_max(data not None, bint min_positive=False): # <<<<<<<<<<<<<<
+ * def min_max(data not None, bint min_positive=False, bint finite=False): # <<<<<<<<<<<<<<
* """Returns min, max and optionally strictly positive min of data.
*
*/
- __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_data, __pyx_n_s_min_positive_2); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __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, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__tmp_14_days_tvincent, __pyx_n_s_min_max_2, 195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__50 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_min_positive_2, __pyx_n_s_finite, __pyx_n_s_native_endian_dtype); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__50);
+ __Pyx_GIVEREF(__pyx_tuple__50);
+ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_min_max_2, 267, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 267, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__38 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__38);
- __Pyx_GIVEREF(__pyx_tuple__38);
+ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__39);
- __Pyx_GIVEREF(__pyx_tuple__39);
+ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__53);
+ __Pyx_GIVEREF(__pyx_tuple__53);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__40);
- __Pyx_GIVEREF(__pyx_tuple__40);
+ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__55);
+ __Pyx_GIVEREF(__pyx_tuple__55);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__42);
- __Pyx_GIVEREF(__pyx_tuple__42);
+ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__56);
+ __Pyx_GIVEREF(__pyx_tuple__56);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -23826,10 +30738,10 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -23849,9 +30761,8 @@ PyMODINIT_FUNC PyInit_combo(void)
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;
+ PyObject *__pyx_t_7 = NULL;
+ static PyThread_type_lock __pyx_t_8[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -23863,17 +30774,24 @@ PyMODINIT_FUNC PyInit_combo(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_combo(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -23888,34 +30806,34 @@ PyMODINIT_FUNC PyInit_combo(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_combo) {
- 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 (__pyx_module_is_main_silx__math__combo) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "combo")) {
- if (unlikely(PyDict_SetItemString(modules, "combo", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.combo")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.combo", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -23925,10 +30843,13 @@ PyMODINIT_FUNC PyInit_combo(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -23939,565 +30860,763 @@ PyMODINIT_FUNC PyInit_combo(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "combo.pyx":31
+ /* "silx/math/combo.pyx":31
* """
*
* __authors__ = ["T. Vincent"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "20/12/2016"
+ * __date__ = "16/08/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_T_Vincent);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_T_Vincent);
__Pyx_GIVEREF(__pyx_kp_s_T_Vincent);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_T_Vincent);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "combo.pyx":32
+ /* "silx/math/combo.pyx":32
*
* __authors__ = ["T. Vincent"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "20/12/2016"
+ * __date__ = "16/08/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;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
- /* "combo.pyx":33
+ /* "silx/math/combo.pyx":33
* __authors__ = ["T. Vincent"]
* __license__ = "MIT"
- * __date__ = "20/12/2016" # <<<<<<<<<<<<<<
+ * __date__ = "16/08/2017" # <<<<<<<<<<<<<<
*
* cimport cython
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_20_12_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_16_08_2017) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":39
+ * # Windows compatibility: Cross-platform INFINITY
+ * from libc.float cimport DBL_MAX
+ * cdef double INFINITY = DBL_MAX + DBL_MAX # <<<<<<<<<<<<<<
+ * # from libc.math cimport INFINITY
+ *
+ */
+ __pyx_v_4silx_4math_5combo_INFINITY = (DBL_MAX + DBL_MAX);
- /* "combo.pyx":42
- * bint isnan(double x) nogil
+ /* "silx/math/combo.pyx":49
+ *
*
* import numpy # <<<<<<<<<<<<<<
*
*
*/
- __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_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __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;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "combo.pyx":58
+ /* "silx/math/combo.pyx":67
*
*
* class _MinMaxResult(object): # <<<<<<<<<<<<<<
* """Object storing result from :func:`min_max`"""
*
*/
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_builtin_object);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
__Pyx_GIVEREF(__pyx_builtin_object);
- __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_object);
+ __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MinMaxResult, __pyx_n_s_MinMaxResult, (PyObject *) NULL, __pyx_n_s_combo, __pyx_kp_s_Object_storing_result_from_func); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_MinMaxResult, __pyx_n_s_MinMaxResult, (PyObject *) NULL, __pyx_n_s_silx_math_combo, __pyx_kp_s_Object_storing_result_from_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "combo.pyx":61
+ /* "silx/math/combo.pyx":70
* """Object storing result from :func:`min_max`"""
*
* def __init__(self, minimum, min_pos, maximum, # <<<<<<<<<<<<<<
* argmin, argmin_pos, argmax):
* self._minimum = minimum
*/
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_1__init__, 0, __pyx_n_s_MinMaxResult___init, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_1__init__, 0, __pyx_n_s_MinMaxResult___init, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "combo.pyx":72
+ /* "silx/math/combo.pyx":81
*
* minimum = property(
* lambda self: self._minimum, # <<<<<<<<<<<<<<
* doc="Minimum value of the array")
* maximum = property(
*/
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_4lambda1, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_4lambda, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 81, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- /* "combo.pyx":71
+ /* "silx/math/combo.pyx":80
* self._argmax = argmax
*
* minimum = property( # <<<<<<<<<<<<<<
* lambda self: self._minimum,
* doc="Minimum value of the array")
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":82
+ * minimum = property(
+ * lambda self: self._minimum,
+ * doc="Minimum value of the array") # <<<<<<<<<<<<<<
+ * maximum = property(
+ * lambda self: self._maximum,
+ */
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 82, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_doc, __pyx_kp_s_Minimum_value_of_the_array) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_doc, __pyx_kp_s_Minimum_value_of_the_array) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":80
+ * self._argmax = argmax
+ *
+ * minimum = property( # <<<<<<<<<<<<<<
+ * lambda self: self._minimum,
+ * doc="Minimum value of the array")
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __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;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_minimum_2, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_minimum_2, __pyx_t_6) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "combo.pyx":75
+ /* "silx/math/combo.pyx":84
* doc="Minimum value of the array")
* maximum = property(
* lambda self: self._maximum, # <<<<<<<<<<<<<<
* doc="Maximum value of the array")
*
*/
- __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_5lambda2, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_5lambda1, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "combo.pyx":74
+ /* "silx/math/combo.pyx":83
* lambda self: self._minimum,
* doc="Minimum value of the array")
* maximum = property( # <<<<<<<<<<<<<<
* lambda self: self._maximum,
* doc="Maximum value of the array")
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __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, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":85
+ * maximum = property(
+ * lambda self: self._maximum,
+ * doc="Maximum value of the array") # <<<<<<<<<<<<<<
+ *
+ * argmin = property(
+ */
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doc, __pyx_kp_s_Maximum_value_of_the_array) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doc, __pyx_kp_s_Maximum_value_of_the_array) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":83
+ * lambda self: self._minimum,
+ * doc="Minimum value of the array")
+ * maximum = property( # <<<<<<<<<<<<<<
+ * lambda self: self._maximum,
+ * doc="Maximum value of the array")
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_maximum_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_maximum_2, __pyx_t_5) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "combo.pyx":79
+ /* "silx/math/combo.pyx":88
*
* argmin = property(
* lambda self: self._argmin, # <<<<<<<<<<<<<<
- * doc="Index of the first occurence of the minimum value")
+ * doc="Index of the first occurrence of the minimum value")
* argmax = property(
*/
- __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_6lambda3, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_6lambda2, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "combo.pyx":78
+ /* "silx/math/combo.pyx":87
* doc="Maximum value of the array")
*
* argmin = property( # <<<<<<<<<<<<<<
* lambda self: self._argmin,
- * doc="Index of the first occurence of the minimum value")
+ * doc="Index of the first occurrence of the minimum value")
*/
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":89
+ * argmin = property(
+ * lambda self: self._argmin,
+ * doc="Index of the first occurrence of the minimum value") # <<<<<<<<<<<<<<
+ * argmax = property(
+ * lambda self: self._argmax,
+ */
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_first_occurence_of) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_first_occurrence_of) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":87
+ * doc="Maximum value of the array")
+ *
+ * argmin = property( # <<<<<<<<<<<<<<
+ * lambda self: self._argmin,
+ * doc="Index of the first occurrence of the minimum value")
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __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;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmin_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmin_2, __pyx_t_4) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "combo.pyx":82
- * doc="Index of the first occurence of the minimum value")
+ /* "silx/math/combo.pyx":91
+ * doc="Index of the first occurrence of the minimum value")
* argmax = property(
* lambda self: self._argmax, # <<<<<<<<<<<<<<
- * doc="Index of the first occurence of the maximum value")
+ * doc="Index of the first occurrence of the maximum value")
*
*/
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_7lambda4, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_7lambda3, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- /* "combo.pyx":81
+ /* "silx/math/combo.pyx":90
* lambda self: self._argmin,
- * doc="Index of the first occurence of the minimum value")
+ * doc="Index of the first occurrence of the minimum value")
* argmax = property( # <<<<<<<<<<<<<<
* lambda self: self._argmax,
- * doc="Index of the first occurence of the maximum value")
+ * doc="Index of the first occurrence of the maximum value")
*/
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":92
+ * argmax = property(
+ * lambda self: self._argmax,
+ * doc="Index of the first occurrence of the maximum value") # <<<<<<<<<<<<<<
+ *
+ * min_positive = property(
+ */
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_first_occurence_of_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_first_occurrence_of_2) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":90
+ * lambda self: self._argmin,
+ * doc="Index of the first occurrence of the minimum value")
+ * argmax = property( # <<<<<<<<<<<<<<
+ * lambda self: self._argmax,
+ * doc="Index of the first occurrence of the maximum value")
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __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;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmax_2, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmax_2, __pyx_t_6) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "combo.pyx":86
+ /* "silx/math/combo.pyx":95
*
* min_positive = property(
* lambda self: self._min_positive, # <<<<<<<<<<<<<<
* doc="""Strictly positive minimum value
*
*/
- __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_8lambda5, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_8lambda4, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "combo.pyx":85
- * doc="Index of the first occurence of the maximum value")
+ /* "silx/math/combo.pyx":94
+ * doc="Index of the first occurrence of the maximum value")
*
* min_positive = property( # <<<<<<<<<<<<<<
* lambda self: self._min_positive,
* doc="""Strictly positive minimum value
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 94, __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, 0, __pyx_t_6);
__pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":96
+ * min_positive = property(
+ * lambda self: self._min_positive,
+ * doc="""Strictly positive minimum value # <<<<<<<<<<<<<<
+ *
+ * It is None if no value is strictly positive.
+ */
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 96, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doc, __pyx_kp_s_Strictly_positive_minimum_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_doc, __pyx_kp_s_Strictly_positive_minimum_value) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":94
+ * doc="Index of the first occurrence of the maximum value")
+ *
+ * min_positive = property( # <<<<<<<<<<<<<<
+ * lambda self: self._min_positive,
+ * doc="""Strictly positive minimum value
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min_positive_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_min_positive_2, __pyx_t_5) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "combo.pyx":92
+ /* "silx/math/combo.pyx":101
* """)
* argmin_positive = property(
* lambda self: self._argmin_positive, # <<<<<<<<<<<<<<
* doc="""Index of the strictly positive minimum value.
*
*/
- __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_9lambda6, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_9lambda5, 0, __pyx_n_s_MinMaxResult_lambda, NULL, __pyx_n_s_silx_math_combo, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- /* "combo.pyx":91
+ /* "silx/math/combo.pyx":100
* It is None if no value is strictly positive.
* """)
* argmin_positive = property( # <<<<<<<<<<<<<<
* lambda self: self._argmin_positive,
* doc="""Index of the strictly positive minimum value.
*/
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+ /* "silx/math/combo.pyx":102
+ * argmin_positive = property(
+ * lambda self: self._argmin_positive,
+ * doc="""Index of the strictly positive minimum value. # <<<<<<<<<<<<<<
+ *
+ * It is None if no value is strictly positive.
+ */
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_strictly_positive_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_doc, __pyx_kp_s_Index_of_the_strictly_positive_m) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
+
+ /* "silx/math/combo.pyx":100
+ * It is None if no value is strictly positive.
+ * """)
+ * argmin_positive = property( # <<<<<<<<<<<<<<
+ * lambda self: self._argmin_positive,
+ * doc="""Index of the strictly positive minimum value.
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 100, __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;
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmin_positive_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_argmin_positive_2, __pyx_t_4) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "combo.pyx":98
- * It is the index of the first occurence.""")
+ /* "silx/math/combo.pyx":107
+ * It is the index of the first occurrence.""")
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
* if key == 0:
* return self.minimum
*/
- __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5combo_13_MinMaxResult_3__getitem__, 0, __pyx_n_s_MinMaxResult___getitem, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_13_MinMaxResult_3__getitem__, 0, __pyx_n_s_MinMaxResult___getitem, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "combo.pyx":58
+ /* "silx/math/combo.pyx":67
*
*
* class _MinMaxResult(object): # <<<<<<<<<<<<<<
* """Object storing result from :func:`min_max`"""
*
*/
- __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MinMaxResult, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MinMaxResult, __pyx_t_1, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinMaxResult, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinMaxResult, __pyx_t_4) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__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;
- /* "combo.pyx":110
+ /* "silx/math/combo.pyx":119
* @cython.boundscheck(False)
* @cython.wraparound(False)
* def _min_max(_number[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
- * """See :func:`min_max` for documentation."""
- * cdef:
+ * """:func:`min_max` implementation including infinite values
+ *
*/
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_k__2 = __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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_5combo_5_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_min_positive = 0;
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_46__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __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_5combo_7_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_4silx_4math_5combo_7_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults11), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_3)->__pyx_arg_min_positive = 0;
- __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_48__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_double, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __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_5combo_9_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults12), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_50__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_signed_char, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_62__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_float, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_5combo_11_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_4silx_4math_5combo_9_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults13), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults13), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_52__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_signed_short, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_64__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_double, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_5combo_13_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_2__pyx_mdef_4silx_4math_5combo_11_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults14), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults14), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_54__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_signed_int, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_66__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_signed_char, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_5combo_15_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_3__pyx_mdef_4silx_4math_5combo_13_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults15), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults15), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_56__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_signed_long, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_68__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_short, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_5combo_17_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_4__pyx_mdef_4silx_4math_5combo_15_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults16), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults16), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_58__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_char, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_70__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_int, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_5combo_19_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_5__pyx_mdef_4silx_4math_5combo_17_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults17), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults17), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_60__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_short, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_72__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_long, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_5combo_21_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_6__pyx_mdef_4silx_4math_5combo_19_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults18), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults18), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_62__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_int, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_74__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_long_long, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_5combo_23_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_7__pyx_mdef_4silx_4math_5combo_21_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults19), 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults19), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_64__defaults__);
- if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_long_long, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_76__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_char, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_8__pyx_mdef_4silx_4math_5combo_23_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults20), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_t_3)->__pyx_arg_min_positive = 0;
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_78__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_short, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_9__pyx_mdef_4silx_4math_5combo_25_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults21), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_t_3)->__pyx_arg_min_positive = 0;
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_80__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_int, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_mdef_5combo_1_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_combo, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_10__pyx_mdef_4silx_4math_5combo_27_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults22), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_t_3)->__pyx_arg_min_positive = 0;
__Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
- __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_5combo_46__defaults__);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_82__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_long, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_fuse_11__pyx_mdef_4silx_4math_5combo_29_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults23), 0)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_t_3)->__pyx_arg_min_positive = 0;
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_84__defaults__);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_kp_s_unsigned_long_long, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __pyx_FusedFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_1_min_max, 0, __pyx_n_s_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__47)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_t_2);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_4silx_4math_5combo_62__defaults__);
((__pyx_FusedFunctionObject *) __pyx_t_3)->__signatures__ = __pyx_t_1;
__Pyx_GIVEREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_max, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_max, __pyx_t_3) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "combo.pyx":195
+ /* "silx/math/combo.pyx":210
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def _finite_min_max(cython.floating[::1] data, bint min_positive=False): # <<<<<<<<<<<<<<
+ * """:func:`min_max` implementation for floats skipping infinite values
+ *
+ */
+ __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_k__21 = __pyx_t_4;
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_0__pyx_mdef_4silx_4math_5combo_33_finite_min_max, 0, __pyx_n_s_finite_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults26), 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults26, __pyx_t_6)->__pyx_arg_min_positive = 0;
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_5);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_4silx_4math_5combo_90__defaults__);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_float, __pyx_t_6) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_fuse_1__pyx_mdef_4silx_4math_5combo_35_finite_min_max, 0, __pyx_n_s_finite_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (!__Pyx_CyFunction_InitDefaults(__pyx_t_6, sizeof(__pyx_defaults27), 0)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_CyFunction_Defaults(__pyx_defaults27, __pyx_t_6)->__pyx_arg_min_positive = 0;
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_5);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_4silx_4math_5combo_92__defaults__);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_double, __pyx_t_6) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __pyx_FusedFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_3_finite_min_max, 0, __pyx_n_s_finite_min_max, NULL, __pyx_n_s_silx_math_combo, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_6, __pyx_t_5);
+ __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_6, __pyx_pf_4silx_4math_5combo_90__defaults__);
+ ((__pyx_FusedFunctionObject *) __pyx_t_6)->__signatures__ = __pyx_t_4;
+ __Pyx_GIVEREF(__pyx_t_4);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_finite_min_max, __pyx_t_6) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "silx/math/combo.pyx":267
*
*
- * def min_max(data not None, bint min_positive=False): # <<<<<<<<<<<<<<
+ * def min_max(data not None, bint min_positive=False, bint finite=False): # <<<<<<<<<<<<<<
* """Returns min, max and optionally strictly positive min of data.
*
*/
- __pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_5combo_3min_max, NULL, __pyx_n_s_combo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_max_2, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_5combo_5min_max, NULL, __pyx_n_s_silx_math_combo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_min_max_2, __pyx_t_7) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "combo.pyx":1
+ /* "silx/math/combo.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* # /[inserted by cython to avoid comment start]*##########################################################################
* #
*/
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_4, __pyx_kp_u_min_max_line_195, __pyx_kp_u_Returns_min_max_and_optionally_s) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_t_7, __pyx_kp_u_min_max_line_267, __pyx_kp_u_Returns_min_max_and_optionally_s) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* info.obj = self
*
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
* def __dealloc__(array self):
*/
- __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 207, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_7) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_XGOTREF(generic);
- __Pyx_DECREF_SET(generic, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(generic, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_XGOTREF(strided);
- __Pyx_DECREF_SET(strided, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(strided, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_XGOTREF(indirect);
- __Pyx_DECREF_SET(indirect, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(indirect, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_XGOTREF(contiguous);
- __Pyx_DECREF_SET(contiguous, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(contiguous, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_XGOTREF(indirect_contiguous);
- __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_8[0] = PyThread_allocate_lock();
+ __pyx_t_8[1] = PyThread_allocate_lock();
+ __pyx_t_8[2] = PyThread_allocate_lock();
+ __pyx_t_8[3] = PyThread_allocate_lock();
+ __pyx_t_8[4] = PyThread_allocate_lock();
+ __pyx_t_8[5] = PyThread_allocate_lock();
+ __pyx_t_8[6] = PyThread_allocate_lock();
+ __pyx_t_8[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_8, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
- /* "View.MemoryView":496
+ /* "View.MemoryView":535
* info.obj = self
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 535, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_7) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * return self.from_object
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_7 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 981, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_7) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "__pyxutil":2
+ /* "View.MemoryView":1391
*
- * cdef extern from *: # <<<<<<<<<<<<<<
- * void __pyx_PyErr_Clear "PyErr_Clear" ()
- * __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(object)
+ * @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 ---*/
@@ -24510,13 +31629,14 @@ PyMODINIT_FUNC PyInit_combo(void)
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init combo", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.combo", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init combo");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.combo");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -24527,7 +31647,8 @@ PyMODINIT_FUNC PyInit_combo(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -24544,6 +31665,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -24557,6 +31679,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -24582,6 +31705,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -24595,6 +31719,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -24696,6 +31821,92 @@ bad:
return -1;
}
+/* PyIntBinop */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
@@ -24715,10 +31926,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -24728,27 +31939,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
+/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -24787,6 +31993,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -24820,10 +32027,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -24883,7 +32093,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -24903,23 +32113,92 @@ bad:
}
#endif
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -24929,16 +32208,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -24949,7 +32240,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -24967,7 +32258,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -24991,16 +32282,77 @@ bad:
return -1;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+/* UnicodeAsUCS4 */
+ static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
+ Py_ssize_t length;
+ #if CYTHON_PEP393_ENABLED
+ length = PyUnicode_GET_LENGTH(x);
+ if (likely(length == 1)) {
+ return PyUnicode_READ_CHAR(x, 0);
+ }
+ #else
+ length = PyUnicode_GET_SIZE(x);
+ if (likely(length == 1)) {
+ return PyUnicode_AS_UNICODE(x)[0];
+ }
+ #if Py_UNICODE_SIZE == 2
+ else if (PyUnicode_GET_SIZE(x) == 2) {
+ Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
+ if (high_val >= 0xD800 && high_val <= 0xDBFF) {
+ Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
+ if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
+ return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
+ }
+ }
+ }
+ #endif
+ #endif
+ PyErr_Format(PyExc_ValueError,
+ "only single character unicode strings can be converted to Py_UCS4, "
+ "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
+ return (Py_UCS4)-1;
+}
+
+/* object_ord */
+ static long __Pyx__PyObject_Ord(PyObject* c) {
+ Py_ssize_t size;
+ if (PyBytes_Check(c)) {
+ size = PyBytes_GET_SIZE(c);
+ if (likely(size == 1)) {
+ return (unsigned char) PyBytes_AS_STRING(c)[0];
+ }
+#if PY_MAJOR_VERSION < 3
+ } else if (PyUnicode_Check(c)) {
+ return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ } else if (PyByteArray_Check(c)) {
+ size = PyByteArray_GET_SIZE(c);
+ if (likely(size == 1)) {
+ return (unsigned char) PyByteArray_AS_STRING(c)[0];
+ }
+#endif
+ } else {
+ PyErr_Format(PyExc_TypeError,
+ "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
+ return (long)(Py_UCS4)-1;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "ord() expected a character, but string of length %zd found", size);
+ return (long)(Py_UCS4)-1;
+}
+
+/* SetItemInt */
+ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
int r;
if (!j) return -1;
r = PyObject_SetItem(o, j, v);
Py_DECREF(j);
return r;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
+ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
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)))) {
@@ -25018,10 +32370,9 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return -1;
+ PyErr_Clear();
}
}
return m->sq_ass_item(o, i, v);
@@ -25039,8 +32390,9 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* IterFinish */
+ static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
PyThreadState *tstate = PyThreadState_GET();
PyObject* exc_type = tstate->curexc_type;
if (unlikely(exc_type)) {
@@ -25073,7 +32425,128 @@ static CYTHON_INLINE int __Pyx_IterFinish(void) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -25092,8 +32565,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -25107,7 +32586,26 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -25119,6 +32617,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -25126,22 +32629,31 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+/* PyObjectCallMethod0 */
+ static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
PyObject *method, *result = NULL;
method = __Pyx_PyObject_GetAttrStr(obj, method_name);
if (unlikely(!method)) goto bad;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_UNPACK_METHODS
if (likely(PyMethod_Check(method))) {
PyObject *self = PyMethod_GET_SELF(method);
if (likely(self)) {
@@ -25158,18 +32670,21 @@ bad:
return result;
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+/* UnpackItemEndCheck */
+ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
if (unlikely(retval)) {
Py_DECREF(retval);
__Pyx_RaiseTooManyValuesError(expected);
@@ -25180,11 +32695,13 @@ static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
return 0;
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* UnpackTupleError */
+ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
if (t == Py_None) {
__Pyx_RaiseNoneNotIterableError();
} else if (PyTuple_GET_SIZE(t) < index) {
@@ -25194,7 +32711,8 @@ static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
}
}
-static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+/* UnpackTuple2 */
+ static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
int is_tuple, int has_known_size, int decref_tuple) {
Py_ssize_t index;
PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
@@ -25240,7 +32758,8 @@ bad:
return -1;
}
-static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+/* dict_iter */
+ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
Py_ssize_t* p_orig_length, int* p_source_is_dict) {
is_dict = is_dict || likely(PyDict_CheckExact(iterable));
*p_source_is_dict = is_dict;
@@ -25267,8 +32786,9 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di
}
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) {
+static CYTHON_INLINE int __Pyx_dict_iter_next(
+ PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
if (source_is_dict) {
@@ -25334,9 +32854,10 @@ static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* iter_obj, Py_ssize_t ori
return 1;
}
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+/* GetModuleGlobalName */
+ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -25351,7 +32872,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -25900,7 +33422,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -25956,7 +33479,6 @@ no_fail:
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
@@ -26035,33 +33557,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-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_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26098,7 +33595,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26181,14 +33679,43 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+}
+static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
+ const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (none_allowed && obj == Py_None) return 1;
+ else if (exact) {
+ if (likely(Py_TYPE(obj) == type)) return 1;
+ #if PY_MAJOR_VERSION == 2
+ else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(PyObject_TypeCheck(obj, type))) return 1;
+ }
+ __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
+ return 0;
+}
+
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -26200,13 +33727,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -26226,7 +33760,8 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -26238,26 +33773,33 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -26265,8 +33807,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -26279,8 +33822,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -26292,9 +33836,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -26318,10 +33863,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -26335,22 +33879,151 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -26371,9 +34044,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -26390,7 +34068,8 @@ bad:
return -1;
}
-static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
+/* CalculateMetaclass */
+ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
for (i=0; i < nbases; i++) {
PyTypeObject *tmptype;
@@ -26428,7 +34107,8 @@ static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bas
return (PyObject*) metaclass;
}
-static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+/* FetchCommonType */
+ static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
PyObject* fake_module;
PyTypeObject* cached_type = NULL;
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
@@ -26466,7 +34146,8 @@ bad:
goto done;
}
-static PyObject *
+/* CythonFunction */
+ static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
if (unlikely(op->func_doc == NULL)) {
@@ -26619,15 +34300,25 @@ __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
+ int result = 0;
PyObject *res = op->defaults_getter((PyObject *) op);
if (unlikely(!res))
return -1;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
Py_INCREF(op->defaults_tuple);
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
Py_INCREF(op->defaults_kwdict);
+ #else
+ op->defaults_tuple = PySequence_ITEM(res, 0);
+ if (unlikely(!op->defaults_tuple)) result = -1;
+ else {
+ op->defaults_kwdict = PySequence_ITEM(res, 1);
+ if (unlikely(!op->defaults_kwdict)) result = -1;
+ }
+ #endif
Py_DECREF(res);
- return 0;
+ return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
@@ -26737,9 +34428,6 @@ static PyGetSetDef __pyx_CyFunction_getsets[] = {
{(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}
@@ -26814,7 +34502,7 @@ __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
int i;
for (i = 0; i < m->defaults_pyobjects; i++)
Py_XDECREF(pydefaults[i]);
- PyMem_Free(m->defaults);
+ PyObject_Free(m->defaults);
m->defaults = NULL;
}
return 0;
@@ -26875,37 +34563,40 @@ __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
PyString_AsString(op->func_qualname), (void *)op);
#endif
}
-#if CYTHON_COMPILING_IN_PYPY
-static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
PyCFunctionObject* f = (PyCFunctionObject*)func;
- PyCFunction meth = PyCFunction_GET_FUNCTION(func);
- PyObject *self = PyCFunction_GET_SELF(func);
+ PyCFunction meth = f->m_ml->ml_meth;
Py_ssize_t size;
- switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
+ switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
case METH_VARARGS:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0)
+ 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) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 0)
+ if (likely(size == 0))
return (*meth)(self, NULL);
PyErr_Format(PyExc_TypeError,
- "%.200s() takes no arguments (%zd given)",
+ "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
break;
case METH_O:
- if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
+ if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
size = PyTuple_GET_SIZE(arg);
- if (size == 1)
- return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
+ if (likely(size == 1)) {
+ PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
+ if (unlikely(!arg0)) return NULL;
+ result = (*meth)(self, arg0);
+ Py_DECREF(arg0);
+ return result;
+ }
PyErr_Format(PyExc_TypeError,
- "%.200s() takes exactly one argument (%zd given)",
+ "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
f->m_ml->ml_name, size);
return NULL;
}
@@ -26920,11 +34611,32 @@ static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject
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);
+static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
+}
+static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
+ PyObject *result;
+ __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
+ if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
+ Py_ssize_t argc;
+ PyObject *new_args;
+ PyObject *self;
+ argc = PyTuple_GET_SIZE(args);
+ new_args = PyTuple_GetSlice(args, 1, argc);
+ if (unlikely(!new_args))
+ return NULL;
+ self = PyTuple_GetItem(args, 0);
+ if (unlikely(!self)) {
+ Py_DECREF(new_args);
+ return NULL;
+ }
+ result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
+ Py_DECREF(new_args);
+ } else {
+ result = __Pyx_CyFunction_Call(func, args, kw);
+ }
+ return result;
}
-#endif
static PyTypeObject __pyx_CyFunctionType_type = {
PyVarObject_HEAD_INIT(0, 0)
"cython_function_or_method",
@@ -26944,7 +34656,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
0,
0,
- __Pyx_CyFunction_Call,
+ __Pyx_CyFunction_CallAsMethod,
0,
0,
0,
@@ -26985,10 +34697,7 @@ static PyTypeObject __pyx_CyFunctionType_type = {
0,
#endif
};
-static int __Pyx_CyFunction_init(void) {
-#if !CYTHON_COMPILING_IN_PYPY
- __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
-#endif
+static int __pyx_CyFunction_init(void) {
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
if (__pyx_CyFunctionType == NULL) {
return -1;
@@ -26997,7 +34706,7 @@ static int __Pyx_CyFunction_init(void) {
}
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);
+ m->defaults = PyObject_Malloc(size);
if (!m->defaults)
return PyErr_NoMemory();
memset(m->defaults, 0, size);
@@ -27020,7 +34729,8 @@ static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, Py
Py_INCREF(dict);
}
-static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
+/* Py3ClassCreate */
+ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
PyObject *ns;
if (metaclass) {
@@ -27086,7 +34796,8 @@ static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObj
return result;
}
-static PyObject *
+/* FusedFunction */
+ static PyObject *
__pyx_FusedFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags,
PyObject *qualname, PyObject *self,
PyObject *module, PyObject *globals,
@@ -27186,8 +34897,15 @@ __pyx_FusedFunction_getitem(__pyx_FusedFunctionObject *self, PyObject *idx)
if (!list)
return NULL;
for (i = 0; i < n; i++) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject *item = PyTuple_GET_ITEM(idx, i);
+#else
+ PyObject *item = PySequence_ITEM(idx, i);
+#endif
string = _obj_to_str(item);
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_DECREF(item);
+#endif
if (!string || PyList_Append(list, string) < 0)
goto __pyx_err;
Py_DECREF(string);
@@ -27226,30 +34944,13 @@ 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);
+ return __Pyx_CyFunction_CallAsMethod(func, args, kw);
} else {
- result = __Pyx_CyFunction_Call(func, args, kw);
+ return __Pyx_CyFunction_Call(func, args, kw);
}
- return result;
}
static PyObject *
__pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
@@ -27268,11 +34969,18 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
if (!new_args)
return NULL;
self = binding_func->self;
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_INCREF(self);
+#endif
Py_INCREF(self);
PyTuple_SET_ITEM(new_args, 0, self);
for (i = 0; i < argc; i++) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
PyObject *item = PyTuple_GET_ITEM(args, i);
Py_INCREF(item);
+#else
+ PyObject *item = PySequence_ITEM(args, i); if (unlikely(!item)) goto bad;
+#endif
PyTuple_SET_ITEM(new_args, i + 1, item);
}
args = new_args;
@@ -27281,33 +34989,57 @@ __pyx_FusedFunction_call(PyObject *func, PyObject *args, PyObject *kw)
PyErr_SetString(PyExc_TypeError, "Need at least one argument, 0 given.");
return NULL;
}
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
self = PyTuple_GET_ITEM(args, 0);
+#else
+ self = PySequence_ITEM(args, 0); if (unlikely(!self)) return NULL;
+#endif
}
- 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 (self && !is_classmethod && !is_staticmethod) {
+ int is_instance = PyObject_IsInstance(self, binding_func->type);
+ if (unlikely(!is_instance)) {
+ 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 bad;
+ } else if (unlikely(is_instance == -1)) {
+ goto bad;
+ }
}
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_XDECREF(self);
+ self = NULL;
+#endif
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);
+ PyObject *tup;
+ if (is_staticmethod && binding_func->func.flags & __Pyx_CYFUNCTION_CCLASS) {
+ tup = PyTuple_Pack(3, args,
+ kw == NULL ? Py_None : kw,
+ binding_func->func.defaults_tuple);
+ if (unlikely(!tup)) goto bad;
+ new_func = (__pyx_FusedFunctionObject *) __Pyx_CyFunction_CallMethod(
+ func, binding_func->__signatures__, tup, NULL);
+ } else {
+ tup = PyTuple_Pack(4, binding_func->__signatures__, args,
+ kw == NULL ? Py_None : kw,
+ binding_func->func.defaults_tuple);
+ if (unlikely(!tup)) goto bad;
+ new_func = (__pyx_FusedFunctionObject *) __pyx_FusedFunction_callfunction(func, tup, NULL);
+ }
Py_DECREF(tup);
- if (!new_func)
- goto __pyx_err;
+ if (unlikely(!new_func))
+ goto bad;
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:
+bad:
+#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
+ Py_XDECREF(self);
+#endif
Py_XDECREF(new_args);
Py_XDECREF((PyObject *) new_func);
return result;
@@ -27389,13 +35121,14 @@ static int __pyx_FusedFunction_init(void) {
return 0;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -27468,7 +35201,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -27541,14 +35275,108 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, 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_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;
+ }
+ Py_DECREF(obj);
+ view->obj = NULL;
+}
+#endif
+
+
+ /* MemviewSliceIsContig */
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
+}
+
+/* Capsule */
+ 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;
+}
+
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -27588,7 +35416,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -27769,7 +35598,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27791,7 +35621,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27813,7 +35644,31 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_char(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed__char(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_signed__char, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_short(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27824,7 +35679,7 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_sig
}
retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
(PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
- &__Pyx_TypeInfo_signed_char, stack,
+ &__Pyx_TypeInfo_short, stack,
&result, obj);
if (unlikely(retcode == -1))
goto __pyx_fail;
@@ -27835,7 +35690,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_short(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_int(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27846,7 +35702,7 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_sig
}
retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
(PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
- &__Pyx_TypeInfo_signed_short, stack,
+ &__Pyx_TypeInfo_int, stack,
&result, obj);
if (unlikely(retcode == -1))
goto __pyx_fail;
@@ -27857,7 +35713,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_int(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27868,7 +35725,7 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_sig
}
retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
(PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
- &__Pyx_TypeInfo_signed_int, stack,
+ &__Pyx_TypeInfo_long, stack,
&result, obj);
if (unlikely(retcode == -1))
goto __pyx_fail;
@@ -27879,7 +35736,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_signed_long(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_PY_LONG_LONG(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27890,7 +35748,7 @@ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_sig
}
retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
(PyBUF_C_CONTIGUOUS | PyBUF_FORMAT | PyBUF_WRITABLE), 1,
- &__Pyx_TypeInfo_signed_long, stack,
+ &__Pyx_TypeInfo_PY_LONG_LONG, stack,
&result, obj);
if (unlikely(retcode == -1))
goto __pyx_fail;
@@ -27901,7 +35759,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_char(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_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_CONTIG) };
@@ -27923,7 +35782,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_short(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27945,7 +35805,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_int(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27967,7 +35828,31 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_long(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_unsigned_long, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_unsigned_PY_LONG_LONG(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27989,291 +35874,559 @@ __pyx_fail:
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;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
}
- 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;
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_float(const char *itemp) {
+ return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
+ float value = __pyx_PyFloat_AsFloat(obj);
+ if ((value == (float)-1) && PyErr_Occurred())
+ return 0;
+ *(float *) itemp = value;
+ return 1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
+ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 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);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
+ } else {
+ if (sizeof(unsigned int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ {
+ 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);
+ }
}
-#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_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;
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
+ return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
}
-static void __Pyx_ReleaseBuffer(Py_buffer *view) {
- PyObject *obj = view->obj;
- if (!obj) return;
- if (PyObject_CheckBuffer(obj)) {
- PyBuffer_Release(view);
- return;
- }
- Py_DECREF(obj);
- view->obj = NULL;
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
+ double value = __pyx_PyFloat_AsDouble(obj);
+ if ((value == (double)-1) && PyErr_Occurred())
+ return 0;
+ *(double *) itemp = value;
+ return 1;
}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__char(signed char value) {
+ const signed char neg_one = (signed char) -1, const_zero = (signed char) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(signed char) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(signed char) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(signed char) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
+ }
+ } else {
+ if (sizeof(signed char) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(signed char) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(signed char),
+ little, !is_unsigned);
+ }
+}
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_signed__char(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_signed__char(*(signed char *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_signed__char(const char *itemp, PyObject *obj) {
+ signed char value = __Pyx_PyInt_As_signed__char(obj);
+ if ((value == (signed char)-1) && PyErr_Occurred())
+ return 0;
+ *(signed char *) itemp = value;
+ return 1;
+}
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
+ const short neg_one = (short) -1, const_zero = (short) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
- if (sizeof(long) < sizeof(long)) {
+ if (sizeof(short) < sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(unsigned long)) {
+ } else if (sizeof(short) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
- if (sizeof(long) <= sizeof(long)) {
+ if (sizeof(short) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(long),
+ return _PyLong_FromByteArray(bytes, sizeof(short),
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; \
- }
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_short(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_short(*(short *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_short(const char *itemp, PyObject *obj) {
+ short value = __Pyx_PyInt_As_short(obj);
+ if ((value == (short)-1) && PyErr_Occurred())
+ return 0;
+ *(short *) itemp = value;
+ return 1;
+}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #endif
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_int(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_int(*(int *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_int(const char *itemp, PyObject *obj) {
+ int value = __Pyx_PyInt_As_int(obj);
+ if ((value == (int)-1) && PyErr_Occurred())
+ return 0;
+ *(int *) itemp = value;
+ return 1;
+}
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_long(*(long *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj) {
+ long value = __Pyx_PyInt_As_long(obj);
+ if ((value == (long)-1) && PyErr_Occurred())
+ return 0;
+ *(long *) itemp = value;
+ return 1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
+ const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
const int is_unsigned = neg_one > const_zero;
-#if 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;
+ if (is_unsigned) {
+ if (sizeof(PY_LONG_LONG) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
- } else
+ } else {
+ if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#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
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_PY_LONG_LONG(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_PY_LONG_LONG(*(PY_LONG_LONG *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_PY_LONG_LONG(const char *itemp, PyObject *obj) {
+ PY_LONG_LONG value = __Pyx_PyInt_As_PY_LONG_LONG(obj);
+ if ((value == (PY_LONG_LONG)-1) && PyErr_Occurred())
+ return 0;
+ *(PY_LONG_LONG *) itemp = value;
+ return 1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
+ const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(unsigned char) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#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
+ }
+ } else {
+ if (sizeof(unsigned char) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#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;
- }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_unsigned_char(*(unsigned char *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
+ unsigned char value = __Pyx_PyInt_As_unsigned_char(obj);
+ if ((value == (unsigned char)-1) && PyErr_Occurred())
+ return 0;
+ *(unsigned char *) itemp = value;
+ return 1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
+ const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(unsigned short) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#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;
+ if (sizeof(unsigned short) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned short),
+ little, !is_unsigned);
}
-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;
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_short(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_unsigned_short(*(unsigned short *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj) {
+ unsigned short value = __Pyx_PyInt_As_unsigned_short(obj);
+ if ((value == (unsigned short)-1) && PyErr_Occurred())
+ return 0;
+ *(unsigned short *) itemp = value;
+ return 1;
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_int(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_unsigned_int(*(unsigned int *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_unsigned_int(const char *itemp, PyObject *obj) {
+ unsigned int value = __Pyx_PyInt_As_unsigned_int(obj);
+ if ((value == (unsigned int)-1) && PyErr_Occurred())
+ return 0;
+ *(unsigned int *) itemp = value;
+ return 1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
+ const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(unsigned long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(unsigned long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
+ little, !is_unsigned);
}
- return 0;
}
-static PyObject *__pyx_memview_get_float(const char *itemp) {
- return (PyObject *) PyFloat_FromDouble(*(float *) itemp);
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_long(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_unsigned_long(*(unsigned long *) itemp);
}
-static int __pyx_memview_set_float(const char *itemp, PyObject *obj) {
- float value = __pyx_PyFloat_AsFloat(obj);
- if ((value == (float)-1) && PyErr_Occurred())
+static CYTHON_INLINE int __pyx_memview_set_unsigned_long(const char *itemp, PyObject *obj) {
+ unsigned long value = __Pyx_PyInt_As_unsigned_long(obj);
+ if ((value == (unsigned long)-1) && PyErr_Occurred())
return 0;
- *(float *) itemp = value;
+ *(unsigned long *) itemp = value;
return 1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
- const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
+ const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
- if (sizeof(unsigned int) < sizeof(long)) {
+ if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+ } else if (sizeof(unsigned PY_LONG_LONG) <= 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);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
- if (sizeof(unsigned int) <= sizeof(long)) {
+ if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG),
little, !is_unsigned);
}
}
-static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
- const unsigned int neg_one = (unsigned int) -1, const_zero = 0;
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_unsigned_PY_LONG_LONG(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_unsigned_PY_LONG_LONG(*(unsigned PY_LONG_LONG *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_unsigned_PY_LONG_LONG(const char *itemp, PyObject *obj) {
+ unsigned PY_LONG_LONG value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(obj);
+ if ((value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())
+ return 0;
+ *(unsigned PY_LONG_LONG *) itemp = value;
+ return 1;
+}
+
+/* MemviewSliceCopyTemplate */
+ 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;
+}
+
+/* BytesContains */
+ 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);
+ return memchr(char_start, (unsigned char)character, (size_t)length) != NULL;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -28290,36 +36443,129 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
+ return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
+ return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
+ return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (unsigned int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28328,7 +36574,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
unsigned int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -28351,7 +36597,7 @@ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
}
} else {
unsigned int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (unsigned int) -1;
val = __Pyx_PyInt_As_unsigned_int(tmp);
Py_DECREF(tmp);
@@ -28367,45 +36613,9 @@ raise_neg_overflow:
return (unsigned int) -1;
}
-static PyObject *__pyx_memview_get_double(const char *itemp) {
- return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
-}
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
- double value = __pyx_PyFloat_AsDouble(obj);
- if ((value == (double)-1) && PyErr_Occurred())
- return 0;
- *(double *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__char(signed char value) {
- const signed char neg_one = (signed char) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(signed char) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed char) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(signed char) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(signed char) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed char) <= 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(signed char),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
- const signed char neg_one = (signed char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
+ const signed char neg_one = (signed char) -1, const_zero = (signed char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -28422,36 +36632,129 @@ static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (signed char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(signed char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(signed char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) >= 2 * PyLong_SHIFT) {
+ return (signed char) (((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(signed char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) >= 3 * PyLong_SHIFT) {
+ return (signed char) (((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(signed char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) >= 4 * PyLong_SHIFT) {
+ return (signed char) (((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (signed char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(signed char) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(signed char, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(signed char) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(signed char, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(signed char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(signed char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(signed char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed char, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(signed char, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (signed char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(signed char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(signed char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(signed char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
+ return (signed char) (((signed char)-1)*(((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(signed char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
+ return (signed char) ((((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
+ return (signed char) (((signed char)-1)*(((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(signed char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
+ return (signed char) ((((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 4 * PyLong_SHIFT) {
+ return (signed char) (((signed char)-1)*(((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(signed char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(signed char) - 1 > 4 * PyLong_SHIFT) {
+ return (signed char) ((((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
if (sizeof(signed char) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed char, long, PyLong_AsLong(x))
- } else if (sizeof(signed char) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(signed char, long long, PyLong_AsLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(signed char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(signed char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(signed char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28460,7 +36763,7 @@ static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
signed char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -28483,7 +36786,7 @@ static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
}
} else {
signed char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (signed char) -1;
val = __Pyx_PyInt_As_signed__char(tmp);
Py_DECREF(tmp);
@@ -28499,91 +36802,148 @@ raise_neg_overflow:
return (signed char) -1;
}
-static PyObject *__pyx_memview_get_signed_char(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_signed__char(*(signed char *) itemp);
-}
-static int __pyx_memview_set_signed_char(const char *itemp, PyObject *obj) {
- signed char value = __Pyx_PyInt_As_signed__char(obj);
- if ((value == (signed char)-1) && PyErr_Occurred())
- return 0;
- *(signed char *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__short(signed short value) {
- const signed short neg_one = (signed short) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(signed short) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed short) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(signed short) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(signed short) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed short) <= 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(signed short),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_As_signed__short(PyObject *x) {
- const signed short neg_one = (signed short) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) {
+ const short neg_one = (short) -1, const_zero = (short) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(signed short) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed short, long, PyInt_AS_LONG(x))
+ if (sizeof(short) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(short, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
- return (signed short) val;
+ return (short) 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed short, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (short) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(short, digit, digits[0])
+ case 2:
+ if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) >= 2 * PyLong_SHIFT) {
+ return (short) (((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) >= 3 * PyLong_SHIFT) {
+ return (short) (((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) >= 4 * PyLong_SHIFT) {
+ return (short) (((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
- if (sizeof(signed short) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(signed short, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(signed short) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(signed short, unsigned long long, PyLong_AsUnsignedLongLong(x))
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (short) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(short) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(short, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed short, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(signed short, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (short) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(short, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(short, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(short) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
+ return (short) (((short)-1)*(((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
+ return (short) ((((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
+ return (short) (((short)-1)*(((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
+ return (short) ((((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
+ return (short) (((short)-1)*(((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
+ return (short) ((((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
- if (sizeof(signed short) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed short, long, PyLong_AsLong(x))
- } else if (sizeof(signed short) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(signed short, long long, PyLong_AsLongLong(x))
+ if (sizeof(short) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(short, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(short, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28591,8 +36951,8 @@ static CYTHON_INLINE signed short __Pyx_PyInt_As_signed__short(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- signed short val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ short val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -28611,111 +36971,168 @@ static CYTHON_INLINE signed short __Pyx_PyInt_As_signed__short(PyObject *x) {
return val;
}
#endif
- return (signed short) -1;
+ return (short) -1;
}
} else {
- signed short val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed short) -1;
- val = __Pyx_PyInt_As_signed__short(tmp);
+ short val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (short) -1;
+ val = __Pyx_PyInt_As_short(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to signed short");
- return (signed short) -1;
+ "value too large to convert to short");
+ return (short) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed short");
- return (signed short) -1;
-}
-
-static PyObject *__pyx_memview_get_signed_short(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_signed__short(*(signed short *) itemp);
-}
-static int __pyx_memview_set_signed_short(const char *itemp, PyObject *obj) {
- signed short value = __Pyx_PyInt_As_signed__short(obj);
- if ((value == (signed short)-1) && PyErr_Occurred())
- return 0;
- *(signed short *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__int(signed int value) {
- const signed int neg_one = (signed int) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(signed int) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed int) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(signed int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(signed int) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed 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(signed int),
- little, !is_unsigned);
- }
+ "can't convert negative value to short");
+ return (short) -1;
}
-static CYTHON_INLINE signed int __Pyx_PyInt_As_signed__int(PyObject *x) {
- const signed int neg_one = (signed int) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(signed int) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed int, long, PyInt_AS_LONG(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 (signed int) val;
+ 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
- if (sizeof(signed int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(signed int, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(signed int) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(signed int, unsigned long long, PyLong_AsUnsignedLongLong(x))
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed int, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(signed int, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
- if (sizeof(signed int) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed int, long, PyLong_AsLong(x))
- } else if (sizeof(signed int) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(signed int, long long, PyLong_AsLongLong(x))
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28723,8 +37140,8 @@ static CYTHON_INLINE signed int __Pyx_PyInt_As_signed__int(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- signed int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -28743,111 +37160,168 @@ static CYTHON_INLINE signed int __Pyx_PyInt_As_signed__int(PyObject *x) {
return val;
}
#endif
- return (signed int) -1;
+ return (int) -1;
}
} else {
- signed int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed int) -1;
- val = __Pyx_PyInt_As_signed__int(tmp);
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to signed int");
- return (signed int) -1;
+ "value too large to convert to int");
+ return (int) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed int");
- return (signed int) -1;
-}
-
-static PyObject *__pyx_memview_get_signed_int(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_signed__int(*(signed int *) itemp);
-}
-static int __pyx_memview_set_signed_int(const char *itemp, PyObject *obj) {
- signed int value = __Pyx_PyInt_As_signed__int(obj);
- if ((value == (signed int)-1) && PyErr_Occurred())
- return 0;
- *(signed int *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__long(signed long value) {
- const signed long neg_one = (signed long) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(signed long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(signed long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(signed long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(signed 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(signed long),
- little, !is_unsigned);
- }
+ "can't convert negative value to int");
+ return (int) -1;
}
-static CYTHON_INLINE signed long __Pyx_PyInt_As_signed__long(PyObject *x) {
- const signed long neg_one = (signed long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(signed long) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed long, long, PyInt_AS_LONG(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 (signed long) val;
+ 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
- if (sizeof(signed long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(signed long, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(signed long) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(signed long, unsigned long long, PyLong_AsUnsignedLongLong(x))
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(signed long, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(signed long, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
- if (sizeof(signed long) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(signed long, long, PyLong_AsLong(x))
- } else if (sizeof(signed long) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(signed long, long long, PyLong_AsLongLong(x))
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28855,8 +37329,8 @@ static CYTHON_INLINE signed long __Pyx_PyInt_As_signed__long(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- signed long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -28875,65 +37349,218 @@ static CYTHON_INLINE signed long __Pyx_PyInt_As_signed__long(PyObject *x) {
return val;
}
#endif
- return (signed long) -1;
+ return (long) -1;
}
} else {
- signed long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed long) -1;
- val = __Pyx_PyInt_As_signed__long(tmp);
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to signed long");
- return (signed long) -1;
+ "value too large to convert to long");
+ return (long) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long) -1;
-}
-
-static PyObject *__pyx_memview_get_signed_long(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_signed__long(*(signed long *) itemp);
-}
-static int __pyx_memview_set_signed_long(const char *itemp, PyObject *obj) {
- signed long value = __Pyx_PyInt_As_signed__long(obj);
- if ((value == (signed long)-1) && PyErr_Occurred())
- return 0;
- *(signed long *) itemp = value;
- return 1;
+ "can't convert negative value to long");
+ return (long) -1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
- const unsigned char neg_one = (unsigned char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
+ const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned char) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned char) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(PY_LONG_LONG) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (PY_LONG_LONG) val;
}
- } else {
- if (sizeof(unsigned char) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned char) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (PY_LONG_LONG) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
+ case 2:
+ if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (PY_LONG_LONG) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (PY_LONG_LONG) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
}
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ PY_LONG_LONG val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (PY_LONG_LONG) -1;
+ }
+ } else {
+ PY_LONG_LONG val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (PY_LONG_LONG) -1;
+ val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
+ Py_DECREF(tmp);
+ return val;
}
- {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
- little, !is_unsigned);
- }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to PY_LONG_LONG");
+ return (PY_LONG_LONG) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to PY_LONG_LONG");
+ return (PY_LONG_LONG) -1;
}
-static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
- const unsigned char neg_one = (unsigned char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
+ const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -28950,36 +37577,129 @@ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
+ return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
+ return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
+ return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(unsigned char) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(unsigned char) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
if (sizeof(unsigned char) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, long, PyLong_AsLong(x))
- } else if (sizeof(unsigned char) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned char, long long, PyLong_AsLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -28988,7 +37708,7 @@ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
unsigned char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -29011,7 +37731,7 @@ static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
}
} else {
unsigned char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (unsigned char) -1;
val = __Pyx_PyInt_As_unsigned_char(tmp);
Py_DECREF(tmp);
@@ -29027,45 +37747,9 @@ raise_neg_overflow:
return (unsigned char) -1;
}
-static PyObject *__pyx_memview_get_unsigned_char(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_unsigned_char(*(unsigned char *) itemp);
-}
-static int __pyx_memview_set_unsigned_char(const char *itemp, PyObject *obj) {
- unsigned char value = __Pyx_PyInt_As_unsigned_char(obj);
- if ((value == (unsigned char)-1) && PyErr_Occurred())
- return 0;
- *(unsigned char *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
- const unsigned short neg_one = (unsigned short) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned short) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned short) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(unsigned short) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned short) <= 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 short),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
- const unsigned short neg_one = (unsigned short) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
+ const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -29082,36 +37766,129 @@ static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned short) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) {
+ return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) {
+ return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) {
+ return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned short) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(unsigned short) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(unsigned short) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned short) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
if (sizeof(unsigned short) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned short, long, PyLong_AsLong(x))
- } else if (sizeof(unsigned short) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned short, long long, PyLong_AsLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -29120,7 +37897,7 @@ static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
unsigned short val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -29143,7 +37920,7 @@ static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
}
} else {
unsigned short val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (unsigned short) -1;
val = __Pyx_PyInt_As_unsigned_short(tmp);
Py_DECREF(tmp);
@@ -29159,102 +37936,148 @@ raise_neg_overflow:
return (unsigned short) -1;
}
-static PyObject *__pyx_memview_get_unsigned_short(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_unsigned_short(*(unsigned short *) itemp);
-}
-static int __pyx_memview_set_unsigned_short(const char *itemp, PyObject *obj) {
- unsigned short value = __Pyx_PyInt_As_unsigned_short(obj);
- if ((value == (unsigned short)-1) && PyErr_Occurred())
- return 0;
- *(unsigned short *) itemp = value;
- return 1;
-}
-
-static PyObject *__pyx_memview_get_unsigned_int(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_unsigned_int(*(unsigned int *) itemp);
-}
-static int __pyx_memview_set_unsigned_int(const char *itemp, PyObject *obj) {
- unsigned int value = __Pyx_PyInt_As_unsigned_int(obj);
- if ((value == (unsigned int)-1) && PyErr_Occurred())
- return 0;
- *(unsigned int *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(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 PY_LONG_LONG),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
+ const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG(x))
+ if (sizeof(unsigned long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x))
} else {
long val = PyInt_AS_LONG(x);
if (is_unsigned && unlikely(val < 0)) {
goto raise_neg_overflow;
}
- return (unsigned PY_LONG_LONG) val;
+ return (unsigned 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) {
+ return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) {
+ return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT) {
+ return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
- if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long long, PyLong_AsUnsignedLongLong(x))
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(unsigned long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
- if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyLong_AsLong(x))
- } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long long, PyLong_AsLongLong(x))
+ if (sizeof(unsigned long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -29262,8 +38085,8 @@ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- unsigned PY_LONG_LONG val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ unsigned long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -29282,220 +38105,168 @@ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(
return val;
}
#endif
- return (unsigned PY_LONG_LONG) -1;
+ return (unsigned long) -1;
}
} else {
- unsigned PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned PY_LONG_LONG) -1;
- val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp);
+ unsigned long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (unsigned long) -1;
+ val = __Pyx_PyInt_As_unsigned_long(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG) -1;
+ "value too large to convert to unsigned long");
+ return (unsigned long) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG) -1;
-}
-
-static PyObject *__pyx_memview_get_unsigned_PY_LONG_LONG(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_unsigned_PY_LONG_LONG(*(unsigned PY_LONG_LONG *) itemp);
-}
-static int __pyx_memview_set_unsigned_PY_LONG_LONG(const char *itemp, PyObject *obj) {
- unsigned PY_LONG_LONG value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(obj);
- if ((value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())
- return 0;
- *(unsigned PY_LONG_LONG *) itemp = value;
- return 1;
-}
-
-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;
+ "can't convert negative value to unsigned long");
+ return (unsigned long) -1;
}
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) {
+ const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(int) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, 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;
+ return (unsigned PY_LONG_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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (unsigned PY_LONG_LONG) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
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
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned PY_LONG_LONG) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (unsigned PY_LONG_LONG) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) ((((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) ((((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned PY_LONG_LONG) ((((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
+ }
+ }
+ break;
}
- #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 (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -29503,8 +38274,8 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ unsigned PY_LONG_LONG val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -29523,100 +38294,168 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
return val;
}
#endif
- return (int) -1;
+ return (unsigned PY_LONG_LONG) -1;
}
} else {
- int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (int) -1;
- val = __Pyx_PyInt_As_int(tmp);
+ unsigned PY_LONG_LONG val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (unsigned PY_LONG_LONG) -1;
+ val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to int");
- return (int) -1;
+ "value too large to convert to unsigned PY_LONG_LONG");
+ return (unsigned PY_LONG_LONG) -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_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);
- }
+ "can't convert negative value to unsigned PY_LONG_LONG");
+ return (unsigned PY_LONG_LONG) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 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))
+ 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 (long) val;
+ 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
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
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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 (sizeof(char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -29624,8 +38463,8 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -29644,27 +38483,28 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
return val;
}
#endif
- return (long) -1;
+ return (char) -1;
}
} else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (long) -1;
- val = __Pyx_PyInt_As_long(tmp);
+ char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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 long");
- return (long) -1;
+ "value too large to convert to char");
+ return (char) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long) -1;
+ "can't convert negative value to char");
+ return (char) -1;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -29679,7 +38519,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -29717,7 +38558,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -29758,7 +38599,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -29779,8 +38620,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -29788,9 +38631,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -29799,11 +38643,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -29828,18 +38675,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/combo/combo.pyx b/silx/math/combo.pyx
index 0390bce..9582dcb 100644
--- a/silx/math/combo/combo.pyx
+++ b/silx/math/combo.pyx
@@ -25,19 +25,26 @@
"""This module provides combination of statistics as single operation.
For now it provides min/max (and optionally positive min) and indices
-of first occurences (i.e., argmin/argmax) in a single pass.
+of first occurrences (i.e., argmin/argmax) in a single pass.
"""
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "20/12/2016"
+__date__ = "16/08/2017"
cimport cython
+# Windows compatibility: Cross-platform INFINITY
+from libc.float cimport DBL_MAX
+cdef double INFINITY = DBL_MAX + DBL_MAX
+# from libc.math cimport INFINITY
+
# Replacement from libc.math cimport isnan
# which is not available on Windows for Python2.7
cdef extern from "isnan.h":
bint isnan(double x) nogil
+ bint isfinite(double x) nogil
+
import numpy
@@ -49,9 +56,11 @@ ctypedef fused _number:
signed short
signed int
signed long
+ signed long long
unsigned char
unsigned short
unsigned int
+ unsigned long
unsigned long long
@@ -77,10 +86,10 @@ class _MinMaxResult(object):
argmin = property(
lambda self: self._argmin,
- doc="Index of the first occurence of the minimum value")
+ doc="Index of the first occurrence of the minimum value")
argmax = property(
lambda self: self._argmax,
- doc="Index of the first occurence of the maximum value")
+ doc="Index of the first occurrence of the maximum value")
min_positive = property(
lambda self: self._min_positive,
@@ -93,7 +102,7 @@ class _MinMaxResult(object):
doc="""Index of the strictly positive minimum value.
It is None if no value is strictly positive.
- It is the index of the first occurence.""")
+ It is the index of the first occurrence.""")
def __getitem__(self, key):
if key == 0:
@@ -108,7 +117,10 @@ class _MinMaxResult(object):
@cython.boundscheck(False)
@cython.wraparound(False)
def _min_max(_number[::1] data, bint min_positive=False):
- """See :func:`min_max` for documentation."""
+ """:func:`min_max` implementation including infinite values
+
+ See :func:`min_max` for documentation.
+ """
cdef:
_number value, minimum, minpos, maximum
unsigned int length
@@ -180,7 +192,7 @@ def _min_max(_number[::1] data, bint min_positive=False):
minimum = value
min_index = index
- if value > 0 and value < min_pos:
+ if 0 < value < min_pos:
min_pos = value
min_pos_index = index
@@ -192,10 +204,70 @@ def _min_max(_number[::1] data, bint min_positive=False):
max_index)
-def min_max(data not None, bint min_positive=False):
+@cython.initializedcheck(False)
+@cython.boundscheck(False)
+@cython.wraparound(False)
+def _finite_min_max(cython.floating[::1] data, bint min_positive=False):
+ """:func:`min_max` implementation for floats skipping infinite values
+
+ See :func:`min_max` for documentation.
+ """
+ cdef:
+ cython.floating value, minimum, minpos, maximum
+ unsigned int length
+ unsigned int index = 0
+ unsigned int min_index = 0
+ unsigned int min_pos_index = 0
+ unsigned int max_index = 0
+
+ length = len(data)
+
+ if length == 0:
+ raise ValueError('Zero-size array')
+
+ with nogil:
+ minimum = INFINITY
+ maximum = -INFINITY
+ min_pos = INFINITY
+
+ if not min_positive:
+ for index in range(length):
+ value = data[index]
+ if isfinite(value):
+ if value > maximum:
+ maximum = value
+ max_index = index
+ if value < minimum:
+ minimum = value
+ min_index = index
+
+ else:
+ for index in range(index, length):
+ value = data[index]
+ if isfinite(value):
+ if value > maximum:
+ maximum = value
+ max_index = index
+ if value < minimum:
+ minimum = value
+ min_index = index
+
+ if 0. < value < min_pos:
+ min_pos = value
+ min_pos_index = index
+
+ return _MinMaxResult(minimum if isfinite(minimum) else None,
+ min_pos if isfinite(min_pos) else None,
+ maximum if isfinite(maximum) else None,
+ min_index if isfinite(minimum) else None,
+ min_pos_index if isfinite(min_pos) else None,
+ max_index if isfinite(maximum) else None)
+
+
+def min_max(data not None, bint min_positive=False, bint finite=False):
"""Returns min, max and optionally strictly positive min of data.
- It also computes the indices of first occurence of min/max.
+ It also computes the indices of first occurrence of min/max.
NaNs are ignored while computing min/max unless all data is NaNs,
in which case returned min/max are NaNs.
@@ -225,14 +297,26 @@ def min_max(data not None, bint min_positive=False):
>>> result.min_positive, result.argmin_positive # Computed
1, 1
+ If *finite* is True, min/max information is computed only from finite data.
+ Then, all result fields (include minimum and maximum) can be None
+ when all data is infinity or NaN.
+
:param data: Array-like dataset
:param bool min_positive: True to compute the positive min and argmin
Default: False.
+ :param bool finite: True to compute min/max from finite data only
+ Default: False.
:returns: An object with minimum, maximum and min_positive attributes
- and the indices of first occurence in the flattened data:
+ and the indices of first occurrence in the flattened data:
argmin, argmax and argmin_positive attributes.
If all data is <= 0 or min_positive argument is False, then
min_positive and argmin_positive are None.
:raises: ValueError if data is empty
"""
- return _min_max(numpy.ascontiguousarray(data).ravel(), min_positive)
+ data = numpy.array(data, copy=False)
+ native_endian_dtype = data.dtype.newbyteorder('N')
+ data = numpy.ascontiguousarray(data, dtype=native_endian_dtype).ravel()
+ if finite and data.dtype.kind == 'f':
+ return _finite_min_max(data, min_positive)
+ else:
+ return _min_max(data, min_positive)
diff --git a/silx/math/fit/filters/filters.c b/silx/math/fit/filters.c
index fd83ee7..84fde30 100644
--- a/silx/math/fit/filters/filters.c
+++ b/silx/math/fit/filters.c
@@ -1,28 +1,32 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "silx/math/fit/filters/include/filters.h"
+ ],
+ "include_dirs": [
+ "silx/math/fit/filters/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.fit.filters"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +45,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +57,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +273,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +294,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +333,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +359,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +443,13 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__filters
-#define __PYX_HAVE_API__filters
+#define __PYX_HAVE__silx__math__fit__filters
+#define __PYX_HAVE_API__silx__math__fit__filters
#include "filters.h"
#include "pythread.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +459,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +467,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +511,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +529,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +558,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +638,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -421,9 +646,10 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "filters.pyx",
+ "silx/math/fit/filters.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +659,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +695,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +733,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -522,7 +751,7 @@ struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -531,6 +760,7 @@ struct __pyx_memoryviewslice_obj;
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -546,7 +776,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -559,7 +789,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -582,7 +812,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -599,7 +829,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -619,7 +863,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -631,6 +875,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -647,19 +894,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -682,18 +929,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -708,42 +956,97 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -769,20 +1072,21 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -790,58 +1094,97 @@ 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);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-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
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -857,12 +1200,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -875,7 +1221,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -891,26 +1238,29 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
-#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
-
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -922,9 +1272,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -938,53 +1299,56 @@ typedef struct {
__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
-
-
+/* None.proto */
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 PyObject *__pyx_memview_get_double(const char *itemp);
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj);
-
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
-
-static PyObject *__pyx_memview_get_long(const char *itemp);
-static int __pyx_memview_set_long(const char *itemp, PyObject *obj);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
char order, int ndim);
+/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
__Pyx_memviewslice *slice2,
int ndim, size_t itemsize);
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj);
+
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -995,14 +1359,19 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1017,9 +1386,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* Module declarations from 'cython' */
-/* Module declarations from 'filters_wrapper' */
+/* Module declarations from 'silx.math.fit.filters_wrapper' */
-/* Module declarations from 'filters' */
+/* Module declarations from 'silx.math.fit.filters' */
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1029,6 +1398,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1063,192 +1434,142 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size
static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_long = { "long", NULL, sizeof(long), { 0 }, 0, IS_UNSIGNED(long) ? 'U' : 'I', IS_UNSIGNED(long), 0 };
-#define __Pyx_MODULE_NAME "filters"
-int __pyx_module_is_main_filters = 0;
+#define __Pyx_MODULE_NAME "silx.math.fit.filters"
+int __pyx_module_is_main_silx__math__fit__filters = 0;
-/* Implementation of 'filters' */
+/* Implementation of 'silx.math.fit.filters' */
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_Ellipsis;
-static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_w, PyObject *__pyx_v_niterations, PyObject *__pyx_v_factor, PyObject *__pyx_v_anchors); /* proto */
-static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
-static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
-static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
-static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_npoints); /* proto */
-static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* 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_C[] = "C";
-static char __pyx_k_O[] = "O";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_w[] = "w";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_nx[] = "nx";
-static char __pyx_k_ny[] = "ny";
-static char __pyx_k_nz[] = "nz";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_int[] = "int_";
-static char __pyx_k_len[] = "__len__";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_copy[] = "copy";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_date[] = "__date__";
-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_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-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_nrows[] = "nrows";
-static char __pyx_k_numpy[] = "numpy";
-static char __pyx_k_order[] = "order";
-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_data_c[] = "data_c";
-static char __pyx_k_factor[] = "factor";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_logger[] = "_logger";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_output[] = "output";
-static char __pyx_k_snip1d[] = "snip1d";
-static char __pyx_k_snip2d[] = "snip2d";
-static char __pyx_k_snip3d[] = "snip3d";
-static char __pyx_k_status[] = "status";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_anchors[] = "anchors";
-static char __pyx_k_asarray[] = "asarray";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_filters[] = "filters";
-static char __pyx_k_float64[] = "float64";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_input_c[] = "input_c";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_logging[] = "logging";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_ndarray[] = "ndarray";
-static char __pyx_k_npoints[] = "npoints";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_P_Knobel[] = "P. Knobel";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_ncolumns[] = "ncolumns";
-static char __pyx_k_smooth1d[] = "smooth1d";
-static char __pyx_k_smooth2d[] = "smooth2d";
-static char __pyx_k_smooth3d[] = "smooth3d";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_anchors_c[] = "anchors_c";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_getLogger[] = "getLogger";
-static char __pyx_k_22_06_2016[] = "22/06/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_data_shape[] = "data_shape";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_snip_width[] = "snip_width";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_basicConfig[] = "basicConfig";
-static char __pyx_k_len_anchors[] = "len_anchors";
-static char __pyx_k_niterations[] = "niterations";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_savitsky_golay[] = "savitsky_golay";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_or_a_numpy_array[] = "or a numpy array";
-static char __pyx_k_strided_and_direct[] = "<strided and direct>";
-static char __pyx_k_or_a_2D_numpy_array[] = "or a 2D numpy array";
-static char __pyx_k_or_a_3D_numpy_array[] = "or a 3D numpy array";
-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_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_than_3_and_smaller_than_100[] = "than 3 and smaller than 100.";
-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_This_module_provides_background[] = "This module provides background extraction functions and smoothing\nfunctions. These functions are extracted from PyMca module SpecFitFuns.\n\nIndex of background extraction functions:\n------------------------------------------\n\n - :func:`strip`\n - :func:`snip1d`\n - :func:`snip2d`\n - :func:`snip3d`\n\nSmoothing functions:\n--------------------\n\n - :func:`savitsky_golay`\n - :func:`smooth1d`\n - :func:`smooth2d`\n - :func:`smooth3d`\n\nAPI documentation:\n-------------------\n\n";
-static char __pyx_k_data_must_be_a_2D_sequence_list[] = "data must be a 2D sequence (list, tuple) ";
-static char __pyx_k_data_must_be_a_3D_sequence_list[] = "data must be a 3D sequence (list, tuple) ";
-static char __pyx_k_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/math/fit/filters/filters.pyx";
-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_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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_Smoothing_failed_Check_that_npoi[] = "Smoothing failed. Check that npoints is greater ";
-static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
-static char __pyx_k_data_array_must_be_2_dimensional[] = "data array must be 2-dimensional";
-static char __pyx_k_data_array_must_be_3_dimensional[] = "data array must be 3-dimensional";
-static char __pyx_k_data_must_be_a_sequence_list_tup[] = "data must be a sequence (list, tuple) ";
-static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
-static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
-static PyObject *__pyx_kp_s_22_06_2016;
+static const char __pyx_k_C[] = "C";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_w[] = "w";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_nx[] = "nx";
+static const char __pyx_k_ny[] = "ny";
+static const char __pyx_k_nz[] = "nz";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_int[] = "int_";
+static const char __pyx_k_len[] = "__len__";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_copy[] = "copy";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_nrows[] = "nrows";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_order[] = "order";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_strip[] = "strip";
+static const char __pyx_k_data_c[] = "data_c";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_factor[] = "factor";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_logger[] = "_logger";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_output[] = "output";
+static const char __pyx_k_snip1d[] = "snip1d";
+static const char __pyx_k_snip2d[] = "snip2d";
+static const char __pyx_k_snip3d[] = "snip3d";
+static const char __pyx_k_status[] = "status";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_anchors[] = "anchors";
+static const char __pyx_k_asarray[] = "asarray";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_input_c[] = "input_c";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_ndarray[] = "ndarray";
+static const char __pyx_k_npoints[] = "npoints";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_P_Knobel[] = "P. Knobel";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_ncolumns[] = "ncolumns";
+static const char __pyx_k_smooth1d[] = "smooth1d";
+static const char __pyx_k_smooth2d[] = "smooth2d";
+static const char __pyx_k_smooth3d[] = "smooth3d";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_anchors_c[] = "anchors_c";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_getLogger[] = "getLogger";
+static const char __pyx_k_15_05_2017[] = "15/05/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_data_shape[] = "data_shape";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_snip_width[] = "snip_width";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_len_anchors[] = "len_anchors";
+static const char __pyx_k_niterations[] = "niterations";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_savitsky_golay[] = "savitsky_golay";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_or_a_numpy_array[] = "or a numpy array";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_or_a_2D_numpy_array[] = "or a 2D numpy array";
+static const char __pyx_k_or_a_3D_numpy_array[] = "or a 3D numpy array";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_silx_math_fit_filters[] = "silx.math.fit.filters";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_than_3_and_smaller_than_100[] = "than 3 and smaller than 100.";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_This_module_provides_background[] = "This module provides background extraction functions and smoothing\nfunctions. These functions are extracted from PyMca module SpecFitFuns.\n\nIndex of background extraction functions:\n------------------------------------------\n\n - :func:`strip`\n - :func:`snip1d`\n - :func:`snip2d`\n - :func:`snip3d`\n\nSmoothing functions:\n--------------------\n\n - :func:`savitsky_golay`\n - :func:`smooth1d`\n - :func:`smooth2d`\n - :func:`smooth3d`\n\nAPI documentation:\n-------------------\n\n";
+static const char __pyx_k_data_must_be_a_2D_sequence_list[] = "data must be a 2D sequence (list, tuple) ";
+static const char __pyx_k_data_must_be_a_3D_sequence_list[] = "data must be a 3D sequence (list, tuple) ";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/fit/filters.pyx";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_Smoothing_failed_Check_that_npoi[] = "Smoothing failed. Check that npoints is greater ";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_data_array_must_be_2_dimensional[] = "data array must be 2-dimensional";
+static const char __pyx_k_data_array_must_be_3_dimensional[] = "data array must be 3-dimensional";
+static const char __pyx_k_data_must_be_a_sequence_list_tup[] = "data must be a sequence (list, tuple) ";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static PyObject *__pyx_kp_s_15_05_2017;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
@@ -1277,7 +1598,6 @@ static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_asarray;
static PyObject *__pyx_n_s_authors;
static PyObject *__pyx_n_s_base;
-static PyObject *__pyx_n_s_basicConfig;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_class;
@@ -1296,10 +1616,10 @@ static PyObject *__pyx_n_s_date;
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_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_factor;
-static PyObject *__pyx_n_s_filters;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_format;
@@ -1320,7 +1640,6 @@ static PyObject *__pyx_n_s_logger;
static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_memview;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
@@ -1347,6 +1666,7 @@ static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_savitsky_golay;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_silx_math_fit_filters;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_smooth1d;
static PyObject *__pyx_n_s_smooth2d;
@@ -1369,8 +1689,52 @@ static PyObject *__pyx_kp_s_than_3_and_smaller_than_100;
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_unpack;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_w;
-static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_w, PyObject *__pyx_v_niterations, PyObject *__pyx_v_factor, PyObject *__pyx_v_anchors); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_npoints); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
@@ -1386,9 +1750,9 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__21;
-static PyObject *__pyx_slice__22;
static PyObject *__pyx_slice__23;
+static PyObject *__pyx_slice__24;
+static PyObject *__pyx_slice__25;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
@@ -1400,8 +1764,9 @@ static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
-static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__31;
@@ -1410,11 +1775,11 @@ static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_codeobj__26;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__47;
static PyObject *__pyx_codeobj__28;
static PyObject *__pyx_codeobj__30;
static PyObject *__pyx_codeobj__32;
@@ -1422,8 +1787,9 @@ static PyObject *__pyx_codeobj__34;
static PyObject *__pyx_codeobj__36;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
+static PyObject *__pyx_codeobj__42;
-/* "filters.pyx":62
+/* "silx/math/fit/filters.pyx":61
*
*
* def strip(data, w=1, niterations=1000, factor=1.0, anchors=None): # <<<<<<<<<<<<<<
@@ -1432,18 +1798,15 @@ static PyObject *__pyx_codeobj__40;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7filters_strip[] = "strip(data, w=1, niterations=1000, factor=1.0, anchors=None)\nExtract background from data using the strip algorithm, as explained at\n http://pymca.sourceforge.net/stripbackground.html.\n\n In its simplest implementation it is just as an iterative procedure\n depending on two parameters. These parameters are the strip background\n width ``w``, and the number of iterations. At each iteration, if the\n contents of channel ``i``, ``y(i)``, is above the average of the contents\n of the channels at ``w`` channels of distance, ``y(i-w)`` and\n ``y(i+w)``, ``y(i)`` is replaced by the average.\n At the end of the process we are left with something that resembles a spectrum\n in which the peaks have been stripped.\n\n :param data: Data array\n :type data: numpy.ndarray\n :param w: Strip width\n :param niterations: number of iterations\n :param factor: scaling factor applied to the average of ``y(i-w)`` and\n ``y(i+w)`` before comparing to ``y(i)``\n :param anchors: Array of anchors, indices of points that will not be\n modified during the stripping procedure.\n :return: Data with peaks stripped away\n ";
-static PyMethodDef __pyx_mdef_7filters_1strip = {"strip", (PyCFunction)__pyx_pw_7filters_1strip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7filters_strip};
-static PyObject *__pyx_pw_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_strip[] = "strip(data, w=1, niterations=1000, factor=1.0, anchors=None)\nExtract background from data using the strip algorithm, as explained at\n http://pymca.sourceforge.net/stripbackground.html.\n\n In its simplest implementation it is just as an iterative procedure\n depending on two parameters. These parameters are the strip background\n width ``w``, and the number of iterations. At each iteration, if the\n contents of channel ``i``, ``y(i)``, is above the average of the contents\n of the channels at ``w`` channels of distance, ``y(i-w)`` and\n ``y(i+w)``, ``y(i)`` is replaced by the average.\n At the end of the process we are left with something that resembles a spectrum\n in which the peaks have been stripped.\n\n :param data: Data array\n :type data: numpy.ndarray\n :param w: Strip width\n :param niterations: number of iterations\n :param factor: scaling factor applied to the average of ``y(i-w)`` and\n ``y(i+w)`` before comparing to ``y(i)``\n :param anchors: Array of anchors, indices of points that will not be\n modified during the stripping procedure.\n :return: Data with peaks stripped away\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_1strip = {"strip", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_1strip, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_7filters_strip};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_w = 0;
PyObject *__pyx_v_niterations = 0;
PyObject *__pyx_v_factor = 0;
PyObject *__pyx_v_anchors = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("strip (wrapper)", 0);
@@ -1493,7 +1856,7 @@ static PyObject *__pyx_pw_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strip") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strip") < 0)) __PYX_ERR(0, 61, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -1514,20 +1877,20 @@ static PyObject *__pyx_pw_7filters_1strip(PyObject *__pyx_self, PyObject *__pyx_
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("strip", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("strip", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 61, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("filters.strip", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.strip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7filters_strip(__pyx_self, __pyx_v_data, __pyx_v_w, __pyx_v_niterations, __pyx_v_factor, __pyx_v_anchors);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_strip(__pyx_self, __pyx_v_data, __pyx_v_w, __pyx_v_niterations, __pyx_v_factor, __pyx_v_anchors);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_w, PyObject *__pyx_v_niterations, PyObject *__pyx_v_factor, PyObject *__pyx_v_anchors) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_w, PyObject *__pyx_v_niterations, PyObject *__pyx_v_factor, PyObject *__pyx_v_anchors) {
__Pyx_memviewslice __pyx_v_input_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_anchors_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -1545,9 +1908,9 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_10;
+ __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_12;
int __pyx_t_13;
long __pyx_t_14;
double __pyx_t_15;
@@ -1557,235 +1920,248 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
long __pyx_t_19;
Py_ssize_t __pyx_t_20;
PyObject *__pyx_t_21 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("strip", 0);
- /* "filters.pyx":90
+ /* "silx/math/fit/filters.pyx":89
* long[::1] anchors_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":91
+ /* "silx/math/fit/filters.pyx":90
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
*/
- __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 90, __pyx_L1_error)
__pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
if (__pyx_t_3) {
- /* "filters.pyx":92
+ /* "silx/math/fit/filters.pyx":91
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a numpy array")
* data_shape = (len(data), )
*/
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 91, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":90
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ * "or a numpy array")
+ */
}
- /* "filters.pyx":94
+ /* "silx/math/fit/filters.pyx":93
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
* data_shape = (len(data), ) # <<<<<<<<<<<<<<
* else:
* data_shape = data.shape
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 93, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
+
+ /* "silx/math/fit/filters.pyx":89
+ * long[::1] anchors_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__"):
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":96
+ /* "silx/math/fit/filters.pyx":95
* data_shape = (len(data), )
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
*
* input_c = numpy.array(data,
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
- /* "filters.pyx":98
+ /* "silx/math/fit/filters.pyx":97
* data_shape = data.shape
*
* input_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
- /* "filters.pyx":99
+ /* "silx/math/fit/filters.pyx":98
*
* input_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 98, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
- /* "filters.pyx":100
+ /* "silx/math/fit/filters.pyx":99
* input_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
- /* "filters.pyx":98
+ /* "silx/math/fit/filters.pyx":97
* data_shape = data.shape
*
* input_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "filters.pyx":101
+ /* "silx/math/fit/filters.pyx":100
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* output = numpy.empty(shape=(input_c.size,),
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_8);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_input_c = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
- /* "filters.pyx":103
+ /* "silx/math/fit/filters.pyx":102
* order='C').reshape(-1)
*
* output = numpy.empty(shape=(input_c.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyDict_New(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_input_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_input_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __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 = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":104
+ /* "silx/math/fit/filters.pyx":103
*
* output = numpy.empty(shape=(input_c.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* if anchors is not None and len(anchors):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "filters.pyx":103
+ /* "silx/math/fit/filters.pyx":102
* order='C').reshape(-1)
*
* output = numpy.empty(shape=(input_c.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
+ if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 102, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_output = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_output = __pyx_t_9;
+ __pyx_t_9.memview = NULL;
+ __pyx_t_9.data = NULL;
- /* "filters.pyx":106
+ /* "silx/math/fit/filters.pyx":105
* dtype=numpy.float64)
*
* if anchors is not None and len(anchors): # <<<<<<<<<<<<<<
@@ -1793,150 +2169,158 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
* anchors_c = numpy.array(anchors,
*/
__pyx_t_4 = (__pyx_v_anchors != Py_None);
- __pyx_t_11 = (__pyx_t_4 != 0);
- if (__pyx_t_11) {
+ __pyx_t_10 = (__pyx_t_4 != 0);
+ if (__pyx_t_10) {
} else {
- __pyx_t_3 = __pyx_t_11;
+ __pyx_t_3 = __pyx_t_10;
goto __pyx_L6_bool_binop_done;
}
- __pyx_t_5 = PyObject_Length(__pyx_v_anchors); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = (__pyx_t_5 != 0);
- __pyx_t_3 = __pyx_t_11;
+ __pyx_t_5 = PyObject_Length(__pyx_v_anchors); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 105, __pyx_L1_error)
+ __pyx_t_10 = (__pyx_t_5 != 0);
+ __pyx_t_3 = __pyx_t_10;
__pyx_L6_bool_binop_done:;
if (__pyx_t_3) {
- /* "filters.pyx":108
+ /* "silx/math/fit/filters.pyx":107
* if anchors is not None and len(anchors):
* # numpy.int_ is the same as C long (http://docs.scipy.org/doc/numpy/user/basics.types.html)
* anchors_c = numpy.array(anchors, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.int_,
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_anchors);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_anchors);
__Pyx_GIVEREF(__pyx_v_anchors);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_anchors);
- /* "filters.pyx":109
+ /* "silx/math/fit/filters.pyx":108
* # numpy.int_ is the same as C long (http://docs.scipy.org/doc/numpy/user/basics.types.html)
* anchors_c = numpy.array(anchors,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.int_,
* order='C')
*/
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 108, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
- /* "filters.pyx":110
+ /* "silx/math/fit/filters.pyx":109
* anchors_c = numpy.array(anchors,
* copy=False,
* dtype=numpy.int_, # <<<<<<<<<<<<<<
* order='C')
* len_anchors = anchors_c.size
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 108, __pyx_L1_error)
- /* "filters.pyx":108
+ /* "silx/math/fit/filters.pyx":107
* if anchors is not None and len(anchors):
* # numpy.int_ is the same as C long (http://docs.scipy.org/doc/numpy/user/basics.types.html)
* anchors_c = numpy.array(anchors, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.int_,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_7);
- if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_7);
+ if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 107, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_anchors_c = __pyx_t_12;
- __pyx_t_12.memview = NULL;
- __pyx_t_12.data = NULL;
+ __pyx_v_anchors_c = __pyx_t_11;
+ __pyx_t_11.memview = NULL;
+ __pyx_t_11.data = NULL;
- /* "filters.pyx":112
+ /* "silx/math/fit/filters.pyx":111
* dtype=numpy.int_,
* order='C')
* len_anchors = anchors_c.size # <<<<<<<<<<<<<<
* else:
* # Make a dummy length-1 array, because if I use shape=(0,) I get the error
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_anchors_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_anchors_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_long, (int (*)(char *, PyObject *)) __pyx_memview_set_long, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_len_anchors = __pyx_t_6;
__pyx_t_6 = 0;
+
+ /* "silx/math/fit/filters.pyx":105
+ * dtype=numpy.float64)
+ *
+ * if anchors is not None and len(anchors): # <<<<<<<<<<<<<<
+ * # numpy.int_ is the same as C long (http://docs.scipy.org/doc/numpy/user/basics.types.html)
+ * anchors_c = numpy.array(anchors,
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "filters.pyx":116
+ /* "silx/math/fit/filters.pyx":115
* # Make a dummy length-1 array, because if I use shape=(0,) I get the error
* # IndexError: Out of bounds on buffer access (axis 0)
* anchors_c = numpy.empty(shape=(1,), # <<<<<<<<<<<<<<
* dtype=numpy.int_)
* len_anchors = 0
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_tuple__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_tuple__2) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
- /* "filters.pyx":117
+ /* "silx/math/fit/filters.pyx":116
* # IndexError: Out of bounds on buffer access (axis 0)
* anchors_c = numpy.empty(shape=(1,),
* dtype=numpy.int_) # <<<<<<<<<<<<<<
* len_anchors = 0
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- /* "filters.pyx":116
+ /* "silx/math/fit/filters.pyx":115
* # Make a dummy length-1 array, because if I use shape=(0,) I get the error
* # IndexError: Out of bounds on buffer access (axis 0)
* anchors_c = numpy.empty(shape=(1,), # <<<<<<<<<<<<<<
* dtype=numpy.int_)
* len_anchors = 0
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_8);
- if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_long(__pyx_t_8);
+ if (unlikely(!__pyx_t_11.memview)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_v_anchors_c = __pyx_t_12;
- __pyx_t_12.memview = NULL;
- __pyx_t_12.data = NULL;
+ __pyx_v_anchors_c = __pyx_t_11;
+ __pyx_t_11.memview = NULL;
+ __pyx_t_11.data = NULL;
- /* "filters.pyx":118
+ /* "silx/math/fit/filters.pyx":117
* anchors_c = numpy.empty(shape=(1,),
* dtype=numpy.int_)
* len_anchors = 0 # <<<<<<<<<<<<<<
@@ -1948,43 +2332,43 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
__pyx_L5:;
- /* "filters.pyx":121
+ /* "silx/math/fit/filters.pyx":120
*
*
* status = filters_wrapper.strip(&input_c[0], input_c.size, # <<<<<<<<<<<<<<
* factor, niterations, w,
* &anchors_c[0], len_anchors, &output[0])
*/
- __pyx_t_5 = 0;
+ __pyx_t_12 = 0;
__pyx_t_13 = -1;
- if (__pyx_t_5 < 0) {
- __pyx_t_5 += __pyx_v_input_c.shape[0];
- if (unlikely(__pyx_t_5 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_5 >= __pyx_v_input_c.shape[0])) __pyx_t_13 = 0;
+ if (__pyx_t_12 < 0) {
+ __pyx_t_12 += __pyx_v_input_c.shape[0];
+ if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
+ } else if (unlikely(__pyx_t_12 >= __pyx_v_input_c.shape[0])) __pyx_t_13 = 0;
if (unlikely(__pyx_t_13 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 120, __pyx_L1_error)
}
- __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_input_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_input_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "filters.pyx":122
+ /* "silx/math/fit/filters.pyx":121
*
* status = filters_wrapper.strip(&input_c[0], input_c.size,
* factor, niterations, w, # <<<<<<<<<<<<<<
* &anchors_c[0], len_anchors, &output[0])
*
*/
- __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_factor); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_16 = __Pyx_PyInt_As_long(__pyx_v_niterations); if (unlikely((__pyx_t_16 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_w); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_factor); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_16 = __Pyx_PyInt_As_long(__pyx_v_niterations); if (unlikely((__pyx_t_16 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_w); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
- /* "filters.pyx":123
+ /* "silx/math/fit/filters.pyx":122
* status = filters_wrapper.strip(&input_c[0], input_c.size,
* factor, niterations, w,
* &anchors_c[0], len_anchors, &output[0]) # <<<<<<<<<<<<<<
@@ -1999,9 +2383,9 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
} else if (unlikely(__pyx_t_17 >= __pyx_v_anchors_c.shape[0])) __pyx_t_18 = 0;
if (unlikely(__pyx_t_18 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_18);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 122, __pyx_L1_error)
}
- __pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_len_anchors); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_len_anchors); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error)
__pyx_t_20 = 0;
__pyx_t_18 = -1;
if (__pyx_t_20 < 0) {
@@ -2010,19 +2394,19 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
} else if (unlikely(__pyx_t_20 >= __pyx_v_output.shape[0])) __pyx_t_18 = 0;
if (unlikely(__pyx_t_18 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_18);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 122, __pyx_L1_error)
}
- /* "filters.pyx":121
+ /* "silx/math/fit/filters.pyx":120
*
*
* status = filters_wrapper.strip(&input_c[0], input_c.size, # <<<<<<<<<<<<<<
* factor, niterations, w,
* &anchors_c[0], len_anchors, &output[0])
*/
- __pyx_v_status = strip((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_input_c.data) + __pyx_t_5)) )))), __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_13, (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_anchors_c.data) + __pyx_t_17)) )))), __pyx_t_19, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_output.data) + __pyx_t_20)) )))));
+ __pyx_v_status = strip((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_input_c.data) + __pyx_t_12)) )))), __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_13, (&(*((long *) ( /* dim=0 */ ((char *) (((long *) __pyx_v_anchors_c.data) + __pyx_t_17)) )))), __pyx_t_19, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_output.data) + __pyx_t_20)) )))));
- /* "filters.pyx":125
+ /* "silx/math/fit/filters.pyx":124
* &anchors_c[0], len_anchors, &output[0])
*
* return numpy.asarray(output).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -2030,15 +2414,15 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2048,26 +2432,46 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
}
if (!__pyx_t_1) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else {
- __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_21, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_7};
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_21);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_21, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2077,25 +2481,43 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_21, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_21 = PyTuple_New(1+1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_21);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_21, 0+1, __pyx_v_data_shape);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "filters.pyx":62
+ /* "silx/math/fit/filters.pyx":61
*
*
* def strip(data, w=1, niterations=1000, factor=1.0, anchors=None): # <<<<<<<<<<<<<<
@@ -2111,10 +2533,9 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
__Pyx_XDECREF(__pyx_t_21);
- __Pyx_AddTraceback("filters.strip", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.strip", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_input_c, 1);
@@ -2127,7 +2548,7 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
return __pyx_r;
}
-/* "filters.pyx":128
+/* "silx/math/fit/filters.pyx":127
*
*
* def snip1d(data, snip_width): # <<<<<<<<<<<<<<
@@ -2136,15 +2557,12 @@ static PyObject *__pyx_pf_7filters_strip(CYTHON_UNUSED PyObject *__pyx_self, PyO
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7filters_2snip1d[] = "snip1d(data, snip_width)\nEstimate the baseline (background) of a 1D data vector by clipping peaks.\n\n Implementation of the algorithm SNIP in 1D is described in *Miroslav\n Morhac et al. Nucl. Instruments and Methods in Physics Research A401\n (1997) 113-132*.\n\n The original idea for 1D and the low-statistics-digital-filter (lsdf) come\n from *C.G. Ryan et al. Nucl. Instruments and Methods in Physics Research\n B34 (1988) 396-402*.\n\n :param data: Data array, preferably 1D and of type *numpy.float64*.\n Else, the data array will be flattened and converted to\n *dtype=numpy.float64* prior to applying the snip filter.\n :type data: numpy.ndarray\n :param snip_width: Width of the snip operator, in number of samples.\n A sample will be iteratively compared to it's neighbors up to a\n distance of ``snip_width`` samples. This parameters has a direct\n influence on the speed of the algorithm.\n :type width: int\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
-static PyMethodDef __pyx_mdef_7filters_3snip1d = {"snip1d", (PyCFunction)__pyx_pw_7filters_3snip1d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7filters_2snip1d};
-static PyObject *__pyx_pw_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_2snip1d[] = "snip1d(data, snip_width)\nEstimate the baseline (background) of a 1D data vector by clipping peaks.\n\n Implementation of the algorithm SNIP in 1D is described in *Miroslav\n Morhac et al. Nucl. Instruments and Methods in Physics Research A401\n (1997) 113-132*.\n\n The original idea for 1D and the low-statistics-digital-filter (lsdf) come\n from *C.G. Ryan et al. Nucl. Instruments and Methods in Physics Research\n B34 (1988) 396-402*.\n\n :param data: Data array, preferably 1D and of type *numpy.float64*.\n Else, the data array will be flattened and converted to\n *dtype=numpy.float64* prior to applying the snip filter.\n :type data: numpy.ndarray\n :param snip_width: Width of the snip operator, in number of samples.\n A sample will be iteratively compared to it's neighbors up to a\n distance of ``snip_width`` samples. This parameters has a direct\n influence on the speed of the algorithm.\n :type width: int\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_3snip1d = {"snip1d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_3snip1d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_7filters_2snip1d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_snip_width = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("snip1d (wrapper)", 0);
@@ -2168,11 +2586,11 @@ static PyObject *__pyx_pw_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snip_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("snip1d", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip1d", 1, 2, 2, 1); __PYX_ERR(0, 127, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip1d") < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2185,20 +2603,20 @@ static PyObject *__pyx_pw_7filters_3snip1d(PyObject *__pyx_self, PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("snip1d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip1d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("filters.snip1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7filters_2snip1d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_2snip1d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_data_shape = NULL;
PyObject *__pyx_r = NULL;
@@ -2212,205 +2630,219 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_10;
+ Py_ssize_t __pyx_t_10;
int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_12;
+ PyObject *__pyx_t_13 = NULL;
__Pyx_RefNannySetupContext("snip1d", 0);
- /* "filters.pyx":154
+ /* "silx/math/fit/filters.pyx":153
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":155
+ /* "silx/math/fit/filters.pyx":154
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
*/
- __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 154, __pyx_L1_error)
__pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
if (__pyx_t_3) {
- /* "filters.pyx":156
+ /* "silx/math/fit/filters.pyx":155
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a numpy array")
* data_shape = (len(data), )
*/
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 155, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":154
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ * "or a numpy array")
+ */
}
- /* "filters.pyx":158
+ /* "silx/math/fit/filters.pyx":157
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
* data_shape = (len(data), ) # <<<<<<<<<<<<<<
* else:
* data_shape = data.shape
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
+
+ /* "silx/math/fit/filters.pyx":153
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__"):
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":160
+ /* "silx/math/fit/filters.pyx":159
* data_shape = (len(data), )
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
- /* "filters.pyx":162
+ /* "silx/math/fit/filters.pyx":161
* data_shape = data.shape
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
- /* "filters.pyx":163
+ /* "silx/math/fit/filters.pyx":162
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
- /* "filters.pyx":164
+ /* "silx/math/fit/filters.pyx":163
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
- /* "filters.pyx":162
+ /* "silx/math/fit/filters.pyx":161
* data_shape = data.shape
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "filters.pyx":165
+ /* "silx/math/fit/filters.pyx":164
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip1d(&data_c[0], data_c.size, snip_width)
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_8);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_data_c = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
- /* "filters.pyx":167
+ /* "silx/math/fit/filters.pyx":166
* order='C').reshape(-1)
*
* filters_wrapper.snip1d(&data_c[0], data_c.size, snip_width) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_5 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_5 < 0) {
- __pyx_t_5 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_5 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_5 >= __pyx_v_data_c.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = 0;
+ __pyx_t_11 = -1;
+ if (__pyx_t_10 < 0) {
+ __pyx_t_10 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
+ } else if (unlikely(__pyx_t_10 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
+ if (unlikely(__pyx_t_11 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_11);
+ __PYX_ERR(0, 166, __pyx_L1_error)
+ }
+ __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- snip1d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_5)) )))), __pyx_t_10, __pyx_t_11);
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error)
+ snip1d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_10)) )))), __pyx_t_11, __pyx_t_12);
- /* "filters.pyx":169
+ /* "silx/math/fit/filters.pyx":168
* filters_wrapper.snip1d(&data_c[0], data_c.size, snip_width)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -2418,15 +2850,15 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
*
*/
__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 = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2436,26 +2868,46 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_7) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2465,25 +2917,43 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_data_shape);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "filters.pyx":128
+ /* "silx/math/fit/filters.pyx":127
*
*
* def snip1d(data, snip_width): # <<<<<<<<<<<<<<
@@ -2499,8 +2969,8 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("filters.snip1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -2510,7 +2980,7 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
return __pyx_r;
}
-/* "filters.pyx":172
+/* "silx/math/fit/filters.pyx":171
*
*
* def snip2d(data, snip_width): # <<<<<<<<<<<<<<
@@ -2519,15 +2989,12 @@ static PyObject *__pyx_pf_7filters_2snip1d(CYTHON_UNUSED PyObject *__pyx_self, P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7filters_4snip2d[] = "snip2d(data, snip_width)\nEstimate the baseline (background) of a 2D data signal by clipping peaks.\n\n Implementation of the algorithm SNIP in 2D described in\n *Miroslav Morhac et al. Nucl. Instruments and Methods in Physics Research\n A401 (1997) 113-132.*\n\n :param data: 2D array\n :type data: numpy.ndarray\n :param width: Width of the snip operator, in number of samples. A wider\n snip operator will result in a smoother result (lower frequency peaks\n will be clipped), and a longer computation time.\n :type width: int\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
-static PyMethodDef __pyx_mdef_7filters_5snip2d = {"snip2d", (PyCFunction)__pyx_pw_7filters_5snip2d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7filters_4snip2d};
-static PyObject *__pyx_pw_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_4snip2d[] = "snip2d(data, snip_width)\nEstimate the baseline (background) of a 2D data signal by clipping peaks.\n\n Implementation of the algorithm SNIP in 2D described in\n *Miroslav Morhac et al. Nucl. Instruments and Methods in Physics Research\n A401 (1997) 113-132.*\n\n :param data: 2D array\n :type data: numpy.ndarray\n :param width: Width of the snip operator, in number of samples. A wider\n snip operator will result in a smoother result (lower frequency peaks\n will be clipped), and a longer computation time.\n :type width: int\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_5snip2d = {"snip2d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_5snip2d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_7filters_4snip2d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_snip_width = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("snip2d (wrapper)", 0);
@@ -2551,11 +3018,11 @@ static PyObject *__pyx_pw_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snip_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("snip2d", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip2d", 1, 2, 2, 1); __PYX_ERR(0, 171, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip2d") < 0)) __PYX_ERR(0, 171, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2568,20 +3035,20 @@ static PyObject *__pyx_pw_7filters_5snip2d(PyObject *__pyx_self, PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("snip2d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip2d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 171, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("filters.snip2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7filters_4snip2d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_4snip2d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_nrows = NULL;
PyObject *__pyx_v_ncolumns = NULL;
@@ -2598,304 +3065,326 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("snip2d", 0);
- /* "filters.pyx":191
+ /* "silx/math/fit/filters.pyx":190
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
* raise TypeError("data must be a 2D sequence (list, tuple) " +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 190, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":192
+ /* "silx/math/fit/filters.pyx":191
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a 2D sequence (list, tuple) " +
* "or a 2D numpy array")
*/
- __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 191, __pyx_L1_error)
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L5_bool_binop_done;
}
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 191, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0);
__pyx_t_4 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (__pyx_t_4) {
- /* "filters.pyx":193
+ /* "silx/math/fit/filters.pyx":192
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
* raise TypeError("data must be a 2D sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a 2D numpy array")
* nrows = len(data)
*/
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_2D_sequence_list, __pyx_kp_s_or_a_2D_numpy_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_2D_sequence_list, __pyx_kp_s_or_a_2D_numpy_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 192, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":191
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"): # <<<<<<<<<<<<<<
+ * raise TypeError("data must be a 2D sequence (list, tuple) " +
+ * "or a 2D numpy array")
+ */
}
- /* "filters.pyx":195
+ /* "silx/math/fit/filters.pyx":194
* raise TypeError("data must be a 2D sequence (list, tuple) " +
* "or a 2D numpy array")
* nrows = len(data) # <<<<<<<<<<<<<<
* ncolumns = len(data[0])
* data_shape = (len(data), len(data[0]))
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 194, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_nrows = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":196
+ /* "silx/math/fit/filters.pyx":195
* "or a 2D numpy array")
* nrows = len(data)
* ncolumns = len(data[0]) # <<<<<<<<<<<<<<
* data_shape = (len(data), len(data[0]))
*
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ncolumns = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":197
+ /* "silx/math/fit/filters.pyx":196
* nrows = len(data)
* ncolumns = len(data[0])
* data_shape = (len(data), len(data[0])) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":190
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
+ * raise TypeError("data must be a 2D sequence (list, tuple) " +
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":200
+ /* "silx/math/fit/filters.pyx":199
*
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
* nrows = data_shape[0]
* if len(data_shape) == 2:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":201
+ /* "silx/math/fit/filters.pyx":200
* else:
* data_shape = data.shape
* nrows = data_shape[0] # <<<<<<<<<<<<<<
* if len(data_shape) == 2:
* ncolumns = data_shape[1]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nrows = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":202
+ /* "silx/math/fit/filters.pyx":201
* data_shape = data.shape
* nrows = data_shape[0]
* if len(data_shape) == 2: # <<<<<<<<<<<<<<
* ncolumns = data_shape[1]
* else:
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 201, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_6 == 2) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":203
+ /* "silx/math/fit/filters.pyx":202
* nrows = data_shape[0]
* if len(data_shape) == 2:
* ncolumns = data_shape[1] # <<<<<<<<<<<<<<
* else:
* raise TypeError("data array must be 2-dimensional")
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_ncolumns = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":201
+ * data_shape = data.shape
+ * nrows = data_shape[0]
+ * if len(data_shape) == 2: # <<<<<<<<<<<<<<
+ * ncolumns = data_shape[1]
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "filters.pyx":205
+ /* "silx/math/fit/filters.pyx":204
* ncolumns = data_shape[1]
* else:
* raise TypeError("data array must be 2-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __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 = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 204, __pyx_L1_error)
}
__pyx_L7:;
}
__pyx_L3:;
- /* "filters.pyx":207
+ /* "silx/math/fit/filters.pyx":206
* raise TypeError("data array must be 2-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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 = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
- /* "filters.pyx":208
+ /* "silx/math/fit/filters.pyx":207
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
- /* "filters.pyx":209
+ /* "silx/math/fit/filters.pyx":208
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
- /* "filters.pyx":207
+ /* "silx/math/fit/filters.pyx":206
* raise TypeError("data array must be 2-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "filters.pyx":210
+ /* "silx/math/fit/filters.pyx":209
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip2d(&data_c[0], nrows, ncolumns, snip_width)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_data_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "filters.pyx":212
+ /* "silx/math/fit/filters.pyx":211
* order='C').reshape(-1)
*
* filters_wrapper.snip2d(&data_c[0], nrows, ncolumns, snip_width) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_6 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_6 < 0) {
- __pyx_t_6 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_6 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_6 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_data_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 211, __pyx_L1_error)
}
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_nrows); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_ncolumns); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- snip2d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_6)) )))), __pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nrows); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ncolumns); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
+ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
+ snip2d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_11)) )))), __pyx_t_12, __pyx_t_13, __pyx_t_14);
- /* "filters.pyx":214
+ /* "silx/math/fit/filters.pyx":213
* filters_wrapper.snip2d(&data_c[0], nrows, ncolumns, snip_width)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -2903,15 +3392,15 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -2921,26 +3410,46 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_8) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -2950,25 +3459,43 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_2) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_data_shape);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 213, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "filters.pyx":172
+ /* "silx/math/fit/filters.pyx":171
*
*
* def snip2d(data, snip_width): # <<<<<<<<<<<<<<
@@ -2984,8 +3511,8 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_AddTraceback("filters.snip2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -2997,7 +3524,7 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
return __pyx_r;
}
-/* "filters.pyx":217
+/* "silx/math/fit/filters.pyx":216
*
*
* def snip3d(data, snip_width): # <<<<<<<<<<<<<<
@@ -3006,15 +3533,12 @@ static PyObject *__pyx_pf_7filters_4snip2d(CYTHON_UNUSED PyObject *__pyx_self, P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7filters_6snip3d[] = "snip3d(data, snip_width)\nEstimate the baseline (background) of a 3D data signal by clipping peaks.\n\n Implementation of the algorithm SNIP in 2D described in\n *Miroslav Morhac et al. Nucl. Instruments and Methods in Physics Research\n A401 (1997) 113-132.*\n\n :param data: 3D array\n :type data: numpy.ndarray\n :param width: Width of the snip operator, in number of samples. A wider\n snip operator will result in a smoother result (lower frequency peaks\n will be clipped), and a longer computation time.\n :type width: int\n\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
-static PyMethodDef __pyx_mdef_7filters_7snip3d = {"snip3d", (PyCFunction)__pyx_pw_7filters_7snip3d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7filters_6snip3d};
-static PyObject *__pyx_pw_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_6snip3d[] = "snip3d(data, snip_width)\nEstimate the baseline (background) of a 3D data signal by clipping peaks.\n\n Implementation of the algorithm SNIP in 2D described in\n *Miroslav Morhac et al. Nucl. Instruments and Methods in Physics Research\n A401 (1997) 113-132.*\n\n :param data: 3D array\n :type data: numpy.ndarray\n :param width: Width of the snip operator, in number of samples. A wider\n snip operator will result in a smoother result (lower frequency peaks\n will be clipped), and a longer computation time.\n :type width: int\n\n :return: Baseline of the input array, as an array of the same shape.\n :rtype: numpy.ndarray\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_7snip3d = {"snip3d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_7snip3d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_7filters_6snip3d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_snip_width = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("snip3d (wrapper)", 0);
@@ -3038,11 +3562,11 @@ static PyObject *__pyx_pw_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_snip_width)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("snip3d", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip3d", 1, 2, 2, 1); __PYX_ERR(0, 216, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip3d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "snip3d") < 0)) __PYX_ERR(0, 216, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -3055,20 +3579,20 @@ static PyObject *__pyx_pw_7filters_7snip3d(PyObject *__pyx_self, PyObject *__pyx
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("snip3d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("snip3d", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 216, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("filters.snip3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7filters_6snip3d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_6snip3d(__pyx_self, __pyx_v_data, __pyx_v_snip_width);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_snip_width) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_nx = NULL;
PyObject *__pyx_v_ny = NULL;
@@ -3087,50 +3611,48 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
int __pyx_t_14;
- PyObject *__pyx_t_15 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_15;
+ PyObject *__pyx_t_16 = NULL;
__Pyx_RefNannySetupContext("snip3d", 0);
- /* "filters.pyx":237
+ /* "silx/math/fit/filters.pyx":236
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":238
+ /* "silx/math/fit/filters.pyx":237
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
* not hasattr(data[0][0], "__len__"):
* raise TypeError("data must be a 3D sequence (list, tuple) " +
*/
- __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 237, __pyx_L1_error)
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L5_bool_binop_done;
}
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0);
if (!__pyx_t_3) {
@@ -3139,330 +3661,362 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
goto __pyx_L5_bool_binop_done;
}
- /* "filters.pyx":239
+ /* "silx/math/fit/filters.pyx":238
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a 3D sequence (list, tuple) " +
* "or a 3D numpy array")
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __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, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 238, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L5_bool_binop_done:;
+
+ /* "silx/math/fit/filters.pyx":237
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
+ * not hasattr(data[0][0], "__len__"):
+ * raise TypeError("data must be a 3D sequence (list, tuple) " +
+ */
if (__pyx_t_4) {
- /* "filters.pyx":240
+ /* "silx/math/fit/filters.pyx":239
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"):
* raise TypeError("data must be a 3D sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a 3D numpy array")
* nx = len(data)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_kp_s_data_must_be_a_3D_sequence_list, __pyx_kp_s_or_a_3D_numpy_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_data_must_be_a_3D_sequence_list, __pyx_kp_s_or_a_3D_numpy_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 239, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":237
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
+ * not hasattr(data[0][0], "__len__"):
+ * raise TypeError("data must be a 3D sequence (list, tuple) " +
+ */
}
- /* "filters.pyx":242
+ /* "silx/math/fit/filters.pyx":241
* raise TypeError("data must be a 3D sequence (list, tuple) " +
* "or a 3D numpy array")
* nx = len(data) # <<<<<<<<<<<<<<
* ny = len(data[0])
* nz = len(data[0][0])
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nx = __pyx_t_1;
__pyx_t_1 = 0;
- /* "filters.pyx":243
+ /* "silx/math/fit/filters.pyx":242
* "or a 3D numpy array")
* nx = len(data)
* ny = len(data[0]) # <<<<<<<<<<<<<<
* nz = len(data[0][0])
* data_shape = (len(data), len(data[0]), len(data[0][0]))
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ny = __pyx_t_1;
__pyx_t_1 = 0;
- /* "filters.pyx":244
+ /* "silx/math/fit/filters.pyx":243
* nx = len(data)
* ny = len(data[0])
* nz = len(data[0][0]) # <<<<<<<<<<<<<<
* data_shape = (len(data), len(data[0]), len(data[0][0]))
* else:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_nz = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":245
+ /* "silx/math/fit/filters.pyx":244
* ny = len(data[0])
* nz = len(data[0][0])
* data_shape = (len(data), len(data[0]), len(data[0][0])) # <<<<<<<<<<<<<<
* else:
* data_shape = data.shape
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 244, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_8 = 0;
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":236
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
+ * not hasattr(data[0][0], "__len__"):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":247
+ /* "silx/math/fit/filters.pyx":246
* data_shape = (len(data), len(data[0]), len(data[0][0]))
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
* nrows = data_shape[0]
* if len(data_shape) == 3:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":248
+ /* "silx/math/fit/filters.pyx":247
* else:
* data_shape = data.shape
* nrows = data_shape[0] # <<<<<<<<<<<<<<
* if len(data_shape) == 3:
* nx = data_shape[0]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nrows = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":249
+ /* "silx/math/fit/filters.pyx":248
* data_shape = data.shape
* nrows = data_shape[0]
* if len(data_shape) == 3: # <<<<<<<<<<<<<<
* nx = data_shape[0]
* ny = data_shape[1]
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 248, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_6 == 3) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":250
+ /* "silx/math/fit/filters.pyx":249
* nrows = data_shape[0]
* if len(data_shape) == 3:
* nx = data_shape[0] # <<<<<<<<<<<<<<
* ny = data_shape[1]
* nz = data_shape[2]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nx = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":251
+ /* "silx/math/fit/filters.pyx":250
* if len(data_shape) == 3:
* nx = data_shape[0]
* ny = data_shape[1] # <<<<<<<<<<<<<<
* nz = data_shape[2]
* else:
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_ny = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":252
+ /* "silx/math/fit/filters.pyx":251
* nx = data_shape[0]
* ny = data_shape[1]
* nz = data_shape[2] # <<<<<<<<<<<<<<
* else:
* raise TypeError("data array must be 3-dimensional")
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nz = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":248
+ * data_shape = data.shape
+ * nrows = data_shape[0]
+ * if len(data_shape) == 3: # <<<<<<<<<<<<<<
+ * nx = data_shape[0]
+ * ny = data_shape[1]
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "filters.pyx":254
+ /* "silx/math/fit/filters.pyx":253
* nz = data_shape[2]
* else:
* raise TypeError("data array must be 3-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 253, __pyx_L1_error)
}
__pyx_L8:;
}
__pyx_L3:;
- /* "filters.pyx":256
+ /* "silx/math/fit/filters.pyx":255
* raise TypeError("data array must be 3-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__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 = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
- /* "filters.pyx":257
+ /* "silx/math/fit/filters.pyx":256
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
- /* "filters.pyx":258
+ /* "silx/math/fit/filters.pyx":257
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
- /* "filters.pyx":256
+ /* "silx/math/fit/filters.pyx":255
* raise TypeError("data array must be 3-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":259
+ /* "silx/math/fit/filters.pyx":258
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip3d(&data_c[0], nx, ny, nz, snip_width)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_data_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "filters.pyx":261
+ /* "silx/math/fit/filters.pyx":260
* order='C').reshape(-1)
*
* filters_wrapper.snip3d(&data_c[0], nx, ny, nz, snip_width) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_6 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_6 < 0) {
- __pyx_t_6 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_6 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_6 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_data_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 260, __pyx_L1_error)
}
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_nx); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_ny); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_nz); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- snip3d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_6)) )))), __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14);
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ny); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
+ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_nz); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
+ __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_snip_width); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 260, __pyx_L1_error)
+ snip3d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_11)) )))), __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15);
- /* "filters.pyx":263
+ /* "silx/math/fit/filters.pyx":262
* filters_wrapper.snip3d(&data_c[0], nx, ny, nz, snip_width)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -3470,15 +4024,15 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
@@ -3488,26 +4042,46 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 262, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -3517,25 +4091,43 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_1) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ {
+ __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_data_shape);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 262, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "filters.pyx":217
+ /* "silx/math/fit/filters.pyx":216
*
*
* def snip3d(data, snip_width): # <<<<<<<<<<<<<<
@@ -3551,8 +4143,8 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("filters.snip3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_AddTraceback("silx.math.fit.filters.snip3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -3566,7 +4158,7 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
return __pyx_r;
}
-/* "filters.pyx":266
+/* "silx/math/fit/filters.pyx":265
*
*
* def savitsky_golay(data, npoints=5): # <<<<<<<<<<<<<<
@@ -3575,15 +4167,12 @@ static PyObject *__pyx_pf_7filters_6snip3d(CYTHON_UNUSED PyObject *__pyx_self, P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_9savitsky_golay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_7filters_8savitsky_golay[] = "savitsky_golay(data, npoints=5)\nSmooth a curve using a Savitsky-Golay filter.\n\n :param data: Input data\n :type data: 1D numpy array\n :param npoints: Size of the smoothing operator in number of samples\n Must be between 3 and 100.\n :return: Smoothed data\n ";
-static PyMethodDef __pyx_mdef_7filters_9savitsky_golay = {"savitsky_golay", (PyCFunction)__pyx_pw_7filters_9savitsky_golay, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7filters_8savitsky_golay};
-static PyObject *__pyx_pw_7filters_9savitsky_golay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_9savitsky_golay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_8savitsky_golay[] = "savitsky_golay(data, npoints=5)\nSmooth a curve using a Savitsky-Golay filter.\n\n :param data: Input data\n :type data: 1D numpy array\n :param npoints: Size of the smoothing operator in number of samples\n Must be between 3 and 100.\n :return: Smoothed data\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_9savitsky_golay = {"savitsky_golay", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_9savitsky_golay, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_7filters_8savitsky_golay};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_9savitsky_golay(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_npoints = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("savitsky_golay (wrapper)", 0);
@@ -3612,7 +4201,7 @@ static PyObject *__pyx_pw_7filters_9savitsky_golay(PyObject *__pyx_self, PyObjec
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "savitsky_golay") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "savitsky_golay") < 0)) __PYX_ERR(0, 265, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -3627,20 +4216,20 @@ static PyObject *__pyx_pw_7filters_9savitsky_golay(PyObject *__pyx_self, PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("savitsky_golay", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("savitsky_golay", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 265, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("filters.savitsky_golay", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.filters.savitsky_golay", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_7filters_8savitsky_golay(__pyx_self, __pyx_v_data, __pyx_v_npoints);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_8savitsky_golay(__pyx_self, __pyx_v_data, __pyx_v_npoints);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_npoints) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_npoints) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output = { 0, 0, { 0 }, { 0 }, { 0 } };
int __pyx_v_status;
@@ -3652,227 +4241,223 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
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 } };
- Py_ssize_t __pyx_t_8;
- int __pyx_t_9;
- long __pyx_t_10;
- Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_7;
+ int __pyx_t_8;
+ long __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
int __pyx_t_12;
- int __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_13 = NULL;
__Pyx_RefNannySetupContext("savitsky_golay", 0);
- /* "filters.pyx":279
+ /* "silx/math/fit/filters.pyx":278
* double[::1] output
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
- /* "filters.pyx":280
+ /* "silx/math/fit/filters.pyx":279
*
* data_c = numpy.array(data,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 279, __pyx_L1_error)
- /* "filters.pyx":279
+ /* "silx/math/fit/filters.pyx":278
* double[::1] output
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "filters.pyx":281
+ /* "silx/math/fit/filters.pyx":280
* data_c = numpy.array(data,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* output = numpy.empty(shape=(data_c.size,),
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_data_c = __pyx_t_6;
__pyx_t_6.memview = NULL;
__pyx_t_6.data = NULL;
- /* "filters.pyx":283
+ /* "silx/math/fit/filters.pyx":282
* order='C').reshape(-1)
*
* output = numpy.empty(shape=(data_c.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __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 = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":284
+ /* "silx/math/fit/filters.pyx":283
*
* output = numpy.empty(shape=(data_c.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = filters_wrapper.SavitskyGolay(&data_c[0], data_c.size,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "filters.pyx":283
+ /* "silx/math/fit/filters.pyx":282
* order='C').reshape(-1)
*
* output = numpy.empty(shape=(data_c.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_2);
+ if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 282, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_output = __pyx_t_7;
- __pyx_t_7.memview = NULL;
- __pyx_t_7.data = NULL;
+ __pyx_v_output = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
- /* "filters.pyx":286
+ /* "silx/math/fit/filters.pyx":285
* dtype=numpy.float64)
*
* status = filters_wrapper.SavitskyGolay(&data_c[0], data_c.size, # <<<<<<<<<<<<<<
* npoints, &output[0])
*
*/
- __pyx_t_8 = 0;
- __pyx_t_9 = -1;
- if (__pyx_t_8 < 0) {
- __pyx_t_8 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
- } else if (unlikely(__pyx_t_8 >= __pyx_v_data_c.shape[0])) __pyx_t_9 = 0;
- if (unlikely(__pyx_t_9 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_9);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = 0;
+ __pyx_t_8 = -1;
+ if (__pyx_t_7 < 0) {
+ __pyx_t_7 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
+ } else if (unlikely(__pyx_t_7 >= __pyx_v_data_c.shape[0])) __pyx_t_8 = 0;
+ if (unlikely(__pyx_t_8 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_8);
+ __PYX_ERR(0, 285, __pyx_L1_error)
+ }
+ __pyx_t_2 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_5); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_t_5); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "filters.pyx":287
+ /* "silx/math/fit/filters.pyx":286
*
* status = filters_wrapper.SavitskyGolay(&data_c[0], data_c.size,
* npoints, &output[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_npoints); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = 0;
- __pyx_t_12 = -1;
- if (__pyx_t_11 < 0) {
- __pyx_t_11 += __pyx_v_output.shape[0];
- if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
- } else if (unlikely(__pyx_t_11 >= __pyx_v_output.shape[0])) __pyx_t_12 = 0;
- if (unlikely(__pyx_t_12 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_12);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_npoints); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 286, __pyx_L1_error)
+ __pyx_t_10 = 0;
+ __pyx_t_11 = -1;
+ if (__pyx_t_10 < 0) {
+ __pyx_t_10 += __pyx_v_output.shape[0];
+ if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
+ } else if (unlikely(__pyx_t_10 >= __pyx_v_output.shape[0])) __pyx_t_11 = 0;
+ if (unlikely(__pyx_t_11 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_11);
+ __PYX_ERR(0, 286, __pyx_L1_error)
}
- /* "filters.pyx":286
+ /* "silx/math/fit/filters.pyx":285
* dtype=numpy.float64)
*
* status = filters_wrapper.SavitskyGolay(&data_c[0], data_c.size, # <<<<<<<<<<<<<<
* npoints, &output[0])
*
*/
- __pyx_v_status = SavitskyGolay((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_8)) )))), __pyx_t_10, __pyx_t_9, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_output.data) + __pyx_t_11)) )))));
+ __pyx_v_status = SavitskyGolay((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_7)) )))), __pyx_t_9, __pyx_t_8, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_output.data) + __pyx_t_10)) )))));
- /* "filters.pyx":289
+ /* "silx/math/fit/filters.pyx":288
* npoints, &output[0])
*
* if status: # <<<<<<<<<<<<<<
* _logger.error("Smoothing failed. Check that npoints is greater " +
* "than 3 and smaller than 100.")
*/
- __pyx_t_13 = (__pyx_v_status != 0);
- if (__pyx_t_13) {
+ __pyx_t_12 = (__pyx_v_status != 0);
+ if (__pyx_t_12) {
- /* "filters.pyx":290
+ /* "silx/math/fit/filters.pyx":289
*
* if status:
* _logger.error("Smoothing failed. Check that npoints is greater " + # <<<<<<<<<<<<<<
* "than 3 and smaller than 100.")
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Smoothing_failed_Check_that_npoi, __pyx_kp_s_than_3_and_smaller_than_100); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Smoothing_failed_Check_that_npoi, __pyx_kp_s_than_3_and_smaller_than_100); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -3882,27 +4467,53 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_1) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_2};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L3;
+
+ /* "silx/math/fit/filters.pyx":288
+ * npoints, &output[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * _logger.error("Smoothing failed. Check that npoints is greater " +
+ * "than 3 and smaller than 100.")
+ */
}
- __pyx_L3:;
- /* "filters.pyx":293
+ /* "silx/math/fit/filters.pyx":292
* "than 3 and smaller than 100.")
*
* return numpy.asarray(output).reshape(data.shape) # <<<<<<<<<<<<<<
@@ -3910,15 +4521,15 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
*
*/
__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 = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __pyx_memoryview_fromslice(__pyx_v_output, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -3928,57 +4539,97 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_1) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_14 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
- if (likely(__pyx_t_14)) {
+ __pyx_t_13 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_13)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_14);
+ __Pyx_INCREF(__pyx_t_13);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_2, function);
}
}
- if (!__pyx_t_14) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_13) {
+ __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_5);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_14); __Pyx_GIVEREF(__pyx_t_14); __pyx_t_14 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_3};
+ __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_13, __pyx_t_3};
+ __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_13); __pyx_t_13 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "filters.pyx":266
+ /* "silx/math/fit/filters.pyx":265
*
*
* def savitsky_golay(data, npoints=5): # <<<<<<<<<<<<<<
@@ -3994,9 +4645,8 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
__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_14);
- __Pyx_AddTraceback("filters.savitsky_golay", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_AddTraceback("silx.math.fit.filters.savitsky_golay", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -4006,7 +4656,7 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "filters.pyx":296
+/* "silx/math/fit/filters.pyx":295
*
*
* def smooth1d(data): # <<<<<<<<<<<<<<
@@ -4015,21 +4665,21 @@ static PyObject *__pyx_pf_7filters_8savitsky_golay(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_11smooth1d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
-static char __pyx_doc_7filters_10smooth1d[] = "smooth1d(data)\nSimple smoothing for 1D data.\n\n For a data array :math:`y` of length :math:`n`, the smoothed array\n :math:`ys` is calculated as a weighted average of neighboring samples:\n\n :math:`ys_0 = 0.75 y_0 + 0.25 y_1`\n\n :math:`ys_i = 0.25 (y_{i-1} + 2 y_i + y_{i+1})` for :math:`0 < i < n-1`\n\n :math:`ys_{n-1} = 0.25 y_{n-2} + 0.75 y_{n-1}`\n\n\n :param data: 1D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
-static PyMethodDef __pyx_mdef_7filters_11smooth1d = {"smooth1d", (PyCFunction)__pyx_pw_7filters_11smooth1d, METH_O, __pyx_doc_7filters_10smooth1d};
-static PyObject *__pyx_pw_7filters_11smooth1d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_11smooth1d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_10smooth1d[] = "smooth1d(data)\nSimple smoothing for 1D data.\n\n For a data array :math:`y` of length :math:`n`, the smoothed array\n :math:`ys` is calculated as a weighted average of neighboring samples:\n\n :math:`ys_0 = 0.75 y_0 + 0.25 y_1`\n\n :math:`ys_i = 0.25 (y_{i-1} + 2 y_i + y_{i+1})` for :math:`0 < i < n-1`\n\n :math:`ys_{n-1} = 0.25 y_{n-2} + 0.75 y_{n-1}`\n\n\n :param data: 1D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_11smooth1d = {"smooth1d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_11smooth1d, METH_O, __pyx_doc_4silx_4math_3fit_7filters_10smooth1d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_11smooth1d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("smooth1d (wrapper)", 0);
- __pyx_r = __pyx_pf_7filters_10smooth1d(__pyx_self, ((PyObject *)__pyx_v_data));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_10smooth1d(__pyx_self, ((PyObject *)__pyx_v_data));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_data_shape = NULL;
PyObject *__pyx_r = NULL;
@@ -4043,203 +4693,217 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
__Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_10;
- PyObject *__pyx_t_11 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
__Pyx_RefNannySetupContext("smooth1d", 0);
- /* "filters.pyx":317
+ /* "silx/math/fit/filters.pyx":316
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 316, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":318
+ /* "silx/math/fit/filters.pyx":317
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
*/
- __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 317, __pyx_L1_error)
__pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
if (__pyx_t_3) {
- /* "filters.pyx":319
+ /* "silx/math/fit/filters.pyx":318
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__"):
* raise TypeError("data must be a sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a numpy array")
* data_shape = (len(data), )
*/
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_sequence_list_tup, __pyx_kp_s_or_a_numpy_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 318, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":317
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__"): # <<<<<<<<<<<<<<
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ * "or a numpy array")
+ */
}
- /* "filters.pyx":321
+ /* "silx/math/fit/filters.pyx":320
* raise TypeError("data must be a sequence (list, tuple) " +
* "or a numpy array")
* data_shape = (len(data), ) # <<<<<<<<<<<<<<
* else:
* data_shape = data.shape
*/
- __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
+
+ /* "silx/math/fit/filters.pyx":316
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__"):
+ * raise TypeError("data must be a sequence (list, tuple) " +
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":323
+ /* "silx/math/fit/filters.pyx":322
* data_shape = (len(data), )
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_data_shape = __pyx_t_1;
__pyx_t_1 = 0;
}
__pyx_L3:;
- /* "filters.pyx":325
+ /* "silx/math/fit/filters.pyx":324
* data_shape = data.shape
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
- /* "filters.pyx":326
+ /* "silx/math/fit/filters.pyx":325
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
- /* "filters.pyx":327
+ /* "silx/math/fit/filters.pyx":326
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 326, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
- /* "filters.pyx":325
+ /* "silx/math/fit/filters.pyx":324
* data_shape = data.shape
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "filters.pyx":328
+ /* "silx/math/fit/filters.pyx":327
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth1d(&data_c[0], data_c.size)
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_8);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_v_data_c = __pyx_t_9;
__pyx_t_9.memview = NULL;
__pyx_t_9.data = NULL;
- /* "filters.pyx":330
+ /* "silx/math/fit/filters.pyx":329
* order='C').reshape(-1)
*
* filters_wrapper.smooth1d(&data_c[0], data_c.size) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_5 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_5 < 0) {
- __pyx_t_5 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_5 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_5 >= __pyx_v_data_c.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = 0;
+ __pyx_t_11 = -1;
+ if (__pyx_t_10 < 0) {
+ __pyx_t_10 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
+ } else if (unlikely(__pyx_t_10 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
+ if (unlikely(__pyx_t_11 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_11);
+ __PYX_ERR(0, 329, __pyx_L1_error)
+ }
+ __pyx_t_8 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- smooth1d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_5)) )))), __pyx_t_10);
+ smooth1d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_10)) )))), __pyx_t_11);
- /* "filters.pyx":332
+ /* "silx/math/fit/filters.pyx":331
* filters_wrapper.smooth1d(&data_c[0], data_c.size)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -4247,15 +4911,15 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
*
*/
__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 = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_7 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_7)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4265,26 +4929,46 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_7) {
- __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_8);
} else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __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 = NULL;
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
+ __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1};
+ __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -4294,25 +4978,43 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_8) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_data_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data_shape};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_data_shape);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "filters.pyx":296
+ /* "silx/math/fit/filters.pyx":295
*
*
* def smooth1d(data): # <<<<<<<<<<<<<<
@@ -4328,8 +5030,8 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __Pyx_XDECREF(__pyx_t_11);
- __Pyx_AddTraceback("filters.smooth1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_AddTraceback("silx.math.fit.filters.smooth1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -4339,7 +5041,7 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "filters.pyx":335
+/* "silx/math/fit/filters.pyx":334
*
*
* def smooth2d(data): # <<<<<<<<<<<<<<
@@ -4348,21 +5050,21 @@ static PyObject *__pyx_pf_7filters_10smooth1d(CYTHON_UNUSED PyObject *__pyx_self
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_13smooth2d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
-static char __pyx_doc_7filters_12smooth2d[] = "smooth2d(data)\nSimple smoothing for 2D data:\n :func:`smooth1d` is applied succesively along both axis\n\n :param data: 2D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
-static PyMethodDef __pyx_mdef_7filters_13smooth2d = {"smooth2d", (PyCFunction)__pyx_pw_7filters_13smooth2d, METH_O, __pyx_doc_7filters_12smooth2d};
-static PyObject *__pyx_pw_7filters_13smooth2d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_13smooth2d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_12smooth2d[] = "smooth2d(data)\nSimple smoothing for 2D data:\n :func:`smooth1d` is applied succesively along both axis\n\n :param data: 2D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_13smooth2d = {"smooth2d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_13smooth2d, METH_O, __pyx_doc_4silx_4math_3fit_7filters_12smooth2d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_13smooth2d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("smooth2d (wrapper)", 0);
- __pyx_r = __pyx_pf_7filters_12smooth2d(__pyx_self, ((PyObject *)__pyx_v_data));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_12smooth2d(__pyx_self, ((PyObject *)__pyx_v_data));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_nrows = NULL;
PyObject *__pyx_v_ncolumns = NULL;
@@ -4379,302 +5081,324 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
- PyObject *__pyx_t_13 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_13;
+ PyObject *__pyx_t_14 = NULL;
__Pyx_RefNannySetupContext("smooth2d", 0);
- /* "filters.pyx":347
+ /* "silx/math/fit/filters.pyx":346
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
* raise TypeError("data must be a 2D sequence (list, tuple) " +
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":348
+ /* "silx/math/fit/filters.pyx":347
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a 2D sequence (list, tuple) " +
* "or a 2D numpy array")
*/
- __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L5_bool_binop_done;
}
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0);
__pyx_t_4 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
if (__pyx_t_4) {
- /* "filters.pyx":349
+ /* "silx/math/fit/filters.pyx":348
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
* raise TypeError("data must be a 2D sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a 2D numpy array")
* nrows = len(data)
*/
- __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_2D_sequence_list, __pyx_kp_s_or_a_2D_numpy_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyNumber_Add(__pyx_kp_s_data_must_be_a_2D_sequence_list, __pyx_kp_s_or_a_2D_numpy_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 348, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":347
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"): # <<<<<<<<<<<<<<
+ * raise TypeError("data must be a 2D sequence (list, tuple) " +
+ * "or a 2D numpy array")
+ */
}
- /* "filters.pyx":351
+ /* "silx/math/fit/filters.pyx":350
* raise TypeError("data must be a 2D sequence (list, tuple) " +
* "or a 2D numpy array")
* nrows = len(data) # <<<<<<<<<<<<<<
* ncolumns = len(data[0])
* data_shape = (len(data), len(data[0]))
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 350, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_nrows = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":352
+ /* "silx/math/fit/filters.pyx":351
* "or a 2D numpy array")
* nrows = len(data)
* ncolumns = len(data[0]) # <<<<<<<<<<<<<<
* data_shape = (len(data), len(data[0]))
*
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_ncolumns = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":353
+ /* "silx/math/fit/filters.pyx":352
* nrows = len(data)
* ncolumns = len(data[0])
* data_shape = (len(data), len(data[0])) # <<<<<<<<<<<<<<
*
* else:
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 352, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":346
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__"):
+ * raise TypeError("data must be a 2D sequence (list, tuple) " +
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":356
+ /* "silx/math/fit/filters.pyx":355
*
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
* nrows = data_shape[0]
* if len(data_shape) == 2:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":357
+ /* "silx/math/fit/filters.pyx":356
* else:
* data_shape = data.shape
* nrows = data_shape[0] # <<<<<<<<<<<<<<
* if len(data_shape) == 2:
* ncolumns = data_shape[1]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nrows = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":358
+ /* "silx/math/fit/filters.pyx":357
* data_shape = data.shape
* nrows = data_shape[0]
* if len(data_shape) == 2: # <<<<<<<<<<<<<<
* ncolumns = data_shape[1]
* else:
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 357, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_6 == 2) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":359
+ /* "silx/math/fit/filters.pyx":358
* nrows = data_shape[0]
* if len(data_shape) == 2:
* ncolumns = data_shape[1] # <<<<<<<<<<<<<<
* else:
* raise TypeError("data array must be 2-dimensional")
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_ncolumns = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":357
+ * data_shape = data.shape
+ * nrows = data_shape[0]
+ * if len(data_shape) == 2: # <<<<<<<<<<<<<<
+ * ncolumns = data_shape[1]
+ * else:
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "filters.pyx":361
+ /* "silx/math/fit/filters.pyx":360
* ncolumns = data_shape[1]
* else:
* raise TypeError("data array must be 2-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __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 = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 360, __pyx_L1_error)
}
__pyx_L7:;
}
__pyx_L3:;
- /* "filters.pyx":363
+ /* "silx/math/fit/filters.pyx":362
* raise TypeError("data array must be 2-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__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 = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
- /* "filters.pyx":364
+ /* "silx/math/fit/filters.pyx":363
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
- /* "filters.pyx":365
+ /* "silx/math/fit/filters.pyx":364
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 364, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 363, __pyx_L1_error)
- /* "filters.pyx":363
+ /* "silx/math/fit/filters.pyx":362
* raise TypeError("data array must be 2-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 362, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "filters.pyx":366
+ /* "silx/math/fit/filters.pyx":365
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth2d(&data_c[0], nrows, ncolumns)
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_data_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "filters.pyx":368
+ /* "silx/math/fit/filters.pyx":367
* order='C').reshape(-1)
*
* filters_wrapper.smooth2d(&data_c[0], nrows, ncolumns) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_6 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_6 < 0) {
- __pyx_t_6 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_6 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_6 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_data_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 367, __pyx_L1_error)
}
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_nrows); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_ncolumns); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- smooth2d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_6)) )))), __pyx_t_11, __pyx_t_12);
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nrows); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ncolumns); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
+ smooth2d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_11)) )))), __pyx_t_12, __pyx_t_13);
- /* "filters.pyx":370
+ /* "silx/math/fit/filters.pyx":369
* filters_wrapper.smooth2d(&data_c[0], nrows, ncolumns)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
@@ -4682,15 +5406,15 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -4700,26 +5424,46 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_8) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = NULL;
- PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_7};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -4729,25 +5473,43 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_2) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_13);
- PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ {
+ __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_data_shape);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 369, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "filters.pyx":335
+ /* "silx/math/fit/filters.pyx":334
*
*
* def smooth2d(data): # <<<<<<<<<<<<<<
@@ -4763,8 +5525,8 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_13);
- __Pyx_AddTraceback("filters.smooth2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_AddTraceback("silx.math.fit.filters.smooth2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -4776,7 +5538,7 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "filters.pyx":373
+/* "silx/math/fit/filters.pyx":372
*
*
* def smooth3d(data): # <<<<<<<<<<<<<<
@@ -4785,21 +5547,21 @@ static PyObject *__pyx_pf_7filters_12smooth2d(CYTHON_UNUSED PyObject *__pyx_self
*/
/* Python wrapper */
-static PyObject *__pyx_pw_7filters_15smooth3d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
-static char __pyx_doc_7filters_14smooth3d[] = "smooth3d(data)\nSimple smoothing for 3D data:\n :func:`smooth2d` is applied on each 2D slice of the data volume along all\n 3 axis\n\n :param data: 2D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
-static PyMethodDef __pyx_mdef_7filters_15smooth3d = {"smooth3d", (PyCFunction)__pyx_pw_7filters_15smooth3d, METH_O, __pyx_doc_7filters_14smooth3d};
-static PyObject *__pyx_pw_7filters_15smooth3d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_15smooth3d(PyObject *__pyx_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_7filters_14smooth3d[] = "smooth3d(data)\nSimple smoothing for 3D data:\n :func:`smooth2d` is applied on each 2D slice of the data volume along all\n 3 axis\n\n :param data: 2D\302\240data array\n :type data: numpy.ndarray\n :return: Smoothed data\n :rtype: numpy.ndarray(dtype=numpy.float64)\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_7filters_15smooth3d = {"smooth3d", (PyCFunction)__pyx_pw_4silx_4math_3fit_7filters_15smooth3d, METH_O, __pyx_doc_4silx_4math_3fit_7filters_14smooth3d};
+static PyObject *__pyx_pw_4silx_4math_3fit_7filters_15smooth3d(PyObject *__pyx_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("smooth3d (wrapper)", 0);
- __pyx_r = __pyx_pf_7filters_14smooth3d(__pyx_self, ((PyObject *)__pyx_v_data));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_7filters_14smooth3d(__pyx_self, ((PyObject *)__pyx_v_data));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
+static PyObject *__pyx_pf_4silx_4math_3fit_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data) {
__Pyx_memviewslice __pyx_v_data_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_nx = NULL;
PyObject *__pyx_v_ny = NULL;
@@ -4818,49 +5580,47 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
__Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
int __pyx_t_13;
- PyObject *__pyx_t_14 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("smooth3d", 0);
- /* "filters.pyx":386
+ /* "silx/math/fit/filters.pyx":385
* double[::1] data_c
*
* if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ndarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_IsInstance(__pyx_v_data, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 385, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":387
+ /* "silx/math/fit/filters.pyx":386
*
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
* not hasattr(data[0][0], "__len__"):
* raise TypeError("data must be a 3D sequence (list, tuple) " +
*/
- __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_v_data, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 386, __pyx_L1_error)
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
if (!__pyx_t_5) {
} else {
__pyx_t_4 = __pyx_t_5;
goto __pyx_L5_bool_binop_done;
}
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_HasAttr(__pyx_t_2, __pyx_n_s_len); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 386, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_3 = ((!(__pyx_t_5 != 0)) != 0);
if (!__pyx_t_3) {
@@ -4869,343 +5629,375 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
goto __pyx_L5_bool_binop_done;
}
- /* "filters.pyx":388
+ /* "silx/math/fit/filters.pyx":387
* if not isinstance(data, numpy.ndarray):
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"): # <<<<<<<<<<<<<<
* raise TypeError("data must be a 3D sequence (list, tuple) " +
* "or a 3D numpy array")
*/
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 387, __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, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_HasAttr(__pyx_t_1, __pyx_n_s_len); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 387, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_5 = ((!(__pyx_t_3 != 0)) != 0);
__pyx_t_4 = __pyx_t_5;
__pyx_L5_bool_binop_done:;
+
+ /* "silx/math/fit/filters.pyx":386
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
+ * not hasattr(data[0][0], "__len__"):
+ * raise TypeError("data must be a 3D sequence (list, tuple) " +
+ */
if (__pyx_t_4) {
- /* "filters.pyx":389
+ /* "silx/math/fit/filters.pyx":388
* if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
* not hasattr(data[0][0], "__len__"):
* raise TypeError("data must be a 3D sequence (list, tuple) " + # <<<<<<<<<<<<<<
* "or a 3D numpy array")
* nx = len(data)
*/
- __pyx_t_1 = PyNumber_Add(__pyx_kp_s_data_must_be_a_3D_sequence_list, __pyx_kp_s_or_a_3D_numpy_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyNumber_Add(__pyx_kp_s_data_must_be_a_3D_sequence_list, __pyx_kp_s_or_a_3D_numpy_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 388, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 388, __pyx_L1_error)
+
+ /* "silx/math/fit/filters.pyx":386
+ *
+ * if not isinstance(data, numpy.ndarray):
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\ # <<<<<<<<<<<<<<
+ * not hasattr(data[0][0], "__len__"):
+ * raise TypeError("data must be a 3D sequence (list, tuple) " +
+ */
}
- /* "filters.pyx":391
+ /* "silx/math/fit/filters.pyx":390
* raise TypeError("data must be a 3D sequence (list, tuple) " +
* "or a 3D numpy array")
* nx = len(data) # <<<<<<<<<<<<<<
* ny = len(data[0])
* nz = len(data[0][0])
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 390, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_nx = __pyx_t_1;
__pyx_t_1 = 0;
- /* "filters.pyx":392
+ /* "silx/math/fit/filters.pyx":391
* "or a 3D numpy array")
* nx = len(data)
* ny = len(data[0]) # <<<<<<<<<<<<<<
* nz = len(data[0][0])
* data_shape = (len(data), len(data[0]), len(data[0][0]))
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_ny = __pyx_t_1;
__pyx_t_1 = 0;
- /* "filters.pyx":393
+ /* "silx/math/fit/filters.pyx":392
* nx = len(data)
* ny = len(data[0])
* nz = len(data[0][0]) # <<<<<<<<<<<<<<
* data_shape = (len(data), len(data[0]), len(data[0][0]))
* else:
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_v_nz = __pyx_t_2;
__pyx_t_2 = 0;
- /* "filters.pyx":394
+ /* "silx/math/fit/filters.pyx":393
* ny = len(data[0])
* nz = len(data[0][0])
* data_shape = (len(data), len(data[0]), len(data[0][0])) # <<<<<<<<<<<<<<
* else:
* data_shape = data.shape
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 393, __pyx_L1_error)
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_6 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
__pyx_t_2 = 0;
__pyx_t_1 = 0;
__pyx_t_8 = 0;
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":385
+ * double[::1] data_c
+ *
+ * if not isinstance(data, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if not hasattr(data, "__len__") or not hasattr(data[0], "__len__") or\
+ * not hasattr(data[0][0], "__len__"):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "filters.pyx":396
+ /* "silx/math/fit/filters.pyx":395
* data_shape = (len(data), len(data[0]), len(data[0][0]))
* else:
* data_shape = data.shape # <<<<<<<<<<<<<<
* nrows = data_shape[0]
* if len(data_shape) == 3:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 395, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_data_shape = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":397
+ /* "silx/math/fit/filters.pyx":396
* else:
* data_shape = data.shape
* nrows = data_shape[0] # <<<<<<<<<<<<<<
* if len(data_shape) == 3:
* nx = data_shape[0]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nrows = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":398
+ /* "silx/math/fit/filters.pyx":397
* data_shape = data.shape
* nrows = data_shape[0]
* if len(data_shape) == 3: # <<<<<<<<<<<<<<
* nx = data_shape[0]
* ny = data_shape[1]
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_data_shape); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 397, __pyx_L1_error)
__pyx_t_4 = ((__pyx_t_6 == 3) != 0);
if (__pyx_t_4) {
- /* "filters.pyx":399
+ /* "silx/math/fit/filters.pyx":398
* nrows = data_shape[0]
* if len(data_shape) == 3:
* nx = data_shape[0] # <<<<<<<<<<<<<<
* ny = data_shape[1]
* nz = data_shape[2]
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 398, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nx = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":400
+ /* "silx/math/fit/filters.pyx":399
* if len(data_shape) == 3:
* nx = data_shape[0]
* ny = data_shape[1] # <<<<<<<<<<<<<<
* nz = data_shape[2]
* else:
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_ny = __pyx_t_7;
__pyx_t_7 = 0;
- /* "filters.pyx":401
+ /* "silx/math/fit/filters.pyx":400
* nx = data_shape[0]
* ny = data_shape[1]
* nz = data_shape[2] # <<<<<<<<<<<<<<
* else:
* raise TypeError("data array must be 3-dimensional")
*/
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_data_shape, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 400, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_v_nz = __pyx_t_7;
__pyx_t_7 = 0;
+
+ /* "silx/math/fit/filters.pyx":397
+ * data_shape = data.shape
+ * nrows = data_shape[0]
+ * if len(data_shape) == 3: # <<<<<<<<<<<<<<
+ * nx = data_shape[0]
+ * ny = data_shape[1]
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "filters.pyx":403
+ /* "silx/math/fit/filters.pyx":402
* nz = data_shape[2]
* else:
* raise TypeError("data array must be 3-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 402, __pyx_L1_error)
}
__pyx_L8:;
}
__pyx_L3:;
- /* "filters.pyx":405
+ /* "silx/math/fit/filters.pyx":404
* raise TypeError("data array must be 3-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__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 = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
__Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_data);
- /* "filters.pyx":406
+ /* "silx/math/fit/filters.pyx":405
*
* data_c = numpy.array(data,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
- /* "filters.pyx":407
+ /* "silx/math/fit/filters.pyx":406
* data_c = numpy.array(data,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 405, __pyx_L1_error)
- /* "filters.pyx":405
+ /* "silx/math/fit/filters.pyx":404
* raise TypeError("data array must be 3-dimensional")
*
* data_c = numpy.array(data, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":408
+ /* "silx/math/fit/filters.pyx":407
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth3d(&data_c[0], nx, ny, nz)
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_data_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "filters.pyx":410
+ /* "silx/math/fit/filters.pyx":409
* order='C').reshape(-1)
*
* filters_wrapper.smooth3d(&data_c[0], nx, ny, nz) # <<<<<<<<<<<<<<
*
* return numpy.asarray(data_c).reshape(data_shape)
*/
- __pyx_t_6 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_6 < 0) {
- __pyx_t_6 += __pyx_v_data_c.shape[0];
- if (unlikely(__pyx_t_6 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_6 >= __pyx_v_data_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_data_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_data_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 409, __pyx_L1_error)
}
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_v_nx); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_ny); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_nz); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 410; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- smooth3d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_6)) )))), __pyx_t_11, __pyx_t_12, __pyx_t_13);
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_v_nx); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error)
+ __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_v_ny); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error)
+ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_nz); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error)
+ smooth3d((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_data_c.data) + __pyx_t_11)) )))), __pyx_t_12, __pyx_t_13, __pyx_t_14);
- /* "filters.pyx":412
+ /* "silx/math/fit/filters.pyx":411
* filters_wrapper.smooth3d(&data_c[0], nx, ny, nz)
*
* return numpy.asarray(data_c).reshape(data_shape) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_asarray); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_8);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_data_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
@@ -5215,26 +6007,46 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = NULL;
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_7};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 411, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -5244,25 +6056,43 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
}
}
if (!__pyx_t_1) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data_shape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_14);
- PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_INCREF(__pyx_v_data_shape);
- PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_v_data_shape);
- __Pyx_GIVEREF(__pyx_v_data_shape);
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data_shape};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_data_shape);
+ __Pyx_GIVEREF(__pyx_v_data_shape);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_v_data_shape);
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "filters.pyx":373
+ /* "silx/math/fit/filters.pyx":372
*
*
* def smooth3d(data): # <<<<<<<<<<<<<<
@@ -5278,8 +6108,8 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_14);
- __Pyx_AddTraceback("filters.smooth3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.filters.smooth3d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_data_c, 1);
@@ -5293,7 +6123,7 @@ static PyObject *__pyx_pf_7filters_14smooth3d(CYTHON_UNUSED PyObject *__pyx_self
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5309,9 +6139,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -5339,12 +6166,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -5358,7 +6185,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -5372,14 +6199,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -5391,19 +6218,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5420,7 +6247,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -5432,19 +6259,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -5453,12 +6277,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -5467,7 +6291,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -5477,21 +6301,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -5501,95 +6333,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -5599,43 +6444,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -5645,42 +6499,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -5689,7 +6551,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -5697,19 +6559,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -5718,7 +6580,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -5730,20 +6592,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -5752,7 +6622,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -5764,34 +6634,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -5800,7 +6678,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -5809,19 +6687,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -5831,7 +6709,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -5840,7 +6718,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -5850,21 +6728,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__17, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -5874,7 +6760,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -5883,7 +6769,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -5891,30 +6777,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -5923,7 +6797,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -5932,14 +6806,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5952,7 +6838,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -5963,7 +6849,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -5977,14 +6863,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -5995,16 +6881,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -6013,18 +6896,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -6032,21 +6915,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -6054,11 +6945,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -6068,21 +6966,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -6092,7 +6998,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -6102,7 +7008,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -6112,7 +7018,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -6122,7 +7028,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -6132,7 +7038,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -6141,7 +7047,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -6151,7 +7057,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -6160,7 +7066,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -6170,7 +7076,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -6179,22 +7085,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -6207,7 +7121,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -6237,7 +7151,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -6250,18 +7164,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -6271,7 +7185,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -6279,10 +7193,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -6292,7 +7214,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -6302,7 +7224,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -6310,32 +7232,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -6347,84 +7282,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -6432,15 +7411,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6454,24 +7433,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -6479,16 +7455,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6508,7 +7484,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6522,24 +7498,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -6547,16 +7520,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6576,7 +7549,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -6590,35 +7563,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -6638,7 +7608,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -6655,12 +7625,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -6670,96 +7637,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -6770,7 +7745,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -6782,7 +7757,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -6805,7 +7780,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -6817,9 +7792,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -6841,7 +7813,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -6852,25 +7824,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -6883,7 +7855,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -6897,7 +7869,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -6911,19 +7883,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -6935,7 +7907,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -6950,7 +7922,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -6964,7 +7936,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -6973,7 +7945,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -6982,7 +7954,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -6992,7 +7964,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -7000,21 +7972,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -7027,7 +8005,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -7041,9 +8019,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -7068,7 +8043,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -7077,7 +8052,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -7089,43 +8064,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -7138,7 +8108,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -7147,14 +8117,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -7167,16 +8137,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -7186,7 +8156,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -7195,90 +8165,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -7287,7 +8344,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -7296,7 +8353,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -7308,8 +8365,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -7317,7 +8372,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -7330,19 +8385,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -7353,41 +8413,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -7399,8 +8562,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -7420,12 +8583,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -7434,7 +8594,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7446,25 +8606,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -7473,7 +8635,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -7484,18 +8646,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7505,7 +8667,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -7515,8 +8677,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -7535,7 +8697,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -7549,14 +8711,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7568,12 +8730,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -7584,7 +8743,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -7595,20 +8754,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7616,39 +8783,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -7656,25 +8823,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -7682,14 +8857,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -7712,7 +8887,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -7726,14 +8901,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7742,24 +8917,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7767,111 +8939,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -7896,7 +9084,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -7916,24 +9104,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -7941,81 +9126,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -8032,12 +9228,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -8045,11 +9251,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -8061,7 +9273,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -8083,7 +9295,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -8100,55 +9312,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -8169,7 +9378,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -8178,7 +9387,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -8196,12 +9405,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -8210,7 +9416,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -8219,7 +9425,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -8229,7 +9435,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -8238,7 +9444,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -8248,17 +9454,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -8266,22 +9480,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -8290,7 +9512,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -8300,7 +9522,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -8308,24 +9530,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -8335,21 +9565,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -8359,7 +9595,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -8372,8 +9608,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -8387,6 +9625,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -8404,7 +9643,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -8425,7 +9664,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -8439,33 +9678,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -8486,7 +9722,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -8507,41 +9743,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -8549,26 +9781,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -8578,38 +9812,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -8617,14 +9879,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -8637,51 +9907,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -8689,7 +9970,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -8715,7 +9996,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -8736,31 +10017,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -8771,53 +10050,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -8827,66 +10114,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -8895,9 +10202,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -8914,7 +10221,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -8925,7 +10232,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8939,14 +10246,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -8961,7 +10268,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -8971,7 +10278,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -8980,22 +10287,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -9005,7 +10320,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -9014,22 +10329,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -9039,7 +10362,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -9048,22 +10371,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -9073,7 +10404,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -9082,22 +10413,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -9107,7 +10446,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -9117,7 +10456,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -9127,7 +10466,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -9137,7 +10476,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -9146,7 +10485,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -9159,7 +10498,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -9177,78 +10516,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -9263,49 +10599,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -9316,77 +10652,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9395,102 +10730,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9499,110 +10841,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__22, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9611,55 +10956,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -9674,55 +11016,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -9737,51 +11076,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -9789,11 +11125,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -9810,156 +11146,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -9968,18 +11263,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9990,8 +11284,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -10004,20 +11298,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -10027,7 +11321,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -10036,9 +11330,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -10048,8 +11350,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -10062,7 +11364,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -10076,25 +11378,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -10102,54 +11401,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -10170,7 +11469,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -10184,24 +11483,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -10209,27 +11505,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -10249,7 +11545,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -10263,48 +11559,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -10323,8 +11616,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -10337,49 +11630,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -10397,8 +11687,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -10411,26 +11701,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -10439,7 +11726,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -10448,17 +11735,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -10466,14 +11753,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -10491,7 +11778,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10505,14 +11792,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -10520,12 +11807,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -10534,7 +11818,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -10543,17 +11827,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -10561,13 +11845,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10586,7 +11870,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -10601,40 +11885,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -10643,7 +11924,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -10655,7 +11936,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -10677,7 +11958,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -10691,18 +11972,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -10716,7 +11997,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -10745,12 +12026,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -10761,49 +12039,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -10812,7 +12098,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -10821,7 +12107,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -10834,25 +12120,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -10861,7 +12149,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -10871,13 +12159,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -10888,7 +12176,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -10898,27 +12186,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__21);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __Pyx_INCREF(__pyx_slice__23);
+ __Pyx_GIVEREF(__pyx_slice__23);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__23);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -10926,22 +12214,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__24); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -10949,17 +12245,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -10972,29 +12276,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -11013,18 +12325,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -11035,17 +12347,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -11055,29 +12367,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__23);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __Pyx_INCREF(__pyx_slice__25);
+ __Pyx_GIVEREF(__pyx_slice__25);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__25);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -11087,32 +12405,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -11138,76 +12456,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -11216,7 +12541,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -11255,12 +12580,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -11270,7 +12592,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -11279,7 +12601,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -11290,36 +12612,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -11327,20 +12649,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -11351,7 +12681,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -11361,7 +12691,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -11371,7 +12701,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -11380,7 +12710,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -11389,7 +12719,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -11401,25 +12731,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -11428,7 +12760,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -11439,7 +12771,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -11449,27 +12781,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -11480,7 +12820,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -11489,7 +12829,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -11498,16 +12838,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -11515,24 +12855,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -11541,20 +12889,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -11563,20 +12911,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -11585,55 +12933,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -11644,7 +12992,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -11654,18 +13002,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -11674,73 +13022,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -11762,7 +13118,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -11777,11 +13133,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -11791,7 +13144,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -11801,7 +13154,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -11809,11 +13162,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -11827,28 +13186,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -11860,7 +13233,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -11878,19 +13251,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -11900,7 +13279,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -11910,7 +13289,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -11919,7 +13298,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -11929,7 +13308,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -11937,13 +13316,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -11953,7 +13346,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -11963,7 +13356,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -11971,38 +13364,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -12010,24 +13426,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -12037,7 +13461,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -12047,7 +13471,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -12056,7 +13480,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -12066,7 +13490,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -12074,13 +13498,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -12090,7 +13528,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -12098,49 +13536,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -12150,7 +13611,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -12158,11 +13619,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -12171,7 +13638,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -12181,7 +13648,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -12189,11 +13656,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -12203,7 +13676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -12211,11 +13684,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -12224,7 +13703,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -12233,7 +13712,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -12244,7 +13723,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -12254,7 +13733,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -12262,23 +13741,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -12288,7 +13775,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -12298,7 +13785,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -12308,7 +13795,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -12316,39 +13803,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -12358,7 +13875,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -12382,7 +13899,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -12402,21 +13919,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -12426,7 +13940,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -12436,7 +13950,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -12444,28 +13958,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -12473,20 +13975,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -12495,7 +14005,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -12505,7 +14015,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -12513,13 +14023,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -12529,7 +14045,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -12538,7 +14054,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -12548,35 +14064,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -12586,32 +14116,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -12620,7 +14158,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -12630,7 +14168,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -12638,11 +14176,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -12652,7 +14196,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -12671,7 +14215,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -12694,11 +14238,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -12708,7 +14249,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -12718,7 +14259,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -12728,7 +14269,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -12739,7 +14280,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -12748,7 +14289,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -12760,7 +14301,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -12772,7 +14313,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -12790,20 +14331,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -12813,7 +14360,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -12837,7 +14384,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -12850,17 +14397,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -12869,7 +14416,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -12881,7 +14428,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -12894,12 +14441,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -12909,7 +14453,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -12917,30 +14461,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -12959,7 +14511,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -12973,12 +14525,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -12988,32 +14537,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -13034,36 +14591,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -13072,11 +14629,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -13087,7 +14644,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -13097,7 +14654,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -13105,16 +14663,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -13123,7 +14679,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -13134,35 +14690,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -13171,7 +14735,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -13180,14 +14744,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -13195,7 +14759,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -13205,7 +14769,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -13215,7 +14779,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -13224,7 +14788,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -13233,7 +14797,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -13242,7 +14806,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -13251,7 +14815,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -13260,66 +14824,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -13327,7 +14953,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -13336,7 +14962,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -13348,7 +14974,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -13364,12 +14990,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -13384,36 +15011,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -13422,19 +15046,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -13445,7 +15077,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -13456,7 +15088,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -13464,7 +15096,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13481,10 +15113,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -13494,7 +15126,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -13504,7 +15136,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -13514,7 +15146,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -13523,7 +15155,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -13532,7 +15164,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -13543,59 +15175,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13607,7 +15220,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -13620,12 +15233,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -13634,7 +15244,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -13642,13 +15252,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -13667,7 +15277,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -13685,23 +15295,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -13711,7 +15318,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -13720,20 +15327,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -13744,7 +15359,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -13753,20 +15368,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -13785,7 +15400,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -13797,7 +15412,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -13807,7 +15422,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -13816,21 +15431,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -13843,7 +15466,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -13860,7 +15483,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -13869,7 +15492,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -13878,17 +15501,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -13898,7 +15521,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -13907,7 +15530,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -13915,11 +15538,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -13930,7 +15561,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -13940,7 +15571,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -13949,7 +15580,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -13957,11 +15588,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -13971,7 +15610,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -13980,21 +15619,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14007,7 +15654,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -14027,7 +15674,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -14036,7 +15683,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -14045,7 +15692,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -14054,7 +15701,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -14063,7 +15710,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -14073,7 +15720,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -14093,7 +15740,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -14107,9 +15754,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -14117,22 +15772,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -14141,7 +15804,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -14150,7 +15813,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -14161,22 +15824,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -14185,7 +15856,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -14194,7 +15865,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -14206,7 +15877,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -14217,7 +15888,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14227,7 +15898,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -14236,7 +15907,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14247,7 +15918,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14263,7 +15934,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -14273,7 +15944,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14284,7 +15955,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -14294,7 +15965,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -14304,7 +15975,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14317,7 +15988,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -14332,7 +16003,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -14342,7 +16013,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -14353,7 +16024,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -14362,7 +16033,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -14371,21 +16042,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -14394,7 +16073,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -14406,7 +16085,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -14416,7 +16095,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -14429,7 +16108,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14448,11 +16127,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -14462,7 +16138,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -14471,7 +16147,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -14480,7 +16156,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -14490,19 +16166,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -14511,7 +16193,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -14521,7 +16203,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14532,7 +16214,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -14541,17 +16223,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -14560,7 +16242,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14571,7 +16253,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -14581,53 +16263,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -14637,7 +16333,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14661,7 +16357,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -14676,62 +16372,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -14754,7 +16447,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14770,33 +16463,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -14806,26 +16496,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14850,7 +16560,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14867,16 +16577,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -14886,18 +16593,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -14907,39 +16614,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -14964,7 +16699,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -14989,11 +16724,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -15002,7 +16734,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -15012,7 +16744,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -15021,7 +16753,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -15030,7 +16762,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -15039,7 +16771,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -15049,7 +16781,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -15057,10 +16789,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -15070,7 +16810,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -15078,11 +16818,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -15098,7 +16845,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -15109,7 +16856,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -15119,7 +16866,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -15129,7 +16876,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -15138,7 +16885,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -15146,25 +16893,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -15174,62 +16935,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -15237,11 +17010,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -15251,51 +17030,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
+ *
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
*
- * 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)
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -15304,7 +17098,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15313,7 +17107,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -15322,7 +17116,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -15331,7 +17125,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -15340,7 +17134,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -15349,12 +17143,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -15368,28 +17176,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15398,7 +17212,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -15407,7 +17221,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -15416,7 +17230,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -15425,7 +17239,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -15435,7 +17249,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -15459,21 +17273,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -15482,87 +17296,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -15570,7 +17384,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15581,7 +17395,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -15591,7 +17405,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -15599,11 +17413,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15614,7 +17434,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15629,7 +17449,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -15638,7 +17458,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15653,7 +17473,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15669,7 +17489,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -15680,7 +17500,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -15690,7 +17510,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -15700,7 +17520,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -15708,36 +17528,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -15747,7 +17591,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15759,7 +17603,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -15769,7 +17613,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15778,7 +17622,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -15787,7 +17631,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -15796,7 +17640,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -15807,7 +17651,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15823,7 +17667,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -15832,7 +17676,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -15841,7 +17685,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -15851,7 +17695,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -15862,7 +17706,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -15871,7 +17715,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -15880,22 +17724,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -15904,7 +17756,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -15916,7 +17768,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -15926,6 +17778,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -15937,12 +17790,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -15993,7 +17848,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -16002,7 +17857,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -16044,7 +17899,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "filters.array", /*tp_name*/
+ "silx.math.fit.filters.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -16053,8 +17908,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -16149,7 +18005,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "filters.Enum", /*tp_name*/
+ "silx.math.fit.filters.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -16158,8 +18014,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -16220,10 +18077,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -16301,39 +18159,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -16345,15 +18203,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -16395,7 +18253,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "filters.memoryview", /*tp_name*/
+ "silx.math.fit.filters.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -16404,8 +18262,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -16505,7 +18364,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -16513,13 +18372,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "filters._memoryviewslice", /*tp_name*/
+ "silx.math.fit.filters._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -16528,8 +18387,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -16605,7 +18465,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_22_06_2016, __pyx_k_22_06_2016, sizeof(__pyx_k_22_06_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_15_05_2017, __pyx_k_15_05_2017, sizeof(__pyx_k_15_05_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 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_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
{&__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},
@@ -16634,7 +18495,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 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_basicConfig, __pyx_k_basicConfig, sizeof(__pyx_k_basicConfig), 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},
@@ -16653,10 +18513,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1},
- {&__pyx_n_s_filters, __pyx_k_filters, sizeof(__pyx_k_filters), 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_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
@@ -16677,7 +18537,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
- {&__pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__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},
@@ -16704,6 +18563,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
{&__pyx_n_s_savitsky_golay, __pyx_k_savitsky_golay, sizeof(__pyx_k_savitsky_golay), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_math_fit_filters, __pyx_k_silx_math_fit_filters, sizeof(__pyx_k_silx_math_fit_filters), 0, 0, 1, 1},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_s_smooth1d, __pyx_k_smooth1d, sizeof(__pyx_k_smooth1d), 0, 0, 1, 1},
{&__pyx_n_s_smooth2d, __pyx_k_smooth2d, sizeof(__pyx_k_smooth2d), 0, 0, 1, 1},
@@ -16726,24 +18586,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
- {&__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_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 145; __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 = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 91, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 131, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 178, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -16753,420 +18608,445 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "filters.pyx":101
+ /* "silx/math/fit/filters.pyx":100
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* output = numpy.empty(shape=(input_c.size,),
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "filters.pyx":116
+ /* "silx/math/fit/filters.pyx":115
* # Make a dummy length-1 array, because if I use shape=(0,) I get the error
* # IndexError: Out of bounds on buffer access (axis 0)
* anchors_c = numpy.empty(shape=(1,), # <<<<<<<<<<<<<<
* dtype=numpy.int_)
* len_anchors = 0
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "filters.pyx":165
+ /* "silx/math/fit/filters.pyx":164
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip1d(&data_c[0], data_c.size, snip_width)
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "filters.pyx":205
+ /* "silx/math/fit/filters.pyx":204
* ncolumns = data_shape[1]
* else:
* raise TypeError("data array must be 2-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_2_dimensional); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_2_dimensional); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 204, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "filters.pyx":210
+ /* "silx/math/fit/filters.pyx":209
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip2d(&data_c[0], nrows, ncolumns, snip_width)
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 209, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "filters.pyx":254
+ /* "silx/math/fit/filters.pyx":253
* nz = data_shape[2]
* else:
* raise TypeError("data array must be 3-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_3_dimensional); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_3_dimensional); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "filters.pyx":259
+ /* "silx/math/fit/filters.pyx":258
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.snip3d(&data_c[0], nx, ny, nz, snip_width)
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "filters.pyx":281
+ /* "silx/math/fit/filters.pyx":280
* data_c = numpy.array(data,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* output = numpy.empty(shape=(data_c.size,),
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 280, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "filters.pyx":328
+ /* "silx/math/fit/filters.pyx":327
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth1d(&data_c[0], data_c.size)
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 327, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "filters.pyx":361
+ /* "silx/math/fit/filters.pyx":360
* ncolumns = data_shape[1]
* else:
* raise TypeError("data array must be 2-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_2_dimensional); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_2_dimensional); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- /* "filters.pyx":366
+ /* "silx/math/fit/filters.pyx":365
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth2d(&data_c[0], nrows, ncolumns)
*/
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "filters.pyx":403
+ /* "silx/math/fit/filters.pyx":402
* nz = data_shape[2]
* else:
* raise TypeError("data array must be 3-dimensional") # <<<<<<<<<<<<<<
*
* data_c = numpy.array(data,
*/
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_3_dimensional); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_data_array_must_be_3_dimensional); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- /* "filters.pyx":408
+ /* "silx/math/fit/filters.pyx":407
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
*
* filters_wrapper.smooth3d(&data_c[0], nx, ny, nz)
*/
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __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_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __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_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__22 = PyTuple_New(1); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__22, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__22);
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__23);
+ __Pyx_GIVEREF(__pyx_slice__23);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__22);
- __Pyx_GIVEREF(__pyx_slice__22);
+ __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__24);
+ __Pyx_GIVEREF(__pyx_slice__24);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(1, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__25);
+ __Pyx_GIVEREF(__pyx_slice__25);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
- /* "filters.pyx":62
+ /* "silx/math/fit/filters.pyx":61
*
*
* def strip(data, w=1, niterations=1000, factor=1.0, anchors=None): # <<<<<<<<<<<<<<
* """Extract background from data using the strip algorithm, as explained at
* http://pymca.sourceforge.net/stripbackground.html.
*/
- __pyx_tuple__25 = PyTuple_Pack(11, __pyx_n_s_data, __pyx_n_s_w, __pyx_n_s_niterations, __pyx_n_s_factor, __pyx_n_s_anchors, __pyx_n_s_input_c, __pyx_n_s_output, __pyx_n_s_anchors_c, __pyx_n_s_data_shape, __pyx_n_s_len_anchors, __pyx_n_s_status); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
- __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_strip, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__27 = PyTuple_Pack(11, __pyx_n_s_data, __pyx_n_s_w, __pyx_n_s_niterations, __pyx_n_s_factor, __pyx_n_s_anchors, __pyx_n_s_input_c, __pyx_n_s_output, __pyx_n_s_anchors_c, __pyx_n_s_data_shape, __pyx_n_s_len_anchors, __pyx_n_s_status); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_strip, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 61, __pyx_L1_error)
- /* "filters.pyx":128
+ /* "silx/math/fit/filters.pyx":127
*
*
* def snip1d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 1D data vector by clipping peaks.
*
*/
- __pyx_tuple__27 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
- __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_snip1d, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__29 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+ __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_snip1d, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 127, __pyx_L1_error)
- /* "filters.pyx":172
+ /* "silx/math/fit/filters.pyx":171
*
*
* def snip2d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 2D data signal by clipping peaks.
*
*/
- __pyx_tuple__29 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_nrows, __pyx_n_s_ncolumns, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
- __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_snip2d, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__31 = PyTuple_Pack(6, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_nrows, __pyx_n_s_ncolumns, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_snip2d, 171, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 171, __pyx_L1_error)
- /* "filters.pyx":217
+ /* "silx/math/fit/filters.pyx":216
*
*
* def snip3d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 3D data signal by clipping peaks.
*
*/
- __pyx_tuple__31 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_data_shape, __pyx_n_s_nrows); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
- __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_snip3d, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_s_data, __pyx_n_s_snip_width, __pyx_n_s_data_c, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_data_shape, __pyx_n_s_nrows); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 216, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__33);
+ __Pyx_GIVEREF(__pyx_tuple__33);
+ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_snip3d, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 216, __pyx_L1_error)
- /* "filters.pyx":266
+ /* "silx/math/fit/filters.pyx":265
*
*
* def savitsky_golay(data, npoints=5): # <<<<<<<<<<<<<<
* """Smooth a curve using a Savitsky-Golay filter.
*
*/
- __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_npoints, __pyx_n_s_data_c, __pyx_n_s_output, __pyx_n_s_status); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
- __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_savitsky_golay, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_npoints, __pyx_n_s_data_c, __pyx_n_s_output, __pyx_n_s_status); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 265, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
+ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_savitsky_golay, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 265, __pyx_L1_error)
- /* "filters.pyx":296
+ /* "silx/math/fit/filters.pyx":295
*
*
* def smooth1d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 1D data.
*
*/
- __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
- __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_smooth1d, 296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__37 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 295, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_smooth1d, 295, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 295, __pyx_L1_error)
- /* "filters.pyx":335
+ /* "silx/math/fit/filters.pyx":334
*
*
* def smooth2d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 2D data:
* :func:`smooth1d` is applied succesively along both axis
*/
- __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_nrows, __pyx_n_s_ncolumns, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__37);
- __Pyx_GIVEREF(__pyx_tuple__37);
- __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_smooth2d, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_nrows, __pyx_n_s_ncolumns, __pyx_n_s_data_shape); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 334, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
+ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_smooth2d, 334, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 334, __pyx_L1_error)
- /* "filters.pyx":373
+ /* "silx/math/fit/filters.pyx":372
*
*
* def smooth3d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 3D data:
* :func:`smooth2d` is applied on each 2D slice of the data volume along all
*/
- __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_data_shape, __pyx_n_s_nrows); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__39);
- __Pyx_GIVEREF(__pyx_tuple__39);
- __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_smooth3d, 373, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__41 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_data_c, __pyx_n_s_nx, __pyx_n_s_ny, __pyx_n_s_nz, __pyx_n_s_data_shape, __pyx_n_s_nrows); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 372, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_smooth3d, 372, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 372, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__41 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__42);
- __Pyx_GIVEREF(__pyx_tuple__42);
+ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__44);
+ __Pyx_GIVEREF(__pyx_tuple__44);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
+ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__44);
- __Pyx_GIVEREF(__pyx_tuple__44);
+ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__46);
+ __Pyx_GIVEREF(__pyx_tuple__46);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
+ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -17175,13 +19055,13 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_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_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -17200,9 +19080,7 @@ PyMODINIT_FUNC PyInit_filters(void)
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;
+ static PyThread_type_lock __pyx_t_6[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -17214,17 +19092,24 @@ PyMODINIT_FUNC PyInit_filters(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_filters(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -17239,34 +19124,34 @@ PyMODINIT_FUNC PyInit_filters(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_filters) {
- 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 (__pyx_module_is_main_silx__math__fit__filters) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "filters")) {
- if (unlikely(PyDict_SetItemString(modules, "filters", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.fit.filters")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.fit.filters", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -17276,10 +19161,13 @@ PyMODINIT_FUNC PyInit_filters(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -17290,372 +19178,389 @@ PyMODINIT_FUNC PyInit_filters(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "filters.pyx":48
+ /* "silx/math/fit/filters.pyx":48
* """
*
* __authors__ = ["P. Knobel"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "22/06/2016"
+ * __date__ = "15/05/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_P_Knobel);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
__Pyx_GIVEREF(__pyx_kp_s_P_Knobel);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":49
+ /* "silx/math/fit/filters.pyx":49
*
* __authors__ = ["P. Knobel"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "22/06/2016"
+ * __date__ = "15/05/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
- /* "filters.pyx":50
+ /* "silx/math/fit/filters.pyx":50
* __authors__ = ["P. Knobel"]
* __license__ = "MIT"
- * __date__ = "22/06/2016" # <<<<<<<<<<<<<<
+ * __date__ = "15/05/2017" # <<<<<<<<<<<<<<
*
* import logging
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_22_06_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_05_2017) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
- /* "filters.pyx":52
- * __date__ = "22/06/2016"
+ /* "silx/math/fit/filters.pyx":52
+ * __date__ = "15/05/2017"
*
* import logging # <<<<<<<<<<<<<<
* import numpy
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":53
+ /* "silx/math/fit/filters.pyx":53
*
* import logging
* import numpy # <<<<<<<<<<<<<<
*
- * logging.basicConfig()
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 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_numpy, __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;
-
- /* "filters.pyx":55
- * import numpy
- *
- * logging.basicConfig() # <<<<<<<<<<<<<<
* _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_basicConfig); 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 = 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 = 55; __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 = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 53, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":56
+ /* "silx/math/fit/filters.pyx":55
+ * import numpy
*
- * logging.basicConfig()
* _logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
*
* cimport cython
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __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_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __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 = 56; __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_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":62
+ /* "silx/math/fit/filters.pyx":61
*
*
* def strip(data, w=1, niterations=1000, factor=1.0, anchors=None): # <<<<<<<<<<<<<<
* """Extract background from data using the strip algorithm, as explained at
* http://pymca.sourceforge.net/stripbackground.html.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_1strip, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_1strip, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":128
+ /* "silx/math/fit/filters.pyx":127
*
*
* def snip1d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 1D data vector by clipping peaks.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_3snip1d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_3snip1d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip1d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip1d, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":172
+ /* "silx/math/fit/filters.pyx":171
*
*
* def snip2d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 2D data signal by clipping peaks.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_5snip2d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_5snip2d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip2d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip2d, __pyx_t_1) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":217
+ /* "silx/math/fit/filters.pyx":216
*
*
* def snip3d(data, snip_width): # <<<<<<<<<<<<<<
* """Estimate the baseline (background) of a 3D data signal by clipping peaks.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_7snip3d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_7snip3d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip3d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_snip3d, __pyx_t_1) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":266
+ /* "silx/math/fit/filters.pyx":265
*
*
* def savitsky_golay(data, npoints=5): # <<<<<<<<<<<<<<
* """Smooth a curve using a Savitsky-Golay filter.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_9savitsky_golay, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_9savitsky_golay, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_savitsky_golay, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_savitsky_golay, __pyx_t_1) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":296
+ /* "silx/math/fit/filters.pyx":295
*
*
* def smooth1d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 1D data.
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_11smooth1d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_11smooth1d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth1d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth1d, __pyx_t_1) < 0) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":335
+ /* "silx/math/fit/filters.pyx":334
*
*
* def smooth2d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 2D data:
* :func:`smooth1d` is applied succesively along both axis
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_13smooth2d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_13smooth2d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth2d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth2d, __pyx_t_1) < 0) __PYX_ERR(0, 334, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":373
+ /* "silx/math/fit/filters.pyx":372
*
*
* def smooth3d(data): # <<<<<<<<<<<<<<
* """Simple smoothing for 3D data:
* :func:`smooth2d` is applied on each 2D slice of the data volume along all
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7filters_15smooth3d, NULL, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_7filters_15smooth3d, NULL, __pyx_n_s_silx_math_fit_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth3d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_smooth3d, __pyx_t_1) < 0) __PYX_ERR(0, 372, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "filters.pyx":1
+ /* "silx/math/fit/filters.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* #/[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__41, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __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
+ /* "View.MemoryView":283
*
* 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__42, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __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
+ /* "View.MemoryView":284
* 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__43, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __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
+ /* "View.MemoryView":287
*
*
* 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__44, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __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
+ /* "View.MemoryView":288
*
* 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__45, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_6[0] = PyThread_allocate_lock();
+ __pyx_t_6[1] = PyThread_allocate_lock();
+ __pyx_t_6[2] = PyThread_allocate_lock();
+ __pyx_t_6[3] = PyThread_allocate_lock();
+ __pyx_t_6[4] = PyThread_allocate_lock();
+ __pyx_t_6[5] = PyThread_allocate_lock();
+ __pyx_t_6[6] = PyThread_allocate_lock();
+ __pyx_t_6[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -17674,11 +19579,11 @@ PyMODINIT_FUNC PyInit_filters(void)
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init filters", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.fit.filters", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init filters");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.fit.filters");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -17689,7 +19594,8 @@ PyMODINIT_FUNC PyInit_filters(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -17706,6 +19612,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -17719,6 +19626,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -17732,6 +19640,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -17833,6 +19742,7 @@ bad:
return -1;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -17858,9 +19768,10 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -17875,7 +19786,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -17894,10 +19806,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -17907,27 +19819,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -17966,6 +19873,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -17999,10 +19907,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -18062,7 +19973,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -18082,12 +19993,152 @@ bad:
}
#endif
-static void __Pyx_RaiseBufferIndexError(int axis) {
+/* BufferIndexError */
+ static void __Pyx_RaiseBufferIndexError(int axis) {
PyErr_Format(PyExc_IndexError,
"Out of bounds on buffer access (axis %d)", axis);
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -18106,7 +20157,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -18118,6 +20170,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -18125,18 +20182,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -18685,7 +20751,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -18741,7 +20808,6 @@ no_fail:
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
@@ -18820,7 +20886,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -18828,8 +20895,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -18842,8 +20910,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -18855,9 +20924,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -18881,10 +20951,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -18898,7 +20967,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -18924,7 +20994,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -18961,7 +21032,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -19044,14 +21116,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -19063,13 +21137,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -19089,22 +21170,26 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -19116,23 +21201,18 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -19142,16 +21222,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -19162,7 +21254,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -19180,7 +21272,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -19204,41 +21296,250 @@ bad:
return -1;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -19259,9 +21560,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -19278,28 +21584,14 @@ bad:
return -1;
}
-#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 int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -19372,7 +21664,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -19445,7 +21738,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -19473,83 +21766,83 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ *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 PyObject *__pyx_memview_get_double(const char *itemp) {
+/* Capsule */
+ 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;
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
}
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
double value = __pyx_PyFloat_AsDouble(obj);
if ((value == (double)-1) && PyErr_Occurred())
return 0;
@@ -19557,22 +21850,27 @@ static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
return 1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -19583,29 +21881,110 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#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; \
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #endif
-#endif
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_long(const char *itemp) {
+ return (PyObject *) __Pyx_PyInt_From_long(*(long *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_long(const char *itemp, PyObject *obj) {
+ long value = __Pyx_PyInt_As_long(obj);
+ if ((value == (long)-1) && PyErr_Occurred())
+ return 0;
+ *(long *) itemp = value;
+ return 1;
+}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* MemviewSliceCopyTemplate */
+ 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;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19622,36 +22001,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19660,7 +22132,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19683,7 +22155,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -19699,19 +22171,9 @@ raise_neg_overflow:
return (long) -1;
}
-static PyObject *__pyx_memview_get_long(const char *itemp) {
- return (PyObject *) __Pyx_PyInt_From_long(*(long *) itemp);
-}
-static int __pyx_memview_set_long(const char *itemp, PyObject *obj) {
- long value = __Pyx_PyInt_As_long(obj);
- if ((value == (long)-1) && PyErr_Occurred())
- return 0;
- *(long *) itemp = value;
- return 1;
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19728,36 +22190,129 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -19766,7 +22321,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -19789,7 +22344,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
}
} else {
int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
@@ -19805,157 +22360,27 @@ raise_neg_overflow:
return (int) -1;
}
-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_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -19966,8 +22391,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -19984,36 +22410,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -20022,7 +22541,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -20045,7 +22564,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -20061,7 +22580,8 @@ raise_neg_overflow:
return (char) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -20101,7 +22621,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -20282,7 +22803,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -20304,7 +22826,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_long(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -20326,7 +22849,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -20341,7 +22865,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -20379,7 +22904,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -20420,7 +22945,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -20441,8 +22966,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -20450,9 +22977,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -20461,11 +22989,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -20490,18 +23021,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/fit/filters/filters.pyx b/silx/math/fit/filters.pyx
index 9887ad7..1a7aa3b 100644
--- a/silx/math/fit/filters/filters.pyx
+++ b/silx/math/fit/filters.pyx
@@ -47,12 +47,11 @@ API documentation:
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "22/06/2016"
+__date__ = "15/05/2017"
import logging
import numpy
-logging.basicConfig()
_logger = logging.getLogger(__name__)
cimport cython
diff --git a/silx/math/fit/filters/filters_wrapper.pxd b/silx/math/fit/filters_wrapper.pxd
index e4f7c72..e4f7c72 100644
--- a/silx/math/fit/filters/filters_wrapper.pxd
+++ b/silx/math/fit/filters_wrapper.pxd
diff --git a/silx/math/fit/fittheories.py b/silx/math/fit/fittheories.py
index bd3e1ce..b5069e9 100644
--- a/silx/math/fit/fittheories.py
+++ b/silx/math/fit/fittheories.py
@@ -89,12 +89,11 @@ from silx.math.fit.filters import strip, savitsky_golay
from silx.math.fit.leastsq import leastsq
from silx.math.fit.fittheory import FitTheory
-logging.basicConfig()
_logger = logging.getLogger(__name__)
__authors__ = ["V.A. Sole", "P. Knobel"]
__license__ = "MIT"
-__date__ = "06/01/2017"
+__date__ = "15/05/2017"
DEFAULT_CONFIG = {
diff --git a/silx/math/fit/functions/functions.c b/silx/math/fit/functions.c
index 21c6911..b5759e4 100644
--- a/silx/math/fit/functions/functions.c
+++ b/silx/math/fit/functions.c
@@ -1,28 +1,32 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "silx/math/fit/functions/include/functions.h"
+ ],
+ "include_dirs": [
+ "silx/math/fit/functions/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.fit.functions"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +45,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +57,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +273,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +294,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +333,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +359,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +443,13 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__functions
-#define __PYX_HAVE_API__functions
+#define __PYX_HAVE__silx__math__fit__functions
+#define __PYX_HAVE_API__silx__math__fit__functions
#include "functions.h"
#include "pythread.h"
-#include "string.h"
-#include "stdlib.h"
-#include "stdio.h"
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +459,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +467,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +511,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +529,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +558,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +638,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -421,9 +646,10 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "functions.pyx",
+ "silx/math/fit/functions.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +659,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +695,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +733,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -522,7 +751,7 @@ struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -531,6 +760,7 @@ struct __pyx_memoryviewslice_obj;
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -546,7 +776,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -559,7 +789,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -582,7 +812,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -599,7 +829,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -619,7 +863,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -631,6 +875,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -647,19 +894,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -682,18 +929,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -708,33 +956,93 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -760,29 +1068,49 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
-#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) : \
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* PyFloatBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, int inplace);
+#else
+#define __Pyx_PyFloat_AddCObj(op1, op2, floatval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -790,58 +1118,97 @@ 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);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#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)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -857,12 +1224,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -875,7 +1237,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -891,26 +1254,29 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
-#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
-
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -922,9 +1288,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -938,50 +1315,52 @@ typedef struct {
__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
-
-
+/* None.proto */
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 PyObject *__pyx_memview_get_double(const char *itemp);
-static int __pyx_memview_set_double(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 int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
char order, int ndim);
+/* OverlappingSlices.proto */
static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
__Pyx_memviewslice *slice2,
int ndim, size_t itemsize);
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -992,12 +1371,16 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1012,9 +1395,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* Module declarations from 'cython' */
-/* Module declarations from 'functions_wrapper' */
+/* Module declarations from 'silx.math.fit.functions_wrapper' */
-/* Module declarations from 'functions' */
+/* Module declarations from 'silx.math.fit.functions' */
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1024,6 +1407,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1057,10 +1442,10 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_
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_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
-#define __Pyx_MODULE_NAME "functions"
-int __pyx_module_is_main_functions = 0;
+#define __Pyx_MODULE_NAME "silx.math.fit.functions"
+int __pyx_module_is_main_silx__math__fit__functions = 0;
-/* Implementation of 'functions' */
+/* Implementation of 'silx.math.fit.functions' */
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_ValueError;
@@ -1068,201 +1453,140 @@ 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_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params); /* proto */
-static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c); /* proto */
-static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_pars); /* 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_C[] = "C";
-static char __pyx_k_O[] = "O";
-static char __pyx_k_a[] = "a";
-static char __pyx_k_b[] = "b";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_i[] = "i";
-static char __pyx_k_x[] = "x";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_pi[] = "pi";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_erf[] = "erf";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_x_c[] = "x_c";
-static char __pyx_k_y_c[] = "y_c";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_copy[] = "copy";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_erfc[] = "erfc";
-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_pars[] = "pars";
-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_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-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_float[] = "float";
-static char __pyx_k_numpy[] = "numpy";
-static char __pyx_k_order[] = "order";
-static char __pyx_k_range[] = "range";
-static char __pyx_k_shape[] = "shape";
-static char __pyx_k_start[] = "start";
-static char __pyx_k_zeros[] = "zeros";
-static char __pyx_k_arctan[] = "arctan";
-static char __pyx_k_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_logger[] = "_logger";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_params[] = "params";
-static char __pyx_k_status[] = "status";
-static char __pyx_k_struct[] = "struct";
-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_float64[] = "float64";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_len_dim[] = "len_dim";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_logging[] = "logging";
-static char __pyx_k_lt_term[] = "lt_term";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_newpars[] = "newpars";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_st_term[] = "st_term";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_P_Knobel[] = "P. Knobel";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_params_c[] = "params_c";
-static char __pyx_k_sum_slit[] = "sum_slit";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_functions[] = "functions";
-static char __pyx_k_getLogger[] = "getLogger";
-static char __pyx_k_step_term[] = "step_term";
-static char __pyx_k_sum_gauss[] = "sum_gauss";
-static char __pyx_k_17_06_2016[] = "17/06/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_sum_agauss[] = "sum_agauss";
-static char __pyx_k_sum_pvoigt[] = "sum_pvoigt";
-static char __pyx_k_sum_stepup[] = "sum_stepup";
-static char __pyx_k_tail_flags[] = "tail_flags";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_atan_stepup[] = "atan_stepup";
-static char __pyx_k_basicConfig[] = "basicConfig";
-static char __pyx_k_sum_apvoigt[] = "sum_apvoigt";
-static char __pyx_k_sum_lorentz[] = "sum_lorentz";
-static char __pyx_k_sum_alorentz[] = "sum_alorentz";
-static char __pyx_k_sum_stepdown[] = "sum_stepdown";
-static char __pyx_k_gaussian_term[] = "gaussian_term";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_sum_ahypermet[] = "sum_ahypermet";
-static char __pyx_k_periodic_gauss[] = "periodic_gauss";
-static char __pyx_k_sum_fastagauss[] = "sum_fastagauss";
-static char __pyx_k_sum_splitgauss[] = "sum_splitgauss";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_sum_splitpvoigt[] = "sum_splitpvoigt";
-static char __pyx_k_sum_splitlorentz[] = "sum_splitlorentz";
-static char __pyx_k_sum_fastahypermet[] = "sum_fastahypermet";
-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_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
-static char __pyx_k_No_parameters_specified[] = "No parameters specified. ";
-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_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_Cannot_compute_erf_for_an_empty[] = "Cannot compute erf for an empty array";
-static char __pyx_k_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/math/fit/functions/functions.pyx";
-static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_At_least_3_parameters_are_requir[] = "At least 3 parameters are required.";
-static char __pyx_k_At_least_4_parameters_are_requir[] = "At least 4 parameters are required.";
-static char __pyx_k_At_least_5_parameters_are_requir[] = "At least 5 parameters are required.";
-static char __pyx_k_At_least_8_parameters_are_requir[] = "At least 8 parameters are required.";
-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_compute_erfc_for_an_empty[] = "Cannot compute erfc for an empty array";
-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_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_No_gaussian_parameters_specified[] = "No gaussian parameters specified. ";
-static char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_This_module_provides_fit_functio[] = "This module provides fit functions.\n\nList of fit functions:\n-----------------------\n\n - :func:`sum_gauss`\n - :func:`sum_agauss`\n - :func:`sum_splitgauss`\n - :func:`sum_fastagauss`\n\n - :func:`sum_apvoigt`\n - :func:`sum_pvoigt`\n - :func:`sum_splitpvoigt`\n\n - :func:`sum_lorentz`\n - :func:`sum_alorentz`\n - :func:`sum_splitlorentz`\n\n - :func:`sum_stepdown`\n - :func:`sum_stepup`\n - :func:`sum_slit`\n\n - :func:`sum_ahypermet`\n - :func:`sum_fastahypermet`\n\nFull documentation:\n-------------------\n\n";
-static char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
-static char __pyx_k_Wrong_number_of_parameters_for_f[] = "Wrong number of parameters for function";
-static char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
-static char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
-static PyObject *__pyx_kp_s_17_06_2016;
+static const char __pyx_k_C[] = "C";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_a[] = "a";
+static const char __pyx_k_b[] = "b";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_x[] = "x";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_pi[] = "pi";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_erf[] = "erf";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_x_c[] = "x_c";
+static const char __pyx_k_y_c[] = "y_c";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_copy[] = "copy";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_erfc[] = "erfc";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_pars[] = "pars";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_float[] = "float";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_order[] = "order";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_arctan[] = "arctan";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_logger[] = "_logger";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_params[] = "params";
+static const char __pyx_k_status[] = "status";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_asarray[] = "asarray";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_len_dim[] = "len_dim";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_lt_term[] = "lt_term";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_newpars[] = "newpars";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_st_term[] = "st_term";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_P_Knobel[] = "P. Knobel";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_params_c[] = "params_c";
+static const char __pyx_k_sum_slit[] = "sum_slit";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_getLogger[] = "getLogger";
+static const char __pyx_k_step_term[] = "step_term";
+static const char __pyx_k_sum_gauss[] = "sum_gauss";
+static const char __pyx_k_16_08_2017[] = "16/08/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_sum_agauss[] = "sum_agauss";
+static const char __pyx_k_sum_pvoigt[] = "sum_pvoigt";
+static const char __pyx_k_sum_stepup[] = "sum_stepup";
+static const char __pyx_k_tail_flags[] = "tail_flags";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_atan_stepup[] = "atan_stepup";
+static const char __pyx_k_sum_apvoigt[] = "sum_apvoigt";
+static const char __pyx_k_sum_lorentz[] = "sum_lorentz";
+static const char __pyx_k_sum_alorentz[] = "sum_alorentz";
+static const char __pyx_k_sum_stepdown[] = "sum_stepdown";
+static const char __pyx_k_gaussian_term[] = "gaussian_term";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_sum_ahypermet[] = "sum_ahypermet";
+static const char __pyx_k_periodic_gauss[] = "periodic_gauss";
+static const char __pyx_k_sum_fastagauss[] = "sum_fastagauss";
+static const char __pyx_k_sum_splitgauss[] = "sum_splitgauss";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_sum_splitpvoigt[] = "sum_splitpvoigt";
+static const char __pyx_k_sum_splitlorentz[] = "sum_splitlorentz";
+static const char __pyx_k_sum_fastahypermet[] = "sum_fastahypermet";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_No_parameters_specified[] = "No parameters specified. ";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_silx_math_fit_functions[] = "silx.math.fit.functions";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_Cannot_compute_erf_for_an_empty[] = "Cannot compute erf for an empty array";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/fit/functions.pyx";
+static const char __pyx_k_At_least_3_parameters_are_requir[] = "At least 3 parameters are required.";
+static const char __pyx_k_At_least_4_parameters_are_requir[] = "At least 4 parameters are required.";
+static const char __pyx_k_At_least_5_parameters_are_requir[] = "At least 5 parameters are required.";
+static const char __pyx_k_At_least_8_parameters_are_requir[] = "At least 8 parameters are required.";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Cannot_compute_erfc_for_an_empty[] = "Cannot compute erfc for an empty array";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_No_gaussian_parameters_specified[] = "No gaussian parameters specified. ";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_This_module_provides_fit_functio[] = "This module provides fit functions.\n\nList of fit functions:\n-----------------------\n\n - :func:`sum_gauss`\n - :func:`sum_agauss`\n - :func:`sum_splitgauss`\n - :func:`sum_fastagauss`\n\n - :func:`sum_apvoigt`\n - :func:`sum_pvoigt`\n - :func:`sum_splitpvoigt`\n\n - :func:`sum_lorentz`\n - :func:`sum_alorentz`\n - :func:`sum_splitlorentz`\n\n - :func:`sum_stepdown`\n - :func:`sum_stepup`\n - :func:`sum_slit`\n\n - :func:`sum_ahypermet`\n - :func:`sum_fastahypermet`\n\nFull documentation:\n-------------------\n\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_Wrong_number_of_parameters_for_f[] = "Wrong number of parameters for function";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static PyObject *__pyx_kp_s_16_08_2017;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_At_least_3_parameters_are_requir;
static PyObject *__pyx_kp_s_At_least_4_parameters_are_requir;
static PyObject *__pyx_kp_s_At_least_5_parameters_are_requir;
@@ -1301,7 +1625,6 @@ static PyObject *__pyx_n_s_atan_stepup;
static PyObject *__pyx_n_s_authors;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_base;
-static PyObject *__pyx_n_s_basicConfig;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
static PyObject *__pyx_n_s_class;
@@ -1312,6 +1635,7 @@ static PyObject *__pyx_n_s_date;
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_enumerate;
static PyObject *__pyx_n_s_erf;
static PyObject *__pyx_n_s_erfc;
@@ -1322,7 +1646,6 @@ static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_s_fortran;
static PyObject *__pyx_n_u_fortran;
-static PyObject *__pyx_n_s_functions;
static PyObject *__pyx_n_s_gaussian_term;
static PyObject *__pyx_n_s_getLogger;
static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
@@ -1338,7 +1661,6 @@ static PyObject *__pyx_n_s_logging;
static PyObject *__pyx_n_s_lt_term;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_memview;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
@@ -1358,6 +1680,7 @@ static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_silx_math_fit_functions;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_st_term;
static PyObject *__pyx_n_s_start;
@@ -1389,11 +1712,66 @@ 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_n_s_unpack;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_x_c;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_y_c;
static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_pars); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_int_0;
@@ -1413,9 +1791,9 @@ static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_slice__50;
-static PyObject *__pyx_slice__59;
-static PyObject *__pyx_slice__60;
static PyObject *__pyx_slice__61;
+static PyObject *__pyx_slice__62;
+static PyObject *__pyx_slice__63;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
@@ -1464,8 +1842,9 @@ static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
-static PyObject *__pyx_tuple__62;
-static PyObject *__pyx_tuple__63;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__69;
@@ -1485,11 +1864,11 @@ static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__101;
-static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
-static PyObject *__pyx_codeobj__64;
+static PyObject *__pyx_tuple__106;
+static PyObject *__pyx_tuple__107;
static PyObject *__pyx_codeobj__66;
static PyObject *__pyx_codeobj__68;
static PyObject *__pyx_codeobj__70;
@@ -1508,8 +1887,9 @@ static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
+static PyObject *__pyx_codeobj__102;
-/* "functions.pyx":68
+/* "silx/math/fit/functions.pyx":67
*
*
* def erf(x): # <<<<<<<<<<<<<<
@@ -1518,21 +1898,21 @@ static PyObject *__pyx_codeobj__100;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_1erf(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static char __pyx_doc_9functions_erf[] = "erf(x)\nReturn the gaussian error function\n\n :param x: Independant variable where the gaussian error function is\n calculated\n :type x: numpy.ndarray or scalar\n :return: Gaussian error function ``y=erf(x)``\n :raise: IndexError if ``x`` is an empty array\n ";
-static PyMethodDef __pyx_mdef_9functions_1erf = {"erf", (PyCFunction)__pyx_pw_9functions_1erf, METH_O, __pyx_doc_9functions_erf};
-static PyObject *__pyx_pw_9functions_1erf(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_1erf(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_erf[] = "erf(x)\nReturn the gaussian error function\n\n :param x: Independent variable where the gaussian error function is\n calculated\n :type x: numpy.ndarray or scalar\n :return: Gaussian error function ``y=erf(x)``\n :raise: IndexError if ``x`` is an empty array\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_1erf = {"erf", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_1erf, METH_O, __pyx_doc_4silx_4math_3fit_9functions_erf};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_1erf(PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("erf (wrapper)", 0);
- __pyx_r = __pyx_pf_9functions_erf(__pyx_self, ((PyObject *)__pyx_v_x));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_erf(__pyx_self, ((PyObject *)__pyx_v_x));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_len_dim = NULL;
@@ -1549,42 +1929,39 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
PyObject *(*__pyx_t_8)(PyObject *);
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 } };
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
int __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("erf", 0);
__Pyx_INCREF(__pyx_v_x);
- /* "functions.pyx":83
+ /* "silx/math/fit/functions.pyx":82
*
* # force list into numpy array
* if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
* x = numpy.asarray(x)
*
*/
- __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 82, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":84
+ /* "silx/math/fit/functions.pyx":83
* # force list into numpy array
* if not hasattr(x, "shape"):
* x = numpy.asarray(x) # <<<<<<<<<<<<<<
*
* for len_dim in x.shape:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __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 = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -1594,59 +1971,85 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L3;
+
+ /* "silx/math/fit/functions.pyx":82
+ *
+ * # force list into numpy array
+ * if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
+ * x = numpy.asarray(x)
+ *
+ */
}
- __pyx_L3:;
- /* "functions.pyx":86
+ /* "silx/math/fit/functions.pyx":85
* x = numpy.asarray(x)
*
* for len_dim in x.shape: # <<<<<<<<<<<<<<
* if len_dim == 0:
* raise IndexError("Cannot compute erf for an empty array")
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 85, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 85, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
@@ -1655,7 +2058,7 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
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 = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 85, __pyx_L1_error)
}
break;
}
@@ -1664,33 +2067,42 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
__Pyx_XDECREF_SET(__pyx_v_len_dim, __pyx_t_3);
__pyx_t_3 = 0;
- /* "functions.pyx":87
+ /* "silx/math/fit/functions.pyx":86
*
* for len_dim in x.shape:
* if len_dim == 0: # <<<<<<<<<<<<<<
* raise IndexError("Cannot compute erf for an empty array")
*
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_len_dim, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_len_dim, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 86, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
- /* "functions.pyx":88
+ /* "silx/math/fit/functions.pyx":87
* for len_dim in x.shape:
* if len_dim == 0:
* raise IndexError("Cannot compute erf for an empty array") # <<<<<<<<<<<<<<
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 87, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":86
+ *
+ * for len_dim in x.shape:
+ * if len_dim == 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Cannot compute erf for an empty array")
+ *
+ */
}
- /* "functions.pyx":86
+ /* "silx/math/fit/functions.pyx":85
* x = numpy.asarray(x)
*
* for len_dim in x.shape: # <<<<<<<<<<<<<<
@@ -1700,119 +2112,119 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":90
+ /* "silx/math/fit/functions.pyx":89
* raise IndexError("Cannot compute erf for an empty array")
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__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 = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 89, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_x_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "functions.pyx":91
+ /* "silx/math/fit/functions.pyx":90
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.erf_array(&x_c[0], x_c.size, &y_c[0])
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__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 = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
- if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 90, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_y_c = __pyx_t_11;
- __pyx_t_11.memview = NULL;
- __pyx_t_11.data = NULL;
+ __pyx_v_y_c = __pyx_t_10;
+ __pyx_t_10.memview = NULL;
+ __pyx_t_10.data = NULL;
- /* "functions.pyx":93
+ /* "silx/math/fit/functions.pyx":92
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
* status = functions_wrapper.erf_array(&x_c[0], x_c.size, &y_c[0]) # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_7 = 0;
+ __pyx_t_11 = 0;
__pyx_t_12 = -1;
- if (__pyx_t_7 < 0) {
- __pyx_t_7 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_7 < 0)) __pyx_t_12 = 0;
- } else if (unlikely(__pyx_t_7 >= __pyx_v_x_c.shape[0])) __pyx_t_12 = 0;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_x_c.shape[0])) __pyx_t_12 = 0;
if (unlikely(__pyx_t_12 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_12);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 92, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_13 = 0;
__pyx_t_14 = -1;
@@ -1822,11 +2234,11 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
} else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
if (unlikely(__pyx_t_14 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_14);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 92, __pyx_L1_error)
}
- __pyx_v_status = erf_array((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_7)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
+ __pyx_v_status = erf_array((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":95
+ /* "silx/math/fit/functions.pyx":94
* status = functions_wrapper.erf_array(&x_c[0], x_c.size, &y_c[0])
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -1834,15 +2246,15 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -1852,28 +2264,48 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_15 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -1883,26 +2315,46 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
}
}
if (!__pyx_t_15) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "functions.pyx":68
+ /* "silx/math/fit/functions.pyx":67
*
*
* def erf(x): # <<<<<<<<<<<<<<
@@ -1918,9 +2370,8 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
__Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("functions.erf", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.erf", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -1932,7 +2383,7 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
return __pyx_r;
}
-/* "functions.pyx":98
+/* "silx/math/fit/functions.pyx":97
*
*
* def erfc(x): # <<<<<<<<<<<<<<
@@ -1941,21 +2392,21 @@ static PyObject *__pyx_pf_9functions_erf(CYTHON_UNUSED PyObject *__pyx_self, PyO
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_3erfc(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static char __pyx_doc_9functions_2erfc[] = "erfc(x)\nReturn the gaussian complementary error function\n\n :param x: Independant variable where the gaussian complementary error\n function is calculated\n :type x: numpy.ndarray or scalar\n :return: Gaussian complementary error function ``y=erfc(x)``\n :type rtype: numpy.ndarray\n :raise: IndexError if ``x`` is an empty array\n ";
-static PyMethodDef __pyx_mdef_9functions_3erfc = {"erfc", (PyCFunction)__pyx_pw_9functions_3erfc, METH_O, __pyx_doc_9functions_2erfc};
-static PyObject *__pyx_pw_9functions_3erfc(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_3erfc(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_2erfc[] = "erfc(x)\nReturn the gaussian complementary error function\n\n :param x: Independent variable where the gaussian complementary error\n function is calculated\n :type x: numpy.ndarray or scalar\n :return: Gaussian complementary error function ``y=erfc(x)``\n :type rtype: numpy.ndarray\n :raise: IndexError if ``x`` is an empty array\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_3erfc = {"erfc", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_3erfc, METH_O, __pyx_doc_4silx_4math_3fit_9functions_2erfc};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_3erfc(PyObject *__pyx_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("erfc (wrapper)", 0);
- __pyx_r = __pyx_pf_9functions_2erfc(__pyx_self, ((PyObject *)__pyx_v_x));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_2erfc(__pyx_self, ((PyObject *)__pyx_v_x));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
PyObject *__pyx_v_len_dim = NULL;
@@ -1972,42 +2423,39 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
PyObject *(*__pyx_t_8)(PyObject *);
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 } };
+ Py_ssize_t __pyx_t_11;
int __pyx_t_12;
Py_ssize_t __pyx_t_13;
int __pyx_t_14;
PyObject *__pyx_t_15 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("erfc", 0);
__Pyx_INCREF(__pyx_v_x);
- /* "functions.pyx":113
+ /* "silx/math/fit/functions.pyx":112
*
* # force list into numpy array
* if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
* x = numpy.asarray(x)
*
*/
- __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 112, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":114
+ /* "silx/math/fit/functions.pyx":113
* # force list into numpy array
* if not hasattr(x, "shape"):
* x = numpy.asarray(x) # <<<<<<<<<<<<<<
*
* for len_dim in x.shape:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -2017,59 +2465,85 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L3;
+
+ /* "silx/math/fit/functions.pyx":112
+ *
+ * # force list into numpy array
+ * if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
+ * x = numpy.asarray(x)
+ *
+ */
}
- __pyx_L3:;
- /* "functions.pyx":116
+ /* "silx/math/fit/functions.pyx":115
* x = numpy.asarray(x)
*
* for len_dim in x.shape: # <<<<<<<<<<<<<<
* if len_dim == 0:
* raise IndexError("Cannot compute erfc for an empty array")
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
__pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
- __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 115, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
for (;;) {
if (likely(!__pyx_t_8)) {
if (likely(PyList_CheckExact(__pyx_t_5))) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#endif
} else {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
#else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#endif
}
} else {
@@ -2078,7 +2552,7 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
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 = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 115, __pyx_L1_error)
}
break;
}
@@ -2087,33 +2561,42 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
__Pyx_XDECREF_SET(__pyx_v_len_dim, __pyx_t_3);
__pyx_t_3 = 0;
- /* "functions.pyx":117
+ /* "silx/math/fit/functions.pyx":116
*
* for len_dim in x.shape:
* if len_dim == 0: # <<<<<<<<<<<<<<
* raise IndexError("Cannot compute erfc for an empty array")
*
*/
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_len_dim, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_EqObjC(__pyx_v_len_dim, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_2) {
- /* "functions.pyx":118
+ /* "silx/math/fit/functions.pyx":117
* for len_dim in x.shape:
* if len_dim == 0:
* raise IndexError("Cannot compute erfc for an empty array") # <<<<<<<<<<<<<<
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 117, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":116
+ *
+ * for len_dim in x.shape:
+ * if len_dim == 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Cannot compute erfc for an empty array")
+ *
+ */
}
- /* "functions.pyx":116
+ /* "silx/math/fit/functions.pyx":115
* x = numpy.asarray(x)
*
* for len_dim in x.shape: # <<<<<<<<<<<<<<
@@ -2123,119 +2606,119 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":120
+ /* "silx/math/fit/functions.pyx":119
* raise IndexError("Cannot compute erfc for an empty array")
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_x);
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_reshape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_9);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_v_x_c = __pyx_t_10;
__pyx_t_10.memview = NULL;
__pyx_t_10.data = NULL;
- /* "functions.pyx":121
+ /* "silx/math/fit/functions.pyx":120
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.erfc_array(&x_c[0], x_c.size, &y_c[0])
*/
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__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 = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
- if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_3);
+ if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_y_c = __pyx_t_11;
- __pyx_t_11.memview = NULL;
- __pyx_t_11.data = NULL;
+ __pyx_v_y_c = __pyx_t_10;
+ __pyx_t_10.memview = NULL;
+ __pyx_t_10.data = NULL;
- /* "functions.pyx":123
+ /* "silx/math/fit/functions.pyx":122
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
* status = functions_wrapper.erfc_array(&x_c[0], x_c.size, &y_c[0]) # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_7 = 0;
+ __pyx_t_11 = 0;
__pyx_t_12 = -1;
- if (__pyx_t_7 < 0) {
- __pyx_t_7 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_7 < 0)) __pyx_t_12 = 0;
- } else if (unlikely(__pyx_t_7 >= __pyx_v_x_c.shape[0])) __pyx_t_12 = 0;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_x_c.shape[0])) __pyx_t_12 = 0;
if (unlikely(__pyx_t_12 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_12);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 122, __pyx_L1_error)
}
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_x_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_t_13 = 0;
__pyx_t_14 = -1;
@@ -2245,11 +2728,11 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
} else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
if (unlikely(__pyx_t_14 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_14);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 122, __pyx_L1_error)
}
- __pyx_v_status = erfc_array((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_7)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
+ __pyx_v_status = erfc_array((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":125
+ /* "silx/math/fit/functions.pyx":124
* status = functions_wrapper.erfc_array(&x_c[0], x_c.size, &y_c[0])
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -2257,15 +2740,15 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -2275,28 +2758,48 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_15);
- PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_15 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -2306,26 +2809,46 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
}
}
if (!__pyx_t_15) {
- __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_9);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15); __Pyx_GIVEREF(__pyx_t_15); __pyx_t_15 = NULL;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_3};
+ __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_9;
__pyx_t_9 = 0;
goto __pyx_L0;
- /* "functions.pyx":98
+ /* "silx/math/fit/functions.pyx":97
*
*
* def erfc(x): # <<<<<<<<<<<<<<
@@ -2341,9 +2864,8 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_9);
__PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
__Pyx_XDECREF(__pyx_t_15);
- __Pyx_AddTraceback("functions.erfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.erfc", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -2355,7 +2877,7 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
return __pyx_r;
}
-/* "functions.pyx":128
+/* "silx/math/fit/functions.pyx":127
*
*
* def sum_gauss(x, *params): # <<<<<<<<<<<<<<
@@ -2364,15 +2886,12 @@ static PyObject *__pyx_pf_9functions_2erfc(CYTHON_UNUSED PyObject *__pyx_self, P
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_4sum_gauss[] = "sum_gauss(x, *params)\nReturn a sum of gaussian functions defined by *(height, centroid, fwhm)*,\n where:\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1, height2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
-static PyMethodDef __pyx_mdef_9functions_5sum_gauss = {"sum_gauss", (PyCFunction)__pyx_pw_9functions_5sum_gauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_4sum_gauss};
-static PyObject *__pyx_pw_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_4sum_gauss[] = "sum_gauss(x, *params)\nReturn a sum of gaussian functions defined by *(height, centroid, fwhm)*,\n where:\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1, height2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_5sum_gauss = {"sum_gauss", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_5sum_gauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_4sum_gauss};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_gauss (wrapper)", 0);
@@ -2405,7 +2924,7 @@ static PyObject *__pyx_pw_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_gauss") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_gauss") < 0)) __PYX_ERR(0, 127, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -2416,14 +2935,14 @@ static PyObject *__pyx_pw_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_gauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_gauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 127, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_4sum_gauss(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_4sum_gauss(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -2431,7 +2950,7 @@ static PyObject *__pyx_pw_9functions_5sum_gauss(PyObject *__pyx_self, PyObject *
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -2446,340 +2965,344 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_gauss", 0);
- /* "functions.pyx":148
+ /* "silx/math/fit/functions.pyx":147
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No gaussian parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 147, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":149
+ /* "silx/math/fit/functions.pyx":148
*
* if not len(params):
* raise IndexError("No gaussian parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 148, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":147
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No gaussian parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":153
+ /* "silx/math/fit/functions.pyx":152
*
* # ensure float64 (double) type and 1D contiguous data layout in memory
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __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[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":154
+ /* "silx/math/fit/functions.pyx":153
* # ensure float64 (double) type and 1D contiguous data layout in memory
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
- /* "functions.pyx":155
+ /* "silx/math/fit/functions.pyx":154
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 154, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
- /* "functions.pyx":153
+ /* "silx/math/fit/functions.pyx":152
*
* # ensure float64 (double) type and 1D contiguous data layout in memory
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":156
+ /* "silx/math/fit/functions.pyx":155
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":157
+ /* "silx/math/fit/functions.pyx":156
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":158
+ /* "silx/math/fit/functions.pyx":157
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
- /* "functions.pyx":159
+ /* "silx/math/fit/functions.pyx":158
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 157, __pyx_L1_error)
- /* "functions.pyx":157
+ /* "silx/math/fit/functions.pyx":156
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":160
+ /* "silx/math/fit/functions.pyx":159
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":161
+ /* "silx/math/fit/functions.pyx":160
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":162
+ /* "silx/math/fit/functions.pyx":161
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_gauss(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":161
+ /* "silx/math/fit/functions.pyx":160
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 160, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":165
+ /* "silx/math/fit/functions.pyx":164
*
* status = functions_wrapper.sum_gauss(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 164, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":166
+ /* "silx/math/fit/functions.pyx":165
* status = functions_wrapper.sum_gauss(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 165, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":167
+ /* "silx/math/fit/functions.pyx":166
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 166, __pyx_L1_error)
}
- /* "functions.pyx":164
+ /* "silx/math/fit/functions.pyx":163
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_gauss( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_gauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_gauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":169
+ /* "silx/math/fit/functions.pyx":168
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -2789,21 +3312,29 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":170
+ /* "silx/math/fit/functions.pyx":169
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* # reshape y_c to match original, possibly unusual, data shape
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 169, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":168
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":173
+ /* "silx/math/fit/functions.pyx":172
*
* # reshape y_c to match original, possibly unusual, data shape
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -2811,15 +3342,15 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
*
*/
__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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -2829,57 +3360,97 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); 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_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":128
+ /* "silx/math/fit/functions.pyx":127
*
*
* def sum_gauss(x, *params): # <<<<<<<<<<<<<<
@@ -2895,10 +3466,8 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -2909,7 +3478,7 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
return __pyx_r;
}
-/* "functions.pyx":176
+/* "silx/math/fit/functions.pyx":175
*
*
* def sum_agauss(x, *params): # <<<<<<<<<<<<<<
@@ -2918,15 +3487,12 @@ static PyObject *__pyx_pf_9functions_4sum_gauss(CYTHON_UNUSED PyObject *__pyx_se
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_7sum_agauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_6sum_agauss[] = "sum_agauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm)*,\n where:\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1, area2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
-static PyMethodDef __pyx_mdef_9functions_7sum_agauss = {"sum_agauss", (PyCFunction)__pyx_pw_9functions_7sum_agauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_6sum_agauss};
-static PyObject *__pyx_pw_9functions_7sum_agauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_7sum_agauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_6sum_agauss[] = "sum_agauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm)*,\n where:\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1, area2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_7sum_agauss = {"sum_agauss", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_7sum_agauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_6sum_agauss};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_7sum_agauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_agauss (wrapper)", 0);
@@ -2959,7 +3525,7 @@ static PyObject *__pyx_pw_9functions_7sum_agauss(PyObject *__pyx_self, PyObject
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_agauss") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_agauss") < 0)) __PYX_ERR(0, 175, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -2970,14 +3536,14 @@ static PyObject *__pyx_pw_9functions_7sum_agauss(PyObject *__pyx_self, PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_agauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_agauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 175, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_agauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_agauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_6sum_agauss(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_6sum_agauss(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -2985,7 +3551,7 @@ static PyObject *__pyx_pw_9functions_7sum_agauss(PyObject *__pyx_self, PyObject
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -3000,340 +3566,344 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_agauss", 0);
- /* "functions.pyx":196
+ /* "silx/math/fit/functions.pyx":195
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No gaussian parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 195, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":197
+ /* "silx/math/fit/functions.pyx":196
*
* if not len(params):
* raise IndexError("No gaussian parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 196, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":195
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No gaussian parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":200
+ /* "silx/math/fit/functions.pyx":199
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __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[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":201
+ /* "silx/math/fit/functions.pyx":200
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
- /* "functions.pyx":202
+ /* "silx/math/fit/functions.pyx":201
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 201, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
- /* "functions.pyx":200
+ /* "silx/math/fit/functions.pyx":199
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 199, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":203
+ /* "silx/math/fit/functions.pyx":202
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":204
+ /* "silx/math/fit/functions.pyx":203
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":205
+ /* "silx/math/fit/functions.pyx":204
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- /* "functions.pyx":206
+ /* "silx/math/fit/functions.pyx":205
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
- /* "functions.pyx":204
+ /* "silx/math/fit/functions.pyx":203
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":207
+ /* "silx/math/fit/functions.pyx":206
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":208
+ /* "silx/math/fit/functions.pyx":207
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":209
+ /* "silx/math/fit/functions.pyx":208
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_agauss(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":208
+ /* "silx/math/fit/functions.pyx":207
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":212
+ /* "silx/math/fit/functions.pyx":211
*
* status = functions_wrapper.sum_agauss(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 211, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":213
+ /* "silx/math/fit/functions.pyx":212
* status = functions_wrapper.sum_agauss(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 212, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":214
+ /* "silx/math/fit/functions.pyx":213
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 213, __pyx_L1_error)
}
- /* "functions.pyx":211
+ /* "silx/math/fit/functions.pyx":210
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_agauss( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_agauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_agauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":216
+ /* "silx/math/fit/functions.pyx":215
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -3343,21 +3913,29 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":217
+ /* "silx/math/fit/functions.pyx":216
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 216, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":215
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":219
+ /* "silx/math/fit/functions.pyx":218
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -3365,15 +3943,15 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
*
*/
__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 = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -3383,57 +3961,97 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":176
+ /* "silx/math/fit/functions.pyx":175
*
*
* def sum_agauss(x, *params): # <<<<<<<<<<<<<<
@@ -3449,10 +4067,8 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_agauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_agauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -3463,7 +4079,7 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
return __pyx_r;
}
-/* "functions.pyx":222
+/* "silx/math/fit/functions.pyx":221
*
*
* def sum_fastagauss(x, *params): # <<<<<<<<<<<<<<
@@ -3472,15 +4088,12 @@ static PyObject *__pyx_pf_9functions_6sum_agauss(CYTHON_UNUSED PyObject *__pyx_s
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_8sum_fastagauss[] = "sum_fastagauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm)*,\n where:\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n This implementation differs from :func:`sum_agauss` by the usage of a\n lookup table with precalculated exponential values. This might speed up\n the computation for large numbers of individual gaussian functions.\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1, area2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
-static PyMethodDef __pyx_mdef_9functions_9sum_fastagauss = {"sum_fastagauss", (PyCFunction)__pyx_pw_9functions_9sum_fastagauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_8sum_fastagauss};
-static PyObject *__pyx_pw_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_8sum_fastagauss[] = "sum_fastagauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm)*,\n where:\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n This implementation differs from :func:`sum_agauss` by the usage of a\n lookup table with precalculated exponential values. This might speed up\n the computation for large numbers of individual gaussian functions.\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1, area2, centroid2, fwhm2,...)*\n :return: Array of sum of gaussian functions at each ``x`` coordinate.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_9sum_fastagauss = {"sum_fastagauss", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_9sum_fastagauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_8sum_fastagauss};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_fastagauss (wrapper)", 0);
@@ -3513,7 +4126,7 @@ static PyObject *__pyx_pw_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObj
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_fastagauss") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_fastagauss") < 0)) __PYX_ERR(0, 221, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -3524,14 +4137,14 @@ static PyObject *__pyx_pw_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_fastagauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_fastagauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 221, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_fastagauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_fastagauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_8sum_fastagauss(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_8sum_fastagauss(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -3539,7 +4152,7 @@ static PyObject *__pyx_pw_9functions_9sum_fastagauss(PyObject *__pyx_self, PyObj
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -3554,340 +4167,344 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_fastagauss", 0);
- /* "functions.pyx":246
+ /* "silx/math/fit/functions.pyx":245
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No gaussian parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 245, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":247
+ /* "silx/math/fit/functions.pyx":246
*
* if not len(params):
* raise IndexError("No gaussian parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 246, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":245
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No gaussian parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":250
+ /* "silx/math/fit/functions.pyx":249
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __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[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":251
+ /* "silx/math/fit/functions.pyx":250
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
- /* "functions.pyx":252
+ /* "silx/math/fit/functions.pyx":251
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 250, __pyx_L1_error)
- /* "functions.pyx":250
+ /* "silx/math/fit/functions.pyx":249
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 249, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":253
+ /* "silx/math/fit/functions.pyx":252
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":254
+ /* "silx/math/fit/functions.pyx":253
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":255
+ /* "silx/math/fit/functions.pyx":254
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
- /* "functions.pyx":256
+ /* "silx/math/fit/functions.pyx":255
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 254, __pyx_L1_error)
- /* "functions.pyx":254
+ /* "silx/math/fit/functions.pyx":253
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":257
+ /* "silx/math/fit/functions.pyx":256
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":258
+ /* "silx/math/fit/functions.pyx":257
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":259
+ /* "silx/math/fit/functions.pyx":258
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_fastagauss(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":258
+ /* "silx/math/fit/functions.pyx":257
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 257, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":262
+ /* "silx/math/fit/functions.pyx":261
*
* status = functions_wrapper.sum_fastagauss(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 261, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 261, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":263
+ /* "silx/math/fit/functions.pyx":262
* status = functions_wrapper.sum_fastagauss(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 262, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 262, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":264
+ /* "silx/math/fit/functions.pyx":263
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 263, __pyx_L1_error)
}
- /* "functions.pyx":261
+ /* "silx/math/fit/functions.pyx":260
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_fastagauss( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_fastagauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_fastagauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":266
+ /* "silx/math/fit/functions.pyx":265
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -3897,21 +4514,29 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":267
+ /* "silx/math/fit/functions.pyx":266
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 266, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":265
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":269
+ /* "silx/math/fit/functions.pyx":268
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -3919,15 +4544,15 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
*
*/
__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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -3937,57 +4562,97 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":222
+ /* "silx/math/fit/functions.pyx":221
*
*
* def sum_fastagauss(x, *params): # <<<<<<<<<<<<<<
@@ -4003,10 +4668,8 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_fastagauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_fastagauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -4017,7 +4680,7 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
return __pyx_r;
}
-/* "functions.pyx":272
+/* "silx/math/fit/functions.pyx":271
*
*
* def sum_splitgauss(x, *params): # <<<<<<<<<<<<<<
@@ -4026,15 +4689,12 @@ static PyObject *__pyx_pf_9functions_8sum_fastagauss(CYTHON_UNUSED PyObject *__p
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_11sum_splitgauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_10sum_splitgauss[] = "sum_splitgauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm1, fwhm2)*,\n where:\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm1* is the full-width at half maximum for the distribution\n when ``x < centroid``\n - *fwhm2* is the full-width at half maximum for the distribution\n when ``x > centroid``\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm11, fwhm21, height2, centroid2, fwhm12, fwhm22,...)*\n :return: Array of sum of split gaussian functions at each ``x`` coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_11sum_splitgauss = {"sum_splitgauss", (PyCFunction)__pyx_pw_9functions_11sum_splitgauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_10sum_splitgauss};
-static PyObject *__pyx_pw_9functions_11sum_splitgauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_11sum_splitgauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_10sum_splitgauss[] = "sum_splitgauss(x, *params)\nReturn a sum of gaussian functions defined by *(area, centroid, fwhm1, fwhm2)*,\n where:\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm1* is the full-width at half maximum for the distribution\n when ``x < centroid``\n - *fwhm2* is the full-width at half maximum for the distribution\n when ``x > centroid``\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of gaussian parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm11, fwhm21, height2, centroid2, fwhm12, fwhm22,...)*\n :return: Array of sum of split gaussian functions at each ``x`` coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_11sum_splitgauss = {"sum_splitgauss", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_11sum_splitgauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_10sum_splitgauss};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_11sum_splitgauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_splitgauss (wrapper)", 0);
@@ -4067,7 +4727,7 @@ static PyObject *__pyx_pw_9functions_11sum_splitgauss(PyObject *__pyx_self, PyOb
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitgauss") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitgauss") < 0)) __PYX_ERR(0, 271, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -4078,14 +4738,14 @@ static PyObject *__pyx_pw_9functions_11sum_splitgauss(PyObject *__pyx_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_splitgauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_splitgauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 271, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_splitgauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitgauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_10sum_splitgauss(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_10sum_splitgauss(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -4093,7 +4753,7 @@ static PyObject *__pyx_pw_9functions_11sum_splitgauss(PyObject *__pyx_self, PyOb
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -4108,340 +4768,344 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_splitgauss", 0);
- /* "functions.pyx":295
+ /* "silx/math/fit/functions.pyx":294
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No gaussian parameters specified. " +
* "At least 4 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 294, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":296
+ /* "silx/math/fit/functions.pyx":295
*
* if not len(params):
* raise IndexError("No gaussian parameters specified. " + # <<<<<<<<<<<<<<
* "At least 4 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_gaussian_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 295, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":294
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No gaussian parameters specified. " +
+ * "At least 4 parameters are required.")
+ */
}
- /* "functions.pyx":299
+ /* "silx/math/fit/functions.pyx":298
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __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[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":300
+ /* "silx/math/fit/functions.pyx":299
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
- /* "functions.pyx":301
+ /* "silx/math/fit/functions.pyx":300
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 300, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 299, __pyx_L1_error)
- /* "functions.pyx":299
+ /* "silx/math/fit/functions.pyx":298
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 298, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":302
+ /* "silx/math/fit/functions.pyx":301
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":303
+ /* "silx/math/fit/functions.pyx":302
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":304
+ /* "silx/math/fit/functions.pyx":303
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
- /* "functions.pyx":305
+ /* "silx/math/fit/functions.pyx":304
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 304, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 303, __pyx_L1_error)
- /* "functions.pyx":303
+ /* "silx/math/fit/functions.pyx":302
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":306
+ /* "silx/math/fit/functions.pyx":305
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":307
+ /* "silx/math/fit/functions.pyx":306
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":308
+ /* "silx/math/fit/functions.pyx":307
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_splitgauss(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":307
+ /* "silx/math/fit/functions.pyx":306
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 306, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":311
+ /* "silx/math/fit/functions.pyx":310
*
* status = functions_wrapper.sum_splitgauss(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 310, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 310, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":312
+ /* "silx/math/fit/functions.pyx":311
* status = functions_wrapper.sum_splitgauss(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 311, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":313
+ /* "silx/math/fit/functions.pyx":312
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 312, __pyx_L1_error)
}
- /* "functions.pyx":310
+ /* "silx/math/fit/functions.pyx":309
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_splitgauss( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_splitgauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_splitgauss((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":315
+ /* "silx/math/fit/functions.pyx":314
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -4451,21 +5115,29 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":316
+ /* "silx/math/fit/functions.pyx":315
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 315, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":314
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":318
+ /* "silx/math/fit/functions.pyx":317
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -4473,15 +5145,15 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
*
*/
__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 = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -4491,57 +5163,97 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 317, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":272
+ /* "silx/math/fit/functions.pyx":271
*
*
* def sum_splitgauss(x, *params): # <<<<<<<<<<<<<<
@@ -4557,10 +5269,8 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_splitgauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitgauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -4571,7 +5281,7 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
return __pyx_r;
}
-/* "functions.pyx":321
+/* "silx/math/fit/functions.pyx":320
*
*
* def sum_apvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -4580,15 +5290,12 @@ static PyObject *__pyx_pf_9functions_10sum_splitgauss(CYTHON_UNUSED PyObject *__
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_12sum_apvoigt[] = "sum_apvoigt(x, *params)\nReturn a sum of pseudo-Voigt functions, defined by *(area, centroid, fwhm,\n eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *area* is the area underneath both G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum of both functions\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 4):\n *(area1, centroid1, fwhm1, eta1, area2, centroid2, fwhm2, eta2,...)*\n :return: Array of sum of pseudo-Voigt functions at each ``x`` coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_13sum_apvoigt = {"sum_apvoigt", (PyCFunction)__pyx_pw_9functions_13sum_apvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_12sum_apvoigt};
-static PyObject *__pyx_pw_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_12sum_apvoigt[] = "sum_apvoigt(x, *params)\nReturn a sum of pseudo-Voigt functions, defined by *(area, centroid, fwhm,\n eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *area* is the area underneath both G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum of both functions\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 4):\n *(area1, centroid1, fwhm1, eta1, area2, centroid2, fwhm2, eta2,...)*\n :return: Array of sum of pseudo-Voigt functions at each ``x`` coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_13sum_apvoigt = {"sum_apvoigt", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_13sum_apvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_12sum_apvoigt};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_apvoigt (wrapper)", 0);
@@ -4621,7 +5328,7 @@ static PyObject *__pyx_pw_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObjec
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_apvoigt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_apvoigt") < 0)) __PYX_ERR(0, 320, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -4632,14 +5339,14 @@ static PyObject *__pyx_pw_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_apvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_apvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 320, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_apvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_apvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_12sum_apvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_12sum_apvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -4647,7 +5354,7 @@ static PyObject *__pyx_pw_9functions_13sum_apvoigt(PyObject *__pyx_self, PyObjec
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -4662,340 +5369,344 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_apvoigt", 0);
- /* "functions.pyx":346
+ /* "silx/math/fit/functions.pyx":345
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 345, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":347
+ /* "silx/math/fit/functions.pyx":346
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 4 parameters are required.")
* x_c = numpy.array(x,
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 346, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":345
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 4 parameters are required.")
+ */
}
- /* "functions.pyx":349
+ /* "silx/math/fit/functions.pyx":348
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 348, __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[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":350
+ /* "silx/math/fit/functions.pyx":349
* "At least 4 parameters are required.")
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
- /* "functions.pyx":351
+ /* "silx/math/fit/functions.pyx":350
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
- /* "functions.pyx":349
+ /* "silx/math/fit/functions.pyx":348
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 348, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":352
+ /* "silx/math/fit/functions.pyx":351
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":353
+ /* "silx/math/fit/functions.pyx":352
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":354
+ /* "silx/math/fit/functions.pyx":353
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
- /* "functions.pyx":355
+ /* "silx/math/fit/functions.pyx":354
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
- /* "functions.pyx":353
+ /* "silx/math/fit/functions.pyx":352
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":356
+ /* "silx/math/fit/functions.pyx":355
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":357
+ /* "silx/math/fit/functions.pyx":356
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 356, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":358
+ /* "silx/math/fit/functions.pyx":357
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_apvoigt(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":357
+ /* "silx/math/fit/functions.pyx":356
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 356, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":361
+ /* "silx/math/fit/functions.pyx":360
*
* status = functions_wrapper.sum_apvoigt(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 360, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":362
+ /* "silx/math/fit/functions.pyx":361
* status = functions_wrapper.sum_apvoigt(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 361, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 361, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":363
+ /* "silx/math/fit/functions.pyx":362
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 362, __pyx_L1_error)
}
- /* "functions.pyx":360
+ /* "silx/math/fit/functions.pyx":359
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_apvoigt( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_apvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_apvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":365
+ /* "silx/math/fit/functions.pyx":364
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -5005,21 +5716,29 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":366
+ /* "silx/math/fit/functions.pyx":365
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 365, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":364
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":368
+ /* "silx/math/fit/functions.pyx":367
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -5027,15 +5746,15 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
*
*/
__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 = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -5045,57 +5764,97 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":321
+ /* "silx/math/fit/functions.pyx":320
*
*
* def sum_apvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -5111,10 +5870,8 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_apvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_apvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -5125,7 +5882,7 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "functions.pyx":371
+/* "silx/math/fit/functions.pyx":370
*
*
* def sum_pvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -5134,15 +5891,12 @@ static PyObject *__pyx_pf_9functions_12sum_apvoigt(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_14sum_pvoigt[] = "sum_pvoigt(x, *params)\nReturn a sum of pseudo-Voigt functions, defined by *(height, centroid,\n fwhm, eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *height* is the peak amplitude of G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum of both functions\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm1, eta1, height2, centroid2, fwhm2, eta2,...)*\n :return: Array of sum of pseudo-Voigt functions at each ``x`` coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_15sum_pvoigt = {"sum_pvoigt", (PyCFunction)__pyx_pw_9functions_15sum_pvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_14sum_pvoigt};
-static PyObject *__pyx_pw_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_14sum_pvoigt[] = "sum_pvoigt(x, *params)\nReturn a sum of pseudo-Voigt functions, defined by *(height, centroid,\n fwhm, eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *height* is the peak amplitude of G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum of both functions\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm1, eta1, height2, centroid2, fwhm2, eta2,...)*\n :return: Array of sum of pseudo-Voigt functions at each ``x`` coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_15sum_pvoigt = {"sum_pvoigt", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_15sum_pvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_14sum_pvoigt};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_pvoigt (wrapper)", 0);
@@ -5175,7 +5929,7 @@ static PyObject *__pyx_pw_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_pvoigt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_pvoigt") < 0)) __PYX_ERR(0, 370, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -5186,14 +5940,14 @@ static PyObject *__pyx_pw_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_pvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_pvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 370, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_pvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_pvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_14sum_pvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_14sum_pvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -5201,7 +5955,7 @@ static PyObject *__pyx_pw_9functions_15sum_pvoigt(PyObject *__pyx_self, PyObject
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -5216,340 +5970,344 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_pvoigt", 0);
- /* "functions.pyx":396
+ /* "silx/math/fit/functions.pyx":395
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 395, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":397
+ /* "silx/math/fit/functions.pyx":396
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 4 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 396, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 396, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":395
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 4 parameters are required.")
+ */
}
- /* "functions.pyx":400
+ /* "silx/math/fit/functions.pyx":399
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __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[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":401
+ /* "silx/math/fit/functions.pyx":400
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
- /* "functions.pyx":402
+ /* "silx/math/fit/functions.pyx":401
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
- /* "functions.pyx":400
+ /* "silx/math/fit/functions.pyx":399
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":403
+ /* "silx/math/fit/functions.pyx":402
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":404
+ /* "silx/math/fit/functions.pyx":403
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":405
+ /* "silx/math/fit/functions.pyx":404
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
- /* "functions.pyx":406
+ /* "silx/math/fit/functions.pyx":405
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
- /* "functions.pyx":404
+ /* "silx/math/fit/functions.pyx":403
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":407
+ /* "silx/math/fit/functions.pyx":406
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":408
+ /* "silx/math/fit/functions.pyx":407
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":409
+ /* "silx/math/fit/functions.pyx":408
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_pvoigt(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":408
+ /* "silx/math/fit/functions.pyx":407
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":412
+ /* "silx/math/fit/functions.pyx":411
*
* status = functions_wrapper.sum_pvoigt(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 411, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":413
+ /* "silx/math/fit/functions.pyx":412
* status = functions_wrapper.sum_pvoigt(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 412, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":414
+ /* "silx/math/fit/functions.pyx":413
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 413, __pyx_L1_error)
}
- /* "functions.pyx":411
+ /* "silx/math/fit/functions.pyx":410
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_pvoigt( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_pvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_pvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":416
+ /* "silx/math/fit/functions.pyx":415
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -5559,21 +6317,29 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":417
+ /* "silx/math/fit/functions.pyx":416
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 416, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":415
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":419
+ /* "silx/math/fit/functions.pyx":418
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -5581,15 +6347,15 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
*
*/
__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 = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -5599,57 +6365,97 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":371
+ /* "silx/math/fit/functions.pyx":370
*
*
* def sum_pvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -5665,10 +6471,8 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_pvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_pvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -5679,7 +6483,7 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "functions.pyx":422
+/* "silx/math/fit/functions.pyx":421
*
*
* def sum_splitpvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -5688,15 +6492,12 @@ static PyObject *__pyx_pf_9functions_14sum_pvoigt(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_16sum_splitpvoigt[] = "sum_splitpvoigt(x, *params)\nReturn a sum of split pseudo-Voigt functions, defined by *(height,\n centroid, fwhm1, fwhm2, eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *height* is the peak amplitudefor G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm1* is the full-width at half maximum of both functions\n when ``x < centroid``\n - *fwhm2* is the full-width at half maximum of both functions\n when ``x > centroid``\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 5):\n *(height1, centroid1, fwhm11, fwhm21, eta1,...)*\n :return: Array of sum of split pseudo-Voigt functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_17sum_splitpvoigt = {"sum_splitpvoigt", (PyCFunction)__pyx_pw_9functions_17sum_splitpvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_16sum_splitpvoigt};
-static PyObject *__pyx_pw_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_16sum_splitpvoigt[] = "sum_splitpvoigt(x, *params)\nReturn a sum of split pseudo-Voigt functions, defined by *(height,\n centroid, fwhm1, fwhm2, eta)*.\n\n The pseudo-Voigt profile ``PV(x)`` is an approximation of the Voigt\n profile using a linear combination of a Gaussian curve ``G(x)`` and a\n Lorentzian curve ``L(x)`` instead of their convolution.\n\n - *height* is the peak amplitudefor G(x) and L(x)\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm1* is the full-width at half maximum of both functions\n when ``x < centroid``\n - *fwhm2* is the full-width at half maximum of both functions\n when ``x > centroid``\n - *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of pseudo-Voigt parameters (length must be a multiple\n of 5):\n *(height1, centroid1, fwhm11, fwhm21, eta1,...)*\n :return: Array of sum of split pseudo-Voigt functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_17sum_splitpvoigt = {"sum_splitpvoigt", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_17sum_splitpvoigt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_16sum_splitpvoigt};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_splitpvoigt (wrapper)", 0);
@@ -5729,7 +6530,7 @@ static PyObject *__pyx_pw_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyO
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitpvoigt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitpvoigt") < 0)) __PYX_ERR(0, 421, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -5740,14 +6541,14 @@ static PyObject *__pyx_pw_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyO
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_splitpvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_splitpvoigt", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 421, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_splitpvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitpvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_16sum_splitpvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_16sum_splitpvoigt(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -5755,7 +6556,7 @@ static PyObject *__pyx_pw_9functions_17sum_splitpvoigt(PyObject *__pyx_self, PyO
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -5770,340 +6571,344 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_splitpvoigt", 0);
- /* "functions.pyx":451
+ /* "silx/math/fit/functions.pyx":450
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 5 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 450, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":452
+ /* "silx/math/fit/functions.pyx":451
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 5 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_5_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_5_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 451, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":450
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 5 parameters are required.")
+ */
}
- /* "functions.pyx":455
+ /* "silx/math/fit/functions.pyx":454
* "At least 5 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __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[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":456
+ /* "silx/math/fit/functions.pyx":455
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
- /* "functions.pyx":457
+ /* "silx/math/fit/functions.pyx":456
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 456, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
- /* "functions.pyx":455
+ /* "silx/math/fit/functions.pyx":454
* "At least 5 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":458
+ /* "silx/math/fit/functions.pyx":457
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 457, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":459
+ /* "silx/math/fit/functions.pyx":458
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":460
+ /* "silx/math/fit/functions.pyx":459
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
- /* "functions.pyx":461
+ /* "silx/math/fit/functions.pyx":460
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 459, __pyx_L1_error)
- /* "functions.pyx":459
+ /* "silx/math/fit/functions.pyx":458
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 458, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":462
+ /* "silx/math/fit/functions.pyx":461
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":463
+ /* "silx/math/fit/functions.pyx":462
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":464
+ /* "silx/math/fit/functions.pyx":463
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_splitpvoigt(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":463
+ /* "silx/math/fit/functions.pyx":462
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 462, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":467
+ /* "silx/math/fit/functions.pyx":466
*
* status = functions_wrapper.sum_splitpvoigt(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 466, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 466, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":468
+ /* "silx/math/fit/functions.pyx":467
* status = functions_wrapper.sum_splitpvoigt(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 467, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":469
+ /* "silx/math/fit/functions.pyx":468
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 468, __pyx_L1_error)
}
- /* "functions.pyx":466
+ /* "silx/math/fit/functions.pyx":465
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_splitpvoigt( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_splitpvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_splitpvoigt((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":471
+ /* "silx/math/fit/functions.pyx":470
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -6113,21 +6918,29 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":472
+ /* "silx/math/fit/functions.pyx":471
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 471, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":470
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":474
+ /* "silx/math/fit/functions.pyx":473
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -6135,15 +6948,15 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
*
*/
__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 = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -6153,57 +6966,97 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":422
+ /* "silx/math/fit/functions.pyx":421
*
*
* def sum_splitpvoigt(x, *params): # <<<<<<<<<<<<<<
@@ -6219,10 +7072,8 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_splitpvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitpvoigt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -6233,7 +7084,7 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
return __pyx_r;
}
-/* "functions.pyx":477
+/* "silx/math/fit/functions.pyx":476
*
*
* def sum_lorentz(x, *params): # <<<<<<<<<<<<<<
@@ -6242,15 +7093,12 @@ static PyObject *__pyx_pf_9functions_16sum_splitpvoigt(CYTHON_UNUSED PyObject *_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_19sum_lorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_18sum_lorentz[] = "sum_lorentz(x, *params)\nReturn a sum of Lorentz distributions, also known as Cauchy distribution,\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum Lorentz functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_19sum_lorentz = {"sum_lorentz", (PyCFunction)__pyx_pw_9functions_19sum_lorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_18sum_lorentz};
-static PyObject *__pyx_pw_9functions_19sum_lorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_19sum_lorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_18sum_lorentz[] = "sum_lorentz(x, *params)\nReturn a sum of Lorentz distributions, also known as Cauchy distribution,\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate\n - *fwhm* is the full-width at half maximum\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum Lorentz functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_19sum_lorentz = {"sum_lorentz", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_19sum_lorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_18sum_lorentz};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_19sum_lorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_lorentz (wrapper)", 0);
@@ -6283,7 +7131,7 @@ static PyObject *__pyx_pw_9functions_19sum_lorentz(PyObject *__pyx_self, PyObjec
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_lorentz") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_lorentz") < 0)) __PYX_ERR(0, 476, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -6294,14 +7142,14 @@ static PyObject *__pyx_pw_9functions_19sum_lorentz(PyObject *__pyx_self, PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_lorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_lorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 476, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_lorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_lorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_18sum_lorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_18sum_lorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -6309,7 +7157,7 @@ static PyObject *__pyx_pw_9functions_19sum_lorentz(PyObject *__pyx_self, PyObjec
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -6324,340 +7172,344 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_lorentz", 0);
- /* "functions.pyx":498
+ /* "silx/math/fit/functions.pyx":497
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 497, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":499
+ /* "silx/math/fit/functions.pyx":498
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 498, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":497
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":502
+ /* "silx/math/fit/functions.pyx":501
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __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[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":503
+ /* "silx/math/fit/functions.pyx":502
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
- /* "functions.pyx":504
+ /* "silx/math/fit/functions.pyx":503
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
- /* "functions.pyx":502
+ /* "silx/math/fit/functions.pyx":501
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":505
+ /* "silx/math/fit/functions.pyx":504
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":506
+ /* "silx/math/fit/functions.pyx":505
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":507
+ /* "silx/math/fit/functions.pyx":506
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
- /* "functions.pyx":508
+ /* "silx/math/fit/functions.pyx":507
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 506, __pyx_L1_error)
- /* "functions.pyx":506
+ /* "silx/math/fit/functions.pyx":505
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":509
+ /* "silx/math/fit/functions.pyx":508
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":510
+ /* "silx/math/fit/functions.pyx":509
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":511
+ /* "silx/math/fit/functions.pyx":510
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_lorentz(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":510
+ /* "silx/math/fit/functions.pyx":509
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 509, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":514
+ /* "silx/math/fit/functions.pyx":513
*
* status = functions_wrapper.sum_lorentz(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 513, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 513, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":515
+ /* "silx/math/fit/functions.pyx":514
* status = functions_wrapper.sum_lorentz(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 514, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":516
+ /* "silx/math/fit/functions.pyx":515
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 515, __pyx_L1_error)
}
- /* "functions.pyx":513
+ /* "silx/math/fit/functions.pyx":512
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_lorentz( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_lorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_lorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":518
+ /* "silx/math/fit/functions.pyx":517
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -6667,21 +7519,29 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":519
+ /* "silx/math/fit/functions.pyx":518
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 518, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":517
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":521
+ /* "silx/math/fit/functions.pyx":520
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -6689,15 +7549,15 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
*
*/
__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 = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -6707,57 +7567,97 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":477
+ /* "silx/math/fit/functions.pyx":476
*
*
* def sum_lorentz(x, *params): # <<<<<<<<<<<<<<
@@ -6773,10 +7673,8 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_lorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_lorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -6787,7 +7685,7 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "functions.pyx":524
+/* "silx/math/fit/functions.pyx":523
*
*
* def sum_alorentz(x, *params): # <<<<<<<<<<<<<<
@@ -6796,15 +7694,12 @@ static PyObject *__pyx_pf_9functions_18sum_lorentz(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_21sum_alorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_20sum_alorentz[] = "sum_alorentz(x, *params)\nReturn a sum of Lorentz distributions, also known as Cauchy distribution,\n defined by *(area, centroid, fwhm)*.\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1,...)*\n :return: Array of sum of Lorentz functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_21sum_alorentz = {"sum_alorentz", (PyCFunction)__pyx_pw_9functions_21sum_alorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_20sum_alorentz};
-static PyObject *__pyx_pw_9functions_21sum_alorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_21sum_alorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_20sum_alorentz[] = "sum_alorentz(x, *params)\nReturn a sum of Lorentz distributions, also known as Cauchy distribution,\n defined by *(area, centroid, fwhm)*.\n\n - *area* is the area underneath the peak\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm* is the full-width at half maximum\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 3):\n *(area1, centroid1, fwhm1,...)*\n :return: Array of sum of Lorentz functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_21sum_alorentz = {"sum_alorentz", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_21sum_alorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_20sum_alorentz};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_21sum_alorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_alorentz (wrapper)", 0);
@@ -6837,7 +7732,7 @@ static PyObject *__pyx_pw_9functions_21sum_alorentz(PyObject *__pyx_self, PyObje
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_alorentz") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_alorentz") < 0)) __PYX_ERR(0, 523, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -6848,14 +7743,14 @@ static PyObject *__pyx_pw_9functions_21sum_alorentz(PyObject *__pyx_self, PyObje
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_alorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_alorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 523, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_alorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_alorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_20sum_alorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_20sum_alorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -6863,7 +7758,7 @@ static PyObject *__pyx_pw_9functions_21sum_alorentz(PyObject *__pyx_self, PyObje
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -6878,340 +7773,344 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_alorentz", 0);
- /* "functions.pyx":545
+ /* "silx/math/fit/functions.pyx":544
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 544, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":546
+ /* "silx/math/fit/functions.pyx":545
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 545, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":544
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":549
+ /* "silx/math/fit/functions.pyx":548
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __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[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":550
+ /* "silx/math/fit/functions.pyx":549
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
- /* "functions.pyx":551
+ /* "silx/math/fit/functions.pyx":550
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 550, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 549, __pyx_L1_error)
- /* "functions.pyx":549
+ /* "silx/math/fit/functions.pyx":548
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 548, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":552
+ /* "silx/math/fit/functions.pyx":551
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 551, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":553
+ /* "silx/math/fit/functions.pyx":552
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":554
+ /* "silx/math/fit/functions.pyx":553
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
- /* "functions.pyx":555
+ /* "silx/math/fit/functions.pyx":554
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
- /* "functions.pyx":553
+ /* "silx/math/fit/functions.pyx":552
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 552, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":556
+ /* "silx/math/fit/functions.pyx":555
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":557
+ /* "silx/math/fit/functions.pyx":556
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":558
+ /* "silx/math/fit/functions.pyx":557
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_alorentz(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 557, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":557
+ /* "silx/math/fit/functions.pyx":556
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 556, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":561
+ /* "silx/math/fit/functions.pyx":560
*
* status = functions_wrapper.sum_alorentz(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 560, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 560, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":562
+ /* "silx/math/fit/functions.pyx":561
* status = functions_wrapper.sum_alorentz(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 561, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 561, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":563
+ /* "silx/math/fit/functions.pyx":562
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 562, __pyx_L1_error)
}
- /* "functions.pyx":560
+ /* "silx/math/fit/functions.pyx":559
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_alorentz( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_alorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_alorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":565
+ /* "silx/math/fit/functions.pyx":564
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -7221,21 +8120,29 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":566
+ /* "silx/math/fit/functions.pyx":565
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 565, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":564
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":568
+ /* "silx/math/fit/functions.pyx":567
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -7243,15 +8150,15 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
*
*/
__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 = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -7261,57 +8168,97 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":524
+ /* "silx/math/fit/functions.pyx":523
*
*
* def sum_alorentz(x, *params): # <<<<<<<<<<<<<<
@@ -7327,10 +8274,8 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_alorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_alorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -7341,7 +8286,7 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
return __pyx_r;
}
-/* "functions.pyx":571
+/* "silx/math/fit/functions.pyx":570
*
*
* def sum_splitlorentz(x, *params): # <<<<<<<<<<<<<<
@@ -7350,15 +8295,12 @@ static PyObject *__pyx_pf_9functions_20sum_alorentz(CYTHON_UNUSED PyObject *__py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_23sum_splitlorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_22sum_splitlorentz[] = "sum_splitlorentz(x, *params)\nReturn a sum of split Lorentz distributions,\n defined by *(height, centroid, fwhm1, fwhm2)*.\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm1* is the full-width at half maximum for ``x < centroid``\n - *fwhm2* is the full-width at half maximum for ``x > centroid``\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm11, fwhm21...)*\n :return: Array of sum of Lorentz functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_23sum_splitlorentz = {"sum_splitlorentz", (PyCFunction)__pyx_pw_9functions_23sum_splitlorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_22sum_splitlorentz};
-static PyObject *__pyx_pw_9functions_23sum_splitlorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_23sum_splitlorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_22sum_splitlorentz[] = "sum_splitlorentz(x, *params)\nReturn a sum of split Lorentz distributions,\n defined by *(height, centroid, fwhm1, fwhm2)*.\n\n - *height* is the peak amplitude\n - *centroid* is the peak x-coordinate for both functions\n - *fwhm1* is the full-width at half maximum for ``x < centroid``\n - *fwhm2* is the full-width at half maximum for ``x > centroid``\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of Lorentz parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm11, fwhm21...)*\n :return: Array of sum of Lorentz functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_23sum_splitlorentz = {"sum_splitlorentz", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_23sum_splitlorentz, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_22sum_splitlorentz};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_23sum_splitlorentz(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_splitlorentz (wrapper)", 0);
@@ -7391,7 +8333,7 @@ static PyObject *__pyx_pw_9functions_23sum_splitlorentz(PyObject *__pyx_self, Py
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitlorentz") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_splitlorentz") < 0)) __PYX_ERR(0, 570, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -7402,14 +8344,14 @@ static PyObject *__pyx_pw_9functions_23sum_splitlorentz(PyObject *__pyx_self, Py
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_splitlorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_splitlorentz", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_splitlorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitlorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_22sum_splitlorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_22sum_splitlorentz(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -7417,7 +8359,7 @@ static PyObject *__pyx_pw_9functions_23sum_splitlorentz(PyObject *__pyx_self, Py
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -7432,340 +8374,344 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_splitlorentz", 0);
- /* "functions.pyx":593
+ /* "silx/math/fit/functions.pyx":592
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 592, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":594
+ /* "silx/math/fit/functions.pyx":593
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 4 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 593, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":592
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 4 parameters are required.")
+ */
}
- /* "functions.pyx":597
+ /* "silx/math/fit/functions.pyx":596
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __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[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":598
+ /* "silx/math/fit/functions.pyx":597
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 597, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
- /* "functions.pyx":599
+ /* "silx/math/fit/functions.pyx":598
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 597, __pyx_L1_error)
- /* "functions.pyx":597
+ /* "silx/math/fit/functions.pyx":596
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 596, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":600
+ /* "silx/math/fit/functions.pyx":599
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":601
+ /* "silx/math/fit/functions.pyx":600
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":602
+ /* "silx/math/fit/functions.pyx":601
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 601, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
- /* "functions.pyx":603
+ /* "silx/math/fit/functions.pyx":602
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 601, __pyx_L1_error)
- /* "functions.pyx":601
+ /* "silx/math/fit/functions.pyx":600
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 600, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":604
+ /* "silx/math/fit/functions.pyx":603
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":605
+ /* "silx/math/fit/functions.pyx":604
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 604, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":606
+ /* "silx/math/fit/functions.pyx":605
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_splitlorentz(
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 605, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 605, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":605
+ /* "silx/math/fit/functions.pyx":604
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 604, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":609
+ /* "silx/math/fit/functions.pyx":608
*
* status = functions_wrapper.sum_splitlorentz(
* &x_c[0], x.size, # <<<<<<<<<<<<<<
* &params_c[0], params_c.size,
* &y_c[0])
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 608, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 608, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 608, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":610
+ /* "silx/math/fit/functions.pyx":609
* status = functions_wrapper.sum_splitlorentz(
* &x_c[0], x.size,
* &params_c[0], params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 609, __pyx_L1_error)
}
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":611
+ /* "silx/math/fit/functions.pyx":610
* &x_c[0], x.size,
* &params_c[0], params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 610, __pyx_L1_error)
}
- /* "functions.pyx":608
+ /* "silx/math/fit/functions.pyx":607
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_splitlorentz( # <<<<<<<<<<<<<<
* &x_c[0], x.size,
* &params_c[0], params_c.size,
*/
- __pyx_v_status = sum_splitlorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_splitlorentz((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":613
+ /* "silx/math/fit/functions.pyx":612
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -7775,21 +8721,29 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":614
+ /* "silx/math/fit/functions.pyx":613
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 613, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":612
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":616
+ /* "silx/math/fit/functions.pyx":615
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -7797,15 +8751,15 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
*
*/
__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 = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -7815,57 +8769,97 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 615, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":571
+ /* "silx/math/fit/functions.pyx":570
*
*
* def sum_splitlorentz(x, *params): # <<<<<<<<<<<<<<
@@ -7881,10 +8875,8 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_splitlorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_splitlorentz", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -7895,7 +8887,7 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
return __pyx_r;
}
-/* "functions.pyx":619
+/* "silx/math/fit/functions.pyx":618
*
*
* def sum_stepdown(x, *params): # <<<<<<<<<<<<<<
@@ -7904,15 +8896,12 @@ static PyObject *__pyx_pf_9functions_22sum_splitlorentz(CYTHON_UNUSED PyObject *
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_25sum_stepdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_24sum_stepdown[] = "sum_stepdown(x, *params)\nReturn a sum of stepdown functions.\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the step's amplitude\n - *centroid* is the step's x-coordinate\n - *fwhm* is the full-width at half maximum for the derivative,\n which is a measure of the *sharpness* of the step-down's edge\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of stepdown parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum of stepdown functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_25sum_stepdown = {"sum_stepdown", (PyCFunction)__pyx_pw_9functions_25sum_stepdown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_24sum_stepdown};
-static PyObject *__pyx_pw_9functions_25sum_stepdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_25sum_stepdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_24sum_stepdown[] = "sum_stepdown(x, *params)\nReturn a sum of stepdown functions.\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the step's amplitude\n - *centroid* is the step's x-coordinate\n - *fwhm* is the full-width at half maximum for the derivative,\n which is a measure of the *sharpness* of the step-down's edge\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of stepdown parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum of stepdown functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_25sum_stepdown = {"sum_stepdown", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_25sum_stepdown, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_24sum_stepdown};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_25sum_stepdown(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_stepdown (wrapper)", 0);
@@ -7945,7 +8934,7 @@ static PyObject *__pyx_pw_9functions_25sum_stepdown(PyObject *__pyx_self, PyObje
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_stepdown") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_stepdown") < 0)) __PYX_ERR(0, 618, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -7956,14 +8945,14 @@ static PyObject *__pyx_pw_9functions_25sum_stepdown(PyObject *__pyx_self, PyObje
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_stepdown", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_stepdown", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 618, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_stepdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_stepdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_24sum_stepdown(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_24sum_stepdown(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -7971,7 +8960,7 @@ static PyObject *__pyx_pw_9functions_25sum_stepdown(PyObject *__pyx_self, PyObje
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -7986,356 +8975,360 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_stepdown", 0);
- /* "functions.pyx":641
+ /* "silx/math/fit/functions.pyx":640
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 640, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":642
+ /* "silx/math/fit/functions.pyx":641
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
* x_c = numpy.array(x,
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 641, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 641, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":640
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":644
+ /* "silx/math/fit/functions.pyx":643
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __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[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":645
+ /* "silx/math/fit/functions.pyx":644
* "At least 3 parameters are required.")
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
- /* "functions.pyx":646
+ /* "silx/math/fit/functions.pyx":645
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 645, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 645, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 644, __pyx_L1_error)
- /* "functions.pyx":644
+ /* "silx/math/fit/functions.pyx":643
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 643, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":647
+ /* "silx/math/fit/functions.pyx":646
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 646, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":648
+ /* "silx/math/fit/functions.pyx":647
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":649
+ /* "silx/math/fit/functions.pyx":648
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 648, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
- /* "functions.pyx":650
+ /* "silx/math/fit/functions.pyx":649
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 648, __pyx_L1_error)
- /* "functions.pyx":648
+ /* "silx/math/fit/functions.pyx":647
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 647, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":651
+ /* "silx/math/fit/functions.pyx":650
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":652
+ /* "silx/math/fit/functions.pyx":651
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":653
+ /* "silx/math/fit/functions.pyx":652
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_stepdown(&x_c[0],
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":652
+ /* "silx/math/fit/functions.pyx":651
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 651, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":655
+ /* "silx/math/fit/functions.pyx":654
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_stepdown(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 654, __pyx_L1_error)
}
- /* "functions.pyx":656
+ /* "silx/math/fit/functions.pyx":655
*
* status = functions_wrapper.sum_stepdown(&x_c[0],
* x.size, # <<<<<<<<<<<<<<
* &params_c[0],
* params_c.size,
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 655, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":657
+ /* "silx/math/fit/functions.pyx":656
* status = functions_wrapper.sum_stepdown(&x_c[0],
* x.size,
* &params_c[0], # <<<<<<<<<<<<<<
* params_c.size,
* &y_c[0])
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 656, __pyx_L1_error)
}
- /* "functions.pyx":658
+ /* "silx/math/fit/functions.pyx":657
* x.size,
* &params_c[0],
* params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":659
+ /* "silx/math/fit/functions.pyx":658
* &params_c[0],
* params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 658, __pyx_L1_error)
}
- /* "functions.pyx":655
+ /* "silx/math/fit/functions.pyx":654
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_stepdown(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_v_status = sum_stepdown((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_stepdown((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":661
+ /* "silx/math/fit/functions.pyx":660
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -8345,21 +9338,29 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":662
+ /* "silx/math/fit/functions.pyx":661
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 661, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":660
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":664
+ /* "silx/math/fit/functions.pyx":663
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -8367,15 +9368,15 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
*
*/
__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 = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -8385,57 +9386,97 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":619
+ /* "silx/math/fit/functions.pyx":618
*
*
* def sum_stepdown(x, *params): # <<<<<<<<<<<<<<
@@ -8451,10 +9492,8 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_stepdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_stepdown", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -8465,7 +9504,7 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
return __pyx_r;
}
-/* "functions.pyx":667
+/* "silx/math/fit/functions.pyx":666
*
*
* def sum_stepup(x, *params): # <<<<<<<<<<<<<<
@@ -8474,15 +9513,12 @@ static PyObject *__pyx_pf_9functions_24sum_stepdown(CYTHON_UNUSED PyObject *__py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_27sum_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_26sum_stepup[] = "sum_stepup(x, *params)\nReturn a sum of stepup functions.\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the step's amplitude\n - *centroid* is the step's x-coordinate\n - *fwhm* is the full-width at half maximum for the derivative,\n which is a measure of the *sharpness* of the step-up's edge\n\n :param x: Independant variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of stepup parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum of stepup functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_27sum_stepup = {"sum_stepup", (PyCFunction)__pyx_pw_9functions_27sum_stepup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_26sum_stepup};
-static PyObject *__pyx_pw_9functions_27sum_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_27sum_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_26sum_stepup[] = "sum_stepup(x, *params)\nReturn a sum of stepup functions.\n defined by *(height, centroid, fwhm)*.\n\n - *height* is the step's amplitude\n - *centroid* is the step's x-coordinate\n - *fwhm* is the full-width at half maximum for the derivative,\n which is a measure of the *sharpness* of the step-up's edge\n\n :param x: Independent variable where the gaussians are calculated\n :type x: numpy.ndarray\n :param params: Array of stepup parameters (length must be a multiple\n of 3):\n *(height1, centroid1, fwhm1,...)*\n :return: Array of sum of stepup functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_27sum_stepup = {"sum_stepup", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_27sum_stepup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_26sum_stepup};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_27sum_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_stepup (wrapper)", 0);
@@ -8515,7 +9551,7 @@ static PyObject *__pyx_pw_9functions_27sum_stepup(PyObject *__pyx_self, PyObject
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_stepup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_stepup") < 0)) __PYX_ERR(0, 666, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -8526,14 +9562,14 @@ static PyObject *__pyx_pw_9functions_27sum_stepup(PyObject *__pyx_self, PyObject
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_stepup", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_stepup", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 666, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_26sum_stepup(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_26sum_stepup(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -8541,7 +9577,7 @@ static PyObject *__pyx_pw_9functions_27sum_stepup(PyObject *__pyx_self, PyObject
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -8556,356 +9592,360 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_stepup", 0);
- /* "functions.pyx":689
+ /* "silx/math/fit/functions.pyx":688
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 3 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 688, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":690
+ /* "silx/math/fit/functions.pyx":689
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 3 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_3_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 689, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 689, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 689, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":688
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 3 parameters are required.")
+ */
}
- /* "functions.pyx":693
+ /* "silx/math/fit/functions.pyx":692
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __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[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":694
+ /* "silx/math/fit/functions.pyx":693
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
- /* "functions.pyx":695
+ /* "silx/math/fit/functions.pyx":694
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
- /* "functions.pyx":693
+ /* "silx/math/fit/functions.pyx":692
* "At least 3 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":696
+ /* "silx/math/fit/functions.pyx":695
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 695, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 695, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":697
+ /* "silx/math/fit/functions.pyx":696
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":698
+ /* "silx/math/fit/functions.pyx":697
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 697, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
- /* "functions.pyx":699
+ /* "silx/math/fit/functions.pyx":698
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 698, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
- /* "functions.pyx":697
+ /* "silx/math/fit/functions.pyx":696
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 696, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":700
+ /* "silx/math/fit/functions.pyx":699
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":701
+ /* "silx/math/fit/functions.pyx":700
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":702
+ /* "silx/math/fit/functions.pyx":701
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_stepup(&x_c[0],
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 701, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 701, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":701
+ /* "silx/math/fit/functions.pyx":700
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 700, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":704
+ /* "silx/math/fit/functions.pyx":703
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_stepup(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 703, __pyx_L1_error)
}
- /* "functions.pyx":705
+ /* "silx/math/fit/functions.pyx":704
*
* status = functions_wrapper.sum_stepup(&x_c[0],
* x.size, # <<<<<<<<<<<<<<
* &params_c[0],
* params_c.size,
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":706
+ /* "silx/math/fit/functions.pyx":705
* status = functions_wrapper.sum_stepup(&x_c[0],
* x.size,
* &params_c[0], # <<<<<<<<<<<<<<
* params_c.size,
* &y_c[0])
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 705, __pyx_L1_error)
}
- /* "functions.pyx":707
+ /* "silx/math/fit/functions.pyx":706
* x.size,
* &params_c[0],
* params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 706, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 706, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":708
+ /* "silx/math/fit/functions.pyx":707
* &params_c[0],
* params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 707, __pyx_L1_error)
}
- /* "functions.pyx":704
+ /* "silx/math/fit/functions.pyx":703
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_stepup(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_v_status = sum_stepup((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_stepup((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":710
+ /* "silx/math/fit/functions.pyx":709
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -8915,21 +9955,29 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":711
+ /* "silx/math/fit/functions.pyx":710
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 710, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":709
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":713
+ /* "silx/math/fit/functions.pyx":712
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -8937,15 +9985,15 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
*
*/
__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 = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -8955,57 +10003,97 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":667
+ /* "silx/math/fit/functions.pyx":666
*
*
* def sum_stepup(x, *params): # <<<<<<<<<<<<<<
@@ -9021,10 +10109,8 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -9035,7 +10121,7 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
return __pyx_r;
}
-/* "functions.pyx":716
+/* "silx/math/fit/functions.pyx":715
*
*
* def sum_slit(x, *params): # <<<<<<<<<<<<<<
@@ -9044,15 +10130,12 @@ static PyObject *__pyx_pf_9functions_26sum_stepup(CYTHON_UNUSED PyObject *__pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_29sum_slit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_28sum_slit[] = "sum_slit(x, *params)\nReturn a sum of slit functions.\n defined by *(height, position, fwhm, beamfwhm)*.\n\n - *height* is the slit's amplitude\n - *position* is the center of the slit's x-coordinate\n - *fwhm* is the full-width at half maximum of the slit\n - *beamfwhm* is the full-width at half maximum of the\n derivative, which is a measure of the *sharpness*\n of the edges of the slit\n\n :param x: Independant variable where the slits are calculated\n :type x: numpy.ndarray\n :param params: Array of slit parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm1, beamfwhm1,...)*\n :return: Array of sum of slit functions at each ``x``\n coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_29sum_slit = {"sum_slit", (PyCFunction)__pyx_pw_9functions_29sum_slit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_28sum_slit};
-static PyObject *__pyx_pw_9functions_29sum_slit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_29sum_slit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_28sum_slit[] = "sum_slit(x, *params)\nReturn a sum of slit functions.\n defined by *(height, position, fwhm, beamfwhm)*.\n\n - *height* is the slit's amplitude\n - *position* is the center of the slit's x-coordinate\n - *fwhm* is the full-width at half maximum of the slit\n - *beamfwhm* is the full-width at half maximum of the\n derivative, which is a measure of the *sharpness*\n of the edges of the slit\n\n :param x: Independent variable where the slits are calculated\n :type x: numpy.ndarray\n :param params: Array of slit parameters (length must be a multiple\n of 4):\n *(height1, centroid1, fwhm1, beamfwhm1,...)*\n :return: Array of sum of slit functions at each ``x``\n coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_29sum_slit = {"sum_slit", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_29sum_slit, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_28sum_slit};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_29sum_slit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_slit (wrapper)", 0);
@@ -9085,7 +10168,7 @@ static PyObject *__pyx_pw_9functions_29sum_slit(PyObject *__pyx_self, PyObject *
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_slit") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_slit") < 0)) __PYX_ERR(0, 715, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -9096,14 +10179,14 @@ static PyObject *__pyx_pw_9functions_29sum_slit(PyObject *__pyx_self, PyObject *
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_slit", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_slit", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 715, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_slit", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_slit", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_28sum_slit(__pyx_self, __pyx_v_x, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_28sum_slit(__pyx_self, __pyx_v_x, __pyx_v_params);
/* function exit code */
__Pyx_XDECREF(__pyx_v_params);
@@ -9111,7 +10194,7 @@ static PyObject *__pyx_pw_9functions_29sum_slit(PyObject *__pyx_self, PyObject *
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -9126,356 +10209,360 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_slit", 0);
- /* "functions.pyx":740
+ /* "silx/math/fit/functions.pyx":739
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 4 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 739, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":741
+ /* "silx/math/fit/functions.pyx":740
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 4 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_4_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 740, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 740, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":739
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 4 parameters are required.")
+ */
}
- /* "functions.pyx":744
+ /* "silx/math/fit/functions.pyx":743
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 743, __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[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":745
+ /* "silx/math/fit/functions.pyx":744
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
- /* "functions.pyx":746
+ /* "silx/math/fit/functions.pyx":745
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 745, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 745, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
- /* "functions.pyx":744
+ /* "silx/math/fit/functions.pyx":743
* "At least 4 parameters are required.")
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 743, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":747
+ /* "silx/math/fit/functions.pyx":746
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":748
+ /* "silx/math/fit/functions.pyx":747
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":749
+ /* "silx/math/fit/functions.pyx":748
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
- /* "functions.pyx":750
+ /* "silx/math/fit/functions.pyx":749
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 748, __pyx_L1_error)
- /* "functions.pyx":748
+ /* "silx/math/fit/functions.pyx":747
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":751
+ /* "silx/math/fit/functions.pyx":750
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":752
+ /* "silx/math/fit/functions.pyx":751
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":753
+ /* "silx/math/fit/functions.pyx":752
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_slit(&x_c[0],
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 752, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":752
+ /* "silx/math/fit/functions.pyx":751
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 752; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 751, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":755
+ /* "silx/math/fit/functions.pyx":754
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_slit(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 754, __pyx_L1_error)
}
- /* "functions.pyx":756
+ /* "silx/math/fit/functions.pyx":755
*
* status = functions_wrapper.sum_slit(&x_c[0],
* x.size, # <<<<<<<<<<<<<<
* &params_c[0],
* params_c.size,
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 755, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":757
+ /* "silx/math/fit/functions.pyx":756
* status = functions_wrapper.sum_slit(&x_c[0],
* x.size,
* &params_c[0], # <<<<<<<<<<<<<<
* params_c.size,
* &y_c[0])
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 756, __pyx_L1_error)
}
- /* "functions.pyx":758
+ /* "silx/math/fit/functions.pyx":757
* x.size,
* &params_c[0],
* params_c.size, # <<<<<<<<<<<<<<
* &y_c[0])
*
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":759
+ /* "silx/math/fit/functions.pyx":758
* &params_c[0],
* params_c.size,
* &y_c[0]) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 758, __pyx_L1_error)
}
- /* "functions.pyx":755
+ /* "silx/math/fit/functions.pyx":754
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_slit(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_v_status = sum_slit((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))));
+ __pyx_v_status = sum_slit((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))));
- /* "functions.pyx":761
+ /* "silx/math/fit/functions.pyx":760
* &y_c[0])
*
* if status: # <<<<<<<<<<<<<<
@@ -9485,21 +10572,29 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":762
+ /* "silx/math/fit/functions.pyx":761
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 761, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":760
+ * &y_c[0])
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":764
+ /* "silx/math/fit/functions.pyx":763
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -9507,15 +10602,15 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
*
*/
__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 = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -9525,57 +10620,97 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":716
+ /* "silx/math/fit/functions.pyx":715
*
*
* def sum_slit(x, *params): # <<<<<<<<<<<<<<
@@ -9591,10 +10726,8 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_slit", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_slit", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -9605,7 +10738,7 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
return __pyx_r;
}
-/* "functions.pyx":767
+/* "silx/math/fit/functions.pyx":766
*
*
* def sum_ahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -9614,19 +10747,16 @@ static PyObject *__pyx_pf_9functions_28sum_slit(CYTHON_UNUSED PyObject *__pyx_se
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_30sum_ahypermet[] = "sum_ahypermet(x, *params, gaussian_term=True, st_term=True, lt_term=True, step_term=True)\nReturn a sum of ahypermet functions.\n defined by *(area, position, fwhm, st_area_r, st_slope_r, lt_area_r,\n lt_slope_r, step_height_r)*.\n\n - *area* is the area underneath the gaussian peak\n - *position* is the center of the various peaks and the position of\n the step down\n - *fwhm* is the full-width at half maximum of the terms\n - *st_area_r* is factor between the gaussian area and the area of the\n short tail term\n - *st_slope_r* is a ratio related to the slope of the short tail\n in the low ``x`` values (the lower, the steeper)\n - *lt_area_r* is ratio between the gaussian area and the area of the\n long tail term\n - *lt_slope_r* is a ratio related to the slope of the long tail\n in the low ``x`` values (the lower, the steeper)\n - *step_height_r* is the ratio between the height of the step down\n and the gaussian height\n\n A hypermet function is a sum of four functions (terms):\n\n - a gaussian term\n - a long tail term\n - a short tail term\n - a step down term\n\n :param x: Independant variable where the hypermets are calculated\n :type x: numpy.ndarray\n :param params: Array of hypermet parameters (length must be a multiple\n of 8):\n *(area1, position1, fwhm1, st_area_r1, st_slope_r1, lt_area_r1,\n lt_slope_r1, step_height_r1...)*\n :param gaussian_term: If ``True``, enable gaussian term. Default ``True``\n :param st_term: If ``True``, enable gaussian term. Default ``True``\n :param lt_term: If ``True``, enable gaussian term. Default ``True``\n :param step_term: If ``True``, enable gaussian term. Default ``True``\n :return: Array of sum of hypermet functions at each ``x`` coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_31sum_ahypermet = {"sum_ahypermet", (PyCFunction)__pyx_pw_9functions_31sum_ahypermet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_30sum_ahypermet};
-static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_30sum_ahypermet[] = "sum_ahypermet(x, *params, gaussian_term=True, st_term=True, lt_term=True, step_term=True)\nReturn a sum of ahypermet functions.\n defined by *(area, position, fwhm, st_area_r, st_slope_r, lt_area_r,\n lt_slope_r, step_height_r)*.\n\n - *area* is the area underneath the gaussian peak\n - *position* is the center of the various peaks and the position of\n the step down\n - *fwhm* is the full-width at half maximum of the terms\n - *st_area_r* is factor between the gaussian area and the area of the\n short tail term\n - *st_slope_r* is a ratio related to the slope of the short tail\n in the low ``x`` values (the lower, the steeper)\n - *lt_area_r* is ratio between the gaussian area and the area of the\n long tail term\n - *lt_slope_r* is a ratio related to the slope of the long tail\n in the low ``x`` values (the lower, the steeper)\n - *step_height_r* is the ratio between the height of the step down\n and the gaussian height\n\n A hypermet function is a sum of four functions (terms):\n\n - a gaussian term\n - a long tail term\n - a short tail term\n - a step down term\n\n :param x: Independent variable where the hypermets are calculated\n :type x: numpy.ndarray\n :param params: Array of hypermet parameters (length must be a multiple\n of 8):\n *(area1, position1, fwhm1, st_area_r1, st_slope_r1, lt_area_r1,\n lt_slope_r1, step_height_r1...)*\n :param gaussian_term: If ``True``, enable gaussian term. Default ``True``\n :param st_term: If ``True``, enable gaussian term. Default ``True``\n :param lt_term: If ``True``, enable gaussian term. Default ``True``\n :param step_term: If ``True``, enable gaussian term. Default ``True``\n :return: Array of sum of hypermet functions at each ``x`` coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_31sum_ahypermet = {"sum_ahypermet", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_31sum_ahypermet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_30sum_ahypermet};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_gaussian_term = 0;
PyObject *__pyx_v_st_term = 0;
PyObject *__pyx_v_lt_term = 0;
PyObject *__pyx_v_step_term = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_ahypermet (wrapper)", 0);
@@ -9644,7 +10774,7 @@ static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObj
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_gaussian_term,&__pyx_n_s_st_term,&__pyx_n_s_lt_term,&__pyx_n_s_step_term,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "functions.pyx":768
+ /* "silx/math/fit/functions.pyx":767
*
* def sum_ahypermet(x, *params,
* gaussian_term=True, st_term=True, lt_term=True, step_term=True): # <<<<<<<<<<<<<<
@@ -9678,7 +10808,7 @@ static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObj
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_ahypermet") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_ahypermet") < 0)) __PYX_ERR(0, 766, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -9693,16 +10823,16 @@ static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_ahypermet", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_ahypermet", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 766, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_ahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_ahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_30sum_ahypermet(__pyx_self, __pyx_v_x, __pyx_v_gaussian_term, __pyx_v_st_term, __pyx_v_lt_term, __pyx_v_step_term, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_30sum_ahypermet(__pyx_self, __pyx_v_x, __pyx_v_gaussian_term, __pyx_v_st_term, __pyx_v_lt_term, __pyx_v_step_term, __pyx_v_params);
- /* "functions.pyx":767
+ /* "silx/math/fit/functions.pyx":766
*
*
* def sum_ahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -9716,7 +10846,7 @@ static PyObject *__pyx_pw_9functions_31sum_ahypermet(PyObject *__pyx_self, PyObj
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -9732,60 +10862,64 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_ahypermet", 0);
- /* "functions.pyx":812
+ /* "silx/math/fit/functions.pyx":811
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 8 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 811, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":813
+ /* "silx/math/fit/functions.pyx":812
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 8 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_8_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_8_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 812, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 812, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":811
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 8 parameters are required.")
+ */
}
- /* "functions.pyx":817
+ /* "silx/math/fit/functions.pyx":816
*
* # Sum binary flags to activate various terms of the equation
* tail_flags = 1 if gaussian_term else 0 # <<<<<<<<<<<<<<
* if st_term:
* tail_flags += 2
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gaussian_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gaussian_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 816, __pyx_L1_error)
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_int_1);
__pyx_t_3 = __pyx_int_1;
@@ -9796,394 +10930,412 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
__pyx_v_tail_flags = __pyx_t_3;
__pyx_t_3 = 0;
- /* "functions.pyx":818
+ /* "silx/math/fit/functions.pyx":817
* # Sum binary flags to activate various terms of the equation
* tail_flags = 1 if gaussian_term else 0
* if st_term: # <<<<<<<<<<<<<<
* tail_flags += 2
* if lt_term:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_st_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_st_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 817, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":819
+ /* "silx/math/fit/functions.pyx":818
* tail_flags = 1 if gaussian_term else 0
* if st_term:
* tail_flags += 2 # <<<<<<<<<<<<<<
* if lt_term:
* tail_flags += 4
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_2, 2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L4;
+
+ /* "silx/math/fit/functions.pyx":817
+ * # Sum binary flags to activate various terms of the equation
+ * tail_flags = 1 if gaussian_term else 0
+ * if st_term: # <<<<<<<<<<<<<<
+ * tail_flags += 2
+ * if lt_term:
+ */
}
- __pyx_L4:;
- /* "functions.pyx":820
+ /* "silx/math/fit/functions.pyx":819
* if st_term:
* tail_flags += 2
* if lt_term: # <<<<<<<<<<<<<<
* tail_flags += 4
* if step_term:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 819, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":821
+ /* "silx/math/fit/functions.pyx":820
* tail_flags += 2
* if lt_term:
* tail_flags += 4 # <<<<<<<<<<<<<<
* if step_term:
* tail_flags += 8
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_4, 4, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L5;
+
+ /* "silx/math/fit/functions.pyx":819
+ * if st_term:
+ * tail_flags += 2
+ * if lt_term: # <<<<<<<<<<<<<<
+ * tail_flags += 4
+ * if step_term:
+ */
}
- __pyx_L5:;
- /* "functions.pyx":822
+ /* "silx/math/fit/functions.pyx":821
* if lt_term:
* tail_flags += 4
* if step_term: # <<<<<<<<<<<<<<
* tail_flags += 8
*
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 821, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":823
+ /* "silx/math/fit/functions.pyx":822
* tail_flags += 4
* if step_term:
* tail_flags += 8 # <<<<<<<<<<<<<<
*
* x_c = numpy.array(x,
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_8, 8, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 822, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L6;
+
+ /* "silx/math/fit/functions.pyx":821
+ * if lt_term:
+ * tail_flags += 4
+ * if step_term: # <<<<<<<<<<<<<<
+ * tail_flags += 8
+ *
+ */
}
- __pyx_L6:;
- /* "functions.pyx":825
+ /* "silx/math/fit/functions.pyx":824
* tail_flags += 8
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 824, __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[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":826
+ /* "silx/math/fit/functions.pyx":825
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
- /* "functions.pyx":827
+ /* "silx/math/fit/functions.pyx":826
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 826, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 825, __pyx_L1_error)
- /* "functions.pyx":825
+ /* "silx/math/fit/functions.pyx":824
* tail_flags += 8
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":828
+ /* "silx/math/fit/functions.pyx":827
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 827, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 827, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":829
+ /* "silx/math/fit/functions.pyx":828
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":830
+ /* "silx/math/fit/functions.pyx":829
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
- /* "functions.pyx":831
+ /* "silx/math/fit/functions.pyx":830
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 830, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 829, __pyx_L1_error)
- /* "functions.pyx":829
+ /* "silx/math/fit/functions.pyx":828
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 828, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":832
+ /* "silx/math/fit/functions.pyx":831
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 831, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":833
+ /* "silx/math/fit/functions.pyx":832
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 832, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":834
+ /* "silx/math/fit/functions.pyx":833
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_ahypermet(&x_c[0],
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 833, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":833
+ /* "silx/math/fit/functions.pyx":832
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":836
+ /* "silx/math/fit/functions.pyx":835
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_ahypermet(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 835, __pyx_L1_error)
}
- /* "functions.pyx":837
+ /* "silx/math/fit/functions.pyx":836
*
* status = functions_wrapper.sum_ahypermet(&x_c[0],
* x.size, # <<<<<<<<<<<<<<
* &params_c[0],
* params_c.size,
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 836, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":838
+ /* "silx/math/fit/functions.pyx":837
* status = functions_wrapper.sum_ahypermet(&x_c[0],
* x.size,
* &params_c[0], # <<<<<<<<<<<<<<
* params_c.size,
* &y_c[0],
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 837, __pyx_L1_error)
}
- /* "functions.pyx":839
+ /* "silx/math/fit/functions.pyx":838
* x.size,
* &params_c[0],
* params_c.size, # <<<<<<<<<<<<<<
* &y_c[0],
* tail_flags)
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":840
+ /* "silx/math/fit/functions.pyx":839
* &params_c[0],
* params_c.size,
* &y_c[0], # <<<<<<<<<<<<<<
* tail_flags)
*
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 839, __pyx_L1_error)
}
- /* "functions.pyx":841
+ /* "silx/math/fit/functions.pyx":840
* params_c.size,
* &y_c[0],
* tail_flags) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_tail_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_tail_flags); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 840, __pyx_L1_error)
- /* "functions.pyx":836
+ /* "silx/math/fit/functions.pyx":835
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_ahypermet(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_v_status = sum_ahypermet((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))), __pyx_t_15);
+ __pyx_v_status = sum_ahypermet((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))), __pyx_t_14);
- /* "functions.pyx":843
+ /* "silx/math/fit/functions.pyx":842
* tail_flags)
*
* if status: # <<<<<<<<<<<<<<
@@ -10193,21 +11345,29 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":844
+ /* "silx/math/fit/functions.pyx":843
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 843, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":842
+ * tail_flags)
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":846
+ /* "silx/math/fit/functions.pyx":845
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -10215,15 +11375,15 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
*
*/
__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 = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -10233,57 +11393,97 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":767
+ /* "silx/math/fit/functions.pyx":766
*
*
* def sum_ahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -10299,10 +11499,8 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_ahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_ahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -10314,7 +11512,7 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
return __pyx_r;
}
-/* "functions.pyx":849
+/* "silx/math/fit/functions.pyx":848
*
*
* def sum_fastahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -10323,19 +11521,16 @@ static PyObject *__pyx_pf_9functions_30sum_ahypermet(CYTHON_UNUSED PyObject *__p
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_32sum_fastahypermet[] = "sum_fastahypermet(x, *params, gaussian_term=True, st_term=True, lt_term=True, step_term=True)\nReturn a sum of hypermet functions defined by *(area, position, fwhm,\n st_area_r, st_slope_r, lt_area_r, lt_slope_r, step_height_r)*.\n\n - *area* is the area underneath the gaussian peak\n - *position* is the center of the various peaks and the position of\n the step down\n - *fwhm* is the full-width at half maximum of the terms\n - *st_area_r* is factor between the gaussian area and the area of the\n short tail term\n - *st_slope_r* is a parameter related to the slope of the short tail\n in the low ``x`` values (the lower, the steeper)\n - *lt_area_r* is factor between the gaussian area and the area of the\n long tail term\n - *lt_slope_r* is a parameter related to the slope of the long tail\n in the low ``x`` values (the lower, the steeper)\n - *step_height_r* is the factor between the height of the step down\n and the gaussian height\n\n A hypermet function is a sum of four functions (terms):\n\n - a gaussian term\n - a long tail term\n - a short tail term\n - a step down term\n\n This function differs from :func:`sum_ahypermet` by the use of a lookup\n table for calculating exponentials. This offers better performance when\n calculating many functions for large ``x`` arrays.\n\n :param x: Independant variable where the hypermets are calculated\n :type x: numpy.ndarray\n :param params: Array of hypermet parameters (length must be a multiple\n of 8):\n *(area1, position1, fwhm1, st_area_r1, st_slope_r1, lt_area_r1,\n lt_slope_r1, step_height_r1...)*\n :param gaussian_term: If ``True``, enable gaussian term. Default ``True``\n :param st_term: If ``True``, enable gaussian term. Default ``True``\n :param lt_term: If ``True``, enable gaussian term. Default ``True``\n :param step_t""erm: If ``True``, enable gaussian term. Default ``True``\n :return: Array of sum of hypermet functions at each ``x`` coordinate\n ";
-static PyMethodDef __pyx_mdef_9functions_33sum_fastahypermet = {"sum_fastahypermet", (PyCFunction)__pyx_pw_9functions_33sum_fastahypermet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_32sum_fastahypermet};
-static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_33sum_fastahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_32sum_fastahypermet[] = "sum_fastahypermet(x, *params, gaussian_term=True, st_term=True, lt_term=True, step_term=True)\nReturn a sum of hypermet functions defined by *(area, position, fwhm,\n st_area_r, st_slope_r, lt_area_r, lt_slope_r, step_height_r)*.\n\n - *area* is the area underneath the gaussian peak\n - *position* is the center of the various peaks and the position of\n the step down\n - *fwhm* is the full-width at half maximum of the terms\n - *st_area_r* is factor between the gaussian area and the area of the\n short tail term\n - *st_slope_r* is a parameter related to the slope of the short tail\n in the low ``x`` values (the lower, the steeper)\n - *lt_area_r* is factor between the gaussian area and the area of the\n long tail term\n - *lt_slope_r* is a parameter related to the slope of the long tail\n in the low ``x`` values (the lower, the steeper)\n - *step_height_r* is the factor between the height of the step down\n and the gaussian height\n\n A hypermet function is a sum of four functions (terms):\n\n - a gaussian term\n - a long tail term\n - a short tail term\n - a step down term\n\n This function differs from :func:`sum_ahypermet` by the use of a lookup\n table for calculating exponentials. This offers better performance when\n calculating many functions for large ``x`` arrays.\n\n :param x: Independent variable where the hypermets are calculated\n :type x: numpy.ndarray\n :param params: Array of hypermet parameters (length must be a multiple\n of 8):\n *(area1, position1, fwhm1, st_area_r1, st_slope_r1, lt_area_r1,\n lt_slope_r1, step_height_r1...)*\n :param gaussian_term: If ``True``, enable gaussian term. Default ``True``\n :param st_term: If ``True``, enable gaussian term. Default ``True``\n :param lt_term: If ``True``, enable gaussian term. Default ``True``\n :param step_t""erm: If ``True``, enable gaussian term. Default ``True``\n :return: Array of sum of hypermet functions at each ``x`` coordinate\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_33sum_fastahypermet = {"sum_fastahypermet", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_33sum_fastahypermet, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_32sum_fastahypermet};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_33sum_fastahypermet(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_gaussian_term = 0;
PyObject *__pyx_v_st_term = 0;
PyObject *__pyx_v_lt_term = 0;
PyObject *__pyx_v_step_term = 0;
PyObject *__pyx_v_params = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("sum_fastahypermet (wrapper)", 0);
@@ -10353,7 +11548,7 @@ static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, P
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_gaussian_term,&__pyx_n_s_st_term,&__pyx_n_s_lt_term,&__pyx_n_s_step_term,0};
PyObject* values[5] = {0,0,0,0,0};
- /* "functions.pyx":850
+ /* "silx/math/fit/functions.pyx":849
*
* def sum_fastahypermet(x, *params,
* gaussian_term=True, st_term=True, # <<<<<<<<<<<<<<
@@ -10363,7 +11558,7 @@ static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, P
values[1] = ((PyObject *)Py_True);
values[2] = ((PyObject *)Py_True);
- /* "functions.pyx":851
+ /* "silx/math/fit/functions.pyx":850
* def sum_fastahypermet(x, *params,
* gaussian_term=True, st_term=True,
* lt_term=True, step_term=True): # <<<<<<<<<<<<<<
@@ -10395,7 +11590,7 @@ static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, P
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_fastahypermet") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "sum_fastahypermet") < 0)) __PYX_ERR(0, 848, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -10410,16 +11605,16 @@ static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, P
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("sum_fastahypermet", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("sum_fastahypermet", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 848, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_params); __pyx_v_params = 0;
- __Pyx_AddTraceback("functions.sum_fastahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_fastahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_32sum_fastahypermet(__pyx_self, __pyx_v_x, __pyx_v_gaussian_term, __pyx_v_st_term, __pyx_v_lt_term, __pyx_v_step_term, __pyx_v_params);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_32sum_fastahypermet(__pyx_self, __pyx_v_x, __pyx_v_gaussian_term, __pyx_v_st_term, __pyx_v_lt_term, __pyx_v_step_term, __pyx_v_params);
- /* "functions.pyx":849
+ /* "silx/math/fit/functions.pyx":848
*
*
* def sum_fastahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -10433,7 +11628,7 @@ static PyObject *__pyx_pw_9functions_33sum_fastahypermet(PyObject *__pyx_self, P
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_gaussian_term, PyObject *__pyx_v_st_term, PyObject *__pyx_v_lt_term, PyObject *__pyx_v_step_term, PyObject *__pyx_v_params) {
__Pyx_memviewslice __pyx_v_x_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_params_c = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
@@ -10449,60 +11644,64 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
__Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- int __pyx_t_13;
- Py_ssize_t __pyx_t_14;
- int __pyx_t_15;
- PyObject *__pyx_t_16 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_9;
+ int __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ int __pyx_t_14;
+ PyObject *__pyx_t_15 = NULL;
__Pyx_RefNannySetupContext("sum_fastahypermet", 0);
- /* "functions.pyx":898
+ /* "silx/math/fit/functions.pyx":897
* double[::1] y_c
*
* if not len(params): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 8 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_params); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 897, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":899
+ /* "silx/math/fit/functions.pyx":898
*
* if not len(params):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 8 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_8_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_8_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 898, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":897
+ * double[::1] y_c
+ *
+ * if not len(params): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 8 parameters are required.")
+ */
}
- /* "functions.pyx":903
+ /* "silx/math/fit/functions.pyx":902
*
* # Sum binary flags to activate various terms of the equation
* tail_flags = 1 if gaussian_term else 0 # <<<<<<<<<<<<<<
* if st_term:
* tail_flags += 2
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gaussian_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gaussian_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
if (__pyx_t_2) {
__Pyx_INCREF(__pyx_int_1);
__pyx_t_3 = __pyx_int_1;
@@ -10513,394 +11712,412 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
__pyx_v_tail_flags = __pyx_t_3;
__pyx_t_3 = 0;
- /* "functions.pyx":904
+ /* "silx/math/fit/functions.pyx":903
* # Sum binary flags to activate various terms of the equation
* tail_flags = 1 if gaussian_term else 0
* if st_term: # <<<<<<<<<<<<<<
* tail_flags += 2
* if lt_term:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_st_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_st_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 903, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":905
+ /* "silx/math/fit/functions.pyx":904
* tail_flags = 1 if gaussian_term else 0
* if st_term:
* tail_flags += 2 # <<<<<<<<<<<<<<
* if lt_term:
* tail_flags += 4
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_2, 2, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 904, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L4;
+
+ /* "silx/math/fit/functions.pyx":903
+ * # Sum binary flags to activate various terms of the equation
+ * tail_flags = 1 if gaussian_term else 0
+ * if st_term: # <<<<<<<<<<<<<<
+ * tail_flags += 2
+ * if lt_term:
+ */
}
- __pyx_L4:;
- /* "functions.pyx":906
+ /* "silx/math/fit/functions.pyx":905
* if st_term:
* tail_flags += 2
* if lt_term: # <<<<<<<<<<<<<<
* tail_flags += 4
* if step_term:
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lt_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 905, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":907
+ /* "silx/math/fit/functions.pyx":906
* tail_flags += 2
* if lt_term:
* tail_flags += 4 # <<<<<<<<<<<<<<
* if step_term:
* tail_flags += 8
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_4, 4, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L5;
+
+ /* "silx/math/fit/functions.pyx":905
+ * if st_term:
+ * tail_flags += 2
+ * if lt_term: # <<<<<<<<<<<<<<
+ * tail_flags += 4
+ * if step_term:
+ */
}
- __pyx_L5:;
- /* "functions.pyx":908
+ /* "silx/math/fit/functions.pyx":907
* if lt_term:
* tail_flags += 4
* if step_term: # <<<<<<<<<<<<<<
* tail_flags += 8
*
*/
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step_term); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_step_term); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
if (__pyx_t_2) {
- /* "functions.pyx":909
+ /* "silx/math/fit/functions.pyx":908
* tail_flags += 4
* if step_term:
* tail_flags += 8 # <<<<<<<<<<<<<<
*
* # TODO (maybe):
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tail_flags, __pyx_int_8); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_tail_flags, __pyx_int_8, 8, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_tail_flags, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L6;
+
+ /* "silx/math/fit/functions.pyx":907
+ * if lt_term:
+ * tail_flags += 4
+ * if step_term: # <<<<<<<<<<<<<<
+ * tail_flags += 8
+ *
+ */
}
- __pyx_L6:;
- /* "functions.pyx":918
+ /* "silx/math/fit/functions.pyx":917
* # lt_slope_r (params[8*i + 6]) and lt_term.
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 917, __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[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
__Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_x);
- /* "functions.pyx":919
+ /* "silx/math/fit/functions.pyx":918
*
* x_c = numpy.array(x,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 918, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 918, __pyx_L1_error)
- /* "functions.pyx":920
+ /* "silx/math/fit/functions.pyx":919
* x_c = numpy.array(x,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* params_c = numpy.array(params,
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 919, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 918, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 918, __pyx_L1_error)
- /* "functions.pyx":918
+ /* "silx/math/fit/functions.pyx":917
* # lt_slope_r (params[8*i + 6]) and lt_term.
*
* x_c = numpy.array(x, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":921
+ /* "silx/math/fit/functions.pyx":920
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 920, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 920, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_v_x_c = __pyx_t_8;
__pyx_t_8.memview = NULL;
__pyx_t_8.data = NULL;
- /* "functions.pyx":922
+ /* "silx/math/fit/functions.pyx":921
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_params);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
__Pyx_GIVEREF(__pyx_v_params);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_params);
- /* "functions.pyx":923
+ /* "silx/math/fit/functions.pyx":922
* order='C').reshape(-1)
* params_c = numpy.array(params,
* copy=False, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 922, __pyx_L1_error)
- /* "functions.pyx":924
+ /* "silx/math/fit/functions.pyx":923
* params_c = numpy.array(params,
* copy=False,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 923, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 922, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 922, __pyx_L1_error)
- /* "functions.pyx":922
+ /* "silx/math/fit/functions.pyx":921
* dtype=numpy.float64,
* order='C').reshape(-1)
* params_c = numpy.array(params, # <<<<<<<<<<<<<<
* copy=False,
* dtype=numpy.float64,
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 921, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":925
+ /* "silx/math/fit/functions.pyx":924
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_6);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_params_c = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
+ __pyx_v_params_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":926
+ /* "silx/math/fit/functions.pyx":925
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 925, __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, 0, __pyx_t_7);
__pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_shape, __pyx_t_5) < 0) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":927
+ /* "silx/math/fit/functions.pyx":926
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* status = functions_wrapper.sum_fastahypermet(&x_c[0],
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 926, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":926
+ /* "silx/math/fit/functions.pyx":925
* dtype=numpy.float64,
* order='C').reshape(-1)
* y_c = numpy.empty(shape=(x.size,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_7);
+ if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 925, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_y_c = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
+ __pyx_v_y_c = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
- /* "functions.pyx":929
+ /* "silx/math/fit/functions.pyx":928
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_fastahypermet(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_t_1 = 0;
- __pyx_t_11 = -1;
- if (__pyx_t_1 < 0) {
- __pyx_t_1 += __pyx_v_x_c.shape[0];
- if (unlikely(__pyx_t_1 < 0)) __pyx_t_11 = 0;
- } else if (unlikely(__pyx_t_1 >= __pyx_v_x_c.shape[0])) __pyx_t_11 = 0;
- if (unlikely(__pyx_t_11 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_11);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = 0;
+ __pyx_t_10 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_x_c.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_10 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_x_c.shape[0])) __pyx_t_10 = 0;
+ if (unlikely(__pyx_t_10 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_10);
+ __PYX_ERR(0, 928, __pyx_L1_error)
}
- /* "functions.pyx":930
+ /* "silx/math/fit/functions.pyx":929
*
* status = functions_wrapper.sum_fastahypermet(&x_c[0],
* x.size, # <<<<<<<<<<<<<<
* &params_c[0],
* params_c.size,
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 929, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 929, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "functions.pyx":931
+ /* "silx/math/fit/functions.pyx":930
* status = functions_wrapper.sum_fastahypermet(&x_c[0],
* x.size,
* &params_c[0], # <<<<<<<<<<<<<<
* params_c.size,
* &y_c[0],
*/
- __pyx_t_12 = 0;
- __pyx_t_13 = -1;
- if (__pyx_t_12 < 0) {
- __pyx_t_12 += __pyx_v_params_c.shape[0];
- if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 0;
- } else if (unlikely(__pyx_t_12 >= __pyx_v_params_c.shape[0])) __pyx_t_13 = 0;
- if (unlikely(__pyx_t_13 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_13);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = 0;
+ __pyx_t_12 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_params_c.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_params_c.shape[0])) __pyx_t_12 = 0;
+ if (unlikely(__pyx_t_12 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_12);
+ __PYX_ERR(0, 930, __pyx_L1_error)
}
- /* "functions.pyx":932
+ /* "silx/math/fit/functions.pyx":931
* x.size,
* &params_c[0],
* params_c.size, # <<<<<<<<<<<<<<
* &y_c[0],
* tail_flags)
*/
- __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __pyx_memoryview_fromslice(__pyx_v_params_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 931, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_12 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 931, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- /* "functions.pyx":933
+ /* "silx/math/fit/functions.pyx":932
* &params_c[0],
* params_c.size,
* &y_c[0], # <<<<<<<<<<<<<<
* tail_flags)
*
*/
- __pyx_t_14 = 0;
- __pyx_t_15 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_y_c.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_y_c.shape[0])) __pyx_t_15 = 0;
- if (unlikely(__pyx_t_15 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_15);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_13 = 0;
+ __pyx_t_14 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_y_c.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_y_c.shape[0])) __pyx_t_14 = 0;
+ if (unlikely(__pyx_t_14 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_14);
+ __PYX_ERR(0, 932, __pyx_L1_error)
}
- /* "functions.pyx":934
+ /* "silx/math/fit/functions.pyx":933
* params_c.size,
* &y_c[0],
* tail_flags) # <<<<<<<<<<<<<<
*
* if status:
*/
- __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_v_tail_flags); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_v_tail_flags); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L1_error)
- /* "functions.pyx":929
+ /* "silx/math/fit/functions.pyx":928
* dtype=numpy.float64)
*
* status = functions_wrapper.sum_fastahypermet(&x_c[0], # <<<<<<<<<<<<<<
* x.size,
* &params_c[0],
*/
- __pyx_v_status = sum_fastahypermet((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_1)) )))), __pyx_t_11, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_12)) )))), __pyx_t_13, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_14)) )))), __pyx_t_15);
+ __pyx_v_status = sum_fastahypermet((&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_x_c.data) + __pyx_t_9)) )))), __pyx_t_10, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_params_c.data) + __pyx_t_11)) )))), __pyx_t_12, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_13)) )))), __pyx_t_14);
- /* "functions.pyx":936
+ /* "silx/math/fit/functions.pyx":935
* tail_flags)
*
* if status: # <<<<<<<<<<<<<<
@@ -10910,21 +12127,29 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
__pyx_t_2 = (__pyx_v_status != 0);
if (__pyx_t_2) {
- /* "functions.pyx":937
+ /* "silx/math/fit/functions.pyx":936
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 936, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 936, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":935
+ * tail_flags)
+ *
+ * if status: # <<<<<<<<<<<<<<
+ * raise IndexError("Wrong number of parameters for function")
+ *
+ */
}
- /* "functions.pyx":939
+ /* "silx/math/fit/functions.pyx":938
* raise IndexError("Wrong number of parameters for function")
*
* return numpy.asarray(y_c).reshape(x.shape) # <<<<<<<<<<<<<<
@@ -10932,15 +12157,15 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
*
*/
__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 = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_asarray); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -10950,57 +12175,97 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
}
}
if (!__pyx_t_4) {
- __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_GOTREF(__pyx_t_7);
} else {
- __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_16);
- PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_16, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_3};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_15 = PyTuple_New(1+1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_15, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_reshape); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_16 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
- __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_5);
- if (likely(__pyx_t_16)) {
+ __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_15)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
- __Pyx_INCREF(__pyx_t_16);
+ __Pyx_INCREF(__pyx_t_15);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
}
}
- if (!__pyx_t_16) {
- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!__pyx_t_15) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__Pyx_GOTREF(__pyx_t_6);
} else {
- __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16); __Pyx_GIVEREF(__pyx_t_16); __pyx_t_16 = NULL;
- PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_15, __pyx_t_7};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_15); __pyx_t_15 = NULL;
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":849
+ /* "silx/math/fit/functions.pyx":848
*
*
* def sum_fastahypermet(x, *params, # <<<<<<<<<<<<<<
@@ -11016,10 +12281,8 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
__PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __Pyx_XDECREF(__pyx_t_16);
- __Pyx_AddTraceback("functions.sum_fastahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("silx.math.fit.functions.sum_fastahypermet", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_x_c, 1);
@@ -11031,7 +12294,7 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
return __pyx_r;
}
-/* "functions.pyx":942
+/* "silx/math/fit/functions.pyx":941
*
*
* def atan_stepup(x, a, b, c): # <<<<<<<<<<<<<<
@@ -11040,17 +12303,14 @@ static PyObject *__pyx_pf_9functions_32sum_fastahypermet(CYTHON_UNUSED PyObject
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_35atan_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_34atan_stepup[] = "atan_stepup(x, a, b, c)\n\n Step up function using an inverse tangent.\n\n :param x: Independant variable where the function is calculated\n :type x: numpy array\n :param a: Height of the step up\n :param b: Center of the step up\n :param c: Parameter related to the slope of the step. A lower ``c``\n value yields a sharper step.\n :return: ``a * (0.5 + (arctan((x - b) / c) / pi))``\n :rtype: numpy array\n ";
-static PyMethodDef __pyx_mdef_9functions_35atan_stepup = {"atan_stepup", (PyCFunction)__pyx_pw_9functions_35atan_stepup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_34atan_stepup};
-static PyObject *__pyx_pw_9functions_35atan_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_35atan_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_34atan_stepup[] = "atan_stepup(x, a, b, c)\n\n Step up function using an inverse tangent.\n\n :param x: Independent variable where the function is calculated\n :type x: numpy array\n :param a: Height of the step up\n :param b: Center of the step up\n :param c: Parameter related to the slope of the step. A lower ``c``\n value yields a sharper step.\n :return: ``a * (0.5 + (arctan((x - b) / c) / pi))``\n :rtype: numpy array\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_35atan_stepup = {"atan_stepup", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_35atan_stepup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_34atan_stepup};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_35atan_stepup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_a = 0;
PyObject *__pyx_v_b = 0;
PyObject *__pyx_v_c = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("atan_stepup (wrapper)", 0);
@@ -11076,21 +12336,21 @@ static PyObject *__pyx_pw_9functions_35atan_stepup(PyObject *__pyx_self, PyObjec
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 1); __PYX_ERR(0, 941, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 2); __PYX_ERR(0, 941, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, 3); __PYX_ERR(0, 941, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atan_stepup") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "atan_stepup") < 0)) __PYX_ERR(0, 941, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
goto __pyx_L5_argtuple_error;
@@ -11107,20 +12367,20 @@ static PyObject *__pyx_pw_9functions_35atan_stepup(PyObject *__pyx_self, PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("atan_stepup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 941, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("functions.atan_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.atan_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_34atan_stepup(__pyx_self, __pyx_v_x, __pyx_v_a, __pyx_v_b, __pyx_v_c);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_34atan_stepup(__pyx_self, __pyx_v_x, __pyx_v_a, __pyx_v_b, __pyx_v_c);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -11130,37 +12390,34 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("atan_stepup", 0);
__Pyx_INCREF(__pyx_v_x);
- /* "functions.pyx":955
+ /* "silx/math/fit/functions.pyx":954
* :rtype: numpy array
* """
* if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
* x = numpy.array(x)
* return a * (0.5 + (numpy.arctan((1.0 * x - b) / c) / numpy.pi))
*/
- __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, __pyx_n_s_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 954, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":956
+ /* "silx/math/fit/functions.pyx":955
* """
* if not hasattr(x, "shape"):
* x = numpy.array(x) # <<<<<<<<<<<<<<
* return a * (0.5 + (numpy.arctan((1.0 * x - b) / c) / numpy.pi))
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
@@ -11170,27 +12427,51 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 955, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_x, __pyx_t_3);
__pyx_t_3 = 0;
- goto __pyx_L3;
+
+ /* "silx/math/fit/functions.pyx":954
+ * :rtype: numpy array
+ * """
+ * if not hasattr(x, "shape"): # <<<<<<<<<<<<<<
+ * x = numpy.array(x)
+ * return a * (0.5 + (numpy.arctan((1.0 * x - b) / c) / numpy.pi))
+ */
}
- __pyx_L3:;
- /* "functions.pyx":957
+ /* "silx/math/fit/functions.pyx":956
* if not hasattr(x, "shape"):
* x = numpy.array(x)
* return a * (0.5 + (numpy.arctan((1.0 * x - b) / c) / numpy.pi)) # <<<<<<<<<<<<<<
@@ -11198,21 +12479,21 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arctan); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arctan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_x); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyNumber_Multiply(__pyx_float_1_0, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_v_b); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_t_5, __pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_c); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_c); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
@@ -11222,41 +12503,61 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
}
}
if (!__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pi); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pi); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyNumber_Add(__pyx_float_0_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyFloat_AddCObj(__pyx_float_0_5, __pyx_t_6, 0.5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyNumber_Multiply(__pyx_v_a, __pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Multiply(__pyx_v_a, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
__pyx_r = __pyx_t_6;
__pyx_t_6 = 0;
goto __pyx_L0;
- /* "functions.pyx":942
+ /* "silx/math/fit/functions.pyx":941
*
*
* def atan_stepup(x, a, b, c): # <<<<<<<<<<<<<<
@@ -11271,7 +12572,7 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("functions.atan_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.atan_stepup", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_x);
@@ -11280,7 +12581,7 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
return __pyx_r;
}
-/* "functions.pyx":960
+/* "silx/math/fit/functions.pyx":959
*
*
* def periodic_gauss(x, *pars): # <<<<<<<<<<<<<<
@@ -11289,15 +12590,12 @@ static PyObject *__pyx_pf_9functions_34atan_stepup(CYTHON_UNUSED PyObject *__pyx
*/
/* Python wrapper */
-static PyObject *__pyx_pw_9functions_37periodic_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_9functions_36periodic_gauss[] = "periodic_gauss(x, *pars)\n\n Return a sum of gaussian functions defined by\n *(npeaks, delta, height, centroid, fwhm)*,\n where:\n\n - *npeaks* is the number of gaussians peaks\n - *delta* is the constant distance between 2 peaks\n - *height* is the peak amplitude of all the gaussians\n - *centroid* is the peak x-coordinate of the first gaussian\n - *fwhm* is the full-width at half maximum for all the gaussians\n\n :param x: Independant variable where the function is calculated\n :param pars: *(npeaks, delta, height, centroid, fwhm)*\n :return: Sum of ``npeaks`` gaussians\n ";
-static PyMethodDef __pyx_mdef_9functions_37periodic_gauss = {"periodic_gauss", (PyCFunction)__pyx_pw_9functions_37periodic_gauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9functions_36periodic_gauss};
-static PyObject *__pyx_pw_9functions_37periodic_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_37periodic_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_9functions_36periodic_gauss[] = "periodic_gauss(x, *pars)\n\n Return a sum of gaussian functions defined by\n *(npeaks, delta, height, centroid, fwhm)*,\n where:\n\n - *npeaks* is the number of gaussians peaks\n - *delta* is the constant distance between 2 peaks\n - *height* is the peak amplitude of all the gaussians\n - *centroid* is the peak x-coordinate of the first gaussian\n - *fwhm* is the full-width at half maximum for all the gaussians\n\n :param x: Independent variable where the function is calculated\n :param pars: *(npeaks, delta, height, centroid, fwhm)*\n :return: Sum of ``npeaks`` gaussians\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_9functions_37periodic_gauss = {"periodic_gauss", (PyCFunction)__pyx_pw_4silx_4math_3fit_9functions_37periodic_gauss, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_9functions_36periodic_gauss};
+static PyObject *__pyx_pw_4silx_4math_3fit_9functions_37periodic_gauss(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_x = 0;
PyObject *__pyx_v_pars = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("periodic_gauss (wrapper)", 0);
@@ -11330,7 +12628,7 @@ static PyObject *__pyx_pw_9functions_37periodic_gauss(PyObject *__pyx_self, PyOb
}
if (unlikely(kw_args > 0)) {
const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "periodic_gauss") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "periodic_gauss") < 0)) __PYX_ERR(0, 959, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
goto __pyx_L5_argtuple_error;
@@ -11341,14 +12639,14 @@ static PyObject *__pyx_pw_9functions_37periodic_gauss(PyObject *__pyx_self, PyOb
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("periodic_gauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("periodic_gauss", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 959, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_DECREF(__pyx_v_pars); __pyx_v_pars = 0;
- __Pyx_AddTraceback("functions.periodic_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.functions.periodic_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_9functions_36periodic_gauss(__pyx_self, __pyx_v_x, __pyx_v_pars);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_9functions_36periodic_gauss(__pyx_self, __pyx_v_x, __pyx_v_pars);
/* function exit code */
__Pyx_XDECREF(__pyx_v_pars);
@@ -11356,7 +12654,7 @@ static PyObject *__pyx_pw_9functions_37periodic_gauss(PyObject *__pyx_self, PyOb
return __pyx_r;
}
-static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_pars) {
+static PyObject *__pyx_pf_4silx_4math_3fit_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_pars) {
PyObject *__pyx_v_newpars = NULL;
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_r = NULL;
@@ -11368,156 +12666,186 @@ static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- PyObject *(*__pyx_t_9)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *(*__pyx_t_10)(PyObject *);
__Pyx_RefNannySetupContext("periodic_gauss", 0);
- /* "functions.pyx":977
+ /* "silx/math/fit/functions.pyx":976
* """
*
* if not len(pars): # <<<<<<<<<<<<<<
* raise IndexError("No parameters specified. " +
* "At least 5 parameters are required.")
*/
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_pars); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_pars); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 976, __pyx_L1_error)
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "functions.pyx":978
+ /* "silx/math/fit/functions.pyx":977
*
* if not len(pars):
* raise IndexError("No parameters specified. " + # <<<<<<<<<<<<<<
* "At least 5 parameters are required.")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_5_parameters_are_requir); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_No_parameters_specified, __pyx_kp_s_At_least_5_parameters_are_requir); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 977, __pyx_L1_error)
+
+ /* "silx/math/fit/functions.pyx":976
+ * """
+ *
+ * if not len(pars): # <<<<<<<<<<<<<<
+ * raise IndexError("No parameters specified. " +
+ * "At least 5 parameters are required.")
+ */
}
- /* "functions.pyx":981
+ /* "silx/math/fit/functions.pyx":980
* "At least 5 parameters are required.")
*
* newpars = numpy.zeros((pars[0], 3), numpy.float) # <<<<<<<<<<<<<<
* for i in range(int(pars[0])):
* newpars[i, 0] = pars[2]
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
__Pyx_INCREF(__pyx_int_3);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
__Pyx_GIVEREF(__pyx_int_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_3);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_t_4 = NULL;
- __pyx_t_1 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
__Pyx_DECREF_SET(__pyx_t_5, function);
- __pyx_t_1 = 1;
+ __pyx_t_8 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_7};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_6, __pyx_t_7};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 980, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 980, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_1, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_newpars = __pyx_t_3;
__pyx_t_3 = 0;
- /* "functions.pyx":982
+ /* "silx/math/fit/functions.pyx":981
*
* newpars = numpy.zeros((pars[0], 3), numpy.float)
* for i in range(int(pars[0])): # <<<<<<<<<<<<<<
* newpars[i, 0] = pars[2]
* newpars[i, 1] = pars[3] + i * pars[1]
*/
- __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
__pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
- __pyx_t_9 = NULL;
+ __pyx_t_10 = NULL;
} else {
- __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 981, __pyx_L1_error)
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
- if (likely(!__pyx_t_9)) {
+ if (likely(!__pyx_t_10)) {
if (likely(PyList_CheckExact(__pyx_t_3))) {
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
} else {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
#else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
- __pyx_t_5 = __pyx_t_9(__pyx_t_3);
+ __pyx_t_5 = __pyx_t_10(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
PyObject* exc_type = PyErr_Occurred();
if (exc_type) {
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(0, 981, __pyx_L1_error)
}
break;
}
@@ -11526,69 +12854,69 @@ static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
__pyx_t_5 = 0;
- /* "functions.pyx":983
+ /* "silx/math/fit/functions.pyx":982
* newpars = numpy.zeros((pars[0], 3), numpy.float)
* for i in range(int(pars[0])):
* newpars[i, 0] = pars[2] # <<<<<<<<<<<<<<
* newpars[i, 1] = pars[3] + i * pars[1]
* newpars[:, 2] = pars[4]
*/
- __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 982, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 982, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_INCREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_i);
__Pyx_GIVEREF(__pyx_v_i);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_i);
__Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_int_0);
- if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_t_8, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_int_0);
+ if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_t_9, __pyx_t_5) < 0)) __PYX_ERR(0, 982, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "functions.pyx":984
+ /* "silx/math/fit/functions.pyx":983
* for i in range(int(pars[0])):
* newpars[i, 0] = pars[2]
* newpars[i, 1] = pars[3] + i * pars[1] # <<<<<<<<<<<<<<
* newpars[:, 2] = pars[4]
* return sum_gauss(x, newpars)
*/
- __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_5 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = PyNumber_Multiply(__pyx_v_i, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = PyNumber_Multiply(__pyx_v_i, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 983, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_i);
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_i);
__Pyx_GIVEREF(__pyx_v_i);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_i);
__Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1);
__Pyx_GIVEREF(__pyx_int_1);
- if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_t_7, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_int_1);
+ if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_t_7, __pyx_t_9) < 0)) __PYX_ERR(0, 983, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "functions.pyx":985
+ /* "silx/math/fit/functions.pyx":984
* newpars[i, 0] = pars[2]
* newpars[i, 1] = pars[3] + i * pars[1]
* newpars[:, 2] = pars[4] # <<<<<<<<<<<<<<
* return sum_gauss(x, newpars)
*/
- __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_8);
- if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_tuple__51, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v_pars, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (unlikely(PyObject_SetItem(__pyx_v_newpars, __pyx_tuple__51, __pyx_t_9) < 0)) __PYX_ERR(0, 984, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- /* "functions.pyx":982
+ /* "silx/math/fit/functions.pyx":981
*
* newpars = numpy.zeros((pars[0], 3), numpy.float)
* for i in range(int(pars[0])): # <<<<<<<<<<<<<<
@@ -11598,46 +12926,64 @@ static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "functions.pyx":986
+ /* "silx/math/fit/functions.pyx":985
* newpars[i, 1] = pars[3] + i * pars[1]
* newpars[:, 2] = pars[4]
* return sum_gauss(x, newpars) # <<<<<<<<<<<<<<
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sum_gauss); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sum_gauss); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 985, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__pyx_t_7 = NULL;
- __pyx_t_1 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
- __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_7)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_8, function);
- __pyx_t_1 = 1;
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_5 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (__pyx_t_7) {
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_x, __pyx_v_newpars};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_x, __pyx_v_newpars};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 985, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_8, __pyx_v_x);
+ __Pyx_INCREF(__pyx_v_newpars);
+ __Pyx_GIVEREF(__pyx_v_newpars);
+ PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_8, __pyx_v_newpars);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_1, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __Pyx_INCREF(__pyx_v_newpars);
- PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_1, __pyx_v_newpars);
- __Pyx_GIVEREF(__pyx_v_newpars);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
- /* "functions.pyx":960
+ /* "silx/math/fit/functions.pyx":959
*
*
* def periodic_gauss(x, *pars): # <<<<<<<<<<<<<<
@@ -11652,8 +12998,8 @@ static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("functions.periodic_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("silx.math.fit.functions.periodic_gauss", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_newpars);
@@ -11663,7 +13009,7 @@ static PyObject *__pyx_pf_9functions_36periodic_gauss(CYTHON_UNUSED PyObject *__
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -11679,9 +13025,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -11709,12 +13052,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -11728,7 +13071,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11742,14 +13085,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -11761,19 +13104,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -11790,7 +13133,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -11802,19 +13145,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -11823,12 +13163,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -11837,7 +13177,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -11847,21 +13187,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__52, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -11871,95 +13219,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -11969,43 +13330,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -12015,42 +13385,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -12059,7 +13437,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -12067,19 +13445,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -12088,7 +13466,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -12100,20 +13478,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -12122,7 +13508,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -12134,34 +13520,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -12170,7 +13564,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -12179,19 +13573,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -12201,7 +13595,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -12210,7 +13604,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -12220,21 +13614,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__55, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -12244,7 +13646,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -12253,7 +13655,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -12261,30 +13663,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -12293,7 +13683,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -12302,14 +13692,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -12322,7 +13724,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -12333,7 +13735,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12347,14 +13749,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -12365,16 +13767,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -12383,18 +13782,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12402,21 +13801,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12424,11 +13831,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -12438,21 +13852,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__56, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -12462,7 +13884,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -12472,7 +13894,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -12482,7 +13904,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -12492,7 +13914,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -12502,7 +13924,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -12511,7 +13933,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -12521,7 +13943,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -12530,7 +13952,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -12540,7 +13962,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -12549,22 +13971,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -12577,7 +14007,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -12607,7 +14037,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -12620,18 +14050,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -12641,7 +14071,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -12649,10 +14079,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -12662,7 +14100,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -12672,7 +14110,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -12680,32 +14118,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -12717,84 +14168,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -12802,15 +14297,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -12824,24 +14319,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -12849,16 +14341,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -12878,7 +14370,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -12892,24 +14384,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -12917,16 +14406,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -12946,7 +14435,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -12960,35 +14449,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -13008,7 +14494,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13025,12 +14511,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -13040,96 +14523,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -13140,7 +14631,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -13152,7 +14643,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -13175,7 +14666,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13187,9 +14678,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -13211,7 +14699,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -13222,25 +14710,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -13253,7 +14741,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -13267,7 +14755,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13281,19 +14769,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -13305,7 +14793,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -13320,7 +14808,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13334,7 +14822,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -13343,7 +14831,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -13352,7 +14840,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -13362,7 +14850,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -13370,21 +14858,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -13397,7 +14891,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -13411,9 +14905,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -13438,7 +14929,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -13447,7 +14938,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -13459,43 +14950,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -13508,7 +14994,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -13517,14 +15003,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -13537,16 +15023,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -13556,7 +15042,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -13565,90 +15051,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -13657,7 +15230,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -13666,7 +15239,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -13678,8 +15251,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -13687,7 +15258,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -13700,19 +15271,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -13723,41 +15299,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -13769,8 +15448,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -13790,12 +15469,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -13804,7 +15480,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -13816,25 +15492,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -13843,7 +15521,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -13854,18 +15532,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -13875,7 +15553,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -13885,8 +15563,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -13905,7 +15583,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -13919,14 +15597,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -13938,12 +15616,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -13954,7 +15629,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -13965,20 +15640,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -13986,39 +15669,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -14026,25 +15709,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -14052,14 +15743,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -14082,7 +15773,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14096,14 +15787,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -14112,24 +15803,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -14137,111 +15825,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -14266,7 +15970,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14286,24 +15990,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -14311,81 +16012,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -14402,12 +16114,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -14415,11 +16137,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -14431,7 +16159,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -14453,7 +16181,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14470,55 +16198,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -14539,7 +16264,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -14548,7 +16273,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -14566,12 +16291,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -14580,7 +16302,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -14589,7 +16311,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -14599,7 +16321,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -14608,7 +16330,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -14618,17 +16340,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -14636,22 +16366,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -14660,7 +16398,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -14670,7 +16408,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -14678,24 +16416,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -14705,21 +16451,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -14729,7 +16481,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -14742,8 +16494,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -14757,6 +16511,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -14774,7 +16529,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -14795,7 +16550,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -14809,33 +16564,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -14856,7 +16608,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -14877,41 +16629,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -14919,26 +16667,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -14948,38 +16698,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -14987,14 +16765,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -15007,51 +16793,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__57, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -15059,7 +16856,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15085,7 +16882,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15106,31 +16903,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -15141,53 +16936,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -15197,66 +17000,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -15265,9 +17088,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15284,7 +17107,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -15295,7 +17118,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15309,14 +17132,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -15331,7 +17154,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15341,7 +17164,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -15350,22 +17173,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -15375,7 +17206,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -15384,22 +17215,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -15409,7 +17248,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -15418,22 +17257,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -15443,7 +17290,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -15452,22 +17299,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -15477,7 +17332,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -15487,7 +17342,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -15497,7 +17352,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -15507,7 +17362,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -15516,7 +17371,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -15529,7 +17384,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -15547,78 +17402,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -15633,49 +17485,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -15686,77 +17538,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -15765,102 +17616,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -15869,110 +17727,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__60, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -15981,55 +17842,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -16044,55 +17902,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -16107,51 +17962,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -16159,11 +18011,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -16180,156 +18032,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_int_1);
__pyx_v_result = __pyx_int_1;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -16338,18 +18149,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -16360,8 +18170,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16374,20 +18184,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -16397,7 +18207,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -16406,9 +18216,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -16418,8 +18236,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -16432,7 +18250,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16446,25 +18264,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -16472,54 +18287,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -16540,7 +18355,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16554,24 +18369,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -16579,27 +18391,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -16619,7 +18431,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -16633,48 +18445,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -16693,8 +18502,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -16707,49 +18516,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -16767,8 +18573,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -16781,26 +18587,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -16809,7 +18612,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -16818,17 +18621,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -16836,14 +18639,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -16861,7 +18664,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -16875,14 +18678,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -16890,12 +18693,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -16904,7 +18704,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -16913,17 +18713,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -16931,13 +18731,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -16956,7 +18756,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -16971,40 +18771,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -17013,7 +18810,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -17025,7 +18822,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -17047,7 +18844,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17061,18 +18858,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -17086,7 +18883,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17115,12 +18912,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -17131,49 +18925,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -17182,7 +18984,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -17191,7 +18993,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17204,25 +19006,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -17231,7 +19035,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -17241,13 +19045,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -17258,7 +19062,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -17268,27 +19072,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__59);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__59);
- __Pyx_GIVEREF(__pyx_slice__59);
+ __Pyx_INCREF(__pyx_slice__61);
+ __Pyx_GIVEREF(__pyx_slice__61);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__61);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -17296,22 +19100,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__60); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__62); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -17319,17 +19131,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -17342,29 +19162,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -17383,18 +19211,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -17405,17 +19233,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -17425,29 +19253,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__61);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__61);
- __Pyx_GIVEREF(__pyx_slice__61);
+ __Pyx_INCREF(__pyx_slice__63);
+ __Pyx_GIVEREF(__pyx_slice__63);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__63);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -17457,32 +19291,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -17508,76 +19342,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -17586,7 +19427,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -17625,12 +19466,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -17640,7 +19478,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -17649,7 +19487,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -17660,36 +19498,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -17697,20 +19535,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -17721,7 +19567,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -17731,7 +19577,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -17741,7 +19587,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -17750,7 +19596,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -17759,7 +19605,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -17771,25 +19617,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -17798,7 +19646,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -17809,7 +19657,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -17819,27 +19667,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -17850,7 +19706,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -17859,7 +19715,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -17868,16 +19724,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -17885,24 +19741,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -17911,20 +19775,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -17933,20 +19797,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -17955,55 +19819,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -18014,7 +19878,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -18024,18 +19888,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -18044,73 +19908,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -18132,7 +20004,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -18147,11 +20019,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -18161,7 +20030,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -18171,7 +20040,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18179,11 +20048,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -18197,28 +20072,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -18230,7 +20119,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -18248,19 +20137,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -18270,7 +20165,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -18280,7 +20175,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -18289,7 +20184,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -18299,7 +20194,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -18307,13 +20202,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -18323,7 +20232,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -18333,7 +20242,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18341,38 +20250,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -18380,24 +20312,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -18407,7 +20347,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18417,7 +20357,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -18426,7 +20366,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -18436,7 +20376,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -18444,13 +20384,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -18460,7 +20414,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -18468,49 +20422,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -18520,7 +20497,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -18528,11 +20505,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -18541,7 +20524,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -18551,7 +20534,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -18559,11 +20542,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -18573,7 +20562,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -18581,11 +20570,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -18594,7 +20589,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -18603,7 +20598,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -18614,7 +20609,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -18624,7 +20619,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -18632,23 +20627,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -18658,7 +20661,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -18668,7 +20671,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -18678,7 +20681,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -18686,39 +20689,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -18728,7 +20761,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -18752,7 +20785,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -18772,21 +20805,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -18796,7 +20826,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -18806,7 +20836,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -18814,28 +20844,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -18843,20 +20861,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -18865,7 +20891,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -18875,7 +20901,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -18883,13 +20909,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -18899,7 +20931,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -18908,7 +20940,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -18918,35 +20950,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -18956,32 +21002,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -18990,7 +21044,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -19000,7 +21054,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -19008,11 +21062,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -19022,7 +21082,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -19041,7 +21101,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19064,11 +21124,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -19078,7 +21135,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -19088,7 +21145,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -19098,7 +21155,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -19109,7 +21166,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -19118,7 +21175,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -19130,7 +21187,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -19142,7 +21199,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -19160,20 +21217,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -19183,7 +21246,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -19207,7 +21270,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19220,17 +21283,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -19239,7 +21302,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -19251,7 +21314,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19264,12 +21327,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -19279,7 +21339,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -19287,30 +21347,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -19329,7 +21397,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19343,12 +21411,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -19358,32 +21423,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -19404,36 +21477,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -19442,11 +21515,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -19457,7 +21530,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -19467,7 +21540,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -19475,16 +21549,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -19493,7 +21565,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -19504,35 +21576,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -19541,7 +21621,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -19550,14 +21630,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -19565,7 +21645,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -19575,7 +21655,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -19585,7 +21665,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -19594,7 +21674,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -19603,7 +21683,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -19612,7 +21692,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -19621,7 +21701,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -19630,66 +21710,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -19697,7 +21839,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -19706,7 +21848,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -19718,7 +21860,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -19734,12 +21876,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -19754,36 +21897,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -19792,19 +21932,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -19815,7 +21963,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -19826,7 +21974,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -19834,7 +21982,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -19851,10 +21999,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -19864,7 +22012,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -19874,7 +22022,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -19884,7 +22032,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -19893,7 +22041,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -19902,7 +22050,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -19913,59 +22061,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -19977,7 +22106,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -19990,12 +22119,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20004,7 +22130,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -20012,13 +22138,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -20037,7 +22163,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20055,23 +22181,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -20081,7 +22204,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -20090,20 +22213,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -20114,7 +22245,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -20123,20 +22254,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -20155,7 +22286,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20167,7 +22298,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -20177,7 +22308,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -20186,21 +22317,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -20213,7 +22352,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20230,7 +22369,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -20239,7 +22378,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -20248,17 +22387,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20268,7 +22407,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20277,7 +22416,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20285,11 +22424,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20300,7 +22447,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -20310,7 +22457,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -20319,7 +22466,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -20327,11 +22474,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -20341,7 +22496,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -20350,21 +22505,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20377,7 +22540,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20397,7 +22560,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -20406,7 +22569,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -20415,7 +22578,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -20424,7 +22587,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -20433,7 +22596,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -20443,7 +22606,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -20463,7 +22626,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -20477,9 +22640,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -20487,22 +22658,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -20511,7 +22690,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20520,7 +22699,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20531,22 +22710,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -20555,7 +22742,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -20564,7 +22751,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -20576,7 +22763,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -20587,7 +22774,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20597,7 +22784,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -20606,7 +22793,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20617,7 +22804,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20633,7 +22820,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -20643,7 +22830,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20654,7 +22841,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -20664,7 +22851,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -20674,7 +22861,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -20687,7 +22874,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -20702,7 +22889,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -20712,7 +22899,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -20723,7 +22910,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -20732,7 +22919,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -20741,21 +22928,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -20764,7 +22959,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -20776,7 +22971,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -20786,7 +22981,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -20799,7 +22994,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -20818,11 +23013,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -20832,7 +23024,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -20841,7 +23033,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -20850,7 +23042,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -20860,19 +23052,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -20881,7 +23079,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -20891,7 +23089,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20902,7 +23100,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -20911,17 +23109,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -20930,7 +23128,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -20941,7 +23139,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -20951,53 +23149,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -21007,7 +23219,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -21031,7 +23243,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21046,62 +23258,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -21124,7 +23333,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21140,33 +23349,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -21176,26 +23382,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21220,7 +23446,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21237,16 +23463,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -21256,18 +23479,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -21277,39 +23500,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -21334,7 +23585,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -21359,11 +23610,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -21372,7 +23620,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -21382,7 +23630,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -21391,7 +23639,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -21400,7 +23648,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -21409,7 +23657,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -21419,7 +23667,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21427,10 +23675,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -21440,7 +23696,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -21448,11 +23704,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -21468,7 +23731,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -21479,7 +23742,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -21489,7 +23752,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -21499,7 +23762,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -21508,7 +23771,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -21516,25 +23779,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -21544,62 +23821,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -21607,11 +23896,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -21621,51 +23916,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
+ *
+ * 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);
+
+ /* "View.MemoryView":1297
*
- * 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)
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -21674,7 +23984,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -21683,7 +23993,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -21692,7 +24002,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -21701,7 +24011,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -21710,7 +24020,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -21719,12 +24029,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -21738,28 +24062,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -21768,7 +24098,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -21777,7 +24107,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -21786,7 +24116,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -21795,7 +24125,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -21805,7 +24135,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -21829,21 +24159,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -21852,87 +24182,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -21940,7 +24270,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -21951,7 +24281,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -21961,7 +24291,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -21969,11 +24299,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -21984,7 +24320,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -21999,7 +24335,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -22008,7 +24344,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22023,7 +24359,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22039,7 +24375,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -22050,7 +24386,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22060,7 +24396,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -22070,7 +24406,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -22078,36 +24414,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -22117,7 +24477,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22129,7 +24489,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22139,7 +24499,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -22148,7 +24508,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -22157,7 +24517,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -22166,7 +24526,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -22177,7 +24537,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22193,7 +24553,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -22202,7 +24562,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -22211,7 +24571,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -22221,7 +24581,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -22232,7 +24592,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -22241,7 +24601,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -22250,22 +24610,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -22274,7 +24642,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -22286,7 +24654,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -22296,6 +24664,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -22307,12 +24676,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -22363,7 +24734,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -22372,7 +24743,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -22414,7 +24785,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "functions.array", /*tp_name*/
+ "silx.math.fit.functions.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -22423,8 +24794,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -22519,7 +24891,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "functions.Enum", /*tp_name*/
+ "silx.math.fit.functions.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -22528,8 +24900,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -22590,10 +24963,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -22671,39 +25045,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -22715,15 +25089,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -22765,7 +25139,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "functions.memoryview", /*tp_name*/
+ "silx.math.fit.functions.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -22774,8 +25148,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -22875,7 +25250,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -22883,13 +25258,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "functions._memoryviewslice", /*tp_name*/
+ "silx.math.fit.functions._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -22898,8 +25273,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -22975,7 +25351,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_17_06_2016, __pyx_k_17_06_2016, sizeof(__pyx_k_17_06_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_16_08_2017, __pyx_k_16_08_2017, sizeof(__pyx_k_16_08_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
{&__pyx_kp_s_At_least_3_parameters_are_requir, __pyx_k_At_least_3_parameters_are_requir, sizeof(__pyx_k_At_least_3_parameters_are_requir), 0, 0, 1, 0},
{&__pyx_kp_s_At_least_4_parameters_are_requir, __pyx_k_At_least_4_parameters_are_requir, sizeof(__pyx_k_At_least_4_parameters_are_requir), 0, 0, 1, 0},
{&__pyx_kp_s_At_least_5_parameters_are_requir, __pyx_k_At_least_5_parameters_are_requir, sizeof(__pyx_k_At_least_5_parameters_are_requir), 0, 0, 1, 0},
@@ -23014,7 +25391,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
- {&__pyx_n_s_basicConfig, __pyx_k_basicConfig, sizeof(__pyx_k_basicConfig), 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},
@@ -23025,6 +25401,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
{&__pyx_n_s_erf, __pyx_k_erf, sizeof(__pyx_k_erf), 0, 0, 1, 1},
{&__pyx_n_s_erfc, __pyx_k_erfc, sizeof(__pyx_k_erfc), 0, 0, 1, 1},
@@ -23035,7 +25412,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_functions, __pyx_k_functions, sizeof(__pyx_k_functions), 0, 0, 1, 1},
{&__pyx_n_s_gaussian_term, __pyx_k_gaussian_term, sizeof(__pyx_k_gaussian_term), 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},
@@ -23051,7 +25427,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_lt_term, __pyx_k_lt_term, sizeof(__pyx_k_lt_term), 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_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__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},
@@ -23071,6 +25446,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
{&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_math_fit_functions, __pyx_k_silx_math_fit_functions, sizeof(__pyx_k_silx_math_fit_functions), 0, 0, 1, 1},
{&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
{&__pyx_n_s_st_term, __pyx_k_st_term, sizeof(__pyx_k_st_term), 0, 0, 1, 1},
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
@@ -23102,27 +25478,22 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
{&__pyx_n_s_x_c, __pyx_k_x_c, sizeof(__pyx_k_x_c), 0, 0, 1, 1},
- {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
{&__pyx_n_s_y_c, __pyx_k_y_c, sizeof(__pyx_k_y_c), 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_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __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 = 982; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 87, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 981, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 131, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -23132,961 +25503,986 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "functions.pyx":88
+ /* "silx/math/fit/functions.pyx":87
* for len_dim in x.shape:
* if len_dim == 0:
* raise IndexError("Cannot compute erf for an empty array") # <<<<<<<<<<<<<<
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Cannot_compute_erf_for_an_empty); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Cannot_compute_erf_for_an_empty); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 87, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "functions.pyx":90
+ /* "silx/math/fit/functions.pyx":89
* raise IndexError("Cannot compute erf for an empty array")
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "functions.pyx":118
+ /* "silx/math/fit/functions.pyx":117
* for len_dim in x.shape:
* if len_dim == 0:
* raise IndexError("Cannot compute erfc for an empty array") # <<<<<<<<<<<<<<
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1)
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compute_erfc_for_an_empty); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Cannot_compute_erfc_for_an_empty); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "functions.pyx":120
+ /* "silx/math/fit/functions.pyx":119
* raise IndexError("Cannot compute erfc for an empty array")
*
* x_c = numpy.array(x, copy=False, dtype=numpy.float64, order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x_c.size,), dtype=numpy.float64)
*
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "functions.pyx":156
+ /* "silx/math/fit/functions.pyx":155
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "functions.pyx":160
+ /* "silx/math/fit/functions.pyx":159
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "functions.pyx":170
+ /* "silx/math/fit/functions.pyx":169
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* # reshape y_c to match original, possibly unusual, data shape
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 169, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "functions.pyx":203
+ /* "silx/math/fit/functions.pyx":202
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 202, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "functions.pyx":207
+ /* "silx/math/fit/functions.pyx":206
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "functions.pyx":217
+ /* "silx/math/fit/functions.pyx":216
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 216, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- /* "functions.pyx":253
+ /* "silx/math/fit/functions.pyx":252
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 252, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "functions.pyx":257
+ /* "silx/math/fit/functions.pyx":256
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 256, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- /* "functions.pyx":267
+ /* "silx/math/fit/functions.pyx":266
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- /* "functions.pyx":302
+ /* "silx/math/fit/functions.pyx":301
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 301, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__14);
__Pyx_GIVEREF(__pyx_tuple__14);
- /* "functions.pyx":306
+ /* "silx/math/fit/functions.pyx":305
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 305, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__15);
__Pyx_GIVEREF(__pyx_tuple__15);
- /* "functions.pyx":316
+ /* "silx/math/fit/functions.pyx":315
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 315, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__16);
__Pyx_GIVEREF(__pyx_tuple__16);
- /* "functions.pyx":352
+ /* "silx/math/fit/functions.pyx":351
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 351, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__17);
__Pyx_GIVEREF(__pyx_tuple__17);
- /* "functions.pyx":356
+ /* "silx/math/fit/functions.pyx":355
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 355, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__18);
__Pyx_GIVEREF(__pyx_tuple__18);
- /* "functions.pyx":366
+ /* "silx/math/fit/functions.pyx":365
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 365, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__19);
__Pyx_GIVEREF(__pyx_tuple__19);
- /* "functions.pyx":403
+ /* "silx/math/fit/functions.pyx":402
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 402, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__20);
__Pyx_GIVEREF(__pyx_tuple__20);
- /* "functions.pyx":407
+ /* "silx/math/fit/functions.pyx":406
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__21);
__Pyx_GIVEREF(__pyx_tuple__21);
- /* "functions.pyx":417
+ /* "silx/math/fit/functions.pyx":416
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 416, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__22);
__Pyx_GIVEREF(__pyx_tuple__22);
- /* "functions.pyx":458
+ /* "silx/math/fit/functions.pyx":457
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 457, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__23);
__Pyx_GIVEREF(__pyx_tuple__23);
- /* "functions.pyx":462
+ /* "silx/math/fit/functions.pyx":461
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 461, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__24);
__Pyx_GIVEREF(__pyx_tuple__24);
- /* "functions.pyx":472
+ /* "silx/math/fit/functions.pyx":471
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 471, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__25);
__Pyx_GIVEREF(__pyx_tuple__25);
- /* "functions.pyx":505
+ /* "silx/math/fit/functions.pyx":504
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 504, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__26);
__Pyx_GIVEREF(__pyx_tuple__26);
- /* "functions.pyx":509
+ /* "silx/math/fit/functions.pyx":508
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 508, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__27);
__Pyx_GIVEREF(__pyx_tuple__27);
- /* "functions.pyx":519
+ /* "silx/math/fit/functions.pyx":518
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 518, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__28);
__Pyx_GIVEREF(__pyx_tuple__28);
- /* "functions.pyx":552
+ /* "silx/math/fit/functions.pyx":551
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 551, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__29);
__Pyx_GIVEREF(__pyx_tuple__29);
- /* "functions.pyx":556
+ /* "silx/math/fit/functions.pyx":555
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 555, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__30);
__Pyx_GIVEREF(__pyx_tuple__30);
- /* "functions.pyx":566
+ /* "silx/math/fit/functions.pyx":565
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 565, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__31);
__Pyx_GIVEREF(__pyx_tuple__31);
- /* "functions.pyx":600
+ /* "silx/math/fit/functions.pyx":599
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__32 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__32);
__Pyx_GIVEREF(__pyx_tuple__32);
- /* "functions.pyx":604
+ /* "silx/math/fit/functions.pyx":603
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__33 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__33 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 603, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__33);
__Pyx_GIVEREF(__pyx_tuple__33);
- /* "functions.pyx":614
+ /* "silx/math/fit/functions.pyx":613
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 613, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__34);
__Pyx_GIVEREF(__pyx_tuple__34);
- /* "functions.pyx":647
+ /* "silx/math/fit/functions.pyx":646
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__35 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 646, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__35);
__Pyx_GIVEREF(__pyx_tuple__35);
- /* "functions.pyx":651
+ /* "silx/math/fit/functions.pyx":650
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__36 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 651; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 650, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__36);
__Pyx_GIVEREF(__pyx_tuple__36);
- /* "functions.pyx":662
+ /* "silx/math/fit/functions.pyx":661
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 661, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__37);
__Pyx_GIVEREF(__pyx_tuple__37);
- /* "functions.pyx":696
+ /* "silx/math/fit/functions.pyx":695
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__38 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 695, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__38);
__Pyx_GIVEREF(__pyx_tuple__38);
- /* "functions.pyx":700
+ /* "silx/math/fit/functions.pyx":699
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 699, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__39);
__Pyx_GIVEREF(__pyx_tuple__39);
- /* "functions.pyx":711
+ /* "silx/math/fit/functions.pyx":710
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 710, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__40);
__Pyx_GIVEREF(__pyx_tuple__40);
- /* "functions.pyx":747
+ /* "silx/math/fit/functions.pyx":746
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__41 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__41 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 746, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__41);
__Pyx_GIVEREF(__pyx_tuple__41);
- /* "functions.pyx":751
+ /* "silx/math/fit/functions.pyx":750
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__42 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 750, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__42);
__Pyx_GIVEREF(__pyx_tuple__42);
- /* "functions.pyx":762
+ /* "silx/math/fit/functions.pyx":761
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 761, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__43);
__Pyx_GIVEREF(__pyx_tuple__43);
- /* "functions.pyx":828
+ /* "silx/math/fit/functions.pyx":827
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__44 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 827, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__44);
__Pyx_GIVEREF(__pyx_tuple__44);
- /* "functions.pyx":832
+ /* "silx/math/fit/functions.pyx":831
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__45 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 831, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__45);
__Pyx_GIVEREF(__pyx_tuple__45);
- /* "functions.pyx":844
+ /* "silx/math/fit/functions.pyx":843
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 843, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__46);
__Pyx_GIVEREF(__pyx_tuple__46);
- /* "functions.pyx":921
+ /* "silx/math/fit/functions.pyx":920
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* params_c = numpy.array(params,
* copy=False,
*/
- __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__47 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 920, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__47);
__Pyx_GIVEREF(__pyx_tuple__47);
- /* "functions.pyx":925
+ /* "silx/math/fit/functions.pyx":924
* copy=False,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* y_c = numpy.empty(shape=(x.size,),
* dtype=numpy.float64)
*/
- __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__48 = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 924, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__48);
__Pyx_GIVEREF(__pyx_tuple__48);
- /* "functions.pyx":937
+ /* "silx/math/fit/functions.pyx":936
*
* if status:
* raise IndexError("Wrong number of parameters for function") # <<<<<<<<<<<<<<
*
* return numpy.asarray(y_c).reshape(x.shape)
*/
- __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_Wrong_number_of_parameters_for_f); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 936, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__49);
__Pyx_GIVEREF(__pyx_tuple__49);
- /* "functions.pyx":985
+ /* "silx/math/fit/functions.pyx":984
* newpars[i, 0] = pars[2]
* newpars[i, 1] = pars[3] + i * pars[1]
* newpars[:, 2] = pars[4] # <<<<<<<<<<<<<<
* return sum_gauss(x, newpars)
*/
- __pyx_slice__50 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_slice__50 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__50)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_slice__50);
__Pyx_GIVEREF(__pyx_slice__50);
- __pyx_tuple__51 = PyTuple_Pack(2, __pyx_slice__50, __pyx_int_2); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__51 = PyTuple_Pack(2, __pyx_slice__50, __pyx_int_2); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 984, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__51);
__Pyx_GIVEREF(__pyx_tuple__51);
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__52);
__Pyx_GIVEREF(__pyx_tuple__52);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__53);
__Pyx_GIVEREF(__pyx_tuple__53);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__54);
- __Pyx_GIVEREF(__pyx_tuple__54);
+ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__55);
+ __Pyx_GIVEREF(__pyx_tuple__55);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__55);
- __Pyx_GIVEREF(__pyx_tuple__55);
+ __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__56);
+ __Pyx_GIVEREF(__pyx_tuple__56);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__56 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__56);
- __Pyx_GIVEREF(__pyx_tuple__56);
+ __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__57);
+ __Pyx_GIVEREF(__pyx_tuple__57);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__57 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__57);
- __Pyx_GIVEREF(__pyx_tuple__57);
+ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__58);
+ __Pyx_GIVEREF(__pyx_tuple__58);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__58);
- __Pyx_GIVEREF(__pyx_tuple__58);
+ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__59);
+ __Pyx_GIVEREF(__pyx_tuple__59);
+
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__60 = PyTuple_New(1); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__60);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__60, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__60);
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__59 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__59)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__59);
- __Pyx_GIVEREF(__pyx_slice__59);
+ __pyx_slice__61 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__61)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__61);
+ __Pyx_GIVEREF(__pyx_slice__61);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__60 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__60)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__60);
- __Pyx_GIVEREF(__pyx_slice__60);
+ __pyx_slice__62 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__62)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__62);
+ __Pyx_GIVEREF(__pyx_slice__62);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__61 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__61)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__61);
- __Pyx_GIVEREF(__pyx_slice__61);
+ __pyx_slice__63 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__63)) __PYX_ERR(1, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__63);
+ __Pyx_GIVEREF(__pyx_slice__63);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__62);
- __Pyx_GIVEREF(__pyx_tuple__62);
+ __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__64);
+ __Pyx_GIVEREF(__pyx_tuple__64);
- /* "functions.pyx":68
+ /* "silx/math/fit/functions.pyx":67
*
*
* def erf(x): # <<<<<<<<<<<<<<
* """Return the gaussian error function
*
*/
- __pyx_tuple__63 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_x_c, __pyx_n_s_y_c, __pyx_n_s_len_dim, __pyx_n_s_status); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__63);
- __Pyx_GIVEREF(__pyx_tuple__63);
- __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_erf, 68, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_x_c, __pyx_n_s_y_c, __pyx_n_s_len_dim, __pyx_n_s_status); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__65);
+ __Pyx_GIVEREF(__pyx_tuple__65);
+ __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_erf, 67, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 67, __pyx_L1_error)
- /* "functions.pyx":98
+ /* "silx/math/fit/functions.pyx":97
*
*
* def erfc(x): # <<<<<<<<<<<<<<
* """Return the gaussian complementary error function
*
*/
- __pyx_tuple__65 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_x_c, __pyx_n_s_y_c, __pyx_n_s_len_dim, __pyx_n_s_status); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__65);
- __Pyx_GIVEREF(__pyx_tuple__65);
- __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_erfc, 98, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__67 = PyTuple_Pack(5, __pyx_n_s_x, __pyx_n_s_x_c, __pyx_n_s_y_c, __pyx_n_s_len_dim, __pyx_n_s_status); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 97, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__67);
+ __Pyx_GIVEREF(__pyx_tuple__67);
+ __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_erfc, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 97, __pyx_L1_error)
- /* "functions.pyx":128
+ /* "silx/math/fit/functions.pyx":127
*
*
* def sum_gauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(height, centroid, fwhm)*,
* where:
*/
- __pyx_tuple__67 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__67);
- __Pyx_GIVEREF(__pyx_tuple__67);
- __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_gauss, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__69 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__69);
+ __Pyx_GIVEREF(__pyx_tuple__69);
+ __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_gauss, 127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 127, __pyx_L1_error)
- /* "functions.pyx":176
+ /* "silx/math/fit/functions.pyx":175
*
*
* def sum_agauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm)*,
* where:
*/
- __pyx_tuple__69 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__69);
- __Pyx_GIVEREF(__pyx_tuple__69);
- __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_agauss, 176, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__71 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__71);
+ __Pyx_GIVEREF(__pyx_tuple__71);
+ __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_agauss, 175, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 175, __pyx_L1_error)
- /* "functions.pyx":222
+ /* "silx/math/fit/functions.pyx":221
*
*
* def sum_fastagauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm)*,
* where:
*/
- __pyx_tuple__71 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__71);
- __Pyx_GIVEREF(__pyx_tuple__71);
- __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_fastagauss, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__73 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__73);
+ __Pyx_GIVEREF(__pyx_tuple__73);
+ __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_fastagauss, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 221, __pyx_L1_error)
- /* "functions.pyx":272
+ /* "silx/math/fit/functions.pyx":271
*
*
* def sum_splitgauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm1, fwhm2)*,
* where:
*/
- __pyx_tuple__73 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__73);
- __Pyx_GIVEREF(__pyx_tuple__73);
- __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_splitgauss, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 271, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__75);
+ __Pyx_GIVEREF(__pyx_tuple__75);
+ __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_splitgauss, 271, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 271, __pyx_L1_error)
- /* "functions.pyx":321
+ /* "silx/math/fit/functions.pyx":320
*
*
* def sum_apvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of pseudo-Voigt functions, defined by *(area, centroid, fwhm,
* eta)*.
*/
- __pyx_tuple__75 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__75);
- __Pyx_GIVEREF(__pyx_tuple__75);
- __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_apvoigt, 321, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__77 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 320, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__77);
+ __Pyx_GIVEREF(__pyx_tuple__77);
+ __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_apvoigt, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 320, __pyx_L1_error)
- /* "functions.pyx":371
+ /* "silx/math/fit/functions.pyx":370
*
*
* def sum_pvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of pseudo-Voigt functions, defined by *(height, centroid,
* fwhm, eta)*.
*/
- __pyx_tuple__77 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__77);
- __Pyx_GIVEREF(__pyx_tuple__77);
- __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__77, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_pvoigt, 371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__79 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 370, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__79);
+ __Pyx_GIVEREF(__pyx_tuple__79);
+ __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_pvoigt, 370, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 370, __pyx_L1_error)
- /* "functions.pyx":422
+ /* "silx/math/fit/functions.pyx":421
*
*
* def sum_splitpvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of split pseudo-Voigt functions, defined by *(height,
* centroid, fwhm1, fwhm2, eta)*.
*/
- __pyx_tuple__79 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__79);
- __Pyx_GIVEREF(__pyx_tuple__79);
- __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_splitpvoigt, 422, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__81 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 421, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__81);
+ __Pyx_GIVEREF(__pyx_tuple__81);
+ __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_splitpvoigt, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 421, __pyx_L1_error)
- /* "functions.pyx":477
+ /* "silx/math/fit/functions.pyx":476
*
*
* def sum_lorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of Lorentz distributions, also known as Cauchy distribution,
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_tuple__81 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__81);
- __Pyx_GIVEREF(__pyx_tuple__81);
- __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__81, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_lorentz, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 476, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__83);
+ __Pyx_GIVEREF(__pyx_tuple__83);
+ __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_lorentz, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 476, __pyx_L1_error)
- /* "functions.pyx":524
+ /* "silx/math/fit/functions.pyx":523
*
*
* def sum_alorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of Lorentz distributions, also known as Cauchy distribution,
* defined by *(area, centroid, fwhm)*.
*/
- __pyx_tuple__83 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__83);
- __Pyx_GIVEREF(__pyx_tuple__83);
- __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__83, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_alorentz, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__85 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 523, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__85);
+ __Pyx_GIVEREF(__pyx_tuple__85);
+ __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_alorentz, 523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 523, __pyx_L1_error)
- /* "functions.pyx":571
+ /* "silx/math/fit/functions.pyx":570
*
*
* def sum_splitlorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of split Lorentz distributions,
* defined by *(height, centroid, fwhm1, fwhm2)*.
*/
- __pyx_tuple__85 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__85);
- __Pyx_GIVEREF(__pyx_tuple__85);
- __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__85, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_splitlorentz, 571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__87 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(0, 570, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__87);
+ __Pyx_GIVEREF(__pyx_tuple__87);
+ __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_splitlorentz, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 570, __pyx_L1_error)
- /* "functions.pyx":619
+ /* "silx/math/fit/functions.pyx":618
*
*
* def sum_stepdown(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of stepdown functions.
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_tuple__87 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__87);
- __Pyx_GIVEREF(__pyx_tuple__87);
- __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_stepdown, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__89 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(0, 618, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__89);
+ __Pyx_GIVEREF(__pyx_tuple__89);
+ __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_stepdown, 618, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 618, __pyx_L1_error)
- /* "functions.pyx":667
+ /* "silx/math/fit/functions.pyx":666
*
*
* def sum_stepup(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of stepup functions.
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_tuple__89 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__89);
- __Pyx_GIVEREF(__pyx_tuple__89);
- __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_stepup, 667, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__91 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 666, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__91);
+ __Pyx_GIVEREF(__pyx_tuple__91);
+ __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_stepup, 666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 666, __pyx_L1_error)
- /* "functions.pyx":716
+ /* "silx/math/fit/functions.pyx":715
*
*
* def sum_slit(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of slit functions.
* defined by *(height, position, fwhm, beamfwhm)*.
*/
- __pyx_tuple__91 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__91);
- __Pyx_GIVEREF(__pyx_tuple__91);
- __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_slit, 716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__93 = PyTuple_Pack(6, __pyx_n_s_x, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_status); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 715, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__93);
+ __Pyx_GIVEREF(__pyx_tuple__93);
+ __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_slit, 715, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 715, __pyx_L1_error)
- /* "functions.pyx":767
+ /* "silx/math/fit/functions.pyx":766
*
*
* def sum_ahypermet(x, *params, # <<<<<<<<<<<<<<
* gaussian_term=True, st_term=True, lt_term=True, step_term=True):
* """Return a sum of ahypermet functions.
*/
- __pyx_tuple__93 = PyTuple_Pack(11, __pyx_n_s_x, __pyx_n_s_gaussian_term, __pyx_n_s_st_term, __pyx_n_s_lt_term, __pyx_n_s_step_term, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_tail_flags, __pyx_n_s_status); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__93);
- __Pyx_GIVEREF(__pyx_tuple__93);
- __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 4, 11, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_ahypermet, 767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__95 = PyTuple_Pack(11, __pyx_n_s_x, __pyx_n_s_gaussian_term, __pyx_n_s_st_term, __pyx_n_s_lt_term, __pyx_n_s_step_term, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_tail_flags, __pyx_n_s_status); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 766, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__95);
+ __Pyx_GIVEREF(__pyx_tuple__95);
+ __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 4, 11, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_ahypermet, 766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 766, __pyx_L1_error)
- /* "functions.pyx":849
+ /* "silx/math/fit/functions.pyx":848
*
*
* def sum_fastahypermet(x, *params, # <<<<<<<<<<<<<<
* gaussian_term=True, st_term=True,
* lt_term=True, step_term=True):
*/
- __pyx_tuple__95 = PyTuple_Pack(11, __pyx_n_s_x, __pyx_n_s_gaussian_term, __pyx_n_s_st_term, __pyx_n_s_lt_term, __pyx_n_s_step_term, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_tail_flags, __pyx_n_s_status); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__95);
- __Pyx_GIVEREF(__pyx_tuple__95);
- __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 4, 11, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_sum_fastahypermet, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__97 = PyTuple_Pack(11, __pyx_n_s_x, __pyx_n_s_gaussian_term, __pyx_n_s_st_term, __pyx_n_s_lt_term, __pyx_n_s_step_term, __pyx_n_s_params, __pyx_n_s_x_c, __pyx_n_s_params_c, __pyx_n_s_y_c, __pyx_n_s_tail_flags, __pyx_n_s_status); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 848, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__97);
+ __Pyx_GIVEREF(__pyx_tuple__97);
+ __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(1, 4, 11, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_sum_fastahypermet, 848, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 848, __pyx_L1_error)
- /* "functions.pyx":942
+ /* "silx/math/fit/functions.pyx":941
*
*
* def atan_stepup(x, a, b, c): # <<<<<<<<<<<<<<
* """
* Step up function using an inverse tangent.
*/
- __pyx_tuple__97 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__97);
- __Pyx_GIVEREF(__pyx_tuple__97);
- __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_atan_stepup, 942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__99 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_c); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 941, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__99);
+ __Pyx_GIVEREF(__pyx_tuple__99);
+ __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_atan_stepup, 941, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 941, __pyx_L1_error)
- /* "functions.pyx":960
+ /* "silx/math/fit/functions.pyx":959
*
*
* def periodic_gauss(x, *pars): # <<<<<<<<<<<<<<
* """
* Return a sum of gaussian functions defined by
*/
- __pyx_tuple__99 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_pars, __pyx_n_s_newpars, __pyx_n_s_i); if (unlikely(!__pyx_tuple__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__99);
- __Pyx_GIVEREF(__pyx_tuple__99);
- __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_periodic_gauss, 960, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__101 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_pars, __pyx_n_s_newpars, __pyx_n_s_i); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 959, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__101);
+ __Pyx_GIVEREF(__pyx_tuple__101);
+ __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_periodic_gauss, 959, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 959, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__101 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__101)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__101);
- __Pyx_GIVEREF(__pyx_tuple__101);
+ __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__103);
+ __Pyx_GIVEREF(__pyx_tuple__103);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__102)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__102);
- __Pyx_GIVEREF(__pyx_tuple__102);
+ __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__104);
+ __Pyx_GIVEREF(__pyx_tuple__104);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__103)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__103);
- __Pyx_GIVEREF(__pyx_tuple__103);
+ __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__105);
+ __Pyx_GIVEREF(__pyx_tuple__105);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__104)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__104);
- __Pyx_GIVEREF(__pyx_tuple__104);
+ __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__106);
+ __Pyx_GIVEREF(__pyx_tuple__106);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__105)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__105);
- __Pyx_GIVEREF(__pyx_tuple__105);
+ __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__107);
+ __Pyx_GIVEREF(__pyx_tuple__107);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -24095,16 +26491,16 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) {__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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -24123,9 +26519,7 @@ PyMODINIT_FUNC PyInit_functions(void)
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;
+ static PyThread_type_lock __pyx_t_6[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -24137,17 +26531,24 @@ PyMODINIT_FUNC PyInit_functions(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_functions(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -24162,34 +26563,34 @@ PyMODINIT_FUNC PyInit_functions(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_functions) {
- 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 (__pyx_module_is_main_silx__math__fit__functions) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "functions")) {
- if (unlikely(PyDict_SetItemString(modules, "functions", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.fit.functions")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.fit.functions", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -24199,10 +26600,13 @@ PyMODINIT_FUNC PyInit_functions(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -24213,504 +26617,521 @@ PyMODINIT_FUNC PyInit_functions(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "functions.pyx":54
+ /* "silx/math/fit/functions.pyx":54
* """
*
* __authors__ = ["P. Knobel"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "17/06/2016"
+ * __date__ = "16/08/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_P_Knobel);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
__Pyx_GIVEREF(__pyx_kp_s_P_Knobel);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":55
+ /* "silx/math/fit/functions.pyx":55
*
* __authors__ = ["P. Knobel"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "17/06/2016"
+ * __date__ = "16/08/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
- /* "functions.pyx":56
+ /* "silx/math/fit/functions.pyx":56
* __authors__ = ["P. Knobel"]
* __license__ = "MIT"
- * __date__ = "17/06/2016" # <<<<<<<<<<<<<<
+ * __date__ = "16/08/2017" # <<<<<<<<<<<<<<
*
* import logging
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_17_06_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_16_08_2017) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
- /* "functions.pyx":58
- * __date__ = "17/06/2016"
+ /* "silx/math/fit/functions.pyx":58
+ * __date__ = "16/08/2017"
*
* import logging # <<<<<<<<<<<<<<
* import numpy
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __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 = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":59
+ /* "silx/math/fit/functions.pyx":59
*
* import logging
* import numpy # <<<<<<<<<<<<<<
*
- * logging.basicConfig()
- */
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __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 = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "functions.pyx":61
- * import numpy
- *
- * logging.basicConfig() # <<<<<<<<<<<<<<
* _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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_basicConfig); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __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 = 61; __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 = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":62
+ /* "silx/math/fit/functions.pyx":61
+ * import numpy
*
- * logging.basicConfig()
* _logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
*
* cimport cython
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 61, __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_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_2, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __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 = 62; __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_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_1) < 0) __PYX_ERR(0, 61, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":68
+ /* "silx/math/fit/functions.pyx":67
*
*
* def erf(x): # <<<<<<<<<<<<<<
* """Return the gaussian error function
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_1erf, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_1erf, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_erf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_erf, __pyx_t_1) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":98
+ /* "silx/math/fit/functions.pyx":97
*
*
* def erfc(x): # <<<<<<<<<<<<<<
* """Return the gaussian complementary error function
*
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_3erfc, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_3erfc, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_erfc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_erfc, __pyx_t_1) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":128
+ /* "silx/math/fit/functions.pyx":127
*
*
* def sum_gauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(height, centroid, fwhm)*,
* where:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_5sum_gauss, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_5sum_gauss, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_gauss, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_gauss, __pyx_t_1) < 0) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":176
+ /* "silx/math/fit/functions.pyx":175
*
*
* def sum_agauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm)*,
* where:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_7sum_agauss, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_7sum_agauss, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_agauss, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_agauss, __pyx_t_1) < 0) __PYX_ERR(0, 175, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":222
+ /* "silx/math/fit/functions.pyx":221
*
*
* def sum_fastagauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm)*,
* where:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_9sum_fastagauss, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_9sum_fastagauss, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_fastagauss, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_fastagauss, __pyx_t_1) < 0) __PYX_ERR(0, 221, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":272
+ /* "silx/math/fit/functions.pyx":271
*
*
* def sum_splitgauss(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of gaussian functions defined by *(area, centroid, fwhm1, fwhm2)*,
* where:
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_11sum_splitgauss, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_11sum_splitgauss, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitgauss, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitgauss, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":321
+ /* "silx/math/fit/functions.pyx":320
*
*
* def sum_apvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of pseudo-Voigt functions, defined by *(area, centroid, fwhm,
* eta)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_13sum_apvoigt, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_13sum_apvoigt, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_apvoigt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_apvoigt, __pyx_t_1) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":371
+ /* "silx/math/fit/functions.pyx":370
*
*
* def sum_pvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of pseudo-Voigt functions, defined by *(height, centroid,
* fwhm, eta)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_15sum_pvoigt, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_15sum_pvoigt, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_pvoigt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_pvoigt, __pyx_t_1) < 0) __PYX_ERR(0, 370, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":422
+ /* "silx/math/fit/functions.pyx":421
*
*
* def sum_splitpvoigt(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of split pseudo-Voigt functions, defined by *(height,
* centroid, fwhm1, fwhm2, eta)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_17sum_splitpvoigt, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_17sum_splitpvoigt, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitpvoigt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitpvoigt, __pyx_t_1) < 0) __PYX_ERR(0, 421, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":477
+ /* "silx/math/fit/functions.pyx":476
*
*
* def sum_lorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of Lorentz distributions, also known as Cauchy distribution,
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_19sum_lorentz, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_19sum_lorentz, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_lorentz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_lorentz, __pyx_t_1) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":524
+ /* "silx/math/fit/functions.pyx":523
*
*
* def sum_alorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of Lorentz distributions, also known as Cauchy distribution,
* defined by *(area, centroid, fwhm)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_21sum_alorentz, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_21sum_alorentz, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_alorentz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_alorentz, __pyx_t_1) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":571
+ /* "silx/math/fit/functions.pyx":570
*
*
* def sum_splitlorentz(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of split Lorentz distributions,
* defined by *(height, centroid, fwhm1, fwhm2)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_23sum_splitlorentz, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_23sum_splitlorentz, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitlorentz, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_splitlorentz, __pyx_t_1) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":619
+ /* "silx/math/fit/functions.pyx":618
*
*
* def sum_stepdown(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of stepdown functions.
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_25sum_stepdown, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_25sum_stepdown, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_stepdown, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_stepdown, __pyx_t_1) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":667
+ /* "silx/math/fit/functions.pyx":666
*
*
* def sum_stepup(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of stepup functions.
* defined by *(height, centroid, fwhm)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_27sum_stepup, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_27sum_stepup, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_stepup, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_stepup, __pyx_t_1) < 0) __PYX_ERR(0, 666, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":716
+ /* "silx/math/fit/functions.pyx":715
*
*
* def sum_slit(x, *params): # <<<<<<<<<<<<<<
* """Return a sum of slit functions.
* defined by *(height, position, fwhm, beamfwhm)*.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_29sum_slit, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_29sum_slit, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 715, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_slit, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_slit, __pyx_t_1) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":767
+ /* "silx/math/fit/functions.pyx":766
*
*
* def sum_ahypermet(x, *params, # <<<<<<<<<<<<<<
* gaussian_term=True, st_term=True, lt_term=True, step_term=True):
* """Return a sum of ahypermet functions.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_31sum_ahypermet, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_31sum_ahypermet, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 766, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_ahypermet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_ahypermet, __pyx_t_1) < 0) __PYX_ERR(0, 766, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":849
+ /* "silx/math/fit/functions.pyx":848
*
*
* def sum_fastahypermet(x, *params, # <<<<<<<<<<<<<<
* gaussian_term=True, st_term=True,
* lt_term=True, step_term=True):
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_33sum_fastahypermet, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_33sum_fastahypermet, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_fastahypermet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sum_fastahypermet, __pyx_t_1) < 0) __PYX_ERR(0, 848, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":942
+ /* "silx/math/fit/functions.pyx":941
*
*
* def atan_stepup(x, a, b, c): # <<<<<<<<<<<<<<
* """
* Step up function using an inverse tangent.
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_35atan_stepup, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_35atan_stepup, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_atan_stepup, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_atan_stepup, __pyx_t_1) < 0) __PYX_ERR(0, 941, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":960
+ /* "silx/math/fit/functions.pyx":959
*
*
* def periodic_gauss(x, *pars): # <<<<<<<<<<<<<<
* """
* Return a sum of gaussian functions defined by
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9functions_37periodic_gauss, NULL, __pyx_n_s_functions); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_9functions_37periodic_gauss, NULL, __pyx_n_s_silx_math_fit_functions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_periodic_gauss, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_periodic_gauss, __pyx_t_1) < 0) __PYX_ERR(0, 959, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "functions.pyx":1
+ /* "silx/math/fit/functions.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* #/[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __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[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__101, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 282, __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
+ /* "View.MemoryView":283
*
* 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__102, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 283, __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
+ /* "View.MemoryView":284
* 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__103, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 284, __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
+ /* "View.MemoryView":287
*
*
* 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__104, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 287, __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
+ /* "View.MemoryView":288
*
* 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__105, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_6[0] = PyThread_allocate_lock();
+ __pyx_t_6[1] = PyThread_allocate_lock();
+ __pyx_t_6[2] = PyThread_allocate_lock();
+ __pyx_t_6[3] = PyThread_allocate_lock();
+ __pyx_t_6[4] = PyThread_allocate_lock();
+ __pyx_t_6[5] = PyThread_allocate_lock();
+ __pyx_t_6[6] = PyThread_allocate_lock();
+ __pyx_t_6[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __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[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 981, __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[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -24729,11 +27150,11 @@ PyMODINIT_FUNC PyInit_functions(void)
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.fit.functions", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init functions");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.fit.functions");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -24744,7 +27165,8 @@ PyMODINIT_FUNC PyInit_functions(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -24761,6 +27183,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -24774,9 +27197,10 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -24791,7 +27215,146 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -24810,7 +27373,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -24829,7 +27393,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -24841,6 +27406,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -24848,21 +27418,114 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -24872,27 +27535,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -24931,6 +27589,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -24964,10 +27623,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -25027,7 +27689,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -25047,12 +27709,14 @@ bad:
}
#endif
-static void __Pyx_RaiseBufferIndexError(int axis) {
+/* BufferIndexError */
+ static void __Pyx_RaiseBufferIndexError(int axis) {
PyErr_Format(PyExc_IndexError,
"Out of bounds on buffer access (axis %d)", axis);
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -25601,7 +28265,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -25657,7 +28322,6 @@ no_fail:
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
@@ -25736,7 +28400,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static void __Pyx_RaiseDoubleKeywordsError(
+/* RaiseDoubleKeywords */
+ static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
{
@@ -25749,7 +28414,8 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
-static int __Pyx_ParseOptionalKeywords(
+/* ParseKeywords */
+ static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
PyObject *kwds2,
@@ -25850,7 +28516,8 @@ bad:
return -1;
}
-static void __Pyx_RaiseArgtupleInvalid(
+/* RaiseArgTupleInvalid */
+ static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
Py_ssize_t num_min,
@@ -25875,7 +28542,192 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* PyFloatBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyFloat_AddCObj(PyObject *op1, PyObject *op2, double floatval, CYTHON_UNUSED int inplace) {
+ const double a = floatval;
+ double b, result;
+ if (likely(PyFloat_CheckExact(op2))) {
+ b = PyFloat_AS_DOUBLE(op2);
+ } else
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op2))) {
+ b = (double) PyInt_AS_LONG(op2);
+ } else
+ #endif
+ if (likely(PyLong_CheckExact(op2))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)op2)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op2);
+ switch (size) {
+ case 0: b = 0.0; break;
+ case -1: b = -(double) digits[0]; break;
+ case 1: b = (double) digits[0]; break;
+ case -2:
+ case 2:
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
+ b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
+ if (size == -2)
+ b = -b;
+ break;
+ }
+ }
+ case -3:
+ case 3:
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
+ b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
+ if (size == -3)
+ b = -b;
+ break;
+ }
+ }
+ case -4:
+ case 4:
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
+ b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) (1L<<53))) {
+ if (size == -4)
+ b = -b;
+ break;
+ }
+ }
+ default:
+ #else
+ {
+ #endif
+ b = PyLong_AsDouble(op2);
+ if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
+ }
+ } else {
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+ }
+ PyFPE_START_PROTECT("add", return NULL)
+ result = a + b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+}
+#endif
+
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -25883,8 +28735,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -25897,8 +28750,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -25910,9 +28764,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -25936,10 +28791,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -25953,7 +28807,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -25979,7 +28834,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26016,7 +28872,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -26099,14 +28956,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -26118,13 +28977,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -26144,22 +29010,26 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -26171,23 +29041,18 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -26197,16 +29062,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -26217,7 +29094,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -26235,7 +29112,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -26259,41 +29136,134 @@ bad:
return -1;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -26314,9 +29284,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -26333,28 +29308,14 @@ bad:
return -1;
}
-#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 int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -26427,7 +29388,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -26500,7 +29462,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -26528,238 +29490,13 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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 PyObject *__pyx_memview_get_double(const char *itemp) {
- return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
-}
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
- double value = __pyx_PyFloat_AsDouble(obj);
- if ((value == (double)-1) && PyErr_Occurred())
- return 0;
- *(double *) itemp = value;
- return 1;
-}
-
-#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;
-}
-
-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 int
-__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
+ /* MemviewSliceIsContig */
+ 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;
+ Py_ssize_t itemsize = mvs.memview->view.itemsize;
if (order == 'F') {
step = 1;
start = 0;
@@ -26769,14 +29506,15 @@ __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
}
for (i = 0; i < ndim; i++) {
index = start + step * i;
- if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
+ if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
return 0;
- itemsize *= mvs->shape[index];
+ itemsize *= mvs.shape[index];
}
return 1;
}
-static void
+/* OverlappingSlices */
+ static void
__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
void **out_start, void **out_end,
int ndim, size_t itemsize)
@@ -26811,7 +29549,86 @@ __pyx_slices_overlap(__Pyx_memviewslice *slice1,
return (start1 < end2) && (start2 < end1);
}
-static __Pyx_memviewslice
+/* Capsule */
+ 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;
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
+ return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
+ double value = __pyx_PyFloat_AsDouble(obj);
+ if ((value == (double)-1) && PyErr_Occurred())
+ return 0;
+ *(double *) itemp = value;
+ return 1;
+}
+
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewSliceCopyTemplate */
+ 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,
@@ -26877,34 +29694,216 @@ no_fail:
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);
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
#endif
- return cobj;
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -26915,8 +29914,9 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -26933,36 +29933,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -26971,7 +30064,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -26994,7 +30087,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -27010,8 +30103,9 @@ raise_neg_overflow:
return (char) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -27028,36 +30122,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -27066,7 +30253,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -27089,7 +30276,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -27105,7 +30292,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -27145,7 +30333,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -27326,7 +30515,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -27348,7 +30538,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -27363,7 +30554,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -27401,7 +30593,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -27442,7 +30634,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -27463,8 +30655,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -27472,9 +30666,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -27483,11 +30678,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -27512,18 +30710,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/fit/functions/functions.pyx b/silx/math/fit/functions.pyx
index 196b682..6c491cd 100644
--- a/silx/math/fit/functions/functions.pyx
+++ b/silx/math/fit/functions.pyx
@@ -53,12 +53,11 @@ Full documentation:
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "17/06/2016"
+__date__ = "16/08/2017"
import logging
import numpy
-logging.basicConfig()
_logger = logging.getLogger(__name__)
cimport cython
@@ -68,7 +67,7 @@ cimport functions_wrapper
def erf(x):
"""Return the gaussian error function
- :param x: Independant variable where the gaussian error function is
+ :param x: Independent variable where the gaussian error function is
calculated
:type x: numpy.ndarray or scalar
:return: Gaussian error function ``y=erf(x)``
@@ -98,7 +97,7 @@ def erf(x):
def erfc(x):
"""Return the gaussian complementary error function
- :param x: Independant variable where the gaussian complementary error
+ :param x: Independent variable where the gaussian complementary error
function is calculated
:type x: numpy.ndarray or scalar
:return: Gaussian complementary error function ``y=erfc(x)``
@@ -133,7 +132,7 @@ def sum_gauss(x, *params):
- *centroid* is the peak x-coordinate
- *fwhm* is the full-width at half maximum
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of gaussian parameters (length must be a multiple
of 3):
@@ -181,7 +180,7 @@ def sum_agauss(x, *params):
- *centroid* is the peak x-coordinate
- *fwhm* is the full-width at half maximum
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of gaussian parameters (length must be a multiple
of 3):
@@ -231,7 +230,7 @@ def sum_fastagauss(x, *params):
lookup table with precalculated exponential values. This might speed up
the computation for large numbers of individual gaussian functions.
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of gaussian parameters (length must be a multiple
of 3):
@@ -280,7 +279,7 @@ def sum_splitgauss(x, *params):
- *fwhm2* is the full-width at half maximum for the distribution
when ``x > centroid``
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of gaussian parameters (length must be a multiple
of 4):
@@ -331,7 +330,7 @@ def sum_apvoigt(x, *params):
- *fwhm* is the full-width at half maximum of both functions
- *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of pseudo-Voigt parameters (length must be a multiple
of 4):
@@ -381,7 +380,7 @@ def sum_pvoigt(x, *params):
- *fwhm* is the full-width at half maximum of both functions
- *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of pseudo-Voigt parameters (length must be a multiple
of 4):
@@ -435,7 +434,7 @@ def sum_splitpvoigt(x, *params):
when ``x > centroid``
- *eta* is the Lorentz factor: PV(x) = eta * L(x) + (1 - eta) * G(x)
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of pseudo-Voigt parameters (length must be a multiple
of 5):
@@ -482,7 +481,7 @@ def sum_lorentz(x, *params):
- *centroid* is the peak x-coordinate
- *fwhm* is the full-width at half maximum
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of Lorentz parameters (length must be a multiple
of 3):
@@ -529,7 +528,7 @@ def sum_alorentz(x, *params):
- *centroid* is the peak x-coordinate for both functions
- *fwhm* is the full-width at half maximum
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of Lorentz parameters (length must be a multiple
of 3):
@@ -577,7 +576,7 @@ def sum_splitlorentz(x, *params):
- *fwhm1* is the full-width at half maximum for ``x < centroid``
- *fwhm2* is the full-width at half maximum for ``x > centroid``
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of Lorentz parameters (length must be a multiple
of 4):
@@ -625,7 +624,7 @@ def sum_stepdown(x, *params):
- *fwhm* is the full-width at half maximum for the derivative,
which is a measure of the *sharpness* of the step-down's edge
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of stepdown parameters (length must be a multiple
of 3):
@@ -673,7 +672,7 @@ def sum_stepup(x, *params):
- *fwhm* is the full-width at half maximum for the derivative,
which is a measure of the *sharpness* of the step-up's edge
- :param x: Independant variable where the gaussians are calculated
+ :param x: Independent variable where the gaussians are calculated
:type x: numpy.ndarray
:param params: Array of stepup parameters (length must be a multiple
of 3):
@@ -724,7 +723,7 @@ def sum_slit(x, *params):
derivative, which is a measure of the *sharpness*
of the edges of the slit
- :param x: Independant variable where the slits are calculated
+ :param x: Independent variable where the slits are calculated
:type x: numpy.ndarray
:param params: Array of slit parameters (length must be a multiple
of 4):
@@ -792,7 +791,7 @@ def sum_ahypermet(x, *params,
- a short tail term
- a step down term
- :param x: Independant variable where the hypermets are calculated
+ :param x: Independent variable where the hypermets are calculated
:type x: numpy.ndarray
:param params: Array of hypermet parameters (length must be a multiple
of 8):
@@ -878,7 +877,7 @@ def sum_fastahypermet(x, *params,
table for calculating exponentials. This offers better performance when
calculating many functions for large ``x`` arrays.
- :param x: Independant variable where the hypermets are calculated
+ :param x: Independent variable where the hypermets are calculated
:type x: numpy.ndarray
:param params: Array of hypermet parameters (length must be a multiple
of 8):
@@ -943,7 +942,7 @@ def atan_stepup(x, a, b, c):
"""
Step up function using an inverse tangent.
- :param x: Independant variable where the function is calculated
+ :param x: Independent variable where the function is calculated
:type x: numpy array
:param a: Height of the step up
:param b: Center of the step up
@@ -969,7 +968,7 @@ def periodic_gauss(x, *pars):
- *centroid* is the peak x-coordinate of the first gaussian
- *fwhm* is the full-width at half maximum for all the gaussians
- :param x: Independant variable where the function is calculated
+ :param x: Independent variable where the function is calculated
:param pars: *(npeaks, delta, height, centroid, fwhm)*
:return: Sum of ``npeaks`` gaussians
"""
diff --git a/silx/math/fit/functions/functions_wrapper.pxd b/silx/math/fit/functions_wrapper.pxd
index 780116c..780116c 100644
--- a/silx/math/fit/functions/functions_wrapper.pxd
+++ b/silx/math/fit/functions_wrapper.pxd
diff --git a/silx/math/fit/leastsq.py b/silx/math/fit/leastsq.py
index 874c23a..8c87d6b 100644
--- a/silx/math/fit/leastsq.py
+++ b/silx/math/fit/leastsq.py
@@ -34,7 +34,7 @@ This module is a refactored version of PyMca Gefit.py module.
"""
__authors__ = ["V.A. Sole"]
__license__ = "MIT"
-__date__ = "24/01/2017"
+__date__ = "15/05/2017"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
import numpy
@@ -44,7 +44,6 @@ import time
import logging
import copy
-logging.basicConfig()
_logger = logging.getLogger(__name__)
# codes understood by the routine
diff --git a/silx/math/fit/peaks/peaks.c b/silx/math/fit/peaks.c
index e7d9ddc..45bec48 100644
--- a/silx/math/fit/peaks/peaks.c
+++ b/silx/math/fit/peaks.c
@@ -1,28 +1,32 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "silx/math/fit/peaks/include/peaks.h"
+ ],
+ "include_dirs": [
+ "silx/math/fit/peaks/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c"
+ },
+ "module_name": "silx.math.fit.peaks"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +45,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +57,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +273,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +294,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +333,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +359,74 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,17 +443,13 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__peaks
-#define __PYX_HAVE_API__peaks
-#include "string.h"
-#include "stdlib.h"
+#define __PYX_HAVE__silx__math__fit__peaks
+#define __PYX_HAVE_API__silx__math__fit__peaks
+#include <string.h>
+#include <stdlib.h>
#include "peaks.h"
#include "pythread.h"
-#include "stdio.h"
+#include <stdio.h>
#include "pystate.h"
#ifdef _OPENMP
#include <omp.h>
@@ -247,20 +459,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -268,16 +467,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -294,11 +511,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -312,18 +529,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -334,7 +558,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -414,6 +638,7 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
@@ -421,9 +646,10 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "peaks.pyx",
+ "silx/math/fit/peaks.pyx",
"stringsource",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -433,6 +659,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -468,26 +695,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -504,14 +733,14 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #define __pyx_sub_acquisition_count(memview)\
__pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif
@@ -522,7 +751,7 @@ struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -531,6 +760,7 @@ struct __pyx_memoryviewslice_obj;
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -546,7 +776,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -559,7 +789,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -582,7 +812,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -599,7 +829,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -619,7 +863,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -631,6 +875,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -647,19 +894,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -682,18 +929,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -708,57 +956,122 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
+#endif
+
+/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
+/* abs_long.proto */
static CYTHON_INLINE unsigned long __Pyx_abs_long(long x) {
if (unlikely(x == -LONG_MAX-1))
return ((unsigned long)LONG_MAX) + 1U;
return (unsigned long) labs(x);
}
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-#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) : \
+/* SetItemInt.proto */
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
__Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
int is_list, int wraparound, int boundscheck);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -784,20 +1097,21 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -805,58 +1119,105 @@ 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);
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-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
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -872,12 +1233,7 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -890,7 +1246,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -906,28 +1263,32 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
-#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
-
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -939,9 +1300,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -955,52 +1327,55 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
-static PyObject *__pyx_memview_get_double(const char *itemp);
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* CIntToPy.proto */
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);
-
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1011,12 +1386,16 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1035,9 +1414,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* Module declarations from 'libc.stdlib' */
-/* Module declarations from 'peaks_wrapper' */
+/* Module declarations from 'silx.math.fit.peaks_wrapper' */
-/* Module declarations from 'peaks' */
+/* Module declarations from 'silx.math.fit.peaks' */
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1047,6 +1426,8 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1080,10 +1461,10 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_
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_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
-#define __Pyx_MODULE_NAME "peaks"
-int __pyx_module_is_main_peaks = 0;
+#define __Pyx_MODULE_NAME "silx.math.fit.peaks"
+int __pyx_module_is_main_silx__math__fit__peaks = 0;
-/* Implementation of 'peaks' */
+/* Implementation of 'silx.math.fit.peaks' */
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_MemoryError;
static PyObject *__pyx_builtin_zip;
@@ -1092,175 +1473,133 @@ static PyObject *__pyx_builtin_ValueError;
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_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y, PyObject *__pyx_v_fwhm, PyObject *__pyx_v_sensitivity, PyObject *__pyx_v_begin_index, PyObject *__pyx_v_end_index, PyObject *__pyx_v_debug, PyObject *__pyx_v_relevance_info); /* proto */
-static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y); /* 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_C[] = "C";
-static char __pyx_k_O[] = "O";
-static char __pyx_k_c[] = "c";
-static char __pyx_k_i[] = "i";
-static char __pyx_k_w[] = "w";
-static char __pyx_k_y[] = "y";
-static char __pyx_k__2[] = "";
-static char __pyx_k_id[] = "id";
-static char __pyx_k_MIT[] = "MIT";
-static char __pyx_k_idx[] = "idx";
-static char __pyx_k_max[] = "max";
-static char __pyx_k_msg[] = "msg";
-static char __pyx_k_obj[] = "obj";
-static char __pyx_k_y_c[] = "y_c";
-static char __pyx_k_zip[] = "zip";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_copy[] = "copy";
-static char __pyx_k_date[] = "__date__";
-static char __pyx_k_fwhm[] = "fwhm";
-static char __pyx_k_imax[] = "imax";
-static char __pyx_k_imin[] = "imin";
-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_yfit[] = "yfit";
-static char __pyx_k_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_debug[] = "debug";
-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_numpy[] = "numpy";
-static char __pyx_k_order[] = "order";
-static char __pyx_k_peaks[] = "peaks";
-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_format[] = "format";
-static char __pyx_k_height[] = "height";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_logger[] = "_logger";
-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_authors[] = "__authors__";
-static char __pyx_k_filters[] = "filters";
-static char __pyx_k_float64[] = "float64";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_logging[] = "logging";
-static char __pyx_k_maximum[] = "maximum";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_n_peaks[] = "n_peaks";
-static char __pyx_k_nonzero[] = "nonzero";
-static char __pyx_k_peaks_c[] = "peaks_c";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_P_Knobel[] = "P. Knobel";
-static char __pyx_k_fwhm_min[] = "fwhm_min";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_posindex[] = "posindex";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_end_index[] = "end_index";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_getLogger[] = "getLogger";
-static char __pyx_k_17_06_2016[] = "17/06/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_background[] = "background";
-static char __pyx_k_guess_fwhm[] = "guess_fwhm";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_relevances[] = "relevances";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_basicConfig[] = "basicConfig";
-static char __pyx_k_begin_index[] = "begin_index";
-static char __pyx_k_niterations[] = "niterations";
-static char __pyx_k_peak_search[] = "peak_search";
-static char __pyx_k_relevance_f[] = "relevance %f\n";
-static char __pyx_k_sensitivity[] = "sensitivity";
-static char __pyx_k_peak_index_f[] = "peak index %f, ";
-static char __pyx_k_relevances_c[] = "relevances_c";
-static char __pyx_k_output_arrays[] = "output arrays";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_relevance_info[] = "relevance_info";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_we_found_d_peaks[] = "we found %d peaks.\n";
-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_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_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_Failed_to_reallocate_memory_for[] = "Failed to reallocate memory for output arrays";
-static char __pyx_k_mntdirect__scisoft_users_tvince[] = "/mntdirect/_scisoft/users/tvincent/src/silx/silx/math/fit/peaks/peaks.pyx";
-static char __pyx_k_All_dimensions_preceding_dimensi[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_Before_memory_allocation_error_h[] = "Before memory allocation error happened, ";
-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_Failed_to_allocate_initial_memor[] = "Failed to allocate initial memory for ";
-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_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_This_module_provides_a_peak_sear[] = "This module provides a peak search function and tools related to peak\nanalysis.\n";
-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_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
-static PyObject *__pyx_kp_s_17_06_2016;
+static const char __pyx_k_C[] = "C";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_w[] = "w";
+static const char __pyx_k_y[] = "y";
+static const char __pyx_k__2[] = "";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_idx[] = "idx";
+static const char __pyx_k_max[] = "max";
+static const char __pyx_k_msg[] = "msg";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_y_c[] = "y_c";
+static const char __pyx_k_zip[] = "zip";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_copy[] = "copy";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_fwhm[] = "fwhm";
+static const char __pyx_k_imax[] = "imax";
+static const char __pyx_k_imin[] = "imin";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_yfit[] = "yfit";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_debug[] = "debug";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_order[] = "order";
+static const char __pyx_k_peaks[] = "peaks";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_strip[] = "strip";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_height[] = "height";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_logger[] = "_logger";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_filters[] = "filters";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_logging[] = "logging";
+static const char __pyx_k_maximum[] = "maximum";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_n_peaks[] = "n_peaks";
+static const char __pyx_k_nonzero[] = "nonzero";
+static const char __pyx_k_peaks_c[] = "peaks_c";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_P_Knobel[] = "P. Knobel";
+static const char __pyx_k_fwhm_min[] = "fwhm_min";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_posindex[] = "posindex";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_end_index[] = "end_index";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_getLogger[] = "getLogger";
+static const char __pyx_k_15_05_2017[] = "15/05/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_background[] = "background";
+static const char __pyx_k_guess_fwhm[] = "guess_fwhm";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_relevances[] = "relevances";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_begin_index[] = "begin_index";
+static const char __pyx_k_niterations[] = "niterations";
+static const char __pyx_k_peak_search[] = "peak_search";
+static const char __pyx_k_relevance_f[] = "relevance %f\n";
+static const char __pyx_k_sensitivity[] = "sensitivity";
+static const char __pyx_k_peak_index_f[] = "peak index %f, ";
+static const char __pyx_k_relevances_c[] = "relevances_c";
+static const char __pyx_k_output_arrays[] = "output arrays";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_silx_math_fit[] = "silx.math.fit";
+static const char __pyx_k_relevance_info[] = "relevance_info";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_we_found_d_peaks[] = "we found %d peaks.\n";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_silx_math_fit_peaks[] = "silx.math.fit.peaks";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_Failed_to_reallocate_memory_for[] = "Failed to reallocate memory for output arrays";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/fit/peaks.pyx";
+static const char __pyx_k_Before_memory_allocation_error_h[] = "Before memory allocation error happened, ";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Failed_to_allocate_initial_memor[] = "Failed to allocate initial memory for ";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_This_module_provides_a_peak_sear[] = "This module provides a peak search function and tools related to peak\nanalysis.\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static PyObject *__pyx_kp_s_15_05_2017;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Before_memory_allocation_error_h;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C;
@@ -1290,7 +1629,6 @@ static PyObject *__pyx_n_s_array;
static PyObject *__pyx_n_s_authors;
static PyObject *__pyx_n_s_background;
static PyObject *__pyx_n_s_base;
-static PyObject *__pyx_n_s_basicConfig;
static PyObject *__pyx_n_s_begin_index;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_u_c;
@@ -1303,6 +1641,7 @@ static PyObject *__pyx_n_s_debug;
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_index;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
@@ -1333,7 +1672,6 @@ static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_maximum;
static PyObject *__pyx_n_s_memview;
-static PyObject *__pyx_kp_s_mntdirect__scisoft_users_tvince;
static PyObject *__pyx_n_s_mode;
static PyObject *__pyx_n_s_msg;
static PyObject *__pyx_n_s_n_peaks;
@@ -1362,6 +1700,8 @@ static PyObject *__pyx_n_s_relevances_c;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_sensitivity;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_silx_math_fit;
+static PyObject *__pyx_n_s_silx_math_fit_peaks;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_step;
@@ -1375,13 +1715,51 @@ 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_n_s_unpack;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_kp_s_we_found_d_peaks;
-static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_y_c;
static PyObject *__pyx_n_s_yfit;
static PyObject *__pyx_n_s_zip;
+static PyObject *__pyx_pf_4silx_4math_3fit_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y, PyObject *__pyx_v_fwhm, PyObject *__pyx_v_sensitivity, PyObject *__pyx_v_begin_index, PyObject *__pyx_v_end_index, PyObject *__pyx_v_debug, PyObject *__pyx_v_relevance_info); /* proto */
+static PyObject *__pyx_pf_4silx_4math_3fit_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_3_5;
static PyObject *__pyx_int_0;
@@ -1396,22 +1774,24 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__11;
-static PyObject *__pyx_slice__12;
static PyObject *__pyx_slice__13;
+static PyObject *__pyx_slice__14;
+static PyObject *__pyx_slice__15;
static PyObject *__pyx_tuple__10;
-static PyObject *__pyx_tuple__14;
-static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
-static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
-static PyObject *__pyx_codeobj__16;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
static PyObject *__pyx_codeobj__18;
+static PyObject *__pyx_codeobj__20;
-/* "peaks.pyx":46
+/* "silx/math/fit/peaks.pyx":45
*
*
* def peak_search(y, fwhm, sensitivity=3.5, # <<<<<<<<<<<<<<
@@ -1420,10 +1800,10 @@ static PyObject *__pyx_codeobj__18;
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_5peaks_peak_search[] = "peak_search(y, fwhm, sensitivity=3.5, begin_index=None, end_index=None, debug=False, relevance_info=False)\nFind peaks in a curve.\n\n :param y: Data array\n :type y: numpy.ndarray\n :param fwhm: Estimated full width at half maximum of the typical peaks we\n are interested in (expressed in number of samples)\n :param sensitivity: Threshold factor used for peak detection. Only peaks\n with amplitudes higher than ``\317\203 * sensitivity`` - where ``\317\203`` is the\n standard deviation of the noise - qualify as peaks.\n :param begin_index: Index of the first sample of the region of interest\n in the ``y`` array. If ``None``, start from the first sample.\n :param end_index: Index of the last sample of the region of interest in\n the ``y`` array. If ``None``, process until the last sample.\n :param debug: If ``True``, print debug messages. Default: ``False``\n :param relevance_info: If ``True``, add a second dimension with relevance\n information to the output array. Default: ``False``\n :return: 1D sequence with indices of peaks in the data\n if ``relevance_info`` is ``False``.\n Else, sequence of ``(peak_index, peak_relevance)`` tuples (one tuple\n per peak).\n :raise: ``IndexError`` if the number of peaks is too large to fit in the\n output array.\n ";
-static PyMethodDef __pyx_mdef_5peaks_1peak_search = {"peak_search", (PyCFunction)__pyx_pw_5peaks_1peak_search, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5peaks_peak_search};
-static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_3fit_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_5peaks_peak_search[] = "peak_search(y, fwhm, sensitivity=3.5, begin_index=None, end_index=None, debug=False, relevance_info=False)\nFind peaks in a curve.\n\n :param y: Data array\n :type y: numpy.ndarray\n :param fwhm: Estimated full width at half maximum of the typical peaks we\n are interested in (expressed in number of samples)\n :param sensitivity: Threshold factor used for peak detection. Only peaks\n with amplitudes higher than ``\317\203 * sensitivity`` - where ``\317\203`` is the\n standard deviation of the noise - qualify as peaks.\n :param begin_index: Index of the first sample of the region of interest\n in the ``y`` array. If ``None``, start from the first sample.\n :param end_index: Index of the last sample of the region of interest in\n the ``y`` array. If ``None``, process until the last sample.\n :param debug: If ``True``, print debug messages. Default: ``False``\n :param relevance_info: If ``True``, add a second dimension with relevance\n information to the output array. Default: ``False``\n :return: 1D sequence with indices of peaks in the data\n if ``relevance_info`` is ``False``.\n Else, sequence of ``(peak_index, peak_relevance)`` tuples (one tuple\n per peak).\n :raise: ``IndexError`` if the number of peaks is too large to fit in the\n output array.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_5peaks_1peak_search = {"peak_search", (PyCFunction)__pyx_pw_4silx_4math_3fit_5peaks_1peak_search, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_3fit_5peaks_peak_search};
+static PyObject *__pyx_pw_4silx_4math_3fit_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_y = 0;
PyObject *__pyx_v_fwhm = 0;
PyObject *__pyx_v_sensitivity = 0;
@@ -1431,9 +1811,6 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
PyObject *__pyx_v_end_index = 0;
PyObject *__pyx_v_debug = 0;
PyObject *__pyx_v_relevance_info = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("peak_search (wrapper)", 0);
@@ -1442,7 +1819,7 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
PyObject* values[7] = {0,0,0,0,0,0,0};
values[2] = ((PyObject *)__pyx_float_3_5);
- /* "peaks.pyx":47
+ /* "silx/math/fit/peaks.pyx":46
*
* def peak_search(y, fwhm, sensitivity=3.5,
* begin_index=None, end_index=None, # <<<<<<<<<<<<<<
@@ -1452,7 +1829,7 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
values[3] = ((PyObject *)Py_None);
values[4] = ((PyObject *)Py_None);
- /* "peaks.pyx":48
+ /* "silx/math/fit/peaks.pyx":47
* def peak_search(y, fwhm, sensitivity=3.5,
* begin_index=None, end_index=None,
* debug=False, relevance_info=False): # <<<<<<<<<<<<<<
@@ -1483,7 +1860,7 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fwhm)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("peak_search", 0, 2, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("peak_search", 0, 2, 7, 1); __PYX_ERR(0, 45, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -1512,7 +1889,7 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peak_search") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "peak_search") < 0)) __PYX_ERR(0, 45, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -1537,15 +1914,15 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("peak_search", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("peak_search", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("peaks.peak_search", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.peaks.peak_search", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_5peaks_peak_search(__pyx_self, __pyx_v_y, __pyx_v_fwhm, __pyx_v_sensitivity, __pyx_v_begin_index, __pyx_v_end_index, __pyx_v_debug, __pyx_v_relevance_info);
+ __pyx_r = __pyx_pf_4silx_4math_3fit_5peaks_peak_search(__pyx_self, __pyx_v_y, __pyx_v_fwhm, __pyx_v_sensitivity, __pyx_v_begin_index, __pyx_v_end_index, __pyx_v_debug, __pyx_v_relevance_info);
- /* "peaks.pyx":46
+ /* "silx/math/fit/peaks.pyx":45
*
*
* def peak_search(y, fwhm, sensitivity=3.5, # <<<<<<<<<<<<<<
@@ -1558,7 +1935,7 @@ static PyObject *__pyx_pw_5peaks_1peak_search(PyObject *__pyx_self, PyObject *__
return __pyx_r;
}
-static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y, PyObject *__pyx_v_fwhm, PyObject *__pyx_v_sensitivity, PyObject *__pyx_v_begin_index, PyObject *__pyx_v_end_index, PyObject *__pyx_v_debug, PyObject *__pyx_v_relevance_info) {
+static PyObject *__pyx_pf_4silx_4math_3fit_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y, PyObject *__pyx_v_fwhm, PyObject *__pyx_v_sensitivity, PyObject *__pyx_v_begin_index, PyObject *__pyx_v_end_index, PyObject *__pyx_v_debug, PyObject *__pyx_v_relevance_info) {
int __pyx_v_i;
__Pyx_memviewslice __pyx_v_y_c = { 0, 0, { 0 }, { 0 }, { 0 } };
double *__pyx_v_peaks_c;
@@ -1586,103 +1963,100 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
Py_ssize_t __pyx_t_15;
int __pyx_t_16;
unsigned long __pyx_t_17;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("peak_search", 0);
__Pyx_INCREF(__pyx_v_begin_index);
__Pyx_INCREF(__pyx_v_end_index);
__Pyx_INCREF(__pyx_v_debug);
- /* "peaks.pyx":78
+ /* "silx/math/fit/peaks.pyx":77
* double* relevances_c
*
* y_c = numpy.array(y, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_y);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_y);
__Pyx_GIVEREF(__pyx_v_y);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_y);
- /* "peaks.pyx":79
+ /* "silx/math/fit/peaks.pyx":78
*
* y_c = numpy.array(y,
* copy=True, # <<<<<<<<<<<<<<
* dtype=numpy.float64,
* order='C').reshape(-1)
*/
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
- /* "peaks.pyx":80
+ /* "silx/math/fit/peaks.pyx":79
* y_c = numpy.array(y,
* copy=True,
* dtype=numpy.float64, # <<<<<<<<<<<<<<
* order='C').reshape(-1)
* if debug:
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
- /* "peaks.pyx":78
+ /* "silx/math/fit/peaks.pyx":77
* double* relevances_c
*
* y_c = numpy.array(y, # <<<<<<<<<<<<<<
* copy=True,
* dtype=numpy.float64,
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "peaks.pyx":81
+ /* "silx/math/fit/peaks.pyx":80
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* if debug:
* debug = 1
*/
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dc_double(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_y_c = __pyx_t_6;
__pyx_t_6.memview = NULL;
__pyx_t_6.data = NULL;
- /* "peaks.pyx":82
+ /* "silx/math/fit/peaks.pyx":81
* dtype=numpy.float64,
* order='C').reshape(-1)
* if debug: # <<<<<<<<<<<<<<
* debug = 1
* else:
*/
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_debug); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_debug); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 81, __pyx_L1_error)
if (__pyx_t_7) {
- /* "peaks.pyx":83
+ /* "silx/math/fit/peaks.pyx":82
* order='C').reshape(-1)
* if debug:
* debug = 1 # <<<<<<<<<<<<<<
@@ -1691,23 +2065,31 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
__Pyx_INCREF(__pyx_int_1);
__Pyx_DECREF_SET(__pyx_v_debug, __pyx_int_1);
+
+ /* "silx/math/fit/peaks.pyx":81
+ * dtype=numpy.float64,
+ * order='C').reshape(-1)
+ * if debug: # <<<<<<<<<<<<<<
+ * debug = 1
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "peaks.pyx":85
+ /* "silx/math/fit/peaks.pyx":84
* debug = 1
* else:
* debug = 0 # <<<<<<<<<<<<<<
*
* if begin_index is None:
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_debug, __pyx_int_0);
}
__pyx_L3:;
- /* "peaks.pyx":87
+ /* "silx/math/fit/peaks.pyx":86
* debug = 0
*
* if begin_index is None: # <<<<<<<<<<<<<<
@@ -1718,7 +2100,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_8 = (__pyx_t_7 != 0);
if (__pyx_t_8) {
- /* "peaks.pyx":88
+ /* "silx/math/fit/peaks.pyx":87
*
* if begin_index is None:
* begin_index = 0 # <<<<<<<<<<<<<<
@@ -1727,11 +2109,17 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
__Pyx_INCREF(__pyx_int_0);
__Pyx_DECREF_SET(__pyx_v_begin_index, __pyx_int_0);
- goto __pyx_L4;
+
+ /* "silx/math/fit/peaks.pyx":86
+ * debug = 0
+ *
+ * if begin_index is None: # <<<<<<<<<<<<<<
+ * begin_index = 0
+ * if end_index is None:
+ */
}
- __pyx_L4:;
- /* "peaks.pyx":89
+ /* "silx/math/fit/peaks.pyx":88
* if begin_index is None:
* begin_index = 0
* if end_index is None: # <<<<<<<<<<<<<<
@@ -1742,56 +2130,62 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_7 = (__pyx_t_8 != 0);
if (__pyx_t_7) {
- /* "peaks.pyx":90
+ /* "silx/math/fit/peaks.pyx":89
* begin_index = 0
* if end_index is None:
* end_index = y_c.size - 1 # <<<<<<<<<<<<<<
*
* n_peaks = peaks_wrapper.seek(begin_index, end_index, y_c.size,
*/
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF_SET(__pyx_v_end_index, __pyx_t_5);
__pyx_t_5 = 0;
- goto __pyx_L5;
+
+ /* "silx/math/fit/peaks.pyx":88
+ * if begin_index is None:
+ * begin_index = 0
+ * if end_index is None: # <<<<<<<<<<<<<<
+ * end_index = y_c.size - 1
+ *
+ */
}
- __pyx_L5:;
- /* "peaks.pyx":92
+ /* "silx/math/fit/peaks.pyx":91
* end_index = y_c.size - 1
*
* n_peaks = peaks_wrapper.seek(begin_index, end_index, y_c.size, # <<<<<<<<<<<<<<
* fwhm, sensitivity, debug,
* &y_c[0], &peaks_c, &relevances_c)
*/
- __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_begin_index); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_end_index); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyInt_As_long(__pyx_v_begin_index); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
+ __pyx_t_10 = __Pyx_PyInt_As_long(__pyx_v_end_index); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_y_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "peaks.pyx":93
+ /* "silx/math/fit/peaks.pyx":92
*
* n_peaks = peaks_wrapper.seek(begin_index, end_index, y_c.size,
* fwhm, sensitivity, debug, # <<<<<<<<<<<<<<
* &y_c[0], &peaks_c, &relevances_c)
*
*/
- __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_fwhm); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_sensitivity); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_debug); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_fwhm); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
+ __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_sensitivity); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
+ __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_debug); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 92, __pyx_L1_error)
- /* "peaks.pyx":94
+ /* "silx/math/fit/peaks.pyx":93
* n_peaks = peaks_wrapper.seek(begin_index, end_index, y_c.size,
* fwhm, sensitivity, debug,
* &y_c[0], &peaks_c, &relevances_c) # <<<<<<<<<<<<<<
@@ -1806,10 +2200,10 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
} else if (unlikely(__pyx_t_15 >= __pyx_v_y_c.shape[0])) __pyx_t_16 = 0;
if (unlikely(__pyx_t_16 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_16);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 93, __pyx_L1_error)
}
- /* "peaks.pyx":92
+ /* "silx/math/fit/peaks.pyx":91
* end_index = y_c.size - 1
*
* n_peaks = peaks_wrapper.seek(begin_index, end_index, y_c.size, # <<<<<<<<<<<<<<
@@ -1818,7 +2212,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_n_peaks = seek(__pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, (&(*((double *) ( /* dim=0 */ ((char *) (((double *) __pyx_v_y_c.data) + __pyx_t_15)) )))), (&__pyx_v_peaks_c), (&__pyx_v_relevances_c));
- /* "peaks.pyx":99
+ /* "silx/math/fit/peaks.pyx":98
* # A negative return value means that peaks were found but not enough
* # memory could be allocated for all
* if n_peaks < 0 and n_peaks != -123456: # <<<<<<<<<<<<<<
@@ -1831,12 +2225,12 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_t_7 = __pyx_t_8;
goto __pyx_L7_bool_binop_done;
}
- __pyx_t_8 = ((__pyx_v_n_peaks != -123456) != 0);
+ __pyx_t_8 = ((__pyx_v_n_peaks != -123456L) != 0);
__pyx_t_7 = __pyx_t_8;
__pyx_L7_bool_binop_done:;
if (__pyx_t_7) {
- /* "peaks.pyx":100
+ /* "silx/math/fit/peaks.pyx":99
* # memory could be allocated for all
* if n_peaks < 0 and n_peaks != -123456:
* msg = "Before memory allocation error happened, " # <<<<<<<<<<<<<<
@@ -1846,7 +2240,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_kp_s_Before_memory_allocation_error_h);
__pyx_v_msg = __pyx_kp_s_Before_memory_allocation_error_h;
- /* "peaks.pyx":101
+ /* "silx/math/fit/peaks.pyx":100
* if n_peaks < 0 and n_peaks != -123456:
* msg = "Before memory allocation error happened, "
* msg += "we found %d peaks.\n" % abs(n_peaks) # <<<<<<<<<<<<<<
@@ -1854,31 +2248,31 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
* msg = ""
*/
__pyx_t_17 = __Pyx_abs_long(__pyx_v_n_peaks);
- __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(__pyx_t_17); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_we_found_d_peaks, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_we_found_d_peaks, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 100, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
__pyx_t_3 = 0;
- /* "peaks.pyx":102
+ /* "silx/math/fit/peaks.pyx":101
* msg = "Before memory allocation error happened, "
* msg += "we found %d peaks.\n" % abs(n_peaks)
* _logger.debug(msg) # <<<<<<<<<<<<<<
* msg = ""
* for i in range(abs(n_peaks)):
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_debug); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -1888,23 +2282,41 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
}
}
if (!__pyx_t_5) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __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;
- __Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_msg);
- __Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_msg};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_msg};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_msg);
+ __Pyx_GIVEREF(__pyx_v_msg);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_msg);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "peaks.pyx":103
+ /* "silx/math/fit/peaks.pyx":102
* msg += "we found %d peaks.\n" % abs(n_peaks)
* _logger.debug(msg)
* msg = "" # <<<<<<<<<<<<<<
@@ -1914,7 +2326,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_kp_s__2);
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_kp_s__2);
- /* "peaks.pyx":104
+ /* "silx/math/fit/peaks.pyx":103
* _logger.debug(msg)
* msg = ""
* for i in range(abs(n_peaks)): # <<<<<<<<<<<<<<
@@ -1925,57 +2337,57 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_17; __pyx_t_16+=1) {
__pyx_v_i = __pyx_t_16;
- /* "peaks.pyx":105
+ /* "silx/math/fit/peaks.pyx":104
* msg = ""
* for i in range(abs(n_peaks)):
* msg += "peak index %f, " % peaks_c[i] # <<<<<<<<<<<<<<
* msg += "relevance %f\n" % relevances_c[i]
* _logger.debug(msg)
*/
- __pyx_t_3 = PyFloat_FromDouble((__pyx_v_peaks_c[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((__pyx_v_peaks_c[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_peak_index_f, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_peak_index_f, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
__pyx_t_3 = 0;
- /* "peaks.pyx":106
+ /* "silx/math/fit/peaks.pyx":105
* for i in range(abs(n_peaks)):
* msg += "peak index %f, " % peaks_c[i]
* msg += "relevance %f\n" % relevances_c[i] # <<<<<<<<<<<<<<
* _logger.debug(msg)
* free(peaks_c)
*/
- __pyx_t_3 = PyFloat_FromDouble((__pyx_v_relevances_c[__pyx_v_i])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyFloat_FromDouble((__pyx_v_relevances_c[__pyx_v_i])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_relevance_f, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_relevance_f, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
__pyx_t_3 = 0;
}
- /* "peaks.pyx":107
+ /* "silx/math/fit/peaks.pyx":106
* msg += "peak index %f, " % peaks_c[i]
* msg += "relevance %f\n" % relevances_c[i]
* _logger.debug(msg) # <<<<<<<<<<<<<<
* free(peaks_c)
* free(relevances_c)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logger); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_debug); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_1)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -1985,23 +2397,41 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
}
}
if (!__pyx_t_1) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_msg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = NULL;
- __Pyx_INCREF(__pyx_v_msg);
- PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_msg);
- __Pyx_GIVEREF(__pyx_v_msg);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_msg};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_msg};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_msg);
+ __Pyx_GIVEREF(__pyx_v_msg);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_msg);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "peaks.pyx":108
+ /* "silx/math/fit/peaks.pyx":107
* msg += "relevance %f\n" % relevances_c[i]
* _logger.debug(msg)
* free(peaks_c) # <<<<<<<<<<<<<<
@@ -2010,7 +2440,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
free(__pyx_v_peaks_c);
- /* "peaks.pyx":109
+ /* "silx/math/fit/peaks.pyx":108
* _logger.debug(msg)
* free(peaks_c)
* free(relevances_c) # <<<<<<<<<<<<<<
@@ -2019,159 +2449,175 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
free(__pyx_v_relevances_c);
- /* "peaks.pyx":110
+ /* "silx/math/fit/peaks.pyx":109
* free(peaks_c)
* free(relevances_c)
* raise MemoryError("Failed to reallocate memory for output arrays") # <<<<<<<<<<<<<<
* # Special value -123456 is returned if the initial memory allocation
* #fails, before any search could be performed
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 109, __pyx_L1_error)
+
+ /* "silx/math/fit/peaks.pyx":98
+ * # A negative return value means that peaks were found but not enough
+ * # memory could be allocated for all
+ * if n_peaks < 0 and n_peaks != -123456: # <<<<<<<<<<<<<<
+ * msg = "Before memory allocation error happened, "
+ * msg += "we found %d peaks.\n" % abs(n_peaks)
+ */
}
- /* "peaks.pyx":113
+ /* "silx/math/fit/peaks.pyx":112
* # Special value -123456 is returned if the initial memory allocation
* #fails, before any search could be performed
* elif n_peaks == -123456: # <<<<<<<<<<<<<<
* raise MemoryError("Failed to allocate initial memory for " +
* "output arrays")
*/
- __pyx_t_7 = ((__pyx_v_n_peaks == -123456) != 0);
+ __pyx_t_7 = ((__pyx_v_n_peaks == -123456L) != 0);
if (__pyx_t_7) {
- /* "peaks.pyx":114
+ /* "silx/math/fit/peaks.pyx":113
* #fails, before any search could be performed
* elif n_peaks == -123456:
* raise MemoryError("Failed to allocate initial memory for " + # <<<<<<<<<<<<<<
* "output arrays")
*
*/
- __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Failed_to_allocate_initial_memor, __pyx_kp_s_output_arrays); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Failed_to_allocate_initial_memor, __pyx_kp_s_output_arrays); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 113, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 113, __pyx_L1_error)
+
+ /* "silx/math/fit/peaks.pyx":112
+ * # Special value -123456 is returned if the initial memory allocation
+ * #fails, before any search could be performed
+ * elif n_peaks == -123456: # <<<<<<<<<<<<<<
+ * raise MemoryError("Failed to allocate initial memory for " +
+ * "output arrays")
+ */
}
- /* "peaks.pyx":117
+ /* "silx/math/fit/peaks.pyx":116
* "output arrays")
*
* peaks = numpy.empty(shape=(n_peaks,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
* relevances = numpy.empty(shape=(n_peaks,),
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_n_peaks); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_n_peaks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
__pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "peaks.pyx":118
+ /* "silx/math/fit/peaks.pyx":117
*
* peaks = numpy.empty(shape=(n_peaks,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
* relevances = numpy.empty(shape=(n_peaks,),
* dtype=numpy.float64)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "peaks.pyx":117
+ /* "silx/math/fit/peaks.pyx":116
* "output arrays")
*
* peaks = numpy.empty(shape=(n_peaks,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
* relevances = numpy.empty(shape=(n_peaks,),
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __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_peaks = __pyx_t_5;
__pyx_t_5 = 0;
- /* "peaks.pyx":119
+ /* "silx/math/fit/peaks.pyx":118
* peaks = numpy.empty(shape=(n_peaks,),
* dtype=numpy.float64)
* relevances = numpy.empty(shape=(n_peaks,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_n_peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_n_peaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
__pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_shape, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "peaks.pyx":120
+ /* "silx/math/fit/peaks.pyx":119
* dtype=numpy.float64)
* relevances = numpy.empty(shape=(n_peaks,),
* dtype=numpy.float64) # <<<<<<<<<<<<<<
*
* for i in range(n_peaks):
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":119
+ /* "silx/math/fit/peaks.pyx":118
* peaks = numpy.empty(shape=(n_peaks,),
* dtype=numpy.float64)
* relevances = numpy.empty(shape=(n_peaks,), # <<<<<<<<<<<<<<
* dtype=numpy.float64)
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_relevances = __pyx_t_2;
__pyx_t_2 = 0;
- /* "peaks.pyx":122
+ /* "silx/math/fit/peaks.pyx":121
* dtype=numpy.float64)
*
* for i in range(n_peaks): # <<<<<<<<<<<<<<
@@ -2182,32 +2628,32 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_11; __pyx_t_16+=1) {
__pyx_v_i = __pyx_t_16;
- /* "peaks.pyx":123
+ /* "silx/math/fit/peaks.pyx":122
*
* for i in range(n_peaks):
* peaks[i] = peaks_c[i] # <<<<<<<<<<<<<<
* relevances[i] = relevances_c[i]
*
*/
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_peaks_c[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_peaks_c[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_peaks, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_peaks, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 122, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":124
+ /* "silx/math/fit/peaks.pyx":123
* for i in range(n_peaks):
* peaks[i] = peaks_c[i]
* relevances[i] = relevances_c[i] # <<<<<<<<<<<<<<
*
* free(peaks_c)
*/
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_relevances_c[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_relevances_c[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (unlikely(__Pyx_SetItemInt(__pyx_v_relevances, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_relevances, __pyx_v_i, __pyx_t_2, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- /* "peaks.pyx":126
+ /* "silx/math/fit/peaks.pyx":125
* relevances[i] = relevances_c[i]
*
* free(peaks_c) # <<<<<<<<<<<<<<
@@ -2216,7 +2662,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
free(__pyx_v_peaks_c);
- /* "peaks.pyx":127
+ /* "silx/math/fit/peaks.pyx":126
*
* free(peaks_c)
* free(relevances_c) # <<<<<<<<<<<<<<
@@ -2225,18 +2671,18 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
free(__pyx_v_relevances_c);
- /* "peaks.pyx":129
+ /* "silx/math/fit/peaks.pyx":128
* free(relevances_c)
*
* if not relevance_info: # <<<<<<<<<<<<<<
* return peaks
* else:
*/
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_relevance_info); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_relevance_info); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
__pyx_t_8 = ((!__pyx_t_7) != 0);
if (__pyx_t_8) {
- /* "peaks.pyx":130
+ /* "silx/math/fit/peaks.pyx":129
*
* if not relevance_info:
* return peaks # <<<<<<<<<<<<<<
@@ -2247,42 +2693,45 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_v_peaks);
__pyx_r = __pyx_v_peaks;
goto __pyx_L0;
+
+ /* "silx/math/fit/peaks.pyx":128
+ * free(relevances_c)
+ *
+ * if not relevance_info: # <<<<<<<<<<<<<<
+ * return peaks
+ * else:
+ */
}
- /*else*/ {
- /* "peaks.pyx":132
+ /* "silx/math/fit/peaks.pyx":131
* return peaks
* else:
* return list(zip(peaks, relevances)) # <<<<<<<<<<<<<<
*
*
*/
+ /*else*/ {
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_peaks);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_peaks);
__Pyx_GIVEREF(__pyx_v_peaks);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_peaks);
__Pyx_INCREF(__pyx_v_relevances);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_relevances);
__Pyx_GIVEREF(__pyx_v_relevances);
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_relevances);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __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 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "peaks.pyx":46
+ /* "silx/math/fit/peaks.pyx":45
*
*
* def peak_search(y, fwhm, sensitivity=3.5, # <<<<<<<<<<<<<<
@@ -2298,7 +2747,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __Pyx_AddTraceback("peaks.peak_search", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.peaks.peak_search", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__PYX_XDEC_MEMVIEW(&__pyx_v_y_c, 1);
@@ -2313,7 +2762,7 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-/* "peaks.pyx":135
+/* "silx/math/fit/peaks.pyx":134
*
*
* def guess_fwhm(y): # <<<<<<<<<<<<<<
@@ -2322,21 +2771,21 @@ static PyObject *__pyx_pf_5peaks_peak_search(CYTHON_UNUSED PyObject *__pyx_self,
*/
/* Python wrapper */
-static PyObject *__pyx_pw_5peaks_3guess_fwhm(PyObject *__pyx_self, PyObject *__pyx_v_y); /*proto*/
-static char __pyx_doc_5peaks_2guess_fwhm[] = "guess_fwhm(y)\nReturn the full-width at half maximum for the largest peak in\n the data array.\n\n The algorithm removes the background, then finds a global maximum\n and its corresponding FWHM.\n\n This value can be used as an initial fit parameter, used as input for\n an iterative fit function.\n\n :param y: Data to be used for guessing the fwhm.\n :return: Estimation of full-width at half maximum, based on fwhm of\n the global maximum.\n ";
-static PyMethodDef __pyx_mdef_5peaks_3guess_fwhm = {"guess_fwhm", (PyCFunction)__pyx_pw_5peaks_3guess_fwhm, METH_O, __pyx_doc_5peaks_2guess_fwhm};
-static PyObject *__pyx_pw_5peaks_3guess_fwhm(PyObject *__pyx_self, PyObject *__pyx_v_y) {
+static PyObject *__pyx_pw_4silx_4math_3fit_5peaks_3guess_fwhm(PyObject *__pyx_self, PyObject *__pyx_v_y); /*proto*/
+static char __pyx_doc_4silx_4math_3fit_5peaks_2guess_fwhm[] = "guess_fwhm(y)\nReturn the full-width at half maximum for the largest peak in\n the data array.\n\n The algorithm removes the background, then finds a global maximum\n and its corresponding FWHM.\n\n This value can be used as an initial fit parameter, used as input for\n an iterative fit function.\n\n :param y: Data to be used for guessing the fwhm.\n :return: Estimation of full-width at half maximum, based on fwhm of\n the global maximum.\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_3fit_5peaks_3guess_fwhm = {"guess_fwhm", (PyCFunction)__pyx_pw_4silx_4math_3fit_5peaks_3guess_fwhm, METH_O, __pyx_doc_4silx_4math_3fit_5peaks_2guess_fwhm};
+static PyObject *__pyx_pw_4silx_4math_3fit_5peaks_3guess_fwhm(PyObject *__pyx_self, PyObject *__pyx_v_y) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("guess_fwhm (wrapper)", 0);
- __pyx_r = __pyx_pf_5peaks_2guess_fwhm(__pyx_self, ((PyObject *)__pyx_v_y));
+ __pyx_r = __pyx_pf_4silx_4math_3fit_5peaks_2guess_fwhm(__pyx_self, ((PyObject *)__pyx_v_y));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y) {
+static PyObject *__pyx_pf_4silx_4math_3fit_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_y) {
long __pyx_v_fwhm_min;
PyObject *__pyx_v_background = NULL;
PyObject *__pyx_v_yfit = NULL;
@@ -2358,12 +2807,9 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_t_7;
int __pyx_t_8;
long __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("guess_fwhm", 0);
- /* "peaks.pyx":150
+ /* "silx/math/fit/peaks.pyx":149
* """
* # set at a minimum value for the fwhm
* fwhm_min = 4 # <<<<<<<<<<<<<<
@@ -2372,28 +2818,28 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
*/
__pyx_v_fwhm_min = 4;
- /* "peaks.pyx":153
+ /* "silx/math/fit/peaks.pyx":152
*
* # remove data background (computed with a strip filter)
* background = filters.strip(y, w=1, niterations=1000) # <<<<<<<<<<<<<<
* yfit = y - background
*
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_strip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_v_y);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_y);
__Pyx_GIVEREF(__pyx_v_y);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_y);
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_w, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_niterations, __pyx_int_1000) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_w, __pyx_int_1) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_niterations, __pyx_int_1000) < 0) __PYX_ERR(0, 152, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __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;
@@ -2401,51 +2847,51 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_v_background = __pyx_t_4;
__pyx_t_4 = 0;
- /* "peaks.pyx":154
+ /* "silx/math/fit/peaks.pyx":153
* # remove data background (computed with a strip filter)
* background = filters.strip(y, w=1, niterations=1000)
* yfit = y - background # <<<<<<<<<<<<<<
*
* # basic peak search: find the global maximum
*/
- __pyx_t_4 = PyNumber_Subtract(__pyx_v_y, __pyx_v_background); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyNumber_Subtract(__pyx_v_y, __pyx_v_background); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_v_yfit = __pyx_t_4;
__pyx_t_4 = 0;
- /* "peaks.pyx":157
+ /* "silx/math/fit/peaks.pyx":156
*
* # basic peak search: find the global maximum
* maximum = max(yfit) # <<<<<<<<<<<<<<
* # find indices of all values == maximum
* idx = numpy.nonzero(yfit == maximum)[0]
*/
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_yfit);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_yfit);
__Pyx_GIVEREF(__pyx_v_yfit);
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_yfit);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__pyx_v_maximum = __pyx_t_3;
__pyx_t_3 = 0;
- /* "peaks.pyx":159
+ /* "silx/math/fit/peaks.pyx":158
* maximum = max(yfit)
* # find indices of all values == maximum
* idx = numpy.nonzero(yfit == maximum)[0] # <<<<<<<<<<<<<<
* # take the last one (if any)
* if not len(idx):
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_nonzero); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_yfit, __pyx_v_maximum, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_v_yfit, __pyx_v_maximum, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
__pyx_t_2 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
@@ -2455,39 +2901,59 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
}
}
if (!__pyx_t_2) {
- __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_GOTREF(__pyx_t_3);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __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_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_idx = __pyx_t_1;
__pyx_t_1 = 0;
- /* "peaks.pyx":161
+ /* "silx/math/fit/peaks.pyx":160
* idx = numpy.nonzero(yfit == maximum)[0]
* # take the last one (if any)
* if not len(idx): # <<<<<<<<<<<<<<
* return 0
* posindex = idx[-1]
*/
- __pyx_t_6 = PyObject_Length(__pyx_v_idx); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_idx); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 160, __pyx_L1_error)
__pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
if (__pyx_t_7) {
- /* "peaks.pyx":162
+ /* "silx/math/fit/peaks.pyx":161
* # take the last one (if any)
* if not len(idx):
* return 0 # <<<<<<<<<<<<<<
@@ -2498,33 +2964,41 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_int_0);
__pyx_r = __pyx_int_0;
goto __pyx_L0;
+
+ /* "silx/math/fit/peaks.pyx":160
+ * idx = numpy.nonzero(yfit == maximum)[0]
+ * # take the last one (if any)
+ * if not len(idx): # <<<<<<<<<<<<<<
+ * return 0
+ * posindex = idx[-1]
+ */
}
- /* "peaks.pyx":163
+ /* "silx/math/fit/peaks.pyx":162
* if not len(idx):
* return 0
* posindex = idx[-1] # <<<<<<<<<<<<<<
* height = yfit[posindex]
*
*/
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_idx, -1, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_idx, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_posindex = __pyx_t_1;
__pyx_t_1 = 0;
- /* "peaks.pyx":164
+ /* "silx/math/fit/peaks.pyx":163
* return 0
* posindex = idx[-1]
* height = yfit[posindex] # <<<<<<<<<<<<<<
*
* # now find the width of the peak at half maximum
*/
- __pyx_t_1 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_posindex); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_posindex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_height = __pyx_t_1;
__pyx_t_1 = 0;
- /* "peaks.pyx":167
+ /* "silx/math/fit/peaks.pyx":166
*
* # now find the width of the peak at half maximum
* imin = posindex # <<<<<<<<<<<<<<
@@ -2534,7 +3008,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_v_posindex);
__pyx_v_imin = __pyx_v_posindex;
- /* "peaks.pyx":168
+ /* "silx/math/fit/peaks.pyx":167
* # now find the width of the peak at half maximum
* imin = posindex
* while yfit[imin] > 0.5 * height and imin > 0: # <<<<<<<<<<<<<<
@@ -2542,41 +3016,41 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
* imax = posindex
*/
while (1) {
- __pyx_t_1 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_imin); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_imin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_8) {
} else {
__pyx_t_7 = __pyx_t_8;
goto __pyx_L6_bool_binop_done;
}
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_imin, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_imin, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_7 = __pyx_t_8;
__pyx_L6_bool_binop_done:;
if (!__pyx_t_7) break;
- /* "peaks.pyx":169
+ /* "silx/math/fit/peaks.pyx":168
* imin = posindex
* while yfit[imin] > 0.5 * height and imin > 0:
* imin -= 1 # <<<<<<<<<<<<<<
* imax = posindex
* while yfit[imax] > 0.5 * height and imax < len(yfit) - 1:
*/
- __pyx_t_5 = PyNumber_InPlaceSubtract(__pyx_v_imin, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_imin, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF_SET(__pyx_v_imin, __pyx_t_5);
__pyx_t_5 = 0;
}
- /* "peaks.pyx":170
+ /* "silx/math/fit/peaks.pyx":169
* while yfit[imin] > 0.5 * height and imin > 0:
* imin -= 1
* imax = posindex # <<<<<<<<<<<<<<
@@ -2586,7 +3060,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_INCREF(__pyx_v_posindex);
__pyx_v_imax = __pyx_v_posindex;
- /* "peaks.pyx":171
+ /* "silx/math/fit/peaks.pyx":170
* imin -= 1
* imax = posindex
* while yfit[imax] > 0.5 * height and imax < len(yfit) - 1: # <<<<<<<<<<<<<<
@@ -2594,45 +3068,45 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
*
*/
while (1) {
- __pyx_t_5 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_imax); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_5 = PyObject_GetItem(__pyx_v_yfit, __pyx_v_imax); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_height); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_8) {
} else {
__pyx_t_7 = __pyx_t_8;
goto __pyx_L10_bool_binop_done;
}
- __pyx_t_6 = PyObject_Length(__pyx_v_yfit); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_Length(__pyx_v_yfit); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_imax, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_imax, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_7 = __pyx_t_8;
__pyx_L10_bool_binop_done:;
if (!__pyx_t_7) break;
- /* "peaks.pyx":172
+ /* "silx/math/fit/peaks.pyx":171
* imax = posindex
* while yfit[imax] > 0.5 * height and imax < len(yfit) - 1:
* imax += 1 # <<<<<<<<<<<<<<
*
* fwhm = max(imax - imin - 1, fwhm_min)
*/
- __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_imax, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_imax, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF_SET(__pyx_v_imax, __pyx_t_3);
__pyx_t_3 = 0;
}
- /* "peaks.pyx":174
+ /* "silx/math/fit/peaks.pyx":173
* imax += 1
*
* fwhm = max(imax - imin - 1, fwhm_min) # <<<<<<<<<<<<<<
@@ -2640,19 +3114,19 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
* return fwhm
*/
__pyx_t_9 = __pyx_v_fwhm_min;
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_imax, __pyx_v_imin); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_imax, __pyx_v_imin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_7) {
- __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__pyx_t_3 = __pyx_t_4;
__pyx_t_4 = 0;
@@ -2667,7 +3141,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_v_fwhm = __pyx_t_1;
__pyx_t_1 = 0;
- /* "peaks.pyx":176
+ /* "silx/math/fit/peaks.pyx":175
* fwhm = max(imax - imin - 1, fwhm_min)
*
* return fwhm # <<<<<<<<<<<<<<
@@ -2677,7 +3151,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__pyx_r = __pyx_v_fwhm;
goto __pyx_L0;
- /* "peaks.pyx":135
+ /* "silx/math/fit/peaks.pyx":134
*
*
* def guess_fwhm(y): # <<<<<<<<<<<<<<
@@ -2692,7 +3166,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("peaks.guess_fwhm", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.fit.peaks.guess_fwhm", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_background);
@@ -2709,7 +3183,7 @@ static PyObject *__pyx_pf_5peaks_2guess_fwhm(CYTHON_UNUSED PyObject *__pyx_self,
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -2725,9 +3199,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -2755,12 +3226,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -2774,7 +3245,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -2788,14 +3259,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -2807,19 +3278,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 120, __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[1]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -2836,7 +3307,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -2848,19 +3319,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -2869,12 +3337,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
if (unlikely(__pyx_v_shape == Py_None)) {
PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 127, __pyx_L1_error)
}
- __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[1]; __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_ERR(1, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -2883,7 +3351,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -2893,21 +3361,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 131, __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -2917,95 +3393,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 134, __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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[1]; __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);
+ 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_ERR(1, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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[1]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_5;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -3015,43 +3504,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 149, __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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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[1]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -3061,42 +3559,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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[1]; __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_9);
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 151, __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[1]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -3105,7 +3611,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -3113,19 +3619,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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[1]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -3134,7 +3640,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -3146,20 +3652,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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[1]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -3168,7 +3682,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -3180,34 +3694,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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[1]; __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 162, __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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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[1]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -3216,7 +3738,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -3225,19 +3747,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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[1]; __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[1]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -3247,7 +3769,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -3256,7 +3778,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -3266,21 +3788,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -3290,7 +3820,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -3299,7 +3829,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -3307,30 +3837,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -3339,7 +3857,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -3348,14 +3866,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -3368,7 +3898,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -3379,7 +3909,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -3393,14 +3923,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -3411,16 +3941,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -3429,18 +3956,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -3448,21 +3975,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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[1]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -3470,11 +4005,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -3484,21 +4026,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 190, __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -3508,7 +4058,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -3518,7 +4068,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -3528,7 +4078,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -3538,7 +4088,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -3548,7 +4098,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -3557,7 +4107,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -3567,7 +4117,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -3576,7 +4126,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -3586,7 +4136,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -3595,22 +4145,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -3623,7 +4181,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -3653,7 +4211,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -3666,18 +4224,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -3687,7 +4245,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -3695,10 +4253,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -3708,7 +4274,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -3718,7 +4284,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -3726,32 +4292,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -3763,84 +4342,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 226, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -3848,15 +4471,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -3870,24 +4493,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -3895,16 +4515,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 230, __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[1]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -3924,7 +4544,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -3938,24 +4558,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -3963,16 +4580,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 233, __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[1]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -3992,7 +4609,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -4006,35 +4623,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __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[1]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -4054,7 +4668,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -4071,12 +4685,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -4086,96 +4697,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 245, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 245, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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[1]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 247, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":242
+ /* "View.MemoryView":248
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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[1]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -4186,7 +4805,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -4198,7 +4817,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -4221,7 +4840,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -4233,9 +4852,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -4257,7 +4873,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -4268,25 +4884,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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[1]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -4299,7 +4915,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -4313,7 +4929,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -4327,19 +4943,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -4351,7 +4967,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -4366,7 +4982,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -4380,7 +4996,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -4389,7 +5005,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -4398,7 +5014,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -4408,7 +5024,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -4416,21 +5032,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -4443,7 +5065,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -4457,9 +5079,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -4484,7 +5103,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -4493,7 +5112,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -4505,43 +5124,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 341, __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[1]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -4554,7 +5168,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -4563,14 +5177,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -4583,16 +5197,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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[1]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -4602,7 +5216,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -4611,90 +5225,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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[1]; __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[1]; __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[1]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -4703,7 +5404,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -4712,7 +5413,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -4724,8 +5425,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -4733,7 +5432,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -4746,19 +5445,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -4769,41 +5473,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -4815,8 +5622,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -4836,12 +5643,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -4850,7 +5654,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -4862,25 +5666,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 389, __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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -4889,7 +5695,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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[1]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 389, __pyx_L1_error)
}
break;
}
@@ -4900,18 +5706,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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[1]; __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[1]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 390, __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_ERR(1, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -4921,7 +5727,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -4931,8 +5737,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -4951,7 +5757,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -4965,14 +5771,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -4984,12 +5790,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -5000,7 +5803,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -5011,20 +5814,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -5032,39 +5843,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 399, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 399, __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[1]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 399, __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
+ /* "View.MemoryView":402
*
* 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[1]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -5072,25 +5883,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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[1]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -5098,14 +5917,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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[1]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -5128,7 +5947,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -5142,14 +5961,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -5158,24 +5977,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -5183,111 +5999,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
if (unlikely(size != 2)) {
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 409, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 409, __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[1]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 409, __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
+ /* "View.MemoryView":411
* 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[1]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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[1]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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[1]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 414, __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[1]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 416, __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[1]; __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[1]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 416, __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_ERR(1, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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[1]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -5312,7 +6144,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -5332,24 +6164,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -5357,81 +6186,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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[1]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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[1]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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[1]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -5448,12 +6288,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -5461,11 +6311,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -5477,7 +6333,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -5499,7 +6355,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -5516,55 +6372,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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[1]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 436, __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[1]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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[1]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -5585,7 +6438,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -5594,7 +6447,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -5612,12 +6465,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -5626,7 +6476,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -5635,7 +6485,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -5645,7 +6495,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -5654,7 +6504,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -5664,17 +6514,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL:
* raise MemoryError # <<<<<<<<<<<<<<
* item = tmp
* else:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(1, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -5682,22 +6540,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -5706,7 +6572,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -5716,7 +6582,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -5724,24 +6590,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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[1]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ /*else*/ {
+ __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_ERR(1, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -5751,21 +6625,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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[1]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -5775,7 +6655,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -5788,8 +6668,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -5803,6 +6685,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -5820,7 +6703,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -5841,7 +6724,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -5855,33 +6738,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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[1]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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[1]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -5902,7 +6782,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -5923,41 +6803,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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[1]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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[1]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -5965,26 +6841,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 482, __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[1]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -5994,38 +6872,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__pyx_t_8 = 1;
}
}
- __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(1, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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[1]; __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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -6033,14 +6939,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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[1]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;};
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -6053,51 +6967,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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[1]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(1, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__9, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 484, __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[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __PYX_ERR(1, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -6105,7 +7030,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -6131,7 +7056,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -6152,31 +7077,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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[1]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -6187,53 +7110,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 499, __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[1]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 501, __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -6243,66 +7174,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_7 = 1;
}
}
- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(1, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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[1]; __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[1]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ 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_ERR(1, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 0;
if (unlikely(__pyx_v_bytesvalue == Py_None)) {
PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 464; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -6311,9 +7262,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -6330,7 +7281,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -6341,7 +7292,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -6355,14 +7306,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -6377,7 +7328,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -6387,7 +7338,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -6396,22 +7347,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -6421,7 +7380,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -6430,22 +7389,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -6455,7 +7422,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -6464,22 +7431,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -6489,7 +7464,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -6498,22 +7473,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -6523,7 +7506,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -6533,7 +7516,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -6543,7 +7526,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -6553,7 +7536,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -6562,7 +7545,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -6575,7 +7558,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -6593,78 +7576,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 540, __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[1]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 540, __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
+ /* "View.MemoryView":541
+ * def T(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[1]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -6679,49 +7659,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -6732,77 +7712,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 550, __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[1]; __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[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
}
- __pyx_t_4 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -6811,102 +7790,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 556, __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[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __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[1]; __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[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -6915,110 +7901,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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[1]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__12, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __pyx_lineno = 531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
- __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -7027,55 +8016,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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[1]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -7090,55 +8076,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -7153,51 +8136,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __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[1]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __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;
@@ -7205,11 +8185,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -7226,156 +8206,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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[1]; __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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -7384,18 +8323,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -7406,8 +8344,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -7420,20 +8358,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -7443,7 +8381,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -7452,9 +8390,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -7464,8 +8410,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -7478,7 +8424,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -7492,25 +8438,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -7518,54 +8461,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 599, __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[1]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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[1]; __pyx_lineno = 568; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -7586,7 +8529,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -7600,24 +8543,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -7625,27 +8565,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 602, __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, 0, __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[1]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -7665,7 +8605,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -7679,48 +8619,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -7739,8 +8676,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -7753,49 +8690,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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[1]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -7813,8 +8747,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -7827,26 +8761,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -7855,7 +8786,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -7864,17 +8795,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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[1]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(1, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -7882,14 +8813,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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[1]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -7907,7 +8838,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -7921,14 +8852,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7936,12 +8867,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -7950,7 +8878,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -7959,17 +8887,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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[1]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(1, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -7977,13 +8905,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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[1]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -8002,7 +8930,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -8017,40 +8945,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 644, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -8059,7 +8984,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -8071,7 +8996,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -8093,7 +9018,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -8107,18 +9032,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -8132,7 +9057,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -8161,12 +9086,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -8177,49 +9099,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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[1]; __pyx_lineno = 628; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* tup = index
*
* result = [] # <<<<<<<<<<<<<<
* have_slices = False
* seen_ellipsis = False
*/
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -8228,7 +9158,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -8237,7 +9167,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -8250,25 +9180,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 665, __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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -8277,7 +9209,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 665, __pyx_L1_error)
}
break;
}
@@ -8287,13 +9219,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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[1]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -8304,7 +9236,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -8314,27 +9246,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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[1]; __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[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 668, __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_ERR(1, 668, __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__11);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__11);
- __Pyx_GIVEREF(__pyx_slice__11);
+ __Pyx_INCREF(__pyx_slice__13);
+ __Pyx_GIVEREF(__pyx_slice__13);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__13);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -8342,22 +9274,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__12); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__14); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -8365,17 +9305,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -8388,29 +9336,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 675, __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[1]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -8429,18 +9385,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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[1]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -8451,17 +9407,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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[1]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(1, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -8471,29 +9427,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __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__13);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__13);
- __Pyx_GIVEREF(__pyx_slice__13);
+ __Pyx_INCREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__15);
}
}
- __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(1, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -8503,32 +9465,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __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[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 684, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -8554,76 +9516,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __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[1]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(1, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -8632,7 +9601,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -8671,12 +9640,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -8686,7 +9652,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -8695,7 +9661,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -8706,36 +9672,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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[1]; __pyx_lineno = 682; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -8743,20 +9709,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -8767,7 +9741,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -8777,7 +9751,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -8787,7 +9761,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -8796,7 +9770,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -8805,7 +9779,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -8817,25 +9791,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 732, __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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -8844,7 +9820,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ else __PYX_ERR(1, 732, __pyx_L1_error)
}
break;
}
@@ -8855,7 +9831,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -8865,27 +9841,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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[1]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -8896,7 +9880,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -8905,7 +9889,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -8914,16 +9898,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -8931,24 +9915,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 746, __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[1]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -8957,20 +9949,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 747, __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[1]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -8979,20 +9971,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 748, __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[1]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -9001,55 +9993,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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[1]; __pyx_lineno = 721; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 750, __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
+ /* "View.MemoryView":751
*
* 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[1]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 751, __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
+ /* "View.MemoryView":752
* 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[1]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 752, __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
+ /* "View.MemoryView":754
* 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[1]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -9060,7 +10052,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -9070,18 +10062,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -9090,73 +10082,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 763, __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[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -9178,7 +10178,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -9193,11 +10193,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -9207,7 +10204,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -9217,7 +10214,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -9225,11 +10222,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -9243,28 +10246,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -9276,7 +10293,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -9294,19 +10311,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -9316,7 +10339,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -9326,7 +10349,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -9335,7 +10358,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -9345,7 +10368,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -9353,13 +10376,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -9369,7 +10406,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -9379,7 +10416,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -9387,38 +10424,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -9426,24 +10486,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -9453,7 +10521,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -9463,7 +10531,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -9472,7 +10540,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -9482,7 +10550,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -9490,13 +10558,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -9506,7 +10588,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -9514,49 +10596,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -9566,7 +10671,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -9574,11 +10679,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -9587,7 +10698,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -9597,7 +10708,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -9605,11 +10716,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -9619,7 +10736,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -9627,11 +10744,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -9640,7 +10763,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -9649,7 +10772,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -9660,7 +10783,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -9670,7 +10793,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -9678,23 +10801,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -9704,7 +10835,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -9714,7 +10845,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -9724,7 +10855,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -9732,39 +10863,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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[1]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -9774,7 +10935,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -9798,7 +10959,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -9818,21 +10979,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -9842,7 +11000,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -9852,7 +11010,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -9860,28 +11018,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -9889,20 +11035,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -9911,7 +11065,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -9921,7 +11075,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -9929,13 +11083,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -9945,7 +11105,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -9954,7 +11114,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -9964,35 +11124,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 914, __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[1]; __pyx_lineno = 885; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -10002,32 +11176,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 917, __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[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 917, __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 = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -10036,7 +11218,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -10046,7 +11228,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -10054,11 +11236,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -10068,7 +11256,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -10087,7 +11275,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -10110,11 +11298,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -10124,7 +11309,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -10134,7 +11319,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -10144,7 +11329,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -10155,7 +11340,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -10164,7 +11349,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -10176,7 +11361,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -10188,7 +11373,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -10206,20 +11391,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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[1]; __pyx_lineno = 914; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
+ __pyx_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(1, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -10229,7 +11420,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -10253,7 +11444,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -10266,17 +11457,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -10285,7 +11476,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -10297,7 +11488,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -10310,12 +11501,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -10325,7 +11513,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -10333,30 +11521,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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[1]; __pyx_lineno = 938; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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[1]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -10375,7 +11571,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -10389,12 +11585,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -10404,32 +11597,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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[1]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(1, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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[1]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -10450,36 +11651,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -10488,11 +11689,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -10503,7 +11704,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -10513,7 +11714,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -10521,16 +11723,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -10539,7 +11739,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -10550,35 +11750,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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[1]; __pyx_lineno = 972; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -10587,7 +11795,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -10596,14 +11804,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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[1]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -10611,7 +11819,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -10621,7 +11829,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -10631,7 +11839,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -10640,7 +11848,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -10649,7 +11857,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -10658,7 +11866,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -10667,7 +11875,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -10676,66 +11884,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -10743,7 +12013,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -10752,7 +12022,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -10764,7 +12034,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -10780,12 +12050,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -10800,36 +12071,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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[1]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -10838,19 +12106,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -10861,7 +12137,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -10872,7 +12148,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -10880,7 +12156,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -10897,10 +12173,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -10910,7 +12186,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -10920,7 +12196,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -10930,7 +12206,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -10939,7 +12215,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -10948,7 +12224,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -10959,59 +12235,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -11023,7 +12280,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -11036,12 +12293,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -11050,7 +12304,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -11058,13 +12312,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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[1]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -11083,7 +12337,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -11101,23 +12355,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -11127,7 +12378,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -11136,20 +12387,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -11160,7 +12419,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -11169,20 +12428,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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[1]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -11201,7 +12460,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -11213,7 +12472,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -11223,7 +12482,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -11232,21 +12491,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -11259,7 +12526,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -11276,7 +12543,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -11285,7 +12552,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -11294,17 +12561,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -11314,7 +12581,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -11323,7 +12590,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -11331,11 +12598,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -11346,7 +12621,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -11356,7 +12631,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -11365,7 +12640,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -11373,11 +12648,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -11387,7 +12670,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -11396,21 +12679,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -11423,7 +12714,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -11443,7 +12734,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -11452,7 +12743,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -11461,7 +12752,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -11470,7 +12761,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -11479,7 +12770,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -11489,7 +12780,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -11509,7 +12800,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -11523,9 +12814,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -11533,22 +12832,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -11557,7 +12864,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -11566,7 +12873,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -11577,22 +12884,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -11601,7 +12916,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -11610,7 +12925,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -11622,7 +12937,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -11633,7 +12948,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -11643,7 +12958,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -11652,7 +12967,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -11663,7 +12978,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -11679,7 +12994,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -11689,7 +13004,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -11700,7 +13015,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -11710,7 +13025,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -11720,7 +13035,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -11733,7 +13048,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -11748,7 +13063,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -11758,7 +13073,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -11769,7 +13084,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -11778,7 +13093,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -11787,21 +13102,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -11810,7 +13133,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -11822,7 +13145,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -11832,7 +13155,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -11845,7 +13168,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -11864,11 +13187,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -11878,7 +13198,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -11887,7 +13207,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -11896,7 +13216,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -11906,19 +13226,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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[1]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(1, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -11927,7 +13253,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -11937,7 +13263,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -11948,7 +13274,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -11957,17 +13283,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -11976,7 +13302,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -11987,7 +13313,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -11997,53 +13323,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -12053,7 +13393,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -12077,7 +13417,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -12092,62 +13432,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1238, __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[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1237, __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 = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -12170,7 +13507,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -12186,33 +13523,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -12222,26 +13556,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __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[1]; __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(1, 1242, __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[1]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -12266,7 +13620,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -12283,16 +13637,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -12302,18 +13653,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_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_ERR(1, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -12323,39 +13674,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1247, __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[1]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -12380,7 +13759,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -12405,11 +13784,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -12418,7 +13794,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -12428,7 +13804,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -12437,7 +13813,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -12446,7 +13822,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -12455,7 +13831,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -12465,7 +13841,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -12473,10 +13849,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -12486,7 +13870,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -12494,11 +13878,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -12514,7 +13905,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -12525,7 +13916,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -12535,7 +13926,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -12545,7 +13936,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -12554,7 +13945,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -12562,25 +13953,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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[1]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __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_ERR(1, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -12590,62 +13995,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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[1]; __pyx_lineno = 1254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
+ __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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[1]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __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_ERR(1, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -12653,11 +14070,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -12667,51 +14090,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
+ *
+ * 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);
+
+ /* "View.MemoryView":1297
*
- * 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)
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -12720,7 +14158,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -12729,7 +14167,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -12738,7 +14176,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -12747,7 +14185,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -12756,7 +14194,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -12765,12 +14203,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -12784,28 +14236,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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[1]; __pyx_lineno = 1283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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[1]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(1, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -12814,7 +14272,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -12823,7 +14281,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -12832,7 +14290,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -12841,7 +14299,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -12851,7 +14309,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -12875,21 +14333,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -12898,87 +14356,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -12986,7 +14444,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -12997,7 +14455,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -13007,7 +14465,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -13015,11 +14473,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -13030,7 +14494,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13045,7 +14509,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -13054,7 +14518,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13069,7 +14533,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13085,7 +14549,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -13096,7 +14560,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -13106,7 +14570,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -13116,7 +14580,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -13124,36 +14588,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -13163,7 +14651,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13175,7 +14663,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -13185,7 +14673,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -13194,7 +14682,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -13203,7 +14691,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -13212,7 +14700,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -13223,7 +14711,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13239,7 +14727,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -13248,7 +14736,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -13257,7 +14745,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -13267,7 +14755,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -13278,7 +14766,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -13287,7 +14775,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -13296,22 +14784,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -13320,7 +14816,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -13332,7 +14828,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -13342,6 +14838,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -13353,12 +14850,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -13409,7 +14908,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -13418,7 +14917,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -13460,7 +14959,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "peaks.array", /*tp_name*/
+ "silx.math.fit.peaks.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -13469,8 +14968,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -13565,7 +15065,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "peaks.Enum", /*tp_name*/
+ "silx.math.fit.peaks.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -13574,8 +15074,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -13636,10 +15137,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -13717,39 +15219,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -13761,15 +15263,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -13811,7 +15313,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "peaks.memoryview", /*tp_name*/
+ "silx.math.fit.peaks.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -13820,8 +15322,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -13921,7 +15424,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -13929,13 +15432,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "peaks._memoryviewslice", /*tp_name*/
+ "silx.math.fit.peaks._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -13944,8 +15447,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -14021,7 +15525,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_17_06_2016, __pyx_k_17_06_2016, sizeof(__pyx_k_17_06_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_15_05_2017, __pyx_k_15_05_2017, sizeof(__pyx_k_15_05_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
{&__pyx_kp_s_Before_memory_allocation_error_h, __pyx_k_Before_memory_allocation_error_h, sizeof(__pyx_k_Before_memory_allocation_error_h), 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_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
@@ -14051,7 +15556,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_authors, __pyx_k_authors, sizeof(__pyx_k_authors), 0, 0, 1, 1},
{&__pyx_n_s_background, __pyx_k_background, sizeof(__pyx_k_background), 0, 0, 1, 1},
{&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
- {&__pyx_n_s_basicConfig, __pyx_k_basicConfig, sizeof(__pyx_k_basicConfig), 0, 0, 1, 1},
{&__pyx_n_s_begin_index, __pyx_k_begin_index, sizeof(__pyx_k_begin_index), 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},
@@ -14064,6 +15568,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_index, __pyx_k_end_index, sizeof(__pyx_k_end_index), 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},
@@ -14094,7 +15599,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
{&__pyx_n_s_maximum, __pyx_k_maximum, sizeof(__pyx_k_maximum), 0, 0, 1, 1},
{&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
- {&__pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_k_mntdirect__scisoft_users_tvince, sizeof(__pyx_k_mntdirect__scisoft_users_tvince), 0, 0, 1, 0},
{&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
{&__pyx_n_s_msg, __pyx_k_msg, sizeof(__pyx_k_msg), 0, 0, 1, 1},
{&__pyx_n_s_n_peaks, __pyx_k_n_peaks, sizeof(__pyx_k_n_peaks), 0, 0, 1, 1},
@@ -14123,6 +15627,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
{&__pyx_n_s_sensitivity, __pyx_k_sensitivity, sizeof(__pyx_k_sensitivity), 0, 0, 1, 1},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_math_fit, __pyx_k_silx_math_fit, sizeof(__pyx_k_silx_math_fit), 0, 0, 1, 1},
+ {&__pyx_n_s_silx_math_fit_peaks, __pyx_k_silx_math_fit_peaks, sizeof(__pyx_k_silx_math_fit_peaks), 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},
@@ -14136,9 +15642,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
{&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
{&__pyx_kp_s_we_found_d_peaks, __pyx_k_we_found_d_peaks, sizeof(__pyx_k_we_found_d_peaks), 0, 0, 1, 0},
- {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
{&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
{&__pyx_n_s_y_c, __pyx_k_y_c, sizeof(__pyx_k_y_c), 0, 0, 1, 1},
{&__pyx_n_s_yfit, __pyx_k_yfit, sizeof(__pyx_k_yfit), 0, 0, 1, 1},
@@ -14146,21 +15652,16 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __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 = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __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 = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __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[1]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 103, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 109, __pyx_L1_error)
+ __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 131, __pyx_L1_error)
+ __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 156, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 131, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -14170,227 +15671,252 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "peaks.pyx":81
+ /* "silx/math/fit/peaks.pyx":80
* copy=True,
* dtype=numpy.float64,
* order='C').reshape(-1) # <<<<<<<<<<<<<<
* if debug:
* debug = 1
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_neg_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "peaks.pyx":110
+ /* "silx/math/fit/peaks.pyx":109
* free(peaks_c)
* free(relevances_c)
* raise MemoryError("Failed to reallocate memory for output arrays") # <<<<<<<<<<<<<<
* # Special value -123456 is returned if the initial memory allocation
* #fails, before any search could be performed
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_reallocate_memory_for); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Failed_to_reallocate_memory_for); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__6);
- __Pyx_GIVEREF(__pyx_tuple__6);
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__7);
- __Pyx_GIVEREF(__pyx_tuple__7);
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__8 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__8);
- __Pyx_GIVEREF(__pyx_tuple__8);
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__9 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__9);
- __Pyx_GIVEREF(__pyx_tuple__9);
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__10);
- __Pyx_GIVEREF(__pyx_tuple__10);
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__12 = PyTuple_New(1); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__12, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__12);
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__11 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__11);
- __Pyx_GIVEREF(__pyx_slice__11);
+ __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) __PYX_ERR(1, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__13);
+ __Pyx_GIVEREF(__pyx_slice__13);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__12 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__12);
- __Pyx_GIVEREF(__pyx_slice__12);
+ __pyx_slice__14 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(1, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__14);
+ __Pyx_GIVEREF(__pyx_slice__14);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__13 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__13);
- __Pyx_GIVEREF(__pyx_slice__13);
+ __pyx_slice__15 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__15)) __PYX_ERR(1, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__15);
+ __Pyx_GIVEREF(__pyx_slice__15);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 660; __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_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
- /* "peaks.pyx":46
+ /* "silx/math/fit/peaks.pyx":45
*
*
* def peak_search(y, fwhm, sensitivity=3.5, # <<<<<<<<<<<<<<
* begin_index=None, end_index=None,
* debug=False, relevance_info=False):
*/
- __pyx_tuple__15 = PyTuple_Pack(15, __pyx_n_s_y, __pyx_n_s_fwhm, __pyx_n_s_sensitivity, __pyx_n_s_begin_index, __pyx_n_s_end_index, __pyx_n_s_debug, __pyx_n_s_relevance_info, __pyx_n_s_i, __pyx_n_s_y_c, __pyx_n_s_peaks_c, __pyx_n_s_relevances_c, __pyx_n_s_n_peaks, __pyx_n_s_msg, __pyx_n_s_peaks, __pyx_n_s_relevances); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
- __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_peak_search, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_y, __pyx_n_s_fwhm, __pyx_n_s_sensitivity, __pyx_n_s_begin_index, __pyx_n_s_end_index, __pyx_n_s_debug, __pyx_n_s_relevance_info, __pyx_n_s_i, __pyx_n_s_y_c, __pyx_n_s_peaks_c, __pyx_n_s_relevances_c, __pyx_n_s_n_peaks, __pyx_n_s_msg, __pyx_n_s_peaks, __pyx_n_s_relevances); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 45, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_peak_search, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 45, __pyx_L1_error)
- /* "peaks.pyx":135
+ /* "silx/math/fit/peaks.pyx":134
*
*
* def guess_fwhm(y): # <<<<<<<<<<<<<<
* """Return the full-width at half maximum for the largest peak in
* the data array.
*/
- __pyx_tuple__17 = PyTuple_Pack(11, __pyx_n_s_y, __pyx_n_s_fwhm_min, __pyx_n_s_background, __pyx_n_s_yfit, __pyx_n_s_maximum, __pyx_n_s_idx, __pyx_n_s_posindex, __pyx_n_s_height, __pyx_n_s_imin, __pyx_n_s_imax, __pyx_n_s_fwhm); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
- __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_mntdirect__scisoft_users_tvince, __pyx_n_s_guess_fwhm, 135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__19 = PyTuple_Pack(11, __pyx_n_s_y, __pyx_n_s_fwhm_min, __pyx_n_s_background, __pyx_n_s_yfit, __pyx_n_s_maximum, __pyx_n_s_idx, __pyx_n_s_posindex, __pyx_n_s_height, __pyx_n_s_imin, __pyx_n_s_imax, __pyx_n_s_fwhm); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_guess_fwhm, 134, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 134, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__19 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__21);
- __Pyx_GIVEREF(__pyx_tuple__21);
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -14399,13 +15925,13 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_float_3_5 = PyFloat_FromDouble(3.5); if (unlikely(!__pyx_float_3_5)) {__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_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_float_3_5 = PyFloat_FromDouble(3.5); if (unlikely(!__pyx_float_3_5)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -14424,9 +15950,7 @@ PyMODINIT_FUNC PyInit_peaks(void)
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;
+ static PyThread_type_lock __pyx_t_6[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -14438,17 +15962,24 @@ PyMODINIT_FUNC PyInit_peaks(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_peaks(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -14463,34 +15994,34 @@ PyMODINIT_FUNC PyInit_peaks(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_peaks) {
- 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 (__pyx_module_is_main_silx__math__fit__peaks) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "peaks")) {
- if (unlikely(PyDict_SetItemString(modules, "peaks", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.fit.peaks")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.fit.peaks", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -14500,10 +16031,13 @@ PyMODINIT_FUNC PyInit_peaks(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 103, __pyx_L1_error)
__pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -14514,321 +16048,338 @@ PyMODINIT_FUNC PyInit_peaks(void)
__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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 326, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 951, __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[1]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 951, __pyx_L1_error)
__pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
/*--- Type import code ---*/
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "peaks.pyx":28
+ /* "silx/math/fit/peaks.pyx":28
* """
*
* __authors__ = ["P. Knobel"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "17/06/2016"
+ * __date__ = "15/05/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_P_Knobel);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
__Pyx_GIVEREF(__pyx_kp_s_P_Knobel);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_P_Knobel);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "peaks.pyx":29
+ /* "silx/math/fit/peaks.pyx":29
*
* __authors__ = ["P. Knobel"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "17/06/2016"
+ * __date__ = "15/05/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
- /* "peaks.pyx":30
+ /* "silx/math/fit/peaks.pyx":30
* __authors__ = ["P. Knobel"]
* __license__ = "MIT"
- * __date__ = "17/06/2016" # <<<<<<<<<<<<<<
+ * __date__ = "15/05/2017" # <<<<<<<<<<<<<<
*
* import logging
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_17_06_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_15_05_2017) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
- /* "peaks.pyx":32
- * __date__ = "17/06/2016"
+ /* "silx/math/fit/peaks.pyx":32
+ * __date__ = "15/05/2017"
*
* import logging # <<<<<<<<<<<<<<
* import numpy
*
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_logging, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __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 = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logging, __pyx_t_1) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "peaks.pyx":33
+ /* "silx/math/fit/peaks.pyx":33
*
* import logging
* import numpy # <<<<<<<<<<<<<<
*
- * from . import filters
+ * from silx.math.fit import filters
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __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 = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "peaks.pyx":35
+ /* "silx/math/fit/peaks.pyx":35
* import numpy
*
- * from . import filters # <<<<<<<<<<<<<<
+ * from silx.math.fit import filters # <<<<<<<<<<<<<<
*
- * logging.basicConfig()
+ * _logger = logging.getLogger(__name__)
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_n_s_filters);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_filters);
__Pyx_GIVEREF(__pyx_n_s_filters);
- __pyx_t_2 = __Pyx_Import(__pyx_kp_s__2, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_filters);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_silx_math_fit, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_filters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_filters, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_filters, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":37
- * from . import filters
- *
- * logging.basicConfig() # <<<<<<<<<<<<<<
- * _logger = logging.getLogger(__name__)
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); 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);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_basicConfig); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
- __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
- if (likely(__pyx_t_1)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_3, function);
- }
- }
- if (__pyx_t_1) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __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_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "peaks.pyx":38
+ /* "silx/math/fit/peaks.pyx":37
+ * from silx.math.fit import filters
*
- * logging.basicConfig()
* _logger = logging.getLogger(__name__) # <<<<<<<<<<<<<<
*
* cimport cython
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_logging); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getLogger); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
__Pyx_INCREF(__pyx_t_4);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_1, function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
}
}
if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_GOTREF(__pyx_t_2);
} else {
- __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __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_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_logger, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":46
+ /* "silx/math/fit/peaks.pyx":45
*
*
* def peak_search(y, fwhm, sensitivity=3.5, # <<<<<<<<<<<<<<
* begin_index=None, end_index=None,
* debug=False, relevance_info=False):
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5peaks_1peak_search, NULL, __pyx_n_s_peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_5peaks_1peak_search, NULL, __pyx_n_s_silx_math_fit_peaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_peak_search, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_peak_search, __pyx_t_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":135
+ /* "silx/math/fit/peaks.pyx":134
*
*
* def guess_fwhm(y): # <<<<<<<<<<<<<<
* """Return the full-width at half maximum for the largest peak in
* the data array.
*/
- __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_5peaks_3guess_fwhm, NULL, __pyx_n_s_peaks); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_3fit_5peaks_3guess_fwhm, NULL, __pyx_n_s_silx_math_fit_peaks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_guess_fwhm, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_guess_fwhm, __pyx_t_2) < 0) __PYX_ERR(0, 134, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "peaks.pyx":1
+ /* "silx/math/fit/peaks.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* #/[inserted by cython to avoid comment start]*##########################################################################
* # Copyright (C) 2016-2017 European Synchrotron Radiation Facility
*/
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* info.obj = self
*
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
* def __dealloc__(array self):
*/
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 282, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XGOTREF(generic);
__Pyx_DECREF_SET(generic, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 283, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XGOTREF(strided);
__Pyx_DECREF_SET(strided, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 284, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XGOTREF(indirect);
__Pyx_DECREF_SET(indirect, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XGOTREF(contiguous);
__Pyx_DECREF_SET(contiguous, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_XGOTREF(indirect_contiguous);
__Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
- /* "View.MemoryView":496
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_6[0] = PyThread_allocate_lock();
+ __pyx_t_6[1] = PyThread_allocate_lock();
+ __pyx_t_6[2] = PyThread_allocate_lock();
+ __pyx_t_6[3] = PyThread_allocate_lock();
+ __pyx_t_6[4] = PyThread_allocate_lock();
+ __pyx_t_6[5] = PyThread_allocate_lock();
+ __pyx_t_6[6] = PyThread_allocate_lock();
+ __pyx_t_6[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_6, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* info.obj = self
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * return self.from_object
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_getbuffer_obj_view_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -14847,11 +16398,11 @@ PyMODINIT_FUNC PyInit_peaks(void)
__Pyx_XDECREF(__pyx_t_5);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.fit.peaks", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init peaks");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.fit.peaks");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -14862,7 +16413,8 @@ PyMODINIT_FUNC PyInit_peaks(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -14879,6 +16431,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -14892,6 +16445,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -14917,6 +16471,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -14930,6 +16485,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -15031,9 +16587,10 @@ bad:
return -1;
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -15048,7 +16605,8 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -15067,12 +16625,268 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static void __Pyx_RaiseBufferIndexError(int axis) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a - b);
+ if (likely((x^a) >= 0 || (x^~b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ }
+ x = a - b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla - llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("subtract", return NULL)
+ result = ((double)a) - (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
+}
+#endif
+
+/* BufferIndexError */
+ static void __Pyx_RaiseBufferIndexError(int axis) {
PyErr_Format(PyExc_IndexError,
"Out of bounds on buffer access (axis %d)", axis);
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -15091,7 +16905,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -15103,6 +16918,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -15110,21 +16930,29 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -15134,27 +16962,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -15193,6 +17016,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -15226,10 +17050,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -15289,7 +17116,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -15309,16 +17136,17 @@ bad:
}
#endif
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+/* SetItemInt */
+ static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
int r;
if (!j) return -1;
r = PyObject_SetItem(o, j, v);
Py_DECREF(j);
return r;
}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
+ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
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)))) {
@@ -15336,10 +17164,9 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return -1;
+ PyErr_Clear();
}
}
return m->sq_ass_item(o, i, v);
@@ -15357,7 +17184,8 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -15906,7 +17734,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -15962,7 +17791,6 @@ no_fail:
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
@@ -16041,7 +17869,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
r = PyObject_GetItem(o, j);
@@ -16049,8 +17878,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -16063,8 +17893,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -16076,9 +17907,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -16102,10 +17934,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -16119,7 +17950,124 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -16145,7 +18093,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -16182,7 +18131,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -16265,14 +18215,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -16284,13 +18236,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -16310,22 +18269,26 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -16337,23 +18300,18 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->exc_type;
*value = tstate->exc_value;
*tb = tstate->exc_traceback;
Py_XINCREF(*type);
Py_XINCREF(*value);
Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
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;
@@ -16363,16 +18321,28 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
+}
#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
}
+#endif
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
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;
@@ -16383,7 +18353,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
if (unlikely(tstate->curexc_type))
#else
if (unlikely(PyErr_Occurred()))
@@ -16401,7 +18371,7 @@ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
*type = local_type;
*value = local_value;
*tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_FAST_THREAD_STATE
tmp_type = tstate->exc_type;
tmp_value = tstate->exc_value;
tmp_tb = tstate->exc_traceback;
@@ -16425,41 +18395,134 @@ bad:
return -1;
}
-static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, 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;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
PyErr_SetExcInfo(*type, *value, *tb);
-#endif
*type = tmp_type;
*value = tmp_value;
*tb = tmp_tb;
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(1);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ #endif
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -16480,9 +18543,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -16499,7 +18567,8 @@ bad:
return -1;
}
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+/* ImportFrom */
+ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_Format(PyExc_ImportError,
@@ -16512,28 +18581,14 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
return value;
}
-#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 int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -16606,7 +18661,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -16679,7 +18735,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -16707,83 +18763,83 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ *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 PyObject *__pyx_memview_get_double(const char *itemp) {
+/* Capsule */
+ 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;
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
}
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
double value = __pyx_PyFloat_AsDouble(obj);
if ((value == (double)-1) && PyErr_Occurred())
return 0;
@@ -16791,29 +18847,191 @@ static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
return 1;
}
-#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; \
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
}
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
- #include "longintrepr.h"
- #endif
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
+ const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(unsigned long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(unsigned long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewSliceCopyTemplate */
+ 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;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -16830,36 +19048,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -16868,7 +19179,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -16891,7 +19202,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -16907,34 +19218,9 @@ raise_neg_overflow:
return (long) -1;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
- const unsigned long neg_one = (unsigned long) -1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (is_unsigned) {
- if (sizeof(unsigned long) < sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
- return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(unsigned long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
- }
- } else {
- if (sizeof(unsigned long) <= sizeof(long)) {
- return PyInt_FromLong((long) value);
- } else if (sizeof(unsigned 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(unsigned long),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -16951,36 +19237,129 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -16989,7 +19368,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -17012,7 +19391,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
}
} else {
int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
@@ -17028,195 +19407,9 @@ raise_neg_overflow:
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 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;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -17233,36 +19426,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -17271,7 +19557,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -17294,7 +19580,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -17310,7 +19596,8 @@ raise_neg_overflow:
return (char) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -17350,7 +19637,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -17531,7 +19819,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_double(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -17553,7 +19842,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -17568,7 +19858,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -17606,7 +19897,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -17647,7 +19938,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -17668,8 +19959,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -17677,9 +19970,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -17688,11 +19982,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -17717,18 +20014,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/fit/peaks/peaks.pyx b/silx/math/fit/peaks.pyx
index 02753b0..dfe6f11 100644
--- a/silx/math/fit/peaks/peaks.pyx
+++ b/silx/math/fit/peaks.pyx
@@ -27,14 +27,13 @@ analysis.
__authors__ = ["P. Knobel"]
__license__ = "MIT"
-__date__ = "17/06/2016"
+__date__ = "15/05/2017"
import logging
import numpy
-from . import filters
+from silx.math.fit import filters
-logging.basicConfig()
_logger = logging.getLogger(__name__)
cimport cython
diff --git a/silx/math/fit/peaks/peaks_wrapper.pxd b/silx/math/fit/peaks_wrapper.pxd
index 4c77dc6..4c77dc6 100644
--- a/silx/math/fit/peaks/peaks_wrapper.pxd
+++ b/silx/math/fit/peaks_wrapper.pxd
diff --git a/silx/math/fit/setup.py b/silx/math/fit/setup.py
index f4e1f42..668cb04 100644
--- a/silx/math/fit/setup.py
+++ b/silx/math/fit/setup.py
@@ -1,6 +1,6 @@
# coding: utf-8
# /*##########################################################################
-# Copyright (C) 2016 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2017 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
@@ -39,44 +39,39 @@ def configuration(parent_package='', top_path=None):
# =====================================
# fit functions
# =====================================
- fit_dir = 'functions'
- fit_src = [os.path.join(fit_dir, "src", srcf)
- for srcf in ["funs.c"]]
- fit_src.append(os.path.join(fit_dir, "functions.pyx"))
- fit_inc = [os.path.join(fit_dir, 'include'), numpy.get_include()]
+ fun_src = [os.path.join('functions', "src", "funs.c"),
+ "functions.pyx"]
+ fun_inc = [os.path.join('functions', 'include'), numpy.get_include()]
config.add_extension('functions',
- sources=fit_src,
- include_dirs=fit_inc,
+ sources=fun_src,
+ include_dirs=fun_inc,
language='c')
# =====================================
# fit filters
# =====================================
- fit_dir = 'filters'
- fit_src = [os.path.join(fit_dir, "src", srcf)
- for srcf in ["smoothnd.c", "snip1d.c",
- "snip2d.c", "snip3d.c", "strip.c"]]
- fit_src.append(os.path.join(fit_dir, "filters.pyx"))
- fit_inc = [os.path.join(fit_dir, 'include'), numpy.get_include()]
+ filt_src = [os.path.join('filters', "src", srcf)
+ for srcf in ["smoothnd.c", "snip1d.c",
+ "snip2d.c", "snip3d.c", "strip.c"]]
+ filt_src.append("filters.pyx")
+ filt_inc = [os.path.join('filters', 'include'), numpy.get_include()]
config.add_extension('filters',
- sources=fit_src,
- include_dirs=fit_inc,
+ sources=filt_src,
+ include_dirs=filt_inc,
language='c')
# =====================================
# peaks
# =====================================
- fit_dir = 'peaks'
- fit_src = [os.path.join(fit_dir, "src", srcf)
- for srcf in ["peaks.c"]]
- fit_src.append(os.path.join(fit_dir, "peaks.pyx"))
- fit_inc = [os.path.join(fit_dir, 'include'), numpy.get_include()]
+ peaks_src = [os.path.join('peaks', "src", "peaks.c"),
+ "peaks.pyx"]
+ peaks_inc = [os.path.join('peaks', 'include'), numpy.get_include()]
config.add_extension('peaks',
- sources=fit_src,
- include_dirs=fit_inc,
+ sources=peaks_src,
+ include_dirs=peaks_inc,
language='c')
# =====================================
# =====================================
diff --git a/silx/math/fit/test/test_fit.py b/silx/math/fit/test/test_fit.py
index 4d159c0..11b53cd 100644
--- a/silx/math/fit/test/test_fit.py
+++ b/silx/math/fit/test/test_fit.py
@@ -30,6 +30,9 @@ import unittest
import numpy
import sys
+from silx.test import utils
+from silx.math.fit.leastsq import _logger as fitlogger
+
class Test_leastsq(unittest.TestCase):
"""
@@ -238,6 +241,7 @@ class Test_leastsq(unittest.TestCase):
fittedpar[i])
self.assertTrue(test_condition, msg)
+ @utils.test_logging(fitlogger.name, warning=2)
def testBadlyShapedData(self):
parameters_actual = [10.5, 2, 1000.0, 20., 15]
x = numpy.arange(10000.).reshape(1000, 10)
@@ -259,6 +263,7 @@ class Test_leastsq(unittest.TestCase):
fittedpar[i])
self.assertTrue(test_condition, msg)
+ @utils.test_logging(fitlogger.name, warning=3)
def testDataWithNaN(self):
parameters_actual = [10.5, 2, 1000.0, 20., 15]
x = numpy.arange(10000.).reshape(1000, 10)
diff --git a/silx/math/histogram.py b/silx/math/histogram.py
index 3ee0482..af9ee68 100644
--- a/silx/math/histogram.py
+++ b/silx/math/histogram.py
@@ -136,11 +136,11 @@ bins ranges will be :
* [0, 2.5[, [2.5, 5[, [5, 7.5[, [7.5, 10 **]** if last_bin_closed = **True**
....
-""" # noqa
+"""
__authors__ = ["D. Naudet"]
__license__ = "MIT"
-__date__ = "15/09/2016"
+__date__ = "02/10/2017"
import numpy as np
from .chistogramnd import chistogramnd as _chistogramnd # noqa
@@ -151,7 +151,7 @@ from .chistogramnd_lut import histogramnd_from_lut as _histo_from_lut
class Histogramnd(object):
"""
Computes the multidimensional histogram of some data.
- """ # noqa
+ """
def __init__(self,
sample,
diff --git a/silx/math/histogramnd/histogramnd_c.pxd b/silx/math/histogramnd_c.pxd
index b92b4b7..53b4fae 100644
--- a/silx/math/histogramnd/histogramnd_c.pxd
+++ b/silx/math/histogramnd_c.pxd
@@ -28,7 +28,7 @@ __date__ = "01/02/2016"
cimport numpy
-cdef extern from "include/histogramnd_c.h":
+cdef extern from "histogramnd_c.h":
ctypedef enum histo_opt_type:
HISTO_NONE
diff --git a/silx/math/combo/isnan.h b/silx/math/include/isnan.h
index 9ef86ce..1b9a069 100644
--- a/silx/math/combo/isnan.h
+++ b/silx/math/include/isnan.h
@@ -21,14 +21,9 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-/* This header provides a compatible isnan function across platforms.
+/* This header provides isnan and isfinite functions across platforms.
- VisualStudio 2008 (i.e., Python2.7) provides a _isnan method and no isnan.
-
- Usage from cython:
-
- cdef extern from "isnan.h":
- bint isnan(double x) nogil
+ VisualStudio 2008 (i.e., Python2.7) provides _isnan and _finite functions.
*/
#ifndef __ISNAN_H__
@@ -40,6 +35,7 @@
#include <float.h>
#define isnan(v) _isnan(v)
+#define isfinite(v) _finite(v)
#endif
-#endif /*__ISNAN_H__*/ \ No newline at end of file
+#endif /*__ISNAN_H__*/
diff --git a/silx/math/marchingcubes/marchingcubes.cpp b/silx/math/marchingcubes.cpp
index e97d8f2..3c8a9a6 100644
--- a/silx/math/marchingcubes/marchingcubes.cpp
+++ b/silx/math/marchingcubes.cpp
@@ -1,28 +1,34 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h",
+ "silx/math/marchingcubes/mc.hpp"
+ ],
+ "include_dirs": [
+ "silx/math/marchingcubes",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c++"
+ },
+ "module_name": "silx.math.marchingcubes"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +47,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +59,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +275,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +296,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +335,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +361,88 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef __cplusplus
+ #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #else
+ #define CYTHON_INLINE inline
+ #endif
+#endif
+template<typename T>
+void __Pyx_call_destructor(T& x) {
+ x.~T();
+}
+template<typename T>
+class __Pyx_FakeReference {
+ public:
+ __Pyx_FakeReference() : ptr(NULL) { }
+ __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
+ T *operator->() { return ptr; }
+ T *operator&() { return ptr; }
+ operator T&() { return *ptr; }
+ template<typename U> bool operator ==(U other) { return *ptr == other; }
+ template<typename U> bool operator !=(U other) { return *ptr != other; }
+ private:
+ T *ptr;
+};
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,15 +459,11 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__marchingcubes
-#define __PYX_HAVE_API__marchingcubes
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
+#define __PYX_HAVE__silx__math__marchingcubes
+#define __PYX_HAVE_API__silx__math__marchingcubes
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include <vector>
@@ -254,20 +482,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -275,16 +490,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -301,11 +534,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -319,18 +552,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -341,7 +581,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -421,11 +661,13 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
+/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
@@ -449,13 +691,12 @@ static const char *__pyx_filename;
static const char *__pyx_f[] = {
- "marchingcubes.pyx",
+ "silx/math/marchingcubes.pyx",
"__init__.pxd",
"stringsource",
- "stringsource",
- "stringsource",
"type.pxd",
};
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -491,6 +732,7 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -500,26 +742,28 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -536,19 +780,19 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -557,7 +801,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -566,7 +810,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -575,7 +819,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -584,7 +828,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -593,7 +837,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -602,7 +846,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -611,7 +855,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -620,7 +864,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -629,7 +873,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -638,7 +882,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -647,7 +891,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
*/
typedef npy_long __pyx_t_5numpy_int_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -656,7 +900,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -665,7 +909,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -674,7 +918,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -683,7 +927,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -692,7 +936,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -701,7 +945,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -710,7 +954,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -719,7 +963,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
*/
typedef npy_double __pyx_t_5numpy_float_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -728,7 +972,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
*/
typedef npy_double __pyx_t_5numpy_double_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -736,6 +980,7 @@ typedef npy_double __pyx_t_5numpy_double_t;
* ctypedef npy_cfloat cfloat_t
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
@@ -745,7 +990,9 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
@@ -755,16 +1002,17 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
-struct __pyx_obj_13marchingcubes_MarchingCubes;
+struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes;
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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -773,7 +1021,7 @@ struct __pyx_memoryviewslice_obj;
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -782,7 +1030,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -791,7 +1039,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -800,20 +1048,20 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
-/* "marchingcubes.pyx":56
+/* "silx/math/marchingcubes.pyx":56
*
*
* cdef class MarchingCubes: # <<<<<<<<<<<<<<
* """Compute isosurface using marching cubes algorithm.
*
*/
-struct __pyx_obj_13marchingcubes_MarchingCubes {
+struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes {
PyObject_HEAD
MarchingCubes<float,float> *c_mc;
};
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -822,6 +1070,7 @@ struct __pyx_obj_13marchingcubes_MarchingCubes {
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -837,7 +1086,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -850,7 +1099,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -873,7 +1122,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -890,7 +1139,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -910,7 +1173,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -922,6 +1185,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -938,19 +1204,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -973,18 +1239,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -999,31 +1266,36 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
-#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) : \
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -1031,40 +1303,101 @@ 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);
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* BufferIndexError.proto */
static void __Pyx_RaiseBufferIndexError(int axis);
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -1090,76 +1423,138 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#else
+ #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#endif
+
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#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)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-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);
-
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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);
-}
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#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*/
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -1172,7 +1567,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1188,22 +1584,29 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
-static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name);
-
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1215,9 +1618,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -1231,20 +1645,23 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
@@ -1260,6 +1677,8 @@ static void __Pyx_CppExn2PyErr() {
PyErr_SetString(PyExc_MemoryError, exn.what());
} catch (const std::bad_cast& exn) {
PyErr_SetString(PyExc_TypeError, exn.what());
+ } catch (const std::bad_typeid& exn) {
+ PyErr_SetString(PyExc_TypeError, exn.what());
} catch (const std::domain_error& exn) {
PyErr_SetString(PyExc_ValueError, exn.what());
} catch (const std::invalid_argument& exn) {
@@ -1284,12 +1703,13 @@ static void __Pyx_CppExn2PyErr() {
}
#endif
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
-static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
-
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
+/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
@@ -1302,7 +1722,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
@@ -1310,111 +1731,114 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
#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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
#if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(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);
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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);
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
#if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(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);
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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);
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-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);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
-static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+/* CIntFromPy.proto */
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1425,10 +1849,13 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
@@ -1437,12 +1864,16 @@ static int __Pyx_check_binary_version(void);
#endif
#endif
+/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
+/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1455,19 +1886,21 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* 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 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
@@ -1488,10 +1921,10 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, cha
/* Module declarations from 'libcpp' */
-/* Module declarations from 'mc' */
+/* Module declarations from 'silx.math.mc' */
-/* Module declarations from 'marchingcubes' */
-static PyTypeObject *__pyx_ptype_13marchingcubes_MarchingCubes = 0;
+/* Module declarations from 'silx.math.marchingcubes' */
+static PyTypeObject *__pyx_ptype_4silx_4math_13marchingcubes_MarchingCubes = 0;
static PyTypeObject *__pyx_array_type = 0;
static PyTypeObject *__pyx_MemviewEnum_type = 0;
static PyTypeObject *__pyx_memoryview_type = 0;
@@ -1501,6 +1934,10 @@ static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
+static PyObject *__pyx_convert_vector_to_py_float(const std::vector<float> &); /*proto*/
+static PyObject *__pyx_convert_vector_to_py_unsigned_int(const std::vector<unsigned int> &); /*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*/
@@ -1533,192 +1970,118 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize
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 PyObject *__pyx_convert_vector_to_py_float(const std::vector<float> &); /*proto*/
-static PyObject *__pyx_convert_vector_to_py_unsigned_int(const std::vector<unsigned int> &); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t = { "float32_t", NULL, sizeof(__pyx_t_5numpy_float32_t), { 0 }, 0, 'R', 0, 0 };
static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
-#define __Pyx_MODULE_NAME "marchingcubes"
-int __pyx_module_is_main_marchingcubes = 0;
+#define __Pyx_MODULE_NAME "silx.math.marchingcubes"
+int __pyx_module_is_main_silx__math__marchingcubes = 0;
-/* Implementation of 'marchingcubes' */
-static PyObject *__pyx_builtin_property;
+/* Implementation of 'silx.math.marchingcubes' */
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ImportError;
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 int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_isolevel, PyObject *__pyx_v_invert_normals, PyObject *__pyx_v_sampling); /* proto */
-static void __pyx_pf_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_data); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_slice0, PyArrayObject *__pyx_v_slice1); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_12reset(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(struct __pyx_obj_13marchingcubes_MarchingCubes *__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_13marchingcubes_MarchingCubes(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_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_obj[] = "obj";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_date[] = "__date__";
-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_array[] = "array";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_flags[] = "flags";
-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_format[] = "format";
-static char __pyx_k_import[] = "__import__";
-static char __pyx_k_name_2[] = "__name__";
-static char __pyx_k_slice0[] = "slice0";
-static char __pyx_k_slice1[] = "slice1";
-static char __pyx_k_struct[] = "struct";
-static char __pyx_k_uint32[] = "uint32";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_process[] = "process";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_isolevel[] = "isolevel";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_property[] = "property";
-static char __pyx_k_sampling[] = "sampling";
-static char __pyx_k_T_Vincent[] = "T. Vincent";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_05_09_2016[] = "05/09/2016";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_get_indices[] = "get_indices";
-static char __pyx_k_get_normals[] = "get_normals";
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static char __pyx_k_get_vertices[] = "get_vertices";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_invert_normals[] = "invert_normals";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_Index_out_of_range[] = "Index out of range";
-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_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_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_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_This_module_provides_marching_cu[] = "This module provides marching cubes implementation.\n\nIt provides a :class:`MarchingCubes` class allowing to build an isosurface\nfrom data provided as a 3D data set or slice by slice.\n";
-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_05_09_2016;
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_ravel[] = "ravel";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_slice0[] = "slice0";
+static const char __pyx_k_slice1[] = "slice1";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_uint32[] = "uint32";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_process[] = "process";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_isolevel[] = "isolevel";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_sampling[] = "sampling";
+static const char __pyx_k_T_Vincent[] = "T. Vincent";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_16_08_2017[] = "16/08/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_get_indices[] = "get_indices";
+static const char __pyx_k_get_normals[] = "get_normals";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_get_vertices[] = "get_vertices";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_invert_normals[] = "invert_normals";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_Index_out_of_range[] = "Index out of range";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_This_module_provides_marching_cu[] = "This module provides marching cubes implementation.\n\nIt provides a :class:`MarchingCubes` class allowing to build an isosurface\nfrom data provided as a 3D data set or slice by slice.\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_kp_s_16_08_2017;
+static PyObject *__pyx_n_s_ASCII;
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;
@@ -1726,6 +2089,7 @@ 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_ImportError;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Index_out_of_range;
static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
@@ -1756,6 +2120,7 @@ static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_flags;
@@ -1782,10 +2147,11 @@ 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_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_pack;
static PyObject *__pyx_n_s_process;
-static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_pyx_getbuffer;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
@@ -1809,7 +2175,59 @@ 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_n_s_xrange;
+static int __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_isolevel, PyObject *__pyx_v_invert_normals, PyObject *__pyx_v_sampling); /* proto */
+static void __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_6process(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8process_slice(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_slice0, PyArrayObject *__pyx_v_slice1); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_10finish_process(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_12reset(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_5shape___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8sampling___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14get_vertices(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_16get_normals(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_18get_indices(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_tp_new_4silx_4math_13marchingcubes_MarchingCubes(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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
@@ -1824,9 +2242,9 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__19;
-static PyObject *__pyx_slice__20;
-static PyObject *__pyx_slice__21;
+static PyObject *__pyx_slice__24;
+static PyObject *__pyx_slice__25;
+static PyObject *__pyx_slice__26;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
@@ -1836,14 +2254,19 @@ static PyObject *__pyx_tuple__15;
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__32;
-/* "marchingcubes.pyx":115
+/* "silx/math/marchingcubes.pyx":115
* cdef mc.MarchingCubes[float, float] * c_mc # Pointer to the C++ instance
*
* def __cinit__(self, data=None, isolevel=None, # <<<<<<<<<<<<<<
@@ -1852,15 +2275,12 @@ static PyObject *__pyx_tuple__27;
*/
/* Python wrapper */
-static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_isolevel = 0;
PyObject *__pyx_v_invert_normals = 0;
PyObject *__pyx_v_sampling = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
@@ -1870,7 +2290,7 @@ static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v
values[0] = ((PyObject *)Py_None);
values[1] = ((PyObject *)Py_None);
- /* "marchingcubes.pyx":116
+ /* "silx/math/marchingcubes.pyx":116
*
* def __cinit__(self, data=None, isolevel=None,
* invert_normals=True, sampling=(1, 1, 1)): # <<<<<<<<<<<<<<
@@ -1914,7 +2334,7 @@ static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v
}
}
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 = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 115, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -1933,15 +2353,15 @@ static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 115, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self), __pyx_v_data, __pyx_v_isolevel, __pyx_v_invert_normals, __pyx_v_sampling);
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes___cinit__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self), __pyx_v_data, __pyx_v_isolevel, __pyx_v_invert_normals, __pyx_v_sampling);
- /* "marchingcubes.pyx":115
+ /* "silx/math/marchingcubes.pyx":115
* cdef mc.MarchingCubes[float, float] * c_mc # Pointer to the C++ instance
*
* def __cinit__(self, data=None, isolevel=None, # <<<<<<<<<<<<<<
@@ -1954,7 +2374,7 @@ static int __pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(PyObject *__pyx_v
return __pyx_r;
}
-static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_isolevel, PyObject *__pyx_v_invert_normals, PyObject *__pyx_v_sampling) {
+static int __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_isolevel, PyObject *__pyx_v_invert_normals, PyObject *__pyx_v_sampling) {
int __pyx_r;
__Pyx_RefNannyDeclarations
float __pyx_t_1;
@@ -1966,77 +2386,74 @@ static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_1
PyObject *__pyx_t_7 = NULL;
PyObject *__pyx_t_8 = NULL;
PyObject *__pyx_t_9 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
- /* "marchingcubes.pyx":117
+ /* "silx/math/marchingcubes.pyx":117
* def __cinit__(self, data=None, isolevel=None,
* invert_normals=True, sampling=(1, 1, 1)):
* self.c_mc = new mc.MarchingCubes[float, float](isolevel) # <<<<<<<<<<<<<<
* self.c_mc.invert_normals = bool(invert_normals)
* self.c_mc.sampling[0] = sampling[0]
*/
- __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_isolevel); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_isolevel); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
try {
__pyx_t_2 = new MarchingCubes<float,float> (__pyx_t_1);
} catch(...) {
__Pyx_CppExn2PyErr();
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 117, __pyx_L1_error)
}
__pyx_v_self->c_mc = __pyx_t_2;
- /* "marchingcubes.pyx":118
+ /* "silx/math/marchingcubes.pyx":118
* invert_normals=True, sampling=(1, 1, 1)):
* self.c_mc = new mc.MarchingCubes[float, float](isolevel)
* self.c_mc.invert_normals = bool(invert_normals) # <<<<<<<<<<<<<<
* self.c_mc.sampling[0] = sampling[0]
* self.c_mc.sampling[1] = sampling[1]
*/
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_invert_normals); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_invert_normals); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 118, __pyx_L1_error)
__pyx_v_self->c_mc->invert_normals = (!(!__pyx_t_3));
- /* "marchingcubes.pyx":119
+ /* "silx/math/marchingcubes.pyx":119
* self.c_mc = new mc.MarchingCubes[float, float](isolevel)
* self.c_mc.invert_normals = bool(invert_normals)
* self.c_mc.sampling[0] = sampling[0] # <<<<<<<<<<<<<<
* self.c_mc.sampling[1] = sampling[1]
* self.c_mc.sampling[2] = sampling[2]
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_self->c_mc->sampling[0]) = __pyx_t_5;
- /* "marchingcubes.pyx":120
+ /* "silx/math/marchingcubes.pyx":120
* self.c_mc.invert_normals = bool(invert_normals)
* self.c_mc.sampling[0] = sampling[0]
* self.c_mc.sampling[1] = sampling[1] # <<<<<<<<<<<<<<
* self.c_mc.sampling[2] = sampling[2]
*
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 120, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_self->c_mc->sampling[1]) = __pyx_t_5;
- /* "marchingcubes.pyx":121
+ /* "silx/math/marchingcubes.pyx":121
* self.c_mc.sampling[0] = sampling[0]
* self.c_mc.sampling[1] = sampling[1]
* self.c_mc.sampling[2] = sampling[2] # <<<<<<<<<<<<<<
*
* if data is not None:
*/
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sampling, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
(__pyx_v_self->c_mc->sampling[2]) = __pyx_t_5;
- /* "marchingcubes.pyx":123
+ /* "silx/math/marchingcubes.pyx":123
* self.c_mc.sampling[2] = sampling[2]
*
* if data is not None: # <<<<<<<<<<<<<<
@@ -2047,17 +2464,17 @@ static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_1
__pyx_t_6 = (__pyx_t_3 != 0);
if (__pyx_t_6) {
- /* "marchingcubes.pyx":124
+ /* "silx/math/marchingcubes.pyx":124
*
* if data is not None:
* self.process(data) # <<<<<<<<<<<<<<
*
* def __dealloc__(self):
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_process); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
__pyx_t_8 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
if (likely(__pyx_t_8)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
@@ -2067,26 +2484,50 @@ static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_1
}
}
if (!__pyx_t_8) {
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
} else {
- __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __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 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_data};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_data);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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;
- goto __pyx_L3;
+
+ /* "silx/math/marchingcubes.pyx":123
+ * self.c_mc.sampling[2] = sampling[2]
+ *
+ * if data is not None: # <<<<<<<<<<<<<<
+ * self.process(data)
+ *
+ */
}
- __pyx_L3:;
- /* "marchingcubes.pyx":115
+ /* "silx/math/marchingcubes.pyx":115
* cdef mc.MarchingCubes[float, float] * c_mc # Pointer to the C++ instance
*
* def __cinit__(self, data=None, isolevel=None, # <<<<<<<<<<<<<<
@@ -2102,14 +2543,14 @@ static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_1
__Pyx_XDECREF(__pyx_t_7);
__Pyx_XDECREF(__pyx_t_8);
__Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "marchingcubes.pyx":126
+/* "silx/math/marchingcubes.pyx":126
* self.process(data)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -2118,21 +2559,21 @@ static int __pyx_pf_13marchingcubes_13MarchingCubes___cinit__(struct __pyx_obj_1
*/
/* Python wrapper */
-static void __pyx_pw_13marchingcubes_13MarchingCubes_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_13marchingcubes_13MarchingCubes_3__dealloc__(PyObject *__pyx_v_self) {
+static void __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_3__dealloc__(PyObject *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_pf_13marchingcubes_13MarchingCubes_2__dealloc__(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_2__dealloc__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
}
-static void __pyx_pf_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static void __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "marchingcubes.pyx":127
+ /* "silx/math/marchingcubes.pyx":127
*
* def __dealloc__(self):
* del self.c_mc # <<<<<<<<<<<<<<
@@ -2141,7 +2582,7 @@ static void __pyx_pf_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_o
*/
delete __pyx_v_self->c_mc;
- /* "marchingcubes.pyx":126
+ /* "silx/math/marchingcubes.pyx":126
* self.process(data)
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -2153,56 +2594,54 @@ static void __pyx_pf_13marchingcubes_13MarchingCubes_2__dealloc__(struct __pyx_o
__Pyx_RefNannyFinishContext();
}
-/* "marchingcubes.pyx":129
+/* "silx/math/marchingcubes.pyx":129
* del self.c_mc
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
- * """Allows to unpack object as a single liner:
+ * """Allows one to unpack object as a single liner:
*
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_4__getitem__[] = "Allows to unpack object as a single liner:\n\n vertices, normals, indices = MarchingCubes(...)\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__[] = "Allows one to unpack object as a single liner:\n\n vertices, normals, indices = MarchingCubes(...)\n ";
#if CYTHON_COMPILING_IN_CPYTHON
-struct wrapperbase __pyx_wrapperbase_13marchingcubes_13MarchingCubes_4__getitem__;
+struct wrapperbase __pyx_wrapperbase_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__;
#endif
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self), ((PyObject *)__pyx_v_key));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self), ((PyObject *)__pyx_v_key));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_key) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__getitem__", 0);
- /* "marchingcubes.pyx":134
+ /* "silx/math/marchingcubes.pyx":134
* vertices, normals, indices = MarchingCubes(...)
* """
* if key == 0: # <<<<<<<<<<<<<<
* return self.get_vertices()
* elif key == 1:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "marchingcubes.pyx":135
+ /* "silx/math/marchingcubes.pyx":135
* """
* if key == 0:
* return self.get_vertices() # <<<<<<<<<<<<<<
@@ -2210,10 +2649,10 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
* return self.get_normals()
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_vertices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_vertices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -2223,31 +2662,40 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
}
}
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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/math/marchingcubes.pyx":134
+ * vertices, normals, indices = MarchingCubes(...)
+ * """
+ * if key == 0: # <<<<<<<<<<<<<<
+ * return self.get_vertices()
+ * elif key == 1:
+ */
}
- /* "marchingcubes.pyx":136
+ /* "silx/math/marchingcubes.pyx":136
* if key == 0:
* return self.get_vertices()
* elif key == 1: # <<<<<<<<<<<<<<
* return self.get_normals()
* elif key == 2:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 136, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "marchingcubes.pyx":137
+ /* "silx/math/marchingcubes.pyx":137
* return self.get_vertices()
* elif key == 1:
* return self.get_normals() # <<<<<<<<<<<<<<
@@ -2255,10 +2703,10 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
* return self.get_indices()
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_normals); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_normals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -2268,31 +2716,40 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
}
}
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 = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __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 = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/math/marchingcubes.pyx":136
+ * if key == 0:
+ * return self.get_vertices()
+ * elif key == 1: # <<<<<<<<<<<<<<
+ * return self.get_normals()
+ * elif key == 2:
+ */
}
- /* "marchingcubes.pyx":138
+ /* "silx/math/marchingcubes.pyx":138
* elif key == 1:
* return self.get_normals()
* elif key == 2: # <<<<<<<<<<<<<<
* return self.get_indices()
* else:
*/
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_key, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
if (__pyx_t_2) {
- /* "marchingcubes.pyx":139
+ /* "silx/math/marchingcubes.pyx":139
* return self.get_normals()
* elif key == 2:
* return self.get_indices() # <<<<<<<<<<<<<<
@@ -2300,10 +2757,10 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
* raise IndexError("Index out of range")
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_indices); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -2313,38 +2770,46 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
}
}
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 = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __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 = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
+
+ /* "silx/math/marchingcubes.pyx":138
+ * elif key == 1:
+ * return self.get_normals()
+ * elif key == 2: # <<<<<<<<<<<<<<
+ * return self.get_indices()
+ * else:
+ */
}
- /*else*/ {
- /* "marchingcubes.pyx":141
+ /* "silx/math/marchingcubes.pyx":141
* return self.get_indices()
* else:
* raise IndexError("Index out of range") # <<<<<<<<<<<<<<
*
* def process(self, cnumpy.ndarray[cnumpy.float32_t, ndim=3, mode='c'] data):
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 141, __pyx_L1_error)
}
- /* "marchingcubes.pyx":129
+ /* "silx/math/marchingcubes.pyx":129
* del self.c_mc
*
* def __getitem__(self, key): # <<<<<<<<<<<<<<
- * """Allows to unpack object as a single liner:
+ * """Allows one to unpack object as a single liner:
*
*/
@@ -2353,7 +2818,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -2361,7 +2826,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
return __pyx_r;
}
-/* "marchingcubes.pyx":143
+/* "silx/math/marchingcubes.pyx":143
* raise IndexError("Index out of range")
*
* def process(self, cnumpy.ndarray[cnumpy.float32_t, ndim=3, mode='c'] data): # <<<<<<<<<<<<<<
@@ -2370,17 +2835,14 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_4__getitem__(struct __
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_7process(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_6process[] = "MarchingCubes.process(self, ndarray data)\nCompute an isosurface from a 3D scalar field.\n\n This builds vertices, normals and indices arrays.\n Vertices and normals coordinates are in the same order as input array,\n i.e., (dim 0, dim 1, dim 2).\n\n :param numpy.ndarray data: 3D scalar field\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_7process(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
- CYTHON_UNUSED int __pyx_lineno = 0;
- CYTHON_UNUSED const char *__pyx_filename = NULL;
- CYTHON_UNUSED int __pyx_clineno = 0;
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_7process(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_6process[] = "MarchingCubes.process(self, ndarray data)\nCompute an isosurface from a 3D scalar field.\n\n This builds vertices, normals and indices arrays.\n Vertices and normals coordinates are in the same order as input array,\n i.e., (dim 0, dim 1, dim 2).\n\n :param numpy.ndarray data: 3D scalar field\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_7process(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("process (wrapper)", 0);
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_6process(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self), ((PyArrayObject *)__pyx_v_data));
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 143, __pyx_L1_error)
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_6process(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self), ((PyArrayObject *)__pyx_v_data));
/* function exit code */
goto __pyx_L0;
@@ -2391,7 +2853,7 @@ static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_7process(PyObject *__p
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_data) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_6process(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_data) {
__Pyx_memviewslice __pyx_v_c_data = { 0, 0, { 0 }, { 0 }, { 0 } };
unsigned int __pyx_v_depth;
unsigned int __pyx_v_height;
@@ -2407,9 +2869,6 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
__Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
Py_ssize_t __pyx_t_6;
int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("process", 0);
__pyx_pybuffer_data.pybuffer.buf = NULL;
__pyx_pybuffer_data.refcount = 0;
@@ -2417,24 +2876,24 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
__pyx_pybuffernd_data.rcbuffer = &__pyx_pybuffer_data;
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_data.rcbuffer->pybuffer, (PyObject*)__pyx_v_data, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 143, __pyx_L1_error)
}
__pyx_pybuffernd_data.diminfo[0].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_data.diminfo[0].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_data.diminfo[1].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_data.diminfo[1].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_data.diminfo[2].strides = __pyx_pybuffernd_data.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_data.diminfo[2].shape = __pyx_pybuffernd_data.rcbuffer->pybuffer.shape[2];
- /* "marchingcubes.pyx":152
+ /* "silx/math/marchingcubes.pyx":152
* :param numpy.ndarray data: 3D scalar field
* """
* cdef float[:] c_data = numpy.ravel(data) # <<<<<<<<<<<<<<
* cdef unsigned int depth, height, width
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -2444,28 +2903,46 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_data)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_data)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __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 = NULL;
- __Pyx_INCREF(((PyObject *)__pyx_v_data));
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_data));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
- __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 = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_data)};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_data)};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(((PyObject *)__pyx_v_data));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_data));
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
- if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 152, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_c_data = __pyx_t_5;
__pyx_t_5.memview = NULL;
__pyx_t_5.data = NULL;
- /* "marchingcubes.pyx":155
+ /* "silx/math/marchingcubes.pyx":155
* cdef unsigned int depth, height, width
*
* depth = data.shape[0] # <<<<<<<<<<<<<<
@@ -2474,7 +2951,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
*/
__pyx_v_depth = (__pyx_v_data->dimensions[0]);
- /* "marchingcubes.pyx":156
+ /* "silx/math/marchingcubes.pyx":156
*
* depth = data.shape[0]
* height = data.shape[1] # <<<<<<<<<<<<<<
@@ -2483,7 +2960,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
*/
__pyx_v_height = (__pyx_v_data->dimensions[1]);
- /* "marchingcubes.pyx":157
+ /* "silx/math/marchingcubes.pyx":157
* depth = data.shape[0]
* height = data.shape[1]
* width = data.shape[2] # <<<<<<<<<<<<<<
@@ -2492,7 +2969,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
*/
__pyx_v_width = (__pyx_v_data->dimensions[2]);
- /* "marchingcubes.pyx":159
+ /* "silx/math/marchingcubes.pyx":159
* width = data.shape[2]
*
* self.c_mc.process(&c_data[0], depth, height, width) # <<<<<<<<<<<<<<
@@ -2507,16 +2984,16 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
} else if (unlikely(__pyx_t_6 >= __pyx_v_c_data.shape[0])) __pyx_t_7 = 0;
if (unlikely(__pyx_t_7 != -1)) {
__Pyx_RaiseBufferIndexError(__pyx_t_7);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 159, __pyx_L1_error)
}
try {
__pyx_v_self->c_mc->process((&(*((float *) ( /* dim=0 */ (__pyx_v_c_data.data + __pyx_t_6 * __pyx_v_c_data.strides[0]) )))), __pyx_v_depth, __pyx_v_height, __pyx_v_width);
} catch(...) {
__Pyx_CppExn2PyErr();
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 159, __pyx_L1_error)
}
- /* "marchingcubes.pyx":143
+ /* "silx/math/marchingcubes.pyx":143
* raise IndexError("Index out of range")
*
* def process(self, cnumpy.ndarray[cnumpy.float32_t, ndim=3, mode='c'] data): # <<<<<<<<<<<<<<
@@ -2534,10 +3011,12 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
__Pyx_XDECREF(__pyx_t_4);
__PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_data.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.process", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.process", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
@@ -2549,7 +3028,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
return __pyx_r;
}
-/* "marchingcubes.pyx":161
+/* "silx/math/marchingcubes.pyx":161
* self.c_mc.process(&c_data[0], depth, height, width)
*
* def process_slice(self, # <<<<<<<<<<<<<<
@@ -2558,14 +3037,11 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_6process(struct __pyx_
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_8process_slice[] = "MarchingCubes.process_slice(self, ndarray slice0, ndarray slice1)\nProcess a new slice to build the isosurface.\n\n :param numpy.ndarray slice0: Slice previously provided as slice1.\n :param numpy.ndarray slice1: Slice to process.\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_9process_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_8process_slice[] = "MarchingCubes.process_slice(self, ndarray slice0, ndarray slice1)\nProcess a new slice to build the isosurface.\n\n :param numpy.ndarray slice0: Slice previously provided as slice1.\n :param numpy.ndarray slice1: Slice to process.\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_9process_slice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_slice0 = 0;
PyArrayObject *__pyx_v_slice1 = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("process_slice (wrapper)", 0);
@@ -2589,11 +3065,11 @@ static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice(PyObjec
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_slice1)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("process_slice", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("process_slice", 1, 2, 2, 1); __PYX_ERR(0, 161, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_slice") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "process_slice") < 0)) __PYX_ERR(0, 161, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -2606,15 +3082,15 @@ static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice(PyObjec
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("process_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("process_slice", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 161, __pyx_L3_error)
__pyx_L3_error:;
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.process_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.process_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slice0), __pyx_ptype_5numpy_ndarray, 1, "slice0", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slice1), __pyx_ptype_5numpy_ndarray, 1, "slice1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self), __pyx_v_slice0, __pyx_v_slice1);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slice0), __pyx_ptype_5numpy_ndarray, 1, "slice0", 0))) __PYX_ERR(0, 162, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_slice1), __pyx_ptype_5numpy_ndarray, 1, "slice1", 0))) __PYX_ERR(0, 163, __pyx_L1_error)
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8process_slice(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self), __pyx_v_slice0, __pyx_v_slice1);
/* function exit code */
goto __pyx_L0;
@@ -2625,7 +3101,7 @@ static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice(PyObjec
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_slice0, PyArrayObject *__pyx_v_slice1) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8process_slice(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self, PyArrayObject *__pyx_v_slice0, PyArrayObject *__pyx_v_slice1) {
__Pyx_memviewslice __pyx_v_c_slice0 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_c_slice1 = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_LocalBuf_ND __pyx_pybuffernd_slice0;
@@ -2639,14 +3115,10 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
__Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_7;
- Py_ssize_t __pyx_t_8;
- int __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ int __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("process_slice", 0);
__pyx_pybuffer_slice0.pybuffer.buf = NULL;
__pyx_pybuffer_slice0.refcount = 0;
@@ -2658,16 +3130,16 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
__pyx_pybuffernd_slice1.rcbuffer = &__pyx_pybuffer_slice1;
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slice0.rcbuffer->pybuffer, (PyObject*)__pyx_v_slice0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slice0.rcbuffer->pybuffer, (PyObject*)__pyx_v_slice0, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error)
}
__pyx_pybuffernd_slice0.diminfo[0].strides = __pyx_pybuffernd_slice0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slice0.diminfo[0].shape = __pyx_pybuffernd_slice0.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_slice0.diminfo[1].strides = __pyx_pybuffernd_slice0.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_slice0.diminfo[1].shape = __pyx_pybuffernd_slice0.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slice1.rcbuffer->pybuffer, (PyObject*)__pyx_v_slice1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_slice1.rcbuffer->pybuffer, (PyObject*)__pyx_v_slice1, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 161, __pyx_L1_error)
}
__pyx_pybuffernd_slice1.diminfo[0].strides = __pyx_pybuffernd_slice1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_slice1.diminfo[0].shape = __pyx_pybuffernd_slice1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_slice1.diminfo[1].strides = __pyx_pybuffernd_slice1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_slice1.diminfo[1].shape = __pyx_pybuffernd_slice1.rcbuffer->pybuffer.shape[1];
- /* "marchingcubes.pyx":169
+ /* "silx/math/marchingcubes.pyx":169
* :param numpy.ndarray slice1: Slice to process.
* """
* assert slice0.shape[0] == slice1.shape[0] # <<<<<<<<<<<<<<
@@ -2678,12 +3150,12 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!(((__pyx_v_slice0->dimensions[0]) == (__pyx_v_slice1->dimensions[0])) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 169, __pyx_L1_error)
}
}
#endif
- /* "marchingcubes.pyx":170
+ /* "silx/math/marchingcubes.pyx":170
* """
* assert slice0.shape[0] == slice1.shape[0]
* assert slice0.shape[1] == slice1.shape[1] # <<<<<<<<<<<<<<
@@ -2694,25 +3166,25 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!(((__pyx_v_slice0->dimensions[1]) == (__pyx_v_slice1->dimensions[1])) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 170, __pyx_L1_error)
}
}
#endif
- /* "marchingcubes.pyx":172
+ /* "silx/math/marchingcubes.pyx":172
* assert slice0.shape[1] == slice1.shape[1]
*
* cdef float[:] c_slice0 = numpy.ravel(slice0) # <<<<<<<<<<<<<<
* cdef float[:] c_slice1 = numpy.ravel(slice1)
*
*/
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ravel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 172, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -2722,41 +3194,59 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
}
}
if (!__pyx_t_2) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_slice0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_slice0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __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 = NULL;
- __Pyx_INCREF(((PyObject *)__pyx_v_slice0));
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_slice0));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_slice0));
- __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 = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_slice0)};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_slice0)};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_INCREF(((PyObject *)__pyx_v_slice0));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_slice0));
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_slice0));
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
- if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 172, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_v_c_slice0 = __pyx_t_5;
__pyx_t_5.memview = NULL;
__pyx_t_5.data = NULL;
- /* "marchingcubes.pyx":173
+ /* "silx/math/marchingcubes.pyx":173
*
* cdef float[:] c_slice0 = numpy.ravel(slice0)
* cdef float[:] c_slice1 = numpy.ravel(slice1) # <<<<<<<<<<<<<<
*
* if self.c_mc.depth == 0:
*/
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ravel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_t_3 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_3)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -2766,38 +3256,56 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
}
}
if (!__pyx_t_3) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_slice1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_slice1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
} else {
- __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = NULL;
- __Pyx_INCREF(((PyObject *)__pyx_v_slice1));
- PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_slice1));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_slice1));
- __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 = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_slice1)};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_slice1)};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ __Pyx_INCREF(((PyObject *)__pyx_v_slice1));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_slice1));
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_slice1));
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __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_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_1);
+ if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_c_slice1 = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
+ __pyx_v_c_slice1 = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
- /* "marchingcubes.pyx":175
+ /* "silx/math/marchingcubes.pyx":175
* cdef float[:] c_slice1 = numpy.ravel(slice1)
*
* if self.c_mc.depth == 0: # <<<<<<<<<<<<<<
* # Starts a new isosurface, bootstrap with slice size
* self.c_mc.set_slice_size(slice1.shape[0], slice1.shape[1])
*/
- __pyx_t_7 = ((__pyx_v_self->c_mc->depth == 0) != 0);
- if (__pyx_t_7) {
+ __pyx_t_6 = ((__pyx_v_self->c_mc->depth == 0) != 0);
+ if (__pyx_t_6) {
- /* "marchingcubes.pyx":177
+ /* "silx/math/marchingcubes.pyx":177
* if self.c_mc.depth == 0:
* # Starts a new isosurface, bootstrap with slice size
* self.c_mc.set_slice_size(slice1.shape[0], slice1.shape[1]) # <<<<<<<<<<<<<<
@@ -2805,11 +3313,17 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
* assert slice1.shape[0] == self.c_mc.height
*/
__pyx_v_self->c_mc->set_slice_size((__pyx_v_slice1->dimensions[0]), (__pyx_v_slice1->dimensions[1]));
- goto __pyx_L3;
+
+ /* "silx/math/marchingcubes.pyx":175
+ * cdef float[:] c_slice1 = numpy.ravel(slice1)
+ *
+ * if self.c_mc.depth == 0: # <<<<<<<<<<<<<<
+ * # Starts a new isosurface, bootstrap with slice size
+ * self.c_mc.set_slice_size(slice1.shape[0], slice1.shape[1])
+ */
}
- __pyx_L3:;
- /* "marchingcubes.pyx":179
+ /* "silx/math/marchingcubes.pyx":179
* self.c_mc.set_slice_size(slice1.shape[0], slice1.shape[1])
*
* assert slice1.shape[0] == self.c_mc.height # <<<<<<<<<<<<<<
@@ -2820,12 +3334,12 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!(((__pyx_v_slice1->dimensions[0]) == __pyx_v_self->c_mc->height) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 179, __pyx_L1_error)
}
}
#endif
- /* "marchingcubes.pyx":180
+ /* "silx/math/marchingcubes.pyx":180
*
* assert slice1.shape[0] == self.c_mc.height
* assert slice1.shape[1] == self.c_mc.width # <<<<<<<<<<<<<<
@@ -2836,46 +3350,46 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
if (unlikely(!Py_OptimizeFlag)) {
if (unlikely(!(((__pyx_v_slice1->dimensions[1]) == __pyx_v_self->c_mc->width) != 0))) {
PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 180, __pyx_L1_error)
}
}
#endif
- /* "marchingcubes.pyx":182
+ /* "silx/math/marchingcubes.pyx":182
* assert slice1.shape[1] == self.c_mc.width
*
* self.c_mc.process_slice(&c_slice0[0], &c_slice1[0]) # <<<<<<<<<<<<<<
*
* def finish_process(self):
*/
- __pyx_t_8 = 0;
- __pyx_t_9 = -1;
- if (__pyx_t_8 < 0) {
- __pyx_t_8 += __pyx_v_c_slice0.shape[0];
- if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 0;
- } else if (unlikely(__pyx_t_8 >= __pyx_v_c_slice0.shape[0])) __pyx_t_9 = 0;
- if (unlikely(__pyx_t_9 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_9);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_10 = 0;
- __pyx_t_9 = -1;
- if (__pyx_t_10 < 0) {
- __pyx_t_10 += __pyx_v_c_slice1.shape[0];
- if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
- } else if (unlikely(__pyx_t_10 >= __pyx_v_c_slice1.shape[0])) __pyx_t_9 = 0;
- if (unlikely(__pyx_t_9 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_9);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = 0;
+ __pyx_t_8 = -1;
+ if (__pyx_t_7 < 0) {
+ __pyx_t_7 += __pyx_v_c_slice0.shape[0];
+ if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
+ } else if (unlikely(__pyx_t_7 >= __pyx_v_c_slice0.shape[0])) __pyx_t_8 = 0;
+ if (unlikely(__pyx_t_8 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_8);
+ __PYX_ERR(0, 182, __pyx_L1_error)
+ }
+ __pyx_t_9 = 0;
+ __pyx_t_8 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_c_slice1.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_8 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_c_slice1.shape[0])) __pyx_t_8 = 0;
+ if (unlikely(__pyx_t_8 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_8);
+ __PYX_ERR(0, 182, __pyx_L1_error)
}
try {
- __pyx_v_self->c_mc->process_slice((&(*((float *) ( /* dim=0 */ (__pyx_v_c_slice0.data + __pyx_t_8 * __pyx_v_c_slice0.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_c_slice1.data + __pyx_t_10 * __pyx_v_c_slice1.strides[0]) )))));
+ __pyx_v_self->c_mc->process_slice((&(*((float *) ( /* dim=0 */ (__pyx_v_c_slice0.data + __pyx_t_7 * __pyx_v_c_slice0.strides[0]) )))), (&(*((float *) ( /* dim=0 */ (__pyx_v_c_slice1.data + __pyx_t_9 * __pyx_v_c_slice1.strides[0]) )))));
} catch(...) {
__Pyx_CppExn2PyErr();
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 182, __pyx_L1_error)
}
- /* "marchingcubes.pyx":161
+ /* "silx/math/marchingcubes.pyx":161
* self.c_mc.process(&c_data[0], depth, height, width)
*
* def process_slice(self, # <<<<<<<<<<<<<<
@@ -2892,13 +3406,14 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slice0.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_slice1.rcbuffer->pybuffer);
__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.process_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.process_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
goto __pyx_L2;
__pyx_L0:;
@@ -2912,7 +3427,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
return __pyx_r;
}
-/* "marchingcubes.pyx":184
+/* "silx/math/marchingcubes.pyx":184
* self.c_mc.process_slice(&c_slice0[0], &c_slice1[0])
*
* def finish_process(self): # <<<<<<<<<<<<<<
@@ -2921,25 +3436,25 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_8process_slice(struct
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_11finish_process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_10finish_process[] = "MarchingCubes.finish_process(self)\nClear internal cache after processing slice by slice.";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_11finish_process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_11finish_process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_10finish_process[] = "MarchingCubes.finish_process(self)\nClear internal cache after processing slice by slice.";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_11finish_process(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("finish_process (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_10finish_process(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_10finish_process(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("finish_process", 0);
- /* "marchingcubes.pyx":186
+ /* "silx/math/marchingcubes.pyx":186
* def finish_process(self):
* """Clear internal cache after processing slice by slice."""
* self.c_mc.finish_process() # <<<<<<<<<<<<<<
@@ -2948,7 +3463,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(struc
*/
__pyx_v_self->c_mc->finish_process();
- /* "marchingcubes.pyx":184
+ /* "silx/math/marchingcubes.pyx":184
* self.c_mc.process_slice(&c_slice0[0], &c_slice1[0])
*
* def finish_process(self): # <<<<<<<<<<<<<<
@@ -2963,7 +3478,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(struc
return __pyx_r;
}
-/* "marchingcubes.pyx":188
+/* "silx/math/marchingcubes.pyx":188
* self.c_mc.finish_process()
*
* def reset(self): # <<<<<<<<<<<<<<
@@ -2972,25 +3487,25 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_10finish_process(struc
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_12reset[] = "MarchingCubes.reset(self)\nReset internal resources including computed isosurface info.";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_12reset[] = "MarchingCubes.reset(self)\nReset internal resources including computed isosurface info.";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_13reset(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_12reset(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_12reset(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_12reset(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_12reset(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("reset", 0);
- /* "marchingcubes.pyx":190
+ /* "silx/math/marchingcubes.pyx":190
* def reset(self):
* """Reset internal resources including computed isosurface info."""
* self.c_mc.reset() # <<<<<<<<<<<<<<
@@ -2999,7 +3514,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_12reset(struct __pyx_o
*/
__pyx_v_self->c_mc->reset();
- /* "marchingcubes.pyx":188
+ /* "silx/math/marchingcubes.pyx":188
* self.c_mc.finish_process()
*
* def reset(self): # <<<<<<<<<<<<<<
@@ -3014,7 +3529,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_12reset(struct __pyx_o
return __pyx_r;
}
-/* "marchingcubes.pyx":194
+/* "silx/math/marchingcubes.pyx":194
* @cython.embedsignature(False)
* @property
* def shape(self): # <<<<<<<<<<<<<<
@@ -3023,32 +3538,28 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_12reset(struct __pyx_o
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_15shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_14shape[] = "The shape of the processed scalar field (depth, height, width).";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_15shape(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5shape_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("shape (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_14shape(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_5shape___get__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_5shape___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__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;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("shape", 0);
+ __Pyx_RefNannySetupContext("__get__", 0);
- /* "marchingcubes.pyx":196
+ /* "silx/math/marchingcubes.pyx":196
* def shape(self):
* """The shape of the processed scalar field (depth, height, width)."""
* return self.c_mc.depth, self.c_mc.height, self.c_mc.width # <<<<<<<<<<<<<<
@@ -3056,20 +3567,20 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_o
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->height); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->width); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->c_mc->width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
@@ -3077,7 +3588,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_o
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":194
+ /* "silx/math/marchingcubes.pyx":194
* @cython.embedsignature(False)
* @property
* def shape(self): # <<<<<<<<<<<<<<
@@ -3091,7 +3602,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_o
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3099,7 +3610,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_o
return __pyx_r;
}
-/* "marchingcubes.pyx":200
+/* "silx/math/marchingcubes.pyx":200
* @cython.embedsignature(False)
* @property
* def sampling(self): # <<<<<<<<<<<<<<
@@ -3108,32 +3619,28 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_14shape(struct __pyx_o
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_17sampling(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_16sampling[] = "The sampling over each dimension (depth, height, width).\n\n Default: 1, 1, 1\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_17sampling(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8sampling_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8sampling_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("sampling (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_16sampling(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8sampling___get__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8sampling___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__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;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("sampling", 0);
+ __Pyx_RefNannySetupContext("__get__", 0);
- /* "marchingcubes.pyx":205
+ /* "silx/math/marchingcubes.pyx":205
* Default: 1, 1, 1
* """
* return (self.c_mc.sampling[0], # <<<<<<<<<<<<<<
@@ -3141,44 +3648,44 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __py
* self.c_mc.sampling[2])
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- /* "marchingcubes.pyx":206
+ /* "silx/math/marchingcubes.pyx":206
* """
* return (self.c_mc.sampling[0],
* self.c_mc.sampling[1], # <<<<<<<<<<<<<<
* self.c_mc.sampling[2])
*
*/
- __pyx_t_2 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[1])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- /* "marchingcubes.pyx":207
+ /* "silx/math/marchingcubes.pyx":207
* return (self.c_mc.sampling[0],
* self.c_mc.sampling[1],
* self.c_mc.sampling[2]) # <<<<<<<<<<<<<<
*
* @cython.embedsignature(False)
*/
- __pyx_t_3 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[2])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->c_mc->sampling[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "marchingcubes.pyx":205
+ /* "silx/math/marchingcubes.pyx":205
* Default: 1, 1, 1
* """
* return (self.c_mc.sampling[0], # <<<<<<<<<<<<<<
* self.c_mc.sampling[1],
* self.c_mc.sampling[2])
*/
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
@@ -3186,7 +3693,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __py
__pyx_t_4 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":200
+ /* "silx/math/marchingcubes.pyx":200
* @cython.embedsignature(False)
* @property
* def sampling(self): # <<<<<<<<<<<<<<
@@ -3200,7 +3707,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __py
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.sampling", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.sampling.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3208,7 +3715,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __py
return __pyx_r;
}
-/* "marchingcubes.pyx":211
+/* "silx/math/marchingcubes.pyx":211
* @cython.embedsignature(False)
* @property
* def isolevel(self): # <<<<<<<<<<<<<<
@@ -3217,29 +3724,25 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_16sampling(struct __py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_19isolevel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_18isolevel[] = "The iso-level at which to generate the isosurface";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_19isolevel(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("isolevel (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel___get__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__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("isolevel", 0);
+ __Pyx_RefNannySetupContext("__get__", 0);
- /* "marchingcubes.pyx":213
+ /* "silx/math/marchingcubes.pyx":213
* def isolevel(self):
* """The iso-level at which to generate the isosurface"""
* return self.c_mc.isolevel # <<<<<<<<<<<<<<
@@ -3247,13 +3750,13 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __py
* @cython.embedsignature(False)
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->c_mc->isolevel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->c_mc->isolevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":211
+ /* "silx/math/marchingcubes.pyx":211
* @cython.embedsignature(False)
* @property
* def isolevel(self): # <<<<<<<<<<<<<<
@@ -3264,7 +3767,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __py
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.isolevel", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.isolevel.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3272,7 +3775,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __py
return __pyx_r;
}
-/* "marchingcubes.pyx":217
+/* "silx/math/marchingcubes.pyx":217
* @cython.embedsignature(False)
* @property
* def invert_normals(self): # <<<<<<<<<<<<<<
@@ -3281,29 +3784,25 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_18isolevel(struct __py
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_21invert_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_20invert_normals[] = "True to use gradient descent as normals.";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_21invert_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("invert_normals (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals___get__(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals___get__(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__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("invert_normals", 0);
+ __Pyx_RefNannySetupContext("__get__", 0);
- /* "marchingcubes.pyx":219
+ /* "silx/math/marchingcubes.pyx":219
* def invert_normals(self):
* """True to use gradient descent as normals."""
* return self.c_mc.invert_normals # <<<<<<<<<<<<<<
@@ -3311,13 +3810,13 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struc
* def get_vertices(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->c_mc->invert_normals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->c_mc->invert_normals); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":217
+ /* "silx/math/marchingcubes.pyx":217
* @cython.embedsignature(False)
* @property
* def invert_normals(self): # <<<<<<<<<<<<<<
@@ -3328,7 +3827,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struc
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.invert_normals", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.invert_normals.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3336,7 +3835,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struc
return __pyx_r;
}
-/* "marchingcubes.pyx":221
+/* "silx/math/marchingcubes.pyx":221
* return self.c_mc.invert_normals
*
* def get_vertices(self): # <<<<<<<<<<<<<<
@@ -3345,20 +3844,20 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_20invert_normals(struc
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_23get_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_22get_vertices[] = "MarchingCubes.get_vertices(self)\nVertices currently computed (ndarray of dim NbVertices x 3)\n\n Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_23get_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_15get_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_14get_vertices[] = "MarchingCubes.get_vertices(self)\nVertices currently computed (ndarray of dim NbVertices x 3)\n\n Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_15get_vertices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_vertices (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14get_vertices(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_14get_vertices(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -3366,12 +3865,9 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_vertices", 0);
- /* "marchingcubes.pyx":226
+ /* "silx/math/marchingcubes.pyx":226
* Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).
* """
* return numpy.array(self.c_mc.vertices).reshape(-1, 3) # <<<<<<<<<<<<<<
@@ -3379,15 +3875,15 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
* def get_normals(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_convert_vector_to_py_float(__pyx_v_self->c_mc->vertices); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_convert_vector_to_py_float(__pyx_v_self->c_mc->vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -3397,32 +3893,52 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
}
}
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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __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 = 226; __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 = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 226, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":221
+ /* "silx/math/marchingcubes.pyx":221
* return self.c_mc.invert_normals
*
* def get_vertices(self): # <<<<<<<<<<<<<<
@@ -3437,7 +3953,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.get_vertices", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.get_vertices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3445,7 +3961,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
return __pyx_r;
}
-/* "marchingcubes.pyx":228
+/* "silx/math/marchingcubes.pyx":228
* return numpy.array(self.c_mc.vertices).reshape(-1, 3)
*
* def get_normals(self): # <<<<<<<<<<<<<<
@@ -3454,20 +3970,20 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_22get_vertices(struct
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_25get_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_24get_normals[] = "MarchingCubes.get_normals(self)\nNormals currently computed (ndarray of dim NbVertices x 3)\n\n Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_25get_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_17get_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_16get_normals[] = "MarchingCubes.get_normals(self)\nNormals currently computed (ndarray of dim NbVertices x 3)\n\n Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_17get_normals(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_normals (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_16get_normals(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_16get_normals(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -3475,12 +3991,9 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_normals", 0);
- /* "marchingcubes.pyx":233
+ /* "silx/math/marchingcubes.pyx":233
* Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).
* """
* return numpy.array(self.c_mc.normals).reshape(-1, 3) # <<<<<<<<<<<<<<
@@ -3488,15 +4001,15 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
* def get_indices(self):
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_convert_vector_to_py_float(__pyx_v_self->c_mc->normals); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __pyx_convert_vector_to_py_float(__pyx_v_self->c_mc->normals); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -3506,32 +4019,52 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
}
}
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 = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __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 = 233; __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 = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_2};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_reshape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":228
+ /* "silx/math/marchingcubes.pyx":228
* return numpy.array(self.c_mc.vertices).reshape(-1, 3)
*
* def get_normals(self): # <<<<<<<<<<<<<<
@@ -3546,7 +4079,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.get_normals", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.get_normals", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3554,7 +4087,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
return __pyx_r;
}
-/* "marchingcubes.pyx":235
+/* "silx/math/marchingcubes.pyx":235
* return numpy.array(self.c_mc.normals).reshape(-1, 3)
*
* def get_indices(self): # <<<<<<<<<<<<<<
@@ -3563,20 +4096,20 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_24get_normals(struct _
*/
/* Python wrapper */
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_27get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_13marchingcubes_13MarchingCubes_26get_indices[] = "MarchingCubes.get_indices(self)\nTriangle indices currently computed (ndarray of dim NbTriangles x 3)\n ";
-static PyObject *__pyx_pw_13marchingcubes_13MarchingCubes_27get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_19get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static char __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_18get_indices[] = "MarchingCubes.get_indices(self)\nTriangle indices currently computed (ndarray of dim NbTriangles x 3)\n ";
+static PyObject *__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_19get_indices(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("get_indices (wrapper)", 0);
- __pyx_r = __pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(((struct __pyx_obj_13marchingcubes_MarchingCubes *)__pyx_v_self));
+ __pyx_r = __pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_18get_indices(((struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *)__pyx_v_self));
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(struct __pyx_obj_13marchingcubes_MarchingCubes *__pyx_v_self) {
+static PyObject *__pyx_pf_4silx_4math_13marchingcubes_13MarchingCubes_18get_indices(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
@@ -3584,74 +4117,71 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(struct _
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("get_indices", 0);
- /* "marchingcubes.pyx":238
+ /* "silx/math/marchingcubes.pyx":238
* """Triangle indices currently computed (ndarray of dim NbTriangles x 3)
* """
* return numpy.array(self.c_mc.indices, # <<<<<<<<<<<<<<
* dtype=numpy.uint32).reshape(-1, 3)
*/
__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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_convert_vector_to_py_unsigned_int(__pyx_v_self->c_mc->indices); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __pyx_convert_vector_to_py_unsigned_int(__pyx_v_self->c_mc->indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __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, 0, __pyx_t_1);
__pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- /* "marchingcubes.pyx":239
+ /* "silx/math/marchingcubes.pyx":239
* """
* return numpy.array(self.c_mc.indices,
* dtype=numpy.uint32).reshape(-1, 3) # <<<<<<<<<<<<<<
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "marchingcubes.pyx":238
+ /* "silx/math/marchingcubes.pyx":238
* """Triangle indices currently computed (ndarray of dim NbTriangles x 3)
* """
* return numpy.array(self.c_mc.indices, # <<<<<<<<<<<<<<
* dtype=numpy.uint32).reshape(-1, 3)
*/
- __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 = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 238, __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;
- /* "marchingcubes.pyx":239
+ /* "silx/math/marchingcubes.pyx":239
* """
* return numpy.array(self.c_mc.indices,
* dtype=numpy.uint32).reshape(-1, 3) # <<<<<<<<<<<<<<
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "marchingcubes.pyx":235
+ /* "silx/math/marchingcubes.pyx":235
* return numpy.array(self.c_mc.normals).reshape(-1, 3)
*
* def get_indices(self): # <<<<<<<<<<<<<<
@@ -3666,7 +4196,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(struct _
__Pyx_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("marchingcubes.MarchingCubes.get_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("silx.math.marchingcubes.MarchingCubes.get_indices", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
@@ -3674,7 +4204,7 @@ static PyObject *__pyx_pf_13marchingcubes_13MarchingCubes_26get_indices(struct _
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -3715,16 +4245,13 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
@@ -3737,7 +4264,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L0;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -3746,7 +4273,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_endian_detector = 1;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -3755,7 +4282,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -3764,7 +4291,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -3774,7 +4301,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -3782,22 +4309,30 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
+ /*else*/ {
__pyx_v_copy_shape = 0;
}
__pyx_L4:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -3811,7 +4346,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L6_bool_binop_done;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -3821,23 +4356,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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;}
+ __PYX_ERR(1, 218, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -3851,7 +4402,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L9_bool_binop_done;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -3861,23 +4412,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__7, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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;}
+ __PYX_ERR(1, 222, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -3886,7 +4453,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -3895,7 +4462,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
@@ -3905,7 +4472,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = (__pyx_v_copy_shape != 0);
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
* # 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) # <<<<<<<<<<<<<<
@@ -3914,7 +4481,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
* # 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 # <<<<<<<<<<<<<<
@@ -3923,7 +4490,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231
* 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): # <<<<<<<<<<<<<<
@@ -3934,7 +4501,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -3943,7 +4510,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -3952,20 +4519,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ * 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.
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
* 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
*/
+ /*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
* else:
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -3976,7 +4551,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L11:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -3985,7 +4560,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->suboffsets = NULL;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -3994,7 +4569,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -4003,28 +4578,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
- * cdef list stack
+ * cdef int offset
*/
__pyx_v_f = NULL;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -4033,7 +4608,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
@@ -4051,7 +4626,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -4063,17 +4638,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
+ /*else*/ {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -4082,7 +4665,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L14:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -4092,7 +4675,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -4102,7 +4685,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
@@ -4122,7 +4705,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L20_next_or:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
@@ -4138,43 +4721,51 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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;}
- }
+ __PYX_ERR(1, 259, __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)
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
*/
- switch (__pyx_v_t) {
+ }
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
* (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"
*/
+ switch (__pyx_v_t) {
case NPY_BYTE:
- __pyx_v_f = __pyx_k_b;
+ __pyx_v_f = ((char *)"b");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -4182,10 +4773,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_USHORT: f = "H"
*/
case NPY_UBYTE:
- __pyx_v_f = __pyx_k_B;
+ __pyx_v_f = ((char *)"B");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -4193,10 +4784,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_INT: f = "i"
*/
case NPY_SHORT:
- __pyx_v_f = __pyx_k_h;
+ __pyx_v_f = ((char *)"h");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -4204,10 +4795,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_UINT: f = "I"
*/
case NPY_USHORT:
- __pyx_v_f = __pyx_k_H;
+ __pyx_v_f = ((char *)"H");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -4215,10 +4806,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONG: f = "l"
*/
case NPY_INT:
- __pyx_v_f = __pyx_k_i;
+ __pyx_v_f = ((char *)"i");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -4226,10 +4817,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONG: f = "L"
*/
case NPY_UINT:
- __pyx_v_f = __pyx_k_I;
+ __pyx_v_f = ((char *)"I");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -4237,10 +4828,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGLONG: f = "q"
*/
case NPY_LONG:
- __pyx_v_f = __pyx_k_l;
+ __pyx_v_f = ((char *)"l");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -4248,10 +4839,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONGLONG: f = "Q"
*/
case NPY_ULONG:
- __pyx_v_f = __pyx_k_L;
+ __pyx_v_f = ((char *)"L");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -4259,10 +4850,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_FLOAT: f = "f"
*/
case NPY_LONGLONG:
- __pyx_v_f = __pyx_k_q;
+ __pyx_v_f = ((char *)"q");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -4270,10 +4861,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_DOUBLE: f = "d"
*/
case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k_Q;
+ __pyx_v_f = ((char *)"Q");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -4281,10 +4872,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGDOUBLE: f = "g"
*/
case NPY_FLOAT:
- __pyx_v_f = __pyx_k_f;
+ __pyx_v_f = ((char *)"f");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -4292,10 +4883,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CFLOAT: f = "Zf"
*/
case NPY_DOUBLE:
- __pyx_v_f = __pyx_k_d;
+ __pyx_v_f = ((char *)"d");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -4303,10 +4894,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CDOUBLE: f = "Zd"
*/
case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k_g;
+ __pyx_v_f = ((char *)"g");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -4314,10 +4905,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
case NPY_CFLOAT:
- __pyx_v_f = __pyx_k_Zf;
+ __pyx_v_f = ((char *)"Zf");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -4325,10 +4916,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_OBJECT: f = "O"
*/
case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k_Zd;
+ __pyx_v_f = ((char *)"Zd");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -4336,10 +4927,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* else:
*/
case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k_Zg;
+ __pyx_v_f = ((char *)"Zg");
break;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -4347,37 +4938,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
case NPY_OBJECT:
- __pyx_v_f = __pyx_k_O;
+ __pyx_v_f = ((char *)"O");
break;
default:
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __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_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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;}
+ __PYX_ERR(1, 278, __pyx_L1_error)
break;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -4386,7 +4977,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->format = __pyx_v_f;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -4395,19 +4986,27 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
* 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));
+ /*else*/ {
+ __pyx_v_info->format = ((char *)malloc(0xFF));
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
* else:
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -4416,7 +5015,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->format[0]) = '^';
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -4425,17 +5024,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_offset = 0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285
* 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
__pyx_v_f = __pyx_t_7;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
@@ -4445,7 +5044,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
(__pyx_v_f[0]) = '\x00';
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -4477,7 +5076,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -4501,7 +5100,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -4511,7 +5110,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -4519,11 +5118,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
- goto __pyx_L3;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
}
- __pyx_L3:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -4533,7 +5138,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -4541,11 +5146,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
*
*/
free(__pyx_v_info->strides);
- goto __pyx_L4;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
+ * 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_L4:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -4557,7 +5168,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -4569,12 +5180,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -4582,13 +5190,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -4607,7 +5215,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -4619,12 +5227,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -4632,13 +5237,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -4657,7 +5262,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -4669,12 +5274,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -4682,13 +5284,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -4707,7 +5309,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -4719,12 +5321,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -4732,13 +5331,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
* 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_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_ERR(1, 780, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -4757,7 +5356,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -4769,12 +5368,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -4782,13 +5378,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
* 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_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_ERR(1, 783, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -4807,7 +5403,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -4834,22 +5430,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ *
+ * cdef dtype child
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
@@ -4857,7 +5450,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -4866,33 +5459,38 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
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_ERR(1, 794, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 794, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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
+ /* "../../../../../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;};
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 795, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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;}
+ 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_ERR(1, 795, __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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -4901,7 +5499,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -4909,60 +5507,68 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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;}
+ __PYX_ERR(1, 796, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __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_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __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;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __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_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __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
+ /* "../../../../../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__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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;}
+ __PYX_ERR(1, 799, __pyx_L1_error)
+
+ /* "../../../../../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")
+ *
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -4982,7 +5588,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__pyx_L8_next_or:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
+ /* "../../../../../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)): # <<<<<<<<<<<<<<
@@ -4998,23 +5604,39 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
+
+ /* "../../../../../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")
+ */
if (__pyx_t_6) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 803, __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")
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -5022,24 +5644,24 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* 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_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __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
+ /* "../../../../../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;
+ (__pyx_v_f[0]) = 0x78;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -5048,7 +5670,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_f = (__pyx_v_f + 1);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -5059,7 +5681,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
(__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -5069,7 +5691,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -5079,19 +5701,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __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
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -5101,357 +5723,365 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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;}
+ __PYX_ERR(1, 823, __pyx_L1_error)
+
+ /* "../../../../../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.")
+ *
+ */
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __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
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 104;
+ (__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 105;
+ (__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 108;
+ (__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 113;
+ (__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 102;
+ (__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 100;
+ (__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 103;
+ (__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __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[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __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[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __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
+ /* "../../../../../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;}
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_ERR(1, 844, __pyx_L1_error)
}
__pyx_L15:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -5459,23 +6089,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../../../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:
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
+ /* "../../../../../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;}
+ /*else*/ {
+ __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_ERR(1, 849, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -5485,7 +6123,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -5495,7 +6133,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_r = __pyx_v_f;
goto __pyx_L0;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -5520,7 +6158,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
return __pyx_r;
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -5535,7 +6173,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
int __pyx_t_2;
__Pyx_RefNannySetupContext("set_array_base", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -5546,7 +6184,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
@@ -5554,20 +6192,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
+
+ /* "../../../../../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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ /* "../../../../../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)
*/
+ /*else*/ {
Py_INCREF(__pyx_v_base);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -5578,7 +6224,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
}
__pyx_L3:;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ /* "../../../../../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) # <<<<<<<<<<<<<<
@@ -5587,7 +6233,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
Py_XDECREF(__pyx_v_arr->base);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
* baseptr = <PyObject*>base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
@@ -5596,7 +6242,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
__pyx_v_arr->base = __pyx_v_baseptr;
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -5608,7 +6254,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -5622,7 +6268,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -5632,7 +6278,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -5643,21 +6289,31 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "../../../../../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:
+ */
}
- /*else*/ {
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
* return None
* else:
* return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
*/
+ /*else*/ {
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -5672,7 +6328,509 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":987
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":988
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 989, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":993
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":994
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 995, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":999
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "vector.to_py":67
+ *
+ * @cname("__pyx_convert_vector_to_py_float")
+ * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<<
+ * return [X_to_py(v[i]) for i in range(v.size())]
+ *
+ */
+
+static PyObject *__pyx_convert_vector_to_py_float(const std::vector<float> &__pyx_v_v) {
+ size_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ size_t __pyx_t_2;
+ size_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_float", 0);
+
+ /* "vector.to_py":68
+ * @cname("__pyx_convert_vector_to_py_float")
+ * cdef object __pyx_convert_vector_to_py_float(vector[X]& v):
+ * return [X_to_py(v[i]) for i in range(v.size())] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_v_v.size();
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+ __pyx_t_4 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "vector.to_py":67
+ *
+ * @cname("__pyx_convert_vector_to_py_float")
+ * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<<
+ * return [X_to_py(v[i]) for i in range(v.size())]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_convert_vector_to_py_unsigned_int(const std::vector<unsigned int> &__pyx_v_v) {
+ size_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ size_t __pyx_t_2;
+ size_t __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_unsigned_int", 0);
+
+ /* "vector.to_py":68
+ * @cname("__pyx_convert_vector_to_py_unsigned_int")
+ * cdef object __pyx_convert_vector_to_py_unsigned_int(vector[X]& v):
+ * return [X_to_py(v[i]) for i in range(v.size())] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __pyx_v_v.size();
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+ __pyx_t_4 = __Pyx_PyInt_From_unsigned_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "vector.to_py":67
+ *
+ * @cname("__pyx_convert_vector_to_py_unsigned_int")
+ * cdef object __pyx_convert_vector_to_py_unsigned_int(vector[X]& v): # <<<<<<<<<<<<<<
+ * return [X_to_py(v[i]) for i in range(v.size())]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_unsigned_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5688,9 +6846,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -5718,12 +6873,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -5737,7 +6892,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -5751,14 +6906,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __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;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -5770,19 +6925,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __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(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __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;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -5799,7 +6954,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -5811,19 +6966,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -5832,12 +6984,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
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_ERR(2, 127, __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_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -5846,7 +6998,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -5856,21 +7008,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __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;}
+ __PYX_ERR(2, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -5880,95 +7040,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __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 = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __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;}
+ __PYX_ERR(2, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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);
+ 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_ERR(2, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -5978,43 +7151,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__14, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -6024,42 +7206,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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;}
+ __PYX_ERR(2, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -6068,7 +7258,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -6076,19 +7266,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -6097,7 +7287,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -6109,20 +7299,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -6131,7 +7329,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -6143,34 +7341,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __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_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -6179,7 +7385,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -6188,19 +7394,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -6210,7 +7416,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -6219,7 +7425,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -6229,21 +7435,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__15, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -6253,7 +7467,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -6262,7 +7476,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -6270,30 +7484,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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;}
+ __PYX_ERR(2, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
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_ERR(2, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -6302,7 +7504,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -6311,14 +7513,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -6331,7 +7545,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -6342,7 +7556,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -6356,14 +7570,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -6374,16 +7588,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -6392,18 +7603,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -6411,21 +7622,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -6433,11 +7652,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -6447,21 +7673,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__16, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __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;}
+ __PYX_ERR(2, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -6471,7 +7705,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -6481,7 +7715,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -6491,7 +7725,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -6501,7 +7735,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -6511,7 +7745,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -6520,7 +7754,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -6530,7 +7764,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -6539,7 +7773,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -6549,7 +7783,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -6558,22 +7792,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -6586,7 +7828,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -6616,7 +7858,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -6629,18 +7871,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -6650,7 +7892,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -6658,10 +7900,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -6671,7 +7921,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -6681,7 +7931,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -6689,32 +7939,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -6726,84 +7989,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
/* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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;
}
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+/* "View.MemoryView":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -6811,15 +8118,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6833,24 +8140,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -6858,16 +8162,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __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_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -6887,7 +8191,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6901,24 +8205,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -6926,16 +8227,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __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_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -6955,7 +8256,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -6969,35 +8270,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __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;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -7017,7 +8315,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -7034,12 +8332,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -7049,96 +8344,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __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_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __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_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __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_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __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_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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
+ /* "View.MemoryView":248
* 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;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -7149,7 +8452,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -7161,7 +8464,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -7184,7 +8487,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -7196,9 +8499,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -7220,7 +8520,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -7231,25 +8531,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -7262,7 +8562,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -7276,7 +8576,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -7290,19 +8590,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -7314,7 +8614,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -7329,7 +8629,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -7343,7 +8643,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -7352,7 +8652,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -7361,7 +8661,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -7371,7 +8671,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -7379,21 +8679,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -7406,7 +8712,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -7420,9 +8726,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -7447,7 +8750,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -7456,7 +8759,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -7468,43 +8771,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -7517,7 +8815,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -7526,14 +8824,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -7546,16 +8844,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -7565,7 +8863,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -7574,90 +8872,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -7666,7 +9051,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -7675,7 +9060,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -7687,8 +9072,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -7696,7 +9079,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -7709,19 +9092,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -7732,41 +9120,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -7778,8 +9269,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -7799,12 +9290,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -7813,7 +9301,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7825,25 +9313,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __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;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -7852,7 +9342,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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;}
+ else __PYX_ERR(2, 389, __pyx_L1_error)
}
break;
}
@@ -7863,18 +9353,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __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_ERR(2, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -7884,7 +9374,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -7894,8 +9384,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -7914,7 +9404,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -7928,14 +9418,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -7947,12 +9437,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -7963,7 +9450,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -7974,20 +9461,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -7995,39 +9490,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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;}
+ __PYX_ERR(2, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __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_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __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
+ /* "View.MemoryView":402
*
* 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;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -8035,25 +9530,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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;}
+ /*else*/ {
+ __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_ERR(2, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -8061,14 +9564,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_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_ERR(2, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -8091,7 +9594,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -8105,14 +9608,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -8121,24 +9624,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -8146,111 +9646,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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;}
+ __PYX_ERR(2, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __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_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __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
+ /* "View.MemoryView":411
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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_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_ERR(2, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __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_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_ERR(2, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __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_ERR(2, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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;}
+ /*else*/ {
+ __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_ERR(2, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -8275,7 +9791,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -8295,24 +9811,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -8320,81 +9833,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -8411,12 +9935,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -8424,11 +9958,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -8440,7 +9980,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -8462,7 +10002,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -8479,55 +10019,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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;}
+ __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_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -8548,7 +10085,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -8557,7 +10094,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -8575,12 +10112,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -8589,7 +10123,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -8598,7 +10132,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -8608,7 +10142,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -8617,7 +10151,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -8627,17 +10161,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* 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;}
+ PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -8645,22 +10187,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -8669,7 +10219,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -8679,7 +10229,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -8687,24 +10237,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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;}
+ /*else*/ {
+ __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_ERR(2, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -8714,21 +10272,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -8738,7 +10302,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -8751,8 +10315,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -8766,6 +10332,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -8783,7 +10350,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -8804,7 +10371,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -8818,33 +10385,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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_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_ERR(2, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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_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_ERR(2, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -8865,7 +10429,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -8886,41 +10450,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -8928,26 +10488,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __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_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -8957,38 +10519,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -8996,14 +10586,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -9016,51 +10614,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__17, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __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;}
+ __PYX_ERR(2, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -9068,7 +10677,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -9094,7 +10703,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -9115,31 +10724,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -9150,53 +10757,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __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_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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;}
+ 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_ERR(2, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __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_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -9206,66 +10821,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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;}
+ 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_ERR(2, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 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_ERR(2, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -9274,9 +10909,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -9293,7 +10928,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -9304,7 +10939,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -9318,14 +10953,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -9340,7 +10975,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -9350,7 +10985,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -9359,22 +10994,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -9384,7 +11027,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -9393,22 +11036,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -9418,7 +11069,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -9427,22 +11078,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -9452,7 +11111,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -9461,22 +11120,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -9486,7 +11153,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -9496,7 +11163,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -9506,7 +11173,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -9516,7 +11183,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -9525,7 +11192,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -9538,7 +11205,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -9556,78 +11223,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __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;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __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
+ /* "View.MemoryView":541
+ * def T(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;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -9642,49 +11306,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -9695,77 +11359,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__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_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __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_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9774,102 +11437,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __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;}
+ __PYX_ERR(2, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__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_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __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_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9878,110 +11548,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__23, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -9990,55 +11663,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -10053,55 +11723,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__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_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -10116,51 +11783,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __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_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __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_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __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;
@@ -10168,11 +11832,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -10189,156 +11853,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__Pyx_INCREF(__pyx_int_1);
__pyx_v_result = __pyx_int_1;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -10347,18 +11970,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -10369,8 +11991,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -10383,20 +12005,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -10406,7 +12028,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -10415,9 +12037,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -10427,8 +12057,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -10441,7 +12071,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -10455,25 +12085,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -10481,54 +12108,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __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;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -10549,7 +12176,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -10563,24 +12190,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -10588,27 +12212,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 0, __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_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -10628,7 +12252,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -10642,48 +12266,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -10702,8 +12323,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -10716,49 +12337,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -10776,8 +12394,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -10790,26 +12408,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -10818,7 +12433,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -10827,17 +12442,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(2, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -10845,14 +12460,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -10870,7 +12485,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10884,14 +12499,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -10899,12 +12514,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -10913,7 +12525,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -10922,17 +12534,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(2, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -10940,13 +12552,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -10965,7 +12577,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -10980,40 +12592,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -11022,7 +12631,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -11034,7 +12643,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -11056,7 +12665,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -11070,18 +12679,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -11095,7 +12704,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -11124,12 +12733,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -11140,49 +12746,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -11191,7 +12805,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -11200,7 +12814,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -11213,25 +12827,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __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;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -11240,7 +12856,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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;}
+ else __PYX_ERR(2, 665, __pyx_L1_error)
}
break;
}
@@ -11250,13 +12866,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -11267,7 +12883,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -11277,27 +12893,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __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_ERR(2, 668, __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__19);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__19);
- __Pyx_GIVEREF(__pyx_slice__19);
+ __Pyx_INCREF(__pyx_slice__24);
+ __Pyx_GIVEREF(__pyx_slice__24);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__24);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -11305,22 +12921,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__20); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__25); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -11328,17 +12952,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -11351,29 +12983,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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_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_ERR(2, 675, __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_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __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;}
+ __PYX_ERR(2, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -11392,18 +13032,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -11414,17 +13054,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -11434,29 +13074,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __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__21);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __Pyx_INCREF(__pyx_slice__26);
+ __Pyx_GIVEREF(__pyx_slice__26);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__26);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -11466,32 +13112,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -11517,76 +13163,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -11595,7 +13248,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -11634,12 +13287,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -11649,7 +13299,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -11658,7 +13308,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -11669,36 +13319,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ __PYX_ERR(2, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -11706,20 +13356,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -11730,7 +13388,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -11740,7 +13398,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -11750,7 +13408,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -11759,7 +13417,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -11768,7 +13426,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -11780,25 +13438,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __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;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -11807,7 +13467,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ else __PYX_ERR(2, 732, __pyx_L1_error)
}
break;
}
@@ -11818,7 +13478,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -11828,27 +13488,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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;}
+ __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_ERR(2, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -11859,7 +13527,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -11868,7 +13536,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -11877,16 +13545,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -11894,24 +13562,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -11920,20 +13596,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -11942,20 +13618,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -11964,55 +13640,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __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
+ /* "View.MemoryView":751
*
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __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
+ /* "View.MemoryView":752
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __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
+ /* "View.MemoryView":754
* 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;}
+ __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_ERR(2, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -12023,7 +13699,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -12033,18 +13709,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -12053,73 +13729,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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_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_ERR(2, 763, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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_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_ERR(2, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -12141,7 +13825,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -12156,11 +13840,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -12170,7 +13851,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -12180,7 +13861,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -12188,11 +13869,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -12206,28 +13893,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -12239,7 +13940,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -12257,19 +13958,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -12279,7 +13986,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -12289,7 +13996,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -12298,7 +14005,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -12308,7 +14015,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -12316,13 +14023,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -12332,7 +14053,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -12342,7 +14063,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -12350,38 +14071,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -12389,24 +14133,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -12416,7 +14168,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -12426,7 +14178,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -12435,7 +14187,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -12445,7 +14197,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -12453,13 +14205,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -12469,7 +14235,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -12477,49 +14243,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -12529,7 +14318,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -12537,11 +14326,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -12550,7 +14345,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -12560,7 +14355,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -12568,11 +14363,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -12582,7 +14383,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -12590,11 +14391,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -12603,7 +14410,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -12612,7 +14419,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -12623,7 +14430,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -12633,7 +14440,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -12641,23 +14448,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -12667,7 +14482,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -12677,7 +14492,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -12687,7 +14502,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -12695,39 +14510,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -12737,7 +14582,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -12761,7 +14606,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -12781,21 +14626,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -12805,7 +14647,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -12815,7 +14657,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -12823,28 +14665,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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;}
+ __PYX_ERR(2, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
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_ERR(2, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -12852,20 +14682,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -12874,7 +14712,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -12884,7 +14722,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -12892,13 +14730,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -12908,7 +14752,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -12917,7 +14761,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -12927,35 +14771,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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;}
+ __PYX_ERR(2, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -12965,32 +14823,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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;}
+ __PYX_ERR(2, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -12999,7 +14865,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -13009,7 +14875,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -13017,11 +14883,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -13031,7 +14903,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -13050,7 +14922,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -13073,11 +14945,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -13087,7 +14956,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -13097,7 +14966,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -13107,7 +14976,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -13118,7 +14987,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -13127,7 +14996,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -13139,7 +15008,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -13151,7 +15020,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -13169,20 +15038,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -13192,7 +15067,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -13216,7 +15091,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -13229,17 +15104,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -13248,7 +15123,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -13260,7 +15135,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -13273,12 +15148,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -13288,7 +15160,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -13296,30 +15168,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -13338,7 +15218,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -13352,12 +15232,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -13367,32 +15244,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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;}
+ /*else*/ {
+ __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_ERR(2, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -13413,36 +15298,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -13451,11 +15336,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -13466,7 +15351,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -13476,7 +15361,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -13484,16 +15370,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -13502,7 +15386,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -13513,35 +15397,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -13550,7 +15442,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -13559,14 +15451,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -13574,7 +15466,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -13584,7 +15476,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -13594,7 +15486,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -13603,7 +15495,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -13612,7 +15504,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -13621,7 +15513,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -13630,7 +15522,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -13639,66 +15531,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -13706,7 +15660,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -13715,7 +15669,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -13727,7 +15681,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -13743,12 +15697,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -13763,36 +15718,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -13801,19 +15753,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -13824,7 +15784,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -13835,7 +15795,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -13843,7 +15803,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13860,10 +15820,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -13873,7 +15833,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -13883,7 +15843,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -13893,7 +15853,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -13902,7 +15862,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -13911,7 +15871,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -13922,59 +15882,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -13986,7 +15927,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -13999,12 +15940,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -14013,7 +15951,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -14021,13 +15959,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -14046,7 +15984,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -14064,23 +16002,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -14090,7 +16025,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -14099,20 +16034,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -14123,7 +16066,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -14132,20 +16075,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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_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_ERR(2, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -14164,7 +16107,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -14176,7 +16119,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -14186,7 +16129,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -14195,21 +16138,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -14222,7 +16173,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14239,7 +16190,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -14248,7 +16199,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -14257,17 +16208,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -14277,7 +16228,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -14286,7 +16237,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -14294,11 +16245,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14309,7 +16268,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -14319,7 +16278,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -14328,7 +16287,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -14336,11 +16295,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -14350,7 +16317,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -14359,21 +16326,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14386,7 +16361,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -14406,7 +16381,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -14415,7 +16390,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -14424,7 +16399,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -14433,7 +16408,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -14442,7 +16417,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -14452,7 +16427,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -14472,7 +16447,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -14486,9 +16461,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -14496,22 +16479,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -14520,7 +16511,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -14529,7 +16520,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -14540,22 +16531,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -14564,7 +16563,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -14573,7 +16572,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -14585,7 +16584,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -14596,7 +16595,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14606,7 +16605,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -14615,7 +16614,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14626,7 +16625,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14642,7 +16641,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -14652,7 +16651,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14663,7 +16662,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -14673,7 +16672,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -14683,7 +16682,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -14696,7 +16695,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -14711,7 +16710,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -14721,7 +16720,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -14732,7 +16731,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -14741,7 +16740,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -14750,21 +16749,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -14773,7 +16780,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -14785,7 +16792,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -14795,7 +16802,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -14808,7 +16815,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -14827,11 +16834,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -14841,7 +16845,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -14850,7 +16854,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -14859,7 +16863,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -14869,19 +16873,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -14890,7 +16900,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -14900,7 +16910,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14911,7 +16921,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -14920,17 +16930,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -14939,7 +16949,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -14950,7 +16960,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -14960,53 +16970,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -15016,7 +17040,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -15040,7 +17064,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -15055,62 +17079,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __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_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __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_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __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_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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;}
+ __PYX_ERR(2, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -15133,7 +17154,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -15149,33 +17170,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __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_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __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_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -15185,26 +17203,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(2, 1242, __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;}
+ __PYX_ERR(2, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -15229,7 +17267,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -15246,16 +17284,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -15265,18 +17300,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -15286,39 +17321,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;}
+ __PYX_ERR(2, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(2, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -15343,7 +17406,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -15368,11 +17431,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -15381,7 +17441,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -15391,7 +17451,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -15400,7 +17460,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -15409,7 +17469,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -15418,7 +17478,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -15428,7 +17488,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -15436,10 +17496,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -15449,7 +17517,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -15457,11 +17525,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -15477,7 +17552,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -15488,7 +17563,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -15498,7 +17573,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -15508,7 +17583,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -15517,7 +17592,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -15525,25 +17600,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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;}
+ /*else*/ {
+ __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_ERR(2, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -15553,62 +17642,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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_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_ERR(2, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -15616,11 +17717,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -15630,51 +17737,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
+ *
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
*
- * 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)
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -15683,7 +17805,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15692,7 +17814,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -15701,7 +17823,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -15710,7 +17832,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -15719,7 +17841,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -15728,12 +17850,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -15747,28 +17883,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -15777,7 +17919,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -15786,7 +17928,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -15795,7 +17937,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -15804,7 +17946,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -15814,7 +17956,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -15838,21 +17980,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -15861,87 +18003,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -15949,7 +18091,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15960,7 +18102,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -15970,7 +18112,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -15978,11 +18120,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -15993,7 +18141,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16008,7 +18156,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -16017,7 +18165,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16032,7 +18180,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16048,7 +18196,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -16059,7 +18207,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -16069,7 +18217,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -16079,7 +18227,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -16087,36 +18235,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -16126,7 +18298,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16138,7 +18310,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -16148,7 +18320,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -16157,7 +18329,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -16166,7 +18338,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -16175,7 +18347,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -16186,7 +18358,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16202,7 +18374,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -16211,7 +18383,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -16220,7 +18392,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -16230,7 +18402,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -16241,7 +18413,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -16250,7 +18422,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -16259,22 +18431,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -16283,7 +18463,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -16295,7 +18475,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -16306,125 +18486,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
-/* "vector.to_py":78
- *
- * @cname("__pyx_convert_vector_to_py_float")
- * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<<
- * return [X_to_py(v[i]) for i in range(v.size())]
- *
- */
-
-static PyObject *__pyx_convert_vector_to_py_float(const std::vector<float> &__pyx_v_v) {
- size_t __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- size_t __pyx_t_2;
- size_t __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_float", 0);
-
- /* "vector.to_py":79
- * @cname("__pyx_convert_vector_to_py_float")
- * cdef object __pyx_convert_vector_to_py_float(vector[X]& v):
- * return [X_to_py(v[i]) for i in range(v.size())] # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_v_v.size();
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
- __pyx_t_4 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 79; __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[3]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "vector.to_py":78
- *
- * @cname("__pyx_convert_vector_to_py_float")
- * cdef object __pyx_convert_vector_to_py_float(vector[X]& v): # <<<<<<<<<<<<<<
- * return [X_to_py(v[i]) for i in range(v.size())]
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_convert_vector_to_py_unsigned_int(const std::vector<unsigned int> &__pyx_v_v) {
- size_t __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- size_t __pyx_t_2;
- size_t __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_unsigned_int", 0);
-
- /* "vector.to_py":79
- * @cname("__pyx_convert_vector_to_py_unsigned_int")
- * cdef object __pyx_convert_vector_to_py_unsigned_int(vector[X]& v):
- * return [X_to_py(v[i]) for i in range(v.size())] # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_v_v.size();
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
- __pyx_t_4 = __Pyx_PyInt_From_unsigned_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; __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[4]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- /* "vector.to_py":78
- *
- * @cname("__pyx_convert_vector_to_py_unsigned_int")
- * cdef object __pyx_convert_vector_to_py_unsigned_int(vector[X]& v): # <<<<<<<<<<<<<<
- * return [X_to_py(v[i]) for i in range(v.size())]
- *
- */
-
- /* function exit code */
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_unsigned_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_tp_new_13marchingcubes_MarchingCubes(PyTypeObject *t, PyObject *a, PyObject *k) {
+static PyObject *__pyx_tp_new_4silx_4math_13marchingcubes_MarchingCubes(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o;
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
o = (*t->tp_alloc)(t, 0);
@@ -16432,13 +18494,14 @@ static PyObject *__pyx_tp_new_13marchingcubes_MarchingCubes(PyTypeObject *t, PyO
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
}
if (unlikely(!o)) return 0;
- if (unlikely(__pyx_pw_13marchingcubes_13MarchingCubes_1__cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
+ if (unlikely(__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_1__cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
-static void __pyx_tp_dealloc_13marchingcubes_MarchingCubes(PyObject *o) {
+static void __pyx_tp_dealloc_4silx_4math_13marchingcubes_MarchingCubes(PyObject *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;
@@ -16448,13 +18511,13 @@ static void __pyx_tp_dealloc_13marchingcubes_MarchingCubes(PyObject *o) {
PyObject *etype, *eval, *etb;
PyErr_Fetch(&etype, &eval, &etb);
++Py_REFCNT(o);
- __pyx_pw_13marchingcubes_13MarchingCubes_3__dealloc__(o);
+ __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_3__dealloc__(o);
--Py_REFCNT(o);
PyErr_Restore(etype, eval, etb);
}
(*Py_TYPE(o)->tp_free)(o);
}
-static PyObject *__pyx_sq_item_13marchingcubes_MarchingCubes(PyObject *o, Py_ssize_t i) {
+static PyObject *__pyx_sq_item_4silx_4math_13marchingcubes_MarchingCubes(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);
@@ -16462,26 +18525,46 @@ static PyObject *__pyx_sq_item_13marchingcubes_MarchingCubes(PyObject *o, Py_ssi
return r;
}
-static PyMethodDef __pyx_methods_13marchingcubes_MarchingCubes[] = {
- {"process", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_7process, METH_O, __pyx_doc_13marchingcubes_13MarchingCubes_6process},
- {"process_slice", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_9process_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_13marchingcubes_13MarchingCubes_8process_slice},
- {"finish_process", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_11finish_process, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_10finish_process},
- {"reset", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_13reset, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_12reset},
- {"shape", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_15shape, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_14shape},
- {"sampling", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_17sampling, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_16sampling},
- {"isolevel", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_19isolevel, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_18isolevel},
- {"invert_normals", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_21invert_normals, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_20invert_normals},
- {"get_vertices", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_23get_vertices, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_22get_vertices},
- {"get_normals", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_25get_normals, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_24get_normals},
- {"get_indices", (PyCFunction)__pyx_pw_13marchingcubes_13MarchingCubes_27get_indices, METH_NOARGS, __pyx_doc_13marchingcubes_13MarchingCubes_26get_indices},
+static PyObject *__pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5shape_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_sampling(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8sampling_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_isolevel(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_8isolevel_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_invert_normals(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_14invert_normals_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_4silx_4math_13marchingcubes_MarchingCubes[] = {
+ {"process", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_7process, METH_O, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_6process},
+ {"process_slice", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_9process_slice, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_8process_slice},
+ {"finish_process", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_11finish_process, METH_NOARGS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_10finish_process},
+ {"reset", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_13reset, METH_NOARGS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_12reset},
+ {"get_vertices", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_15get_vertices, METH_NOARGS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_14get_vertices},
+ {"get_normals", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_17get_normals, METH_NOARGS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_16get_normals},
+ {"get_indices", (PyCFunction)__pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_19get_indices, METH_NOARGS, __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_18get_indices},
{0, 0, 0, 0}
};
+static struct PyGetSetDef __pyx_getsets_4silx_4math_13marchingcubes_MarchingCubes[] = {
+ {(char *)"shape", __pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_shape, 0, (char *)"The shape of the processed scalar field (depth, height, width).", 0},
+ {(char *)"sampling", __pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_sampling, 0, (char *)"The sampling over each dimension (depth, height, width).\n\n Default: 1, 1, 1\n ", 0},
+ {(char *)"isolevel", __pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_isolevel, 0, (char *)"The iso-level at which to generate the isosurface", 0},
+ {(char *)"invert_normals", __pyx_getprop_4silx_4math_13marchingcubes_13MarchingCubes_invert_normals, 0, (char *)"True to use gradient descent as normals.", 0},
+ {0, 0, 0, 0, 0}
+};
+
static PySequenceMethods __pyx_tp_as_sequence_MarchingCubes = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
- __pyx_sq_item_13marchingcubes_MarchingCubes, /*sq_item*/
+ __pyx_sq_item_4silx_4math_13marchingcubes_MarchingCubes, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
@@ -16492,23 +18575,24 @@ static PySequenceMethods __pyx_tp_as_sequence_MarchingCubes = {
static PyMappingMethods __pyx_tp_as_mapping_MarchingCubes = {
0, /*mp_length*/
- __pyx_pw_13marchingcubes_13MarchingCubes_5__getitem__, /*mp_subscript*/
+ __pyx_pw_4silx_4math_13marchingcubes_13MarchingCubes_5__getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
-static PyTypeObject __pyx_type_13marchingcubes_MarchingCubes = {
+static PyTypeObject __pyx_type_4silx_4math_13marchingcubes_MarchingCubes = {
PyVarObject_HEAD_INIT(0, 0)
- "marchingcubes.MarchingCubes", /*tp_name*/
- sizeof(struct __pyx_obj_13marchingcubes_MarchingCubes), /*tp_basicsize*/
+ "silx.math.marchingcubes.MarchingCubes", /*tp_name*/
+ sizeof(struct __pyx_obj_4silx_4math_13marchingcubes_MarchingCubes), /*tp_basicsize*/
0, /*tp_itemsize*/
- __pyx_tp_dealloc_13marchingcubes_MarchingCubes, /*tp_dealloc*/
+ __pyx_tp_dealloc_4silx_4math_13marchingcubes_MarchingCubes, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -16528,9 +18612,9 @@ static PyTypeObject __pyx_type_13marchingcubes_MarchingCubes = {
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
- __pyx_methods_13marchingcubes_MarchingCubes, /*tp_methods*/
+ __pyx_methods_4silx_4math_13marchingcubes_MarchingCubes, /*tp_methods*/
0, /*tp_members*/
- 0, /*tp_getset*/
+ __pyx_getsets_4silx_4math_13marchingcubes_MarchingCubes, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
@@ -16538,7 +18622,7 @@ static PyTypeObject __pyx_type_13marchingcubes_MarchingCubes = {
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
- __pyx_tp_new_13marchingcubes_MarchingCubes, /*tp_new*/
+ __pyx_tp_new_4silx_4math_13marchingcubes_MarchingCubes, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
@@ -16552,6 +18636,7 @@ static PyTypeObject __pyx_type_13marchingcubes_MarchingCubes = {
0, /*tp_finalize*/
#endif
};
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -16563,12 +18648,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -16619,7 +18706,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -16628,7 +18715,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -16670,7 +18757,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = {
static PyTypeObject __pyx_type___pyx_array = {
PyVarObject_HEAD_INIT(0, 0)
- "marchingcubes.array", /*tp_name*/
+ "silx.math.marchingcubes.array", /*tp_name*/
sizeof(struct __pyx_array_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_array, /*tp_dealloc*/
@@ -16679,8 +18766,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -16775,7 +18863,7 @@ static PyMethodDef __pyx_methods_Enum[] = {
static PyTypeObject __pyx_type___pyx_MemviewEnum = {
PyVarObject_HEAD_INIT(0, 0)
- "marchingcubes.Enum", /*tp_name*/
+ "silx.math.marchingcubes.Enum", /*tp_name*/
sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_Enum, /*tp_dealloc*/
@@ -16784,8 +18872,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -16846,10 +18935,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -16927,39 +19017,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -16971,15 +19061,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -17021,7 +19111,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
static PyTypeObject __pyx_type___pyx_memoryview = {
PyVarObject_HEAD_INIT(0, 0)
- "marchingcubes.memoryview", /*tp_name*/
+ "silx.math.marchingcubes.memoryview", /*tp_name*/
sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_memoryview, /*tp_dealloc*/
@@ -17030,8 +19120,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -17131,7 +19222,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -17139,13 +19230,13 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_type___pyx_memoryviewslice = {
PyVarObject_HEAD_INIT(0, 0)
- "marchingcubes._memoryviewslice", /*tp_name*/
+ "silx.math.marchingcubes._memoryviewslice", /*tp_name*/
sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
@@ -17154,8 +19245,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -17231,7 +19323,8 @@ static struct PyModuleDef __pyx_moduledef = {
#endif
static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_05_09_2016, __pyx_k_05_09_2016, sizeof(__pyx_k_05_09_2016), 0, 0, 1, 0},
+ {&__pyx_kp_s_16_08_2017, __pyx_k_16_08_2017, sizeof(__pyx_k_16_08_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 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_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},
@@ -17239,6 +19332,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_Index_out_of_range, __pyx_k_Index_out_of_range, sizeof(__pyx_k_Index_out_of_range), 0, 0, 1, 0},
{&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
@@ -17269,6 +19363,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 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_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 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_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
@@ -17295,10 +19390,11 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
+ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
{&__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_process, __pyx_k_process, sizeof(__pyx_k_process), 0, 0, 1, 1},
- {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 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},
@@ -17322,25 +19418,19 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_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_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __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_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_ERR(0, 141, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 218, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -17350,300 +19440,356 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "marchingcubes.pyx":116
+ /* "silx/math/marchingcubes.pyx":116
*
* def __cinit__(self, data=None, isolevel=None,
* invert_normals=True, sampling=(1, 1, 1)): # <<<<<<<<<<<<<<
* self.c_mc = new mc.MarchingCubes[float, float](isolevel)
* self.c_mc.invert_normals = bool(invert_normals)
*/
- __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(3, __pyx_int_1, __pyx_int_1, __pyx_int_1); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 116, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "marchingcubes.pyx":141
+ /* "silx/math/marchingcubes.pyx":141
* return self.get_indices()
* else:
* raise IndexError("Index out of range") # <<<<<<<<<<<<<<
*
* def process(self, cnumpy.ndarray[cnumpy.float32_t, ndim=3, mode='c'] data):
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Index_out_of_range); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Index_out_of_range); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 141, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "marchingcubes.pyx":226
+ /* "silx/math/marchingcubes.pyx":226
* Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).
* """
* return numpy.array(self.c_mc.vertices).reshape(-1, 3) # <<<<<<<<<<<<<<
*
* def get_normals(self):
*/
- __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 226, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "marchingcubes.pyx":233
+ /* "silx/math/marchingcubes.pyx":233
* Order is dim0, dim1, dim2 (i.e., z, y, x if dim0 is depth).
* """
* return numpy.array(self.c_mc.normals).reshape(-1, 3) # <<<<<<<<<<<<<<
*
* def get_indices(self):
*/
- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 233, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "marchingcubes.pyx":239
+ /* "silx/math/marchingcubes.pyx":239
* """
* return numpy.array(self.c_mc.indices,
* dtype=numpy.uint32).reshape(-1, 3) # <<<<<<<<<<<<<<
*/
- __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_3); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 239, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(1, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ /* "../../../../../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__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- /* "../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
+ /* "../../../../../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__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "View.MemoryView":127
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 989, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 1001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__12);
- __Pyx_GIVEREF(__pyx_tuple__12);
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__13);
- __Pyx_GIVEREF(__pyx_tuple__13);
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__16 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__17 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
- /* "View.MemoryView":638
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__23 = PyTuple_New(1); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__23, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__19 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__19);
- __Pyx_GIVEREF(__pyx_slice__19);
+ __pyx_slice__24 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__24)) __PYX_ERR(2, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__24);
+ __Pyx_GIVEREF(__pyx_slice__24);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__20 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__20);
- __Pyx_GIVEREF(__pyx_slice__20);
+ __pyx_slice__25 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__25)) __PYX_ERR(2, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__25);
+ __Pyx_GIVEREF(__pyx_slice__25);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(2, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__26);
+ __Pyx_GIVEREF(__pyx_slice__26);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__22);
- __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__23 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__23);
- __Pyx_GIVEREF(__pyx_tuple__23);
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* 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_direct); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__26);
- __Pyx_GIVEREF(__pyx_tuple__26);
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -17652,12 +19798,12 @@ static int __Pyx_InitCachedConstants(void) {
}
static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -17673,10 +19819,7 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
{
PyObject *__pyx_t_1 = NULL;
int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ static PyThread_type_lock __pyx_t_3[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -17688,17 +19831,24 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_marchingcubes(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -17713,34 +19863,34 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
- if (__pyx_module_is_main_marchingcubes) {
- 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 (__pyx_module_is_main_silx__math__marchingcubes) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "marchingcubes")) {
- if (unlikely(PyDict_SetItemString(modules, "marchingcubes", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "silx.math.marchingcubes")) {
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.marchingcubes", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -17750,24 +19900,27 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
/*--- Variable export code ---*/
/*--- Function export code ---*/
/*--- Type init code ---*/
- if (PyType_Ready(&__pyx_type_13marchingcubes_MarchingCubes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_type_13marchingcubes_MarchingCubes.tp_print = 0;
+ if (PyType_Ready(&__pyx_type_4silx_4math_13marchingcubes_MarchingCubes) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+ __pyx_type_4silx_4math_13marchingcubes_MarchingCubes.tp_print = 0;
#if CYTHON_COMPILING_IN_CPYTHON
{
- PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_13marchingcubes_MarchingCubes, "__getitem__"); if (unlikely(!wrapper)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4silx_4math_13marchingcubes_MarchingCubes, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 56, __pyx_L1_error)
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
- __pyx_wrapperbase_13marchingcubes_13MarchingCubes_4__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
- __pyx_wrapperbase_13marchingcubes_13MarchingCubes_4__getitem__.doc = __pyx_doc_13marchingcubes_13MarchingCubes_4__getitem__;
- ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_13marchingcubes_13MarchingCubes_4__getitem__;
+ __pyx_wrapperbase_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
+ __pyx_wrapperbase_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__.doc = __pyx_doc_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__;
+ ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_4silx_4math_13marchingcubes_13MarchingCubes_4__getitem__;
}
}
#endif
- if (PyObject_SetAttrString(__pyx_m, "MarchingCubes", (PyObject *)&__pyx_type_13marchingcubes_MarchingCubes) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_13marchingcubes_MarchingCubes = &__pyx_type_13marchingcubes_MarchingCubes;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyObject_SetAttrString(__pyx_m, "MarchingCubes", (PyObject *)&__pyx_type_4silx_4math_13marchingcubes_MarchingCubes) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+ __pyx_ptype_4silx_4math_13marchingcubes_MarchingCubes = &__pyx_type_4silx_4math_13marchingcubes_MarchingCubes;
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -17778,18 +19931,18 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __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",
@@ -17798,62 +19951,65 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
#else
sizeof(PyHeapTypeObject),
#endif
- 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[5]; __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;}
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
- /* "marchingcubes.pyx":31
+ /* "silx/math/marchingcubes.pyx":31
* """
*
* __authors__ = ["T. Vincent"] # <<<<<<<<<<<<<<
* __license__ = "MIT"
- * __date__ = "05/09/2016"
+ * __date__ = "16/08/2017"
*/
- __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_T_Vincent);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_T_Vincent);
__Pyx_GIVEREF(__pyx_kp_s_T_Vincent);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_T_Vincent);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "marchingcubes.pyx":32
+ /* "silx/math/marchingcubes.pyx":32
*
* __authors__ = ["T. Vincent"]
* __license__ = "MIT" # <<<<<<<<<<<<<<
- * __date__ = "05/09/2016"
+ * __date__ = "16/08/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;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
- /* "marchingcubes.pyx":33
+ /* "silx/math/marchingcubes.pyx":33
* __authors__ = ["T. Vincent"]
* __license__ = "MIT"
- * __date__ = "05/09/2016" # <<<<<<<<<<<<<<
+ * __date__ = "16/08/2017" # <<<<<<<<<<<<<<
*
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_05_09_2016) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_16_08_2017) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
- /* "marchingcubes.pyx":36
+ /* "silx/math/marchingcubes.pyx":36
*
*
* import numpy # <<<<<<<<<<<<<<
* cimport numpy as cnumpy
* cimport cython
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __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 = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "marchingcubes.pyx":51
+ /* "silx/math/marchingcubes.pyx":51
* void import_umath()
*
* if FALSE: # <<<<<<<<<<<<<<
@@ -17863,7 +20019,7 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
__pyx_t_2 = (0 != 0);
if (__pyx_t_2) {
- /* "marchingcubes.pyx":52
+ /* "silx/math/marchingcubes.pyx":52
*
* if FALSE:
* import_array() # <<<<<<<<<<<<<<
@@ -17872,7 +20028,7 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
*/
import_array();
- /* "marchingcubes.pyx":53
+ /* "silx/math/marchingcubes.pyx":53
* if FALSE:
* import_array()
* import_umath() # <<<<<<<<<<<<<<
@@ -17880,251 +20036,167 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
*
*/
import_umath();
- goto __pyx_L2;
- }
- __pyx_L2:;
-
- /* "marchingcubes.pyx":194
- * @cython.embedsignature(False)
- * @property
- * def shape(self): # <<<<<<<<<<<<<<
- * """The shape of the processed scalar field (depth, height, width)."""
- * return self.c_mc.depth, self.c_mc.height, self.c_mc.width
- */
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- /* "marchingcubes.pyx":193
- *
- * @cython.embedsignature(False)
- * @property # <<<<<<<<<<<<<<
- * def shape(self):
- * """The shape of the processed scalar field (depth, height, width)."""
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes->tp_dict, __pyx_n_s_shape, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_ptype_13marchingcubes_MarchingCubes);
-
- /* "marchingcubes.pyx":200
- * @cython.embedsignature(False)
- * @property
- * def sampling(self): # <<<<<<<<<<<<<<
- * """The sampling over each dimension (depth, height, width).
- *
- */
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes, __pyx_n_s_sampling); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "marchingcubes.pyx":199
- *
- * @cython.embedsignature(False)
- * @property # <<<<<<<<<<<<<<
- * def sampling(self):
- * """The sampling over each dimension (depth, height, width).
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes->tp_dict, __pyx_n_s_sampling, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_ptype_13marchingcubes_MarchingCubes);
-
- /* "marchingcubes.pyx":211
- * @cython.embedsignature(False)
- * @property
- * def isolevel(self): # <<<<<<<<<<<<<<
- * """The iso-level at which to generate the isosurface"""
- * return self.c_mc.isolevel
- */
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes, __pyx_n_s_isolevel); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "marchingcubes.pyx":210
- *
- * @cython.embedsignature(False)
- * @property # <<<<<<<<<<<<<<
- * def isolevel(self):
- * """The iso-level at which to generate the isosurface"""
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes->tp_dict, __pyx_n_s_isolevel, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_ptype_13marchingcubes_MarchingCubes);
-
- /* "marchingcubes.pyx":217
- * @cython.embedsignature(False)
- * @property
- * def invert_normals(self): # <<<<<<<<<<<<<<
- * """True to use gradient descent as normals."""
- * return self.c_mc.invert_normals
- */
- __pyx_t_1 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes, __pyx_n_s_invert_normals); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "marchingcubes.pyx":216
+ /* "silx/math/marchingcubes.pyx":51
+ * void import_umath()
*
- * @cython.embedsignature(False)
- * @property # <<<<<<<<<<<<<<
- * def invert_normals(self):
- * """True to use gradient descent as normals."""
+ * if FALSE: # <<<<<<<<<<<<<<
+ * import_array()
+ * import_umath()
*/
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_13marchingcubes_MarchingCubes->tp_dict, __pyx_n_s_invert_normals, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_ptype_13marchingcubes_MarchingCubes);
+ }
- /* "marchingcubes.pyx":1
+ /* "silx/math/marchingcubes.pyx":1
* # coding: utf-8 # <<<<<<<<<<<<<<
* # /[inserted by cython to avoid comment start]*##########################################################################
* #
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __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;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__23, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __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
+ /* "View.MemoryView":283
*
* 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 = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __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
+ /* "View.MemoryView":284
* 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__25, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __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
+ /* "View.MemoryView":287
*
*
* 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 = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __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
+ /* "View.MemoryView":288
*
* 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__27, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_3[0] = PyThread_allocate_lock();
+ __pyx_t_3[1] = PyThread_allocate_lock();
+ __pyx_t_3[2] = PyThread_allocate_lock();
+ __pyx_t_3[3] = PyThread_allocate_lock();
+ __pyx_t_3[4] = PyThread_allocate_lock();
+ __pyx_t_3[5] = PyThread_allocate_lock();
+ __pyx_t_3[6] = PyThread_allocate_lock();
+ __pyx_t_3[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __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;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __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;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "vector.to_py":78
- *
- * @cname("__pyx_convert_vector_to_py_unsigned_int")
- * cdef object __pyx_convert_vector_to_py_unsigned_int(vector[X]& v): # <<<<<<<<<<<<<<
- * return [X_to_py(v[i]) for i in range(v.size())]
+ /* "View.MemoryView":1391
*
+ * @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 ---*/
@@ -18132,14 +20204,13 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
if (__pyx_m) {
if (__pyx_d) {
- __Pyx_AddTraceback("init marchingcubes", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_AddTraceback("init silx.math.marchingcubes", __pyx_clineno, __pyx_lineno, __pyx_filename);
}
Py_DECREF(__pyx_m); __pyx_m = 0;
} else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init marchingcubes");
+ PyErr_SetString(PyExc_ImportError, "init silx.math.marchingcubes");
}
__pyx_L0:;
__Pyx_RefNannyFinishContext();
@@ -18150,7 +20221,8 @@ PyMODINIT_FUNC PyInit_marchingcubes(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -18167,6 +20239,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -18180,6 +20253,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -18193,6 +20267,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -18294,6 +20369,7 @@ bad:
return -1;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -18319,6 +20395,7 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* GetItemInt */
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
PyObject *r;
if (!j) return NULL;
@@ -18327,8 +20404,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* 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
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
@@ -18341,8 +20419,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
@@ -18354,9 +20433,10 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize
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
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
if (is_list || PyList_CheckExact(o)) {
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
@@ -18380,10 +20460,9 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
if (likely(l >= 0)) {
i += l;
} else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
return NULL;
+ PyErr_Clear();
}
}
return m->sq_item(o, i);
@@ -18397,6 +20476,145 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
@@ -18416,6 +20634,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
+/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
@@ -18435,6 +20654,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
+/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
@@ -18447,6 +20667,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -18454,19 +20679,118 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyObjectCallNoArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -18480,10 +20804,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
}
#endif
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -18493,27 +20817,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -18552,6 +20871,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -18585,10 +20905,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -18648,7 +20971,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -18668,7 +20991,8 @@ bad:
}
#endif
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -18694,7 +21018,8 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -19243,9 +21568,10 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+/* GetModuleGlobalName */
+ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -19260,12 +21586,14 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-static void __Pyx_RaiseBufferIndexError(int axis) {
+/* BufferIndexError */
+ static void __Pyx_RaiseBufferIndexError(int axis) {
PyErr_Format(PyExc_IndexError,
"Out of bounds on buffer access (axis %d)", axis);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -19321,7 +21649,6 @@ no_fail:
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
@@ -19400,22 +21727,26 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -19427,7 +21758,103 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -19464,7 +21891,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -19547,14 +21975,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -19566,13 +21996,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -19592,129 +22029,250 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-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
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
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
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
}
-
-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()))
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#endif
+
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (local_tb) {
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ #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
+ }
}
- #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;
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
}
-static CYTHON_INLINE void __Pyx_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);
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
#endif
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -19735,9 +22293,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -19754,21 +22317,14 @@ bad:
return -1;
}
-static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
- PyObject *result;
- result = __Pyx_PyObject_GetAttrStr(nmspace, name);
- if (!result)
- result = __Pyx_GetModuleGlobalName(name);
- return result;
-}
-
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -19841,7 +22397,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -19914,7 +22471,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -19944,95 +22501,99 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
+ 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;
+}
+
+/* OverlappingSlices */
+ 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);
}
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ *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 CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* Capsule */
+ 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;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -20043,138 +22604,49 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#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;
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
+ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 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);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} 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);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -20185,7 +22657,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
}
}
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -20204,60 +22677,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
}
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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) {
+ static CYTHON_INLINE float __Pyx_c_abs_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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) {
@@ -20275,24 +22774,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
case 1:
return a;
case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_absf(a);
+ r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
@@ -20305,7 +22812,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
#endif
#endif
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -20324,60 +22832,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
}
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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) {
+ static CYTHON_INLINE double __Pyx_c_abs_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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) {
@@ -20395,24 +22929,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
case 1:
return a;
case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_abs(a);
+ r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
@@ -20425,22 +22967,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value)
#endif
#endif
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(int) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(int) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(int) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -20451,159 +22998,39 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
}
}
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 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
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#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;
- }
+ } else {
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
#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 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);
- }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
}
- *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
+/* MemviewSliceCopyTemplate */
+ 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,
@@ -20669,66 +23096,337 @@ no_fail:
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);
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
+ return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
+ return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
+ return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
#endif
- return cobj;
+ if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(unsigned int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ unsigned int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (unsigned int) -1;
+ }
+ } else {
+ unsigned int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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 char __Pyx_PyInt_As_char(PyObject *x) {
- const char neg_one = (char) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
- if (sizeof(char) < sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(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 (char) val;
+ 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
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
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
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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 (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -20736,8 +23434,8 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
PyErr_SetString(PyExc_RuntimeError,
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
- char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -20756,28 +23454,29 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
return val;
}
#endif
- return (char) -1;
+ return (int) -1;
}
} else {
- char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (char) -1;
- val = __Pyx_PyInt_As_char(tmp);
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
return val;
}
raise_overflow:
PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to char");
- return (char) -1;
+ "value too large to convert to int");
+ return (int) -1;
raise_neg_overflow:
PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to char");
- return (char) -1;
+ "can't convert negative value to int");
+ return (int) -1;
}
-static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
- const size_t neg_one = (size_t) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+ const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -20794,36 +23493,129 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (size_t) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
+ return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
+ return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
+ return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (size_t) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(size_t) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long, PyLong_AsUnsignedLong(x))
- } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
- __PYX_VERIFY_RETURN_INT(size_t, unsigned long long, PyLong_AsUnsignedLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +(((PyLongObject*)x)->ob_digit[0]));
- case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (size_t) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
}
- #endif
#endif
if (sizeof(size_t) <= sizeof(long)) {
- __PYX_VERIFY_RETURN_INT(size_t, long, PyLong_AsLong(x))
- } else if (sizeof(size_t) <= sizeof(long long)) {
- __PYX_VERIFY_RETURN_INT(size_t, long long, PyLong_AsLongLong(x))
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -20832,7 +23624,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
size_t val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -20855,7 +23647,7 @@ static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
}
} else {
size_t val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (size_t) -1;
val = __Pyx_PyInt_As_size_t(tmp);
Py_DECREF(tmp);
@@ -20871,8 +23663,198 @@ raise_neg_overflow:
return (size_t) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 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_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (char) -1;
+ }
+ } else {
+ char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(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;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -20889,36 +23871,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -20927,7 +24002,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -20950,7 +24025,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -20966,7 +24041,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -21006,7 +24082,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -21187,7 +24264,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj) {
__Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_BufFmt_StackElem stack[1];
int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
@@ -21209,7 +24287,8 @@ __pyx_fail:
return result;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -21224,7 +24303,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-#ifndef __PYX_HAVE_RT_ImportModule
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
@@ -21241,7 +24321,8 @@ bad:
}
#endif
-#ifndef __PYX_HAVE_RT_ImportType
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
@@ -21287,14 +24368,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif
if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling",
- module_name, class_name);
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
goto bad;
}
return (PyTypeObject *)result;
@@ -21305,7 +24386,8 @@ bad:
}
#endif
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -21343,7 +24425,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -21384,7 +24466,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -21405,8 +24487,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -21414,9 +24498,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -21425,11 +24510,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -21454,18 +24542,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/marchingcubes/marchingcubes.pyx b/silx/math/marchingcubes.pyx
index 8113db5..e14eca2 100644
--- a/silx/math/marchingcubes/marchingcubes.pyx
+++ b/silx/math/marchingcubes.pyx
@@ -30,7 +30,7 @@ from data provided as a 3D data set or slice by slice.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "05/09/2016"
+__date__ = "16/08/2017"
import numpy
@@ -127,7 +127,7 @@ cdef class MarchingCubes:
del self.c_mc
def __getitem__(self, key):
- """Allows to unpack object as a single liner:
+ """Allows one to unpack object as a single liner:
vertices, normals, indices = MarchingCubes(...)
"""
diff --git a/silx/math/marchingcubes/mc.pxd b/silx/math/mc.pxd
index b1c81e7..b1c81e7 100644
--- a/silx/math/marchingcubes/mc.pxd
+++ b/silx/math/mc.pxd
diff --git a/silx/math/medianfilter/__init__.py b/silx/math/medianfilter/__init__.py
index fd5c90c..2b05f06 100644
--- a/silx/math/medianfilter/__init__.py
+++ b/silx/math/medianfilter/__init__.py
@@ -27,4 +27,4 @@ __license__ = "MIT"
__date__ = "02/05/2017"
-from .medianfilter import *
+from .medianfilter import (medfilt, medfilt1d, medfilt2d)
diff --git a/silx/math/medianfilter/include/median_filter.hpp b/silx/math/medianfilter/include/median_filter.hpp
index da1f9fe..78d6c5a 100644
--- a/silx/math/medianfilter/include/median_filter.hpp
+++ b/silx/math/medianfilter/include/median_filter.hpp
@@ -32,11 +32,21 @@
#include <assert.h>
#include <algorithm>
#include <signal.h>
+#include <iostream>
+
+// Modes for the median filter
+enum MODE{
+ NEAREST=0,
+ REFLECT=1,
+ MIRROR=2,
+ SHRINK=3
+};
// Simple function browsing a deque and registring the min and max values
// and if those values are unique or not
template<typename T>
-void getMinMax(std::vector<const T*>& v, T& min, T&max){
+void getMinMax(std::vector<const T*>& v, T& min, T&max,
+ typename std::vector<const T*>::const_iterator end){
// init min and max values
typename std::vector<const T*>::const_iterator it = v.begin();
if (v.size() == 0){
@@ -47,7 +57,7 @@ void getMinMax(std::vector<const T*>& v, T& min, T&max){
it++;
// Browse all the deque
- while(it!=v.end()){
+ while(it!=end){
// check if repeated (should always be before min/max setting)
if(*(*it) > max) max = *(*it);
if(*(*it) < min) min = *(*it);
@@ -61,10 +71,56 @@ bool cmp(const T* a, const T* b){
return *a < *b;
}
+// apply the median filter only on limited part of the vector
template<typename T>
-const T* median(std::vector<const T*>& v) {
- std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), cmp<T>);
- return v[v.size()/2];
+const T* median(std::vector<const T*>& v, int window_size) {
+ std::nth_element(v.begin(), v.begin() + window_size/2, v.begin()+window_size, cmp<T>);
+ return v[window_size/2];
+}
+
+template<typename T>
+void print_window(std::vector<const T*>& v,
+ typename std::vector<const T*>::const_iterator end){
+ typename std::vector<const T*>::const_iterator it;
+ for(it = v.begin(); it != end; ++it){
+ std::cout << *(*it) << " ";
+ }
+ std::cout << std::endl;
+}
+
+// return the index into 0, (length_max - 1) in reflect mode
+int reflect(int index, int length_max){
+ int res = index;
+ // if the index is negative get the positive symetrical value
+ if(res < 0){
+ res += 1;
+ res = -res;
+ }
+ // then apply the reflect algorithm. Frequence is 2 max length
+ res = res % (2*length_max);
+ if(res >= length_max){
+ res = 2*length_max - res -1;
+ res = res % length_max;
+ }
+ return res;
+}
+
+// return the index into 0, (length_max - 1) in mirror mode
+int mirror(int index, int length_max){
+ int res = index;
+ // if the index is negative get the positive symetrical value
+ if(res < 0){
+ res = -res;
+ }
+
+ int rightLimit = length_max -1;
+ // apply the redundancy each two right limit
+ res = res % (2*rightLimit);
+ if(res >= length_max){
+ int distToRedundancy = (2*rightLimit) - res;
+ res = distToRedundancy;
+ }
+ return res;
}
// Browse the column of pixel_x
@@ -74,21 +130,22 @@ void median_filter(
T* output,
int* kernel_dim, // two values : 0:width, 1:height
int* image_dim, // two values : 0:width, 1:height
- int x_pixel, // the x pixel to process
- int y_pixel_range_min,
- int y_pixel_range_max,
- bool conditional){
+ int y_pixel, // the x pixel to process
+ int x_pixel_range_min,
+ int x_pixel_range_max,
+ bool conditional,
+ int pMode){
assert(kernel_dim[0] > 0);
assert(kernel_dim[1] > 0);
- assert(x_pixel >= 0);
+ assert(y_pixel >= 0);
assert(image_dim[0] > 0);
assert(image_dim[1] > 0);
- assert(x_pixel >= 0);
- assert(x_pixel < image_dim[0]);
- assert(y_pixel_range_max < image_dim[1]);
- assert(y_pixel_range_min <= y_pixel_range_max);
- // # kernel odd
+ assert(y_pixel >= 0);
+ assert(y_pixel < image_dim[0]);
+ assert(x_pixel_range_max < image_dim[1]);
+ assert(x_pixel_range_min <= x_pixel_range_max);
+ // kernel odd assertion
assert((kernel_dim[0] - 1)%2 == 0);
assert((kernel_dim[1] - 1)%2 == 0);
@@ -96,42 +153,75 @@ void median_filter(
int halfKernel_x = (kernel_dim[1] - 1) / 2;
int halfKernel_y = (kernel_dim[0] - 1) / 2;
+ MODE mode = static_cast<MODE>(pMode);
+
// init buffer
- // fill the buffer for the first iteration
- // we are treating
std::vector<const T*> window_values(kernel_dim[0]*kernel_dim[1]);
- for(int pixel_y=y_pixel_range_min; pixel_y <= y_pixel_range_max; pixel_y ++ ){
+ for(int x_pixel=x_pixel_range_min; x_pixel <= x_pixel_range_max; x_pixel ++ ){
typename std::vector<const T*>::iterator it = window_values.begin();
// fill the vector
- for(int win_y=pixel_y-halfKernel_y; win_y<= pixel_y+halfKernel_y; win_y++)
+ for(int win_y=y_pixel-halfKernel_y; win_y<= y_pixel+halfKernel_y; win_y++)
{
for(int win_x = x_pixel-halfKernel_x; win_x <= x_pixel+halfKernel_x; win_x++)
{
- int index_x = std::min(std::max(win_x, 0), image_dim[0] - 1);
- int index_y = std::min(std::max(win_y, 0), image_dim[1] - 1);
- *it = (&input[index_y*image_dim[0] + index_x]);
+ int index_x = win_x;
+ int index_y = win_y;
+ switch(mode){
+ case NEAREST:
+ index_x = std::min(std::max(win_x, 0), image_dim[1] - 1);
+ index_y = std::min(std::max(win_y, 0), image_dim[0] - 1);
+ break;
+
+ case REFLECT:
+ index_x = reflect(win_x, image_dim[1]);
+ index_y = reflect(win_y, image_dim[0]);
+ break;
+
+ case MIRROR:
+ index_x = mirror(win_x, image_dim[1]);
+ index_y = mirror(win_y, image_dim[0]);
+ break;
+ case SHRINK:
+ if((index_x < 0) || (index_x > image_dim[1] -1)){
+ continue;
+ }
+ if((index_y < 0) || (index_y > image_dim[0] -1)){
+ continue;
+ }
+ break;
+ }
+ *it = (&input[index_y*image_dim[1] + index_x]);
++it;
}
}
- const T* currentPixelValue = &input[image_dim[0]*pixel_y + x_pixel];
- // change value for the median, only if we don't intend to use the
- // conditional or if the value of the pixel is one of the extrema
- // of the pixel value
+ // get end of the windows. This is needed since in shrink mode we are
+ // not sure to fill the entire window.
+ typename std::vector<const T*>::iterator window_end;
+ int window_size = kernel_dim[0]*kernel_dim[1];
+ if(mode == SHRINK){
+ int x_shrink_ker_dim = std::min(x_pixel+halfKernel_x, image_dim[1]-1) - std::max(0, x_pixel-halfKernel_x)+1;
+ int y_shrink_ker_dim = std::min(y_pixel+halfKernel_y, image_dim[0]-1) - std::max(0, y_pixel-halfKernel_y)+1;
+ window_size = x_shrink_ker_dim*y_shrink_ker_dim;
+ window_end = window_values.begin() + window_size;
+ }else{
+ window_end = window_values.end();
+ }
+
+ // apply the median value if needed for this pixel
+ const T* currentPixelValue = &input[image_dim[1]*y_pixel + x_pixel];
if (conditional == true){
T min = 0;
T max = 0;
- getMinMax(window_values, min, max);
- // In conditional point we are only setting the value to the pixel
- // if the value is the min or max and unique
+ getMinMax(window_values, min, max, window_end);
if ((*currentPixelValue == max) || (*currentPixelValue == min)){
- output[image_dim[0]*pixel_y + x_pixel] = *(median<T>(window_values));
+ output[image_dim[1]*y_pixel + x_pixel] = *(median<T>(window_values, window_size));
}else{
- output[image_dim[0]*pixel_y + x_pixel] = *currentPixelValue;
+ output[image_dim[1]*y_pixel + x_pixel] = *currentPixelValue;
}
}else{
- output[image_dim[0]*pixel_y + x_pixel] = *(median<T>(window_values));
+ output[image_dim[1]*y_pixel + x_pixel] = *(median<T>(window_values, window_size));
}
}
}
diff --git a/silx/math/medianfilter/median_filter.pxd b/silx/math/medianfilter/median_filter.pxd
index b9d3fd2..8460684 100644
--- a/silx/math/medianfilter/median_filter.pxd
+++ b/silx/math/medianfilter/median_filter.pxd
@@ -36,3 +36,6 @@ cdef extern from "median_filter.hpp":
int y_pixel_range_min,
int y_pixel_range_max,
bool conditional) nogil;
+
+ cdef extern int reflect(int index, int length_max);
+ cdef extern int mirror(int index, int length_max);
diff --git a/silx/math/medianfilter/medianfilter.cpp b/silx/math/medianfilter/medianfilter.cpp
index 7ea2899..0a4f137 100644
--- a/silx/math/medianfilter/medianfilter.cpp
+++ b/silx/math/medianfilter/medianfilter.cpp
@@ -1,28 +1,40 @@
-/* Generated by Cython 0.21.1 */
+/* Generated by Cython 0.25.2 */
+
+/* BEGIN: Cython Metadata
+{
+ "distutils": {
+ "depends": [
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/ufuncobject.h",
+ "silx/math/medianfilter/include/median_filter.hpp"
+ ],
+ "extra_compile_args": [
+ "-fopenmp"
+ ],
+ "extra_link_args": [
+ "-fopenmp"
+ ],
+ "include_dirs": [
+ "silx/math/medianfilter/include",
+ "/usr/lib/python2.7/dist-packages/numpy/core/include"
+ ],
+ "language": "c++"
+ },
+ "module_name": "silx.math.medianfilter.medianfilter"
+}
+END: Cython Metadata */
#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"
+#define CYTHON_ABI "0_25_2"
#include <stddef.h>
#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
#ifndef __stdcall
@@ -41,6 +53,11 @@
#ifndef DL_EXPORT
#define DL_EXPORT(t) t
#endif
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+ #define HAVE_LONG_LONG
+ #endif
+#endif
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
@@ -48,63 +65,214 @@
#define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
#endif
-#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
-#define Py_OptimizeFlag 0
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
+ #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) \
+ #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
+#ifndef Py_TPFLAGS_CHECKTYPES
#define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
#define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
-#if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
#define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
+#ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
#define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
0 : _PyUnicode_Ready((PyObject *)(op)))
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
#define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
#define __Pyx_PyUnicode_READY(op) (0)
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
- #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)) ? \
+ #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
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
#endif
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
@@ -113,6 +281,9 @@
#else
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
#if PY_MAJOR_VERSION >= 3
#define PyBaseString_Type PyUnicode_Type
#define PyStringObject PyUnicodeObject
@@ -131,6 +302,7 @@
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#if PY_MAJOR_VERSION >= 3
#define PyIntObject PyLongObject
#define PyInt_Type PyLong_Type
@@ -169,16 +341,20 @@
#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
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#else
- #define CYTHON_INLINE
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
#if defined(__GNUC__)
@@ -191,26 +367,88 @@
#define CYTHON_RESTRICT
#endif
#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+
+#ifndef __cplusplus
+ #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
+#endif
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #else
+ #define CYTHON_INLINE inline
+ #endif
+#endif
+template<typename T>
+void __Pyx_call_destructor(T& x) {
+ x.~T();
+}
+template<typename T>
+class __Pyx_FakeReference {
+ public:
+ __Pyx_FakeReference() : ptr(NULL) { }
+ __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
+ T *operator->() { return ptr; }
+ T *operator&() { return ptr; }
+ operator T&() { return *ptr; }
+ template<typename U> bool operator ==(U other) { return *ptr == other; }
+ template<typename U> bool operator !=(U other) { return *ptr != other; }
+ private:
+ T *ptr;
+};
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
- /* 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();
-}
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
#endif
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
@@ -227,16 +465,12 @@ void __Pyx_call_destructor(T* x) {
#endif
#endif
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
#define __PYX_HAVE__silx__math__medianfilter__medianfilter
#define __PYX_HAVE_API__silx__math__medianfilter__medianfilter
#include "median_filter.hpp"
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "pythread.h"
@@ -249,20 +483,7 @@ void __Pyx_call_destructor(T* x) {
#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;
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
@@ -270,16 +491,34 @@ typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
#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 || \
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER) && defined (_M_X64)
+ #define __Pyx_sst_abs(value) _abs64(value)
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
@@ -296,11 +535,11 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#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)
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
@@ -314,18 +553,25 @@ static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
#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))
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-#if CYTHON_COMPILING_IN_CPYTHON
+#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
@@ -336,7 +582,7 @@ static int __Pyx_init_sys_getdefaultencoding_params(void) {
const char* default_encoding_c;
sys = PyImport_ImportModule("sys");
if (!sys) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
Py_DECREF(sys);
if (!default_encoding) goto bad;
default_encoding_c = PyBytes_AsString(default_encoding);
@@ -416,11 +662,13 @@ static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;
+/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
#if defined(__cplusplus)
#define CYTHON_CCOMPLEX 1
@@ -449,6 +697,7 @@ static const char *__pyx_f[] = {
"stringsource",
"type.pxd",
};
+/* MemviewSliceStruct.proto */
struct __pyx_memoryview_obj;
typedef struct {
struct __pyx_memoryview_obj *memview;
@@ -458,6 +707,7 @@ typedef struct {
Py_ssize_t suboffsets[8];
} __Pyx_memviewslice;
+/* BufferFormatStructs.proto */
#define IS_UNSIGNED(type) (((type) -1) > 0)
struct __Pyx_StructField_;
#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
@@ -493,26 +743,28 @@ typedef struct {
char is_valid_array;
} __Pyx_BufFmt_Context;
+/* Atomics.proto */
#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)) && \
+#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
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
#include <Windows.h>
+ #undef __pyx_atomic_int_type
#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"
+ #pragma message ("Using MSVC atomics")
#endif
#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
#define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
@@ -529,19 +781,19 @@ typedef struct {
#endif
typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
+ #define __pyx_add_acquisition_count(memview)\
__pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
+ #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) \
+ #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) \
+ #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
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
* # in Cython to enable them only on the right systems.
*
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -550,7 +802,7 @@ typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
*/
typedef npy_int8 __pyx_t_5numpy_int8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":724
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
*
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -559,7 +811,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
*/
typedef npy_int16 __pyx_t_5numpy_int16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":725
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":727
* ctypedef npy_int8 int8_t
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -568,7 +820,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
*/
typedef npy_int32 __pyx_t_5numpy_int32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":726
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":728
* ctypedef npy_int16 int16_t
* ctypedef npy_int32 int32_t
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -577,7 +829,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
*/
typedef npy_int64 __pyx_t_5numpy_int64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":730
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
* #ctypedef npy_int128 int128_t
*
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -586,7 +838,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
*/
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":731
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
*
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -595,7 +847,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
*/
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":732
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":734
* ctypedef npy_uint8 uint8_t
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -604,7 +856,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
*/
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":733
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":735
* ctypedef npy_uint16 uint16_t
* ctypedef npy_uint32 uint32_t
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -613,7 +865,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
*/
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":737
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":739
* #ctypedef npy_uint128 uint128_t
*
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -622,7 +874,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
*/
typedef npy_float32 __pyx_t_5numpy_float32_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":738
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":740
*
* ctypedef npy_float32 float32_t
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -631,7 +883,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
*/
typedef npy_float64 __pyx_t_5numpy_float64_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":747
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
* # The int types are mapped a bit surprising --
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -640,7 +892,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
*/
typedef npy_long __pyx_t_5numpy_int_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":748
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":750
* # numpy.int corresponds to 'l' and numpy.long to 'q'
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -649,7 +901,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
*/
typedef npy_longlong __pyx_t_5numpy_long_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":749
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
* ctypedef npy_long int_t
* ctypedef npy_longlong long_t
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -658,7 +910,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
*/
typedef npy_longlong __pyx_t_5numpy_longlong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":751
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
* ctypedef npy_longlong longlong_t
*
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -667,7 +919,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
*/
typedef npy_ulong __pyx_t_5numpy_uint_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":752
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":754
*
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -676,7 +928,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":753
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
* ctypedef npy_ulong uint_t
* ctypedef npy_ulonglong ulong_t
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -685,7 +937,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
*/
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":755
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":757
* ctypedef npy_ulonglong ulonglong_t
*
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -694,7 +946,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
*/
typedef npy_intp __pyx_t_5numpy_intp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":756
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
*
* ctypedef npy_intp intp_t
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -703,7 +955,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
*/
typedef npy_uintp __pyx_t_5numpy_uintp_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":758
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
* ctypedef npy_uintp uintp_t
*
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -712,7 +964,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
*/
typedef npy_double __pyx_t_5numpy_float_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":759
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":761
*
* ctypedef npy_double float_t
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -721,7 +973,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
*/
typedef npy_double __pyx_t_5numpy_double_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":760
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
* ctypedef npy_double float_t
* ctypedef npy_double double_t
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -730,7 +982,7 @@ typedef npy_double __pyx_t_5numpy_double_t;
*/
typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-/* "silx/math/medianfilter/medianfilter.pyx":41
+/* "silx/math/medianfilter/medianfilter.pyx":40
* from libcpp cimport bool
*
* ctypedef unsigned long uint64 # <<<<<<<<<<<<<<
@@ -739,7 +991,7 @@ typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
*/
typedef unsigned long __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64;
-/* "silx/math/medianfilter/medianfilter.pyx":42
+/* "silx/math/medianfilter/medianfilter.pyx":41
*
* ctypedef unsigned long uint64
* ctypedef unsigned int uint32 # <<<<<<<<<<<<<<
@@ -748,7 +1000,7 @@ typedef unsigned long __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64;
*/
typedef unsigned int __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32;
-/* "silx/math/medianfilter/medianfilter.pyx":43
+/* "silx/math/medianfilter/medianfilter.pyx":42
* ctypedef unsigned long uint64
* ctypedef unsigned int uint32
* ctypedef unsigned short uint16 # <<<<<<<<<<<<<<
@@ -756,6 +1008,7 @@ typedef unsigned int __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32;
*
*/
typedef unsigned short __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16;
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< float > __pyx_t_float_complex;
@@ -765,7 +1018,9 @@ typedef unsigned short __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16;
#else
typedef struct { float real, imag; } __pyx_t_float_complex;
#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+/* Declarations.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
typedef ::std::complex< double > __pyx_t_double_complex;
@@ -775,6 +1030,7 @@ typedef unsigned short __pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16;
#else
typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
/*--- Type declarations ---*/
@@ -783,7 +1039,7 @@ struct __pyx_MemviewEnum_obj;
struct __pyx_memoryview_obj;
struct __pyx_memoryviewslice_obj;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":762
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
* ctypedef npy_longdouble longdouble_t
*
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -792,7 +1048,7 @@ struct __pyx_memoryviewslice_obj;
*/
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":763
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":765
*
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -801,7 +1057,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
*/
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":764
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
* ctypedef npy_cfloat cfloat_t
* ctypedef npy_cdouble cdouble_t
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -810,7 +1066,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
*/
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":766
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
* ctypedef npy_clongdouble clongdouble_t
*
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -819,7 +1075,7 @@ typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
*/
typedef npy_cdouble __pyx_t_5numpy_complex_t;
-/* "View.MemoryView":99
+/* "View.MemoryView":103
*
* @cname("__pyx_array")
* cdef class array: # <<<<<<<<<<<<<<
@@ -828,6 +1084,7 @@ typedef npy_cdouble __pyx_t_5numpy_complex_t;
*/
struct __pyx_array_obj {
PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
char *data;
Py_ssize_t len;
char *format;
@@ -843,7 +1100,7 @@ struct __pyx_array_obj {
};
-/* "View.MemoryView":269
+/* "View.MemoryView":275
*
* @cname('__pyx_MemviewEnum')
* cdef class Enum(object): # <<<<<<<<<<<<<<
@@ -856,7 +1113,7 @@ struct __pyx_MemviewEnum_obj {
};
-/* "View.MemoryView":302
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -879,7 +1136,7 @@ struct __pyx_memoryview_obj {
};
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -896,7 +1153,21 @@ struct __pyx_memoryviewslice_obj {
-/* "View.MemoryView":302
+/* "View.MemoryView":103
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":326
*
* @cname('__pyx_memoryview')
* cdef class memoryview(object): # <<<<<<<<<<<<<<
@@ -916,7 +1187,7 @@ struct __pyx_vtabstruct_memoryview {
static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-/* "View.MemoryView":922
+/* "View.MemoryView":951
*
* @cname('__pyx_memoryviewslice')
* cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
@@ -928,6 +1199,9 @@ struct __pyx_vtabstruct__memoryviewslice {
struct __pyx_vtabstruct_memoryview __pyx_base;
};
static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
#define CYTHON_REFNANNY 0
#endif
@@ -944,19 +1218,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
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__); \
+ #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) \
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
- #define __Pyx_RefNannyFinishContext() \
+ #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__)
@@ -979,18 +1253,19 @@ static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
#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); \
+#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); \
+#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
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
PyTypeObject* tp = Py_TYPE(obj);
if (likely(tp->tp_getattro))
@@ -1005,39 +1280,97 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif
+/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
const char* function_name);
+/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+/* GetModuleGlobalName.proto */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif
-#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) : \
+/* PySequenceContains.proto */
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
+ int result = PySequence_Contains(seq, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
-#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
- (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
- __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
+#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) : \
+#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);
@@ -1045,21 +1378,24 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list, int wraparound, int boundscheck);
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
-
+/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif
+/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+/* BufferFormatCheck.proto */
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 const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type); // PROTO
+/* MemviewSliceInit.proto */
#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
#define __Pyx_MEMVIEW_DIRECT 1
#define __Pyx_MEMVIEW_PTR 2
@@ -1085,60 +1421,120 @@ static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+/* ArgTypeTest.proto */
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact);
#define __Pyx_BufPtrCContig2d(type, buf, i0, s0, i1, s1) ((type)((char*)buf + i0 * s0) + i1)
#define __Pyx_BufPtrCContig1d(type, buf, i0, s0) ((type)buf + i0)
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#else
+ #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#endif
+
+/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* IncludeStringH.proto */
#include <string.h>
+/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif
-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
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+/* UnaryNegOverflows.proto */
+#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 PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+/* decode_c_string.proto */
static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
-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);
-
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
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
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1154,12 +1550,15 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
#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*/
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ListExtend.proto */
static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#if CYTHON_COMPILING_IN_CPYTHON
PyObject* none = _PyList_Extend((PyListObject*)L, v);
@@ -1172,7 +1571,8 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
#endif
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
PyListObject* L = (PyListObject*) list;
Py_ssize_t len = Py_SIZE(list);
@@ -1188,20 +1588,29 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif
+/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
int lineno, const char *filename,
- int full_traceback);
+ int full_traceback, int nogil);
+/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+/* CodeObjectCache.proto */
typedef struct {
- int code_line;
PyCodeObject* code_object;
+ int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
int count;
@@ -1213,9 +1622,20 @@ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int co
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
int py_line, const char *filename);
+#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
+
+
+/* BufferStructDeclare.proto */
typedef struct {
Py_ssize_t shape, strides, suboffsets;
} __Pyx_Buf_DimInfo;
@@ -1229,22 +1649,26 @@ typedef struct {
__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
-
-
+/* None.proto */
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);
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs,
+ char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+/* TypeInfoCompare.proto */
static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+/* MemviewSliceValidateAndInit.proto */
static int __Pyx_ValidateAndInit_memviewslice(
int *axes_specs,
int c_or_f_flag,
@@ -1255,24 +1679,37 @@ static int __Pyx_ValidateAndInit_memviewslice(
__Pyx_memviewslice *memviewslice,
PyObject *original_obj);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(PyObject *);
+/* ObjectToMemviewSlice.proto */
static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(PyObject *);
+/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+/* RealImag.proto */
#if CYTHON_CCOMPLEX
#ifdef __cplusplus
#define __Pyx_CREAL(z) ((z).real())
@@ -1285,7 +1722,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
#define __Pyx_CREAL(z) ((z).real)
#define __Pyx_CIMAG(z) ((z).imag)
#endif
-#if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
#define __Pyx_SET_CREAL(z,x) ((z).real(x))
#define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
@@ -1293,109 +1731,105 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
#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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
#if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
#if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(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);
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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);
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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);
-
+/* Arithmetic.proto */
#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))
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
#ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
#if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
#endif
#else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
#if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(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);
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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);
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
#endif
#endif
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
-
-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
-
-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);
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+/* MemviewSliceCopyTemplate.proto */
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);
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);
+/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
@@ -1404,12 +1838,16 @@ static int __Pyx_check_binary_version(void);
#endif
#endif
+/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);
+/* TypeImport.proto */
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* 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*/
@@ -1430,19 +1868,21 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
/* 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 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
/* Module declarations from 'libc.stdlib' */
/* Module declarations from 'numpy' */
@@ -1460,12 +1900,13 @@ 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 Py_ssize_t __pyx_v_4silx_4math_12medianfilter_12medianfilter_size;
static PyObject *generic = 0;
static PyObject *strided = 0;
static PyObject *indirect = 0;
static PyObject *contiguous = 0;
static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
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*/
@@ -1513,208 +1954,150 @@ int __pyx_module_is_main_silx__math__medianfilter__medianfilter = 0;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ImportError;
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_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_buffer, PyObject *__pyx_v_output_buffer); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_filter_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_filter_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_uint64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional); /* proto */
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_buffer, PyArrayObject *__pyx_v_output_buffer, PyArrayObject *__pyx_v_kernel_size, bool __pyx_v_conditional); /* 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_l[] = "l";
-static char __pyx_k_q[] = "q";
-static char __pyx_k_x[] = "x";
-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_obj[] = "obj";
-static char __pyx_k_base[] = "base";
-static char __pyx_k_data[] = "data";
-static char __pyx_k_date[] = "__date__";
-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_array[] = "array";
-static char __pyx_k_check[] = "check";
-static char __pyx_k_class[] = "__class__";
-static char __pyx_k_dtype[] = "dtype";
-static char __pyx_k_error[] = "error";
-static char __pyx_k_flags[] = "flags";
-static char __pyx_k_image[] = "image";
-static char __pyx_k_int16[] = "int16";
-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_shape[] = "shape";
-static char __pyx_k_start[] = "start";
-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_uint16[] = "uint16";
-static char __pyx_k_uint32[] = "uint32";
-static char __pyx_k_uint64[] = "uint64";
-static char __pyx_k_unpack[] = "unpack";
-static char __pyx_k_xrange[] = "xrange";
-static char __pyx_k_H_Payno[] = "H. Payno";
-static char __pyx_k_authors[] = "__authors__";
-static char __pyx_k_float32[] = "float32";
-static char __pyx_k_float64[] = "float64";
-static char __pyx_k_fortran[] = "fortran";
-static char __pyx_k_ker_dim[] = "ker_dim";
-static char __pyx_k_license[] = "__license__";
-static char __pyx_k_medfilt[] = "medfilt";
-static char __pyx_k_memview[] = "memview";
-static char __pyx_k_reshape[] = "reshape";
-static char __pyx_k_Ellipsis[] = "Ellipsis";
-static char __pyx_k_itemsize[] = "itemsize";
-static char __pyx_k_reshaped[] = "reshaped";
-static char __pyx_k_J_Kieffer[] = "J. Kieffer";
-static char __pyx_k_TypeError[] = "TypeError";
-static char __pyx_k_enumerate[] = "enumerate";
-static char __pyx_k_image_dim[] = "image_dim";
-static char __pyx_k_medfilt1d[] = "medfilt1d";
-static char __pyx_k_medfilt2d[] = "medfilt2d";
-static char __pyx_k_02_05_2017[] = "02/05/2017";
-static char __pyx_k_IndexError[] = "IndexError";
-static char __pyx_k_ValueError[] = "ValueError";
-static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
-static char __pyx_k_zeros_like[] = "zeros_like";
-static char __pyx_k_MemoryError[] = "MemoryError";
-static char __pyx_k_conditional[] = "conditional";
-static char __pyx_k_kernel_size[] = "kernel_size";
-static char __pyx_k_medfilterfc[] = "medfilterfc";
-static char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
-static char __pyx_k_RuntimeError[] = "RuntimeError";
-static char __pyx_k_buffer_shape[] = "buffer_shape";
-static char __pyx_k_input_buffer[] = "input_buffer";
-static char __pyx_k_output_buffer[] = "output_buffer";
-static char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k_allocate_buffer[] = "allocate_buffer";
-static char __pyx_k_dtype_is_object[] = "dtype_is_object";
-static char __pyx_k_strided_and_direct[] = "<strided and direct>";
-static char __pyx_k_median_filter_int16[] = "_median_filter_int16";
-static char __pyx_k_median_filter_int32[] = "_median_filter_int32";
-static char __pyx_k_median_filter_int64[] = "_median_filter_int64";
-static char __pyx_k_median_filter_uint16[] = "_median_filter_uint16";
-static char __pyx_k_median_filter_uint32[] = "_median_filter_uint32";
-static char __pyx_k_median_filter_uint64[] = "_median_filter_uint64";
-static char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
-static char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
-static char __pyx_k_median_filter_float32[] = "_median_filter_float32";
-static char __pyx_k_median_filter_float64[] = "_median_filter_float64";
-static char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
-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_input_buffer_dimension_must_mo[] = "<input_buffer> dimension must mo higher than 2.";
-static char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
-static char __pyx_k_users_payno_Documents_dev_esrf[] = "/users/payno/Documents/dev/esrf/silx/paynoSilx/silx/silx/math/medianfilter/medianfilter.pyx";
-static char __pyx_k_Invalid_data_shape_Dimemsion_of[] = "Invalid data shape. Dimemsion of the arary should be 1 or 2";
-static char __pyx_k_input_buffer_must_be_a_C_CONTIG[] = "<input_buffer> must be a C_CONTIGUOUS numpy array.";
-static char __pyx_k_output_buffer_dimension_must_mo[] = "<output_buffer> dimension must mo higher than 2.";
-static char __pyx_k_output_buffer_must_be_a_C_CONTI[] = "<output_buffer> must be a C_CONTIGUOUS numpy array.";
-static char __pyx_k_s_type_is_not_managed_by_the_me[] = "%s type is not managed by the median filter";
-static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
-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_This_module_provides_median_filt[] = "This module provides median filter function for 1D and 2D arrays.\n";
-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_input_buffer_and_output_buffer_m[] = "input buffer and output_buffer must be of the same type";
-static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_silx_math_medianfilter_medianfil[] = "silx.math.medianfilter.medianfilter";
-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 char __pyx_k_input_buffer_and_output_buffer_m_2[] = "input buffer and output_buffer must be of the same dimension and same dimension";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_y[] = "y";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_MIT[] = "MIT";
+static const char __pyx_k_err[] = "err";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_date[] = "__date__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_MODES[] = "MODES";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_check[] = "check";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_image[] = "image";
+static const char __pyx_k_index[] = "index";
+static const char __pyx_k_int16[] = "int16";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_int64[] = "int64";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_mirror[] = "mirror";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_shrink[] = "shrink";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_uint16[] = "uint16";
+static const char __pyx_k_uint32[] = "uint32";
+static const char __pyx_k_uint64[] = "uint64";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_H_Payno[] = "H. Payno";
+static const char __pyx_k_authors[] = "__authors__";
+static const char __pyx_k_float32[] = "float32";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_ker_dim[] = "ker_dim";
+static const char __pyx_k_license[] = "__license__";
+static const char __pyx_k_medfilt[] = "medfilt";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_nearest[] = "nearest";
+static const char __pyx_k_reflect[] = "reflect";
+static const char __pyx_k_reshape[] = "reshape";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_reshaped[] = "reshaped";
+static const char __pyx_k_J_Kieffer[] = "J. Kieffer";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_image_dim[] = "image_dim";
+static const char __pyx_k_medfilt1d[] = "medfilt1d";
+static const char __pyx_k_medfilt2d[] = "medfilt2d";
+static const char __pyx_k_02_05_2017[] = "02/05/2017";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_length_max[] = "length_max";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_zeros_like[] = "zeros_like";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_conditional[] = "conditional";
+static const char __pyx_k_kernel_size[] = "kernel_size";
+static const char __pyx_k_medfilterfc[] = "medfilterfc";
+static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_buffer_shape[] = "buffer_shape";
+static const char __pyx_k_input_buffer[] = "input_buffer";
+static const char __pyx_k_output_buffer[] = "output_buffer";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_median_filter_int16[] = "_median_filter_int16";
+static const char __pyx_k_median_filter_int32[] = "_median_filter_int32";
+static const char __pyx_k_median_filter_int64[] = "_median_filter_int64";
+static const char __pyx_k_median_filter_uint16[] = "_median_filter_uint16";
+static const char __pyx_k_median_filter_uint32[] = "_median_filter_uint32";
+static const char __pyx_k_median_filter_uint64[] = "_median_filter_uint64";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_median_filter_float32[] = "_median_filter_float32";
+static const char __pyx_k_median_filter_float64[] = "_median_filter_float64";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_Requested_mode_s_is_unknowed[] = "Requested mode %s is unknowed.";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_input_buffer_dimension_must_mo[] = "<input_buffer> dimension must mo higher than 2.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_Invalid_data_shape_Dimemsion_of[] = "Invalid data shape. Dimemsion of the arary should be 1 or 2";
+static const char __pyx_k_input_buffer_must_be_a_C_CONTIG[] = "<input_buffer> must be a C_CONTIGUOUS numpy array.";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_output_buffer_dimension_must_mo[] = "<output_buffer> dimension must mo higher than 2.";
+static const char __pyx_k_output_buffer_must_be_a_C_CONTI[] = "<output_buffer> must be a C_CONTIGUOUS numpy array.";
+static const char __pyx_k_s_type_is_not_managed_by_the_me[] = "%s type is not managed by the median filter";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_users_kieffer_workspace_400_rel[] = "/users/kieffer/workspace-400/release/silx/silx/math/medianfilter/medianfilter.pyx";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_This_module_provides_median_filt[] = "This module provides median filter function for 1D and 2D arrays.\n";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_input_buffer_and_output_buffer_m[] = "input buffer and output_buffer must be of the same type";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_silx_math_medianfilter_medianfil[] = "silx.math.medianfilter.medianfilter";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static const char __pyx_k_input_buffer_and_output_buffer_m_2[] = "input buffer and output_buffer must be of the same dimension and same dimension";
static PyObject *__pyx_kp_s_02_05_2017;
+static PyObject *__pyx_n_s_ASCII;
static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
static PyObject *__pyx_n_s_C_CONTIGUOUS;
static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
@@ -1724,6 +2107,7 @@ 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_kp_s_H_Payno;
+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_Invalid_data_shape_Dimemsion_of;
@@ -1731,12 +2115,14 @@ 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_J_Kieffer;
static PyObject *__pyx_n_s_MIT;
+static PyObject *__pyx_n_s_MODES;
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_kp_s_Requested_mode_s_is_unknowed;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
@@ -1757,7 +2143,9 @@ static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_err;
static PyObject *__pyx_n_s_error;
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_float32;
@@ -1770,6 +2158,7 @@ static PyObject *__pyx_n_s_id;
static PyObject *__pyx_n_s_image;
static PyObject *__pyx_n_s_image_dim;
static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_input_buffer;
static PyObject *__pyx_kp_s_input_buffer_and_output_buffer_m;
static PyObject *__pyx_kp_s_input_buffer_and_output_buffer_m_2;
@@ -1782,6 +2171,7 @@ static PyObject *__pyx_n_s_itemsize;
static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
static PyObject *__pyx_n_s_ker_dim;
static PyObject *__pyx_n_s_kernel_size;
+static PyObject *__pyx_n_s_length_max;
static PyObject *__pyx_n_s_license;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_medfilt;
@@ -1797,13 +2187,17 @@ static PyObject *__pyx_n_s_median_filter_uint16;
static PyObject *__pyx_n_s_median_filter_uint32;
static PyObject *__pyx_n_s_median_filter_uint64;
static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_mirror;
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_nearest;
static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_output_buffer;
static PyObject *__pyx_kp_s_output_buffer_dimension_must_mo;
@@ -1812,10 +2206,12 @@ 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_reflect;
static PyObject *__pyx_n_s_reshape;
static PyObject *__pyx_n_s_reshaped;
static PyObject *__pyx_kp_s_s_type_is_not_managed_by_the_me;
static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_shrink;
static PyObject *__pyx_n_s_silx_math_medianfilter_medianfil;
static PyObject *__pyx_n_s_size;
static PyObject *__pyx_n_s_start;
@@ -1833,12 +2229,64 @@ 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_users_payno_Documents_dev_esrf;
-static PyObject *__pyx_n_s_x;
-static PyObject *__pyx_n_s_xrange;
+static PyObject *__pyx_kp_s_users_kieffer_workspace_400_rel;
+static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_zeros_like;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_input_buffer, PyObject *__pyx_v_output_buffer); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8reflect(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_index, int __pyx_v_length_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10mirror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_index, int __pyx_v_length_max); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_24_median_filter_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode); /* proto */
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_26_median_filter_uint16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_buffer, PyArrayObject *__pyx_v_output_buffer, PyArrayObject *__pyx_v_kernel_size, bool __pyx_v_conditional, int __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 int __pyx_array___pyx_pf_15View_dot_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___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_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___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
+static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_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 PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_tuple_;
@@ -1850,9 +2298,9 @@ static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
-static PyObject *__pyx_slice__21;
-static PyObject *__pyx_slice__22;
-static PyObject *__pyx_slice__23;
+static PyObject *__pyx_slice__26;
+static PyObject *__pyx_slice__27;
+static PyObject *__pyx_slice__28;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
@@ -1864,67 +2312,76 @@ 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__27;
static PyObject *__pyx_tuple__29;
-static PyObject *__pyx_tuple__31;
-static PyObject *__pyx_tuple__33;
-static PyObject *__pyx_tuple__35;
-static PyObject *__pyx_tuple__37;
-static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__41;
-static PyObject *__pyx_tuple__43;
-static PyObject *__pyx_tuple__45;
-static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__42;
+static PyObject *__pyx_tuple__44;
+static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
-static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_codeobj__26;
-static PyObject *__pyx_codeobj__28;
-static PyObject *__pyx_codeobj__30;
-static PyObject *__pyx_codeobj__32;
-static PyObject *__pyx_codeobj__34;
-static PyObject *__pyx_codeobj__36;
-static PyObject *__pyx_codeobj__38;
-static PyObject *__pyx_codeobj__40;
-static PyObject *__pyx_codeobj__42;
-static PyObject *__pyx_codeobj__44;
-static PyObject *__pyx_codeobj__46;
-static PyObject *__pyx_codeobj__48;
-
-/* "silx/math/medianfilter/medianfilter.pyx":46
- *
- *
- * def medfilt1d(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_tuple__58;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__60;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_tuple__62;
+static PyObject *__pyx_codeobj__31;
+static PyObject *__pyx_codeobj__33;
+static PyObject *__pyx_codeobj__35;
+static PyObject *__pyx_codeobj__37;
+static PyObject *__pyx_codeobj__39;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__43;
+static PyObject *__pyx_codeobj__45;
+static PyObject *__pyx_codeobj__47;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+static PyObject *__pyx_codeobj__53;
+static PyObject *__pyx_codeobj__55;
+static PyObject *__pyx_codeobj__57;
+
+/* "silx/math/medianfilter/medianfilter.pyx":48
+ *
+ *
+ * def medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
/* Python wrapper */
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_1medfilt1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_medfilt1d[] = "medfilt1d(data, kernel_size=3, bool conditional=False)\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply\n the median filter. Should be 1d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: int\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n\n :returns: the array with the median value for each pixel.\n ";
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_medfilt1d[] = "medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest')\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply\n the median filter. Should be 1d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: int\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n\n :returns: the array with the median value for each pixel.\n ";
static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_1medfilt1d = {"medfilt1d", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_1medfilt1d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_medfilt1d};
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_1medfilt1d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_kernel_size = 0;
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_v_mode = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("medfilt1d (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[3] = {0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,0};
+ PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_3);
+ values[3] = ((PyObject *)__pyx_n_s_nearest);
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);
@@ -1946,12 +2403,18 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_1medfilt1d(P
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional);
if (value) { values[2] = value; kw_args--; }
}
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt1d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt1d") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
@@ -1962,55 +2425,53 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_1medfilt1d(P
__pyx_v_data = values[0];
__pyx_v_kernel_size = values[1];
if (values[2]) {
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
} else {
__pyx_v_conditional = ((bool)0);
}
+ __pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("medfilt1d", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("medfilt1d", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter.medfilt1d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(__pyx_self, __pyx_v_data, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(__pyx_self, __pyx_v_data, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional) {
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
+ int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("medfilt1d", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":60
+ /* "silx/math/medianfilter/medianfilter.pyx":62
* :returns: the array with the median value for each pixel.
* """
- * return medfilt(data, kernel_size, conditional) # <<<<<<<<<<<<<<
+ * return medfilt(data, kernel_size, conditional, mode) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_medfilt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_medfilt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2020,32 +2481,55 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CY
__pyx_t_5 = 1;
}
}
- __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_data, __pyx_v_kernel_size, __pyx_t_3, __pyx_v_mode};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_data, __pyx_v_kernel_size, __pyx_t_3, __pyx_v_mode};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_data);
+ __Pyx_INCREF(__pyx_v_kernel_size);
+ __Pyx_GIVEREF(__pyx_v_kernel_size);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kernel_size);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
+ __Pyx_INCREF(__pyx_v_mode);
+ __Pyx_GIVEREF(__pyx_v_mode);
+ PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_mode);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
}
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __Pyx_INCREF(__pyx_v_kernel_size);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kernel_size);
- __Pyx_GIVEREF(__pyx_v_kernel_size);
- PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "silx/math/medianfilter/medianfilter.pyx":46
+ /* "silx/math/medianfilter/medianfilter.pyx":48
*
*
- * def medfilt1d(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
@@ -2065,36 +2549,36 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_medfilt1d(CY
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":63
+/* "silx/math/medianfilter/medianfilter.pyx":65
*
*
- * def medfilt2d(image, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
/* Python wrapper */
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_3medfilt2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_2medfilt2d[] = "medfilt2d(image, kernel_size=3, bool conditional=False)\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply\n the median filter. Should be 2d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: For 1D should be an int for 2D should be a tuple or\n a list of (kernel_height, kernel_width)\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n\n :returns: the array with the median value for each pixel.\n ";
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_2medfilt2d[] = "medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest')\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply\n the median filter. Should be 2d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: For 1D should be an int for 2D should be a tuple or\n a list of (kernel_height, kernel_width)\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n\n :returns: the array with the median value for each pixel.\n ";
static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_3medfilt2d = {"medfilt2d", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_3medfilt2d, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_2medfilt2d};
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_3medfilt2d(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_image = 0;
PyObject *__pyx_v_kernel_size = 0;
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_v_mode = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("medfilt2d (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[3] = {0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_image,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,0};
+ PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_3);
+ values[3] = ((PyObject *)__pyx_n_s_nearest);
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);
@@ -2116,12 +2600,18 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_3medfilt2d(P
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional);
if (value) { values[2] = value; kw_args--; }
}
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt2d") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt2d") < 0)) __PYX_ERR(0, 65, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
@@ -2132,55 +2622,53 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_3medfilt2d(P
__pyx_v_image = values[0];
__pyx_v_kernel_size = values[1];
if (values[2]) {
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L3_error)
} else {
__pyx_v_conditional = ((bool)0);
}
+ __pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("medfilt2d", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("medfilt2d", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 65, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter.medfilt2d", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(__pyx_self, __pyx_v_image, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(__pyx_self, __pyx_v_image, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional) {
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_image, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
+ int __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("medfilt2d", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":78
+ /* "silx/math/medianfilter/medianfilter.pyx":80
* :returns: the array with the median value for each pixel.
* """
- * return medfilt(image, kernel_size, conditional) # <<<<<<<<<<<<<<
+ * return medfilt(image, kernel_size, conditional, mode) # <<<<<<<<<<<<<<
*
*
*/
__Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_medfilt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_medfilt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = NULL;
__pyx_t_5 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
if (likely(__pyx_t_4)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
@@ -2190,32 +2678,55 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(C
__pyx_t_5 = 1;
}
}
- __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (__pyx_t_4) {
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- }
- __Pyx_INCREF(__pyx_v_image);
- PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_image);
- __Pyx_GIVEREF(__pyx_v_image);
- __Pyx_INCREF(__pyx_v_kernel_size);
- PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kernel_size);
- __Pyx_GIVEREF(__pyx_v_kernel_size);
- PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_image, __pyx_v_kernel_size, __pyx_t_3, __pyx_v_mode};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_image, __pyx_v_kernel_size, __pyx_t_3, __pyx_v_mode};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_image);
+ __Pyx_GIVEREF(__pyx_v_image);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_image);
+ __Pyx_INCREF(__pyx_v_kernel_size);
+ __Pyx_GIVEREF(__pyx_v_kernel_size);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_kernel_size);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
+ __Pyx_INCREF(__pyx_v_mode);
+ __Pyx_GIVEREF(__pyx_v_mode);
+ PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_mode);
+ __pyx_t_3 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "silx/math/medianfilter/medianfilter.pyx":63
+ /* "silx/math/medianfilter/medianfilter.pyx":65
*
*
- * def medfilt2d(image, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
@@ -2235,36 +2746,36 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_2medfilt2d(C
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":81
+/* "silx/math/medianfilter/medianfilter.pyx":83
*
*
- * def medfilt(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
/* Python wrapper */
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_5medfilt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_4medfilt[] = "medfilt(data, kernel_size=3, bool conditional=False)\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply \n the median filter. Should be 1d or 2d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: For 1D should be an int for 2D should be a tuple or \n a list of (kernel_height, kernel_width)\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n\n :returns: the array with the median value for each pixel.\n ";
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_4medfilt[] = "medfilt(data, kernel_size=3, bool conditional=False, mode='nearest')\nFunction computing the median filter of the given input.\n Behavior at boundaries: the algorithm is reducing the size of the\n window/kernel for pixels at boundaries (there is no mirroring).\n\n :param numpy.ndarray data: the array for which we want to apply \n the median filter. Should be 1d or 2d.\n :param kernel_size: the dimension of the kernel.\n :type kernel_size: For 1D should be an int for 2D should be a tuple or \n a list of (kernel_height, kernel_width)\n :param bool conditional: True if we want to apply a conditional median\n filtering.\n :param str mode: the algorithm used to determine how values at borders\n are determined.\n\n :returns: the array with the median value for each pixel.\n ";
static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_5medfilt = {"medfilt", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_5medfilt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_4medfilt};
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_5medfilt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_data = 0;
PyObject *__pyx_v_kernel_size = 0;
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_v_mode = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("medfilt (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[3] = {0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,0};
+ PyObject* values[4] = {0,0,0,0};
values[1] = ((PyObject *)__pyx_int_3);
+ values[3] = ((PyObject *)__pyx_n_s_nearest);
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);
@@ -2286,12 +2797,18 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_5medfilt(PyO
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional);
if (value) { values[2] = value; kw_args--; }
}
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "medfilt") < 0)) __PYX_ERR(0, 83, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
@@ -2302,27 +2819,29 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_5medfilt(PyO
__pyx_v_data = values[0];
__pyx_v_kernel_size = values[1];
if (values[2]) {
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 83, __pyx_L3_error)
} else {
__pyx_v_conditional = ((bool)0);
}
+ __pyx_v_mode = values[3];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("medfilt", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("medfilt", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 83, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter.medfilt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(__pyx_self, __pyx_v_data, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(__pyx_self, __pyx_v_data, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional) {
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kernel_size, bool __pyx_v_conditional, PyObject *__pyx_v_mode) {
+ PyObject *__pyx_v_err = NULL;
int __pyx_v_reshaped;
PyObject *__pyx_v_output_buffer = NULL;
PyObject *__pyx_v_ker_dim = NULL;
@@ -2330,87 +2849,159 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
+ int __pyx_t_2;
int __pyx_t_3;
PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
int __pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ PyObject *__pyx_t_9 = NULL;
__Pyx_RefNannySetupContext("medfilt", 0);
__Pyx_INCREF(__pyx_v_data);
- /* "silx/math/medianfilter/medianfilter.pyx":96
+ /* "silx/math/medianfilter/medianfilter.pyx":100
* :returns: the array with the median value for each pixel.
* """
+ * if mode not in MODES: # <<<<<<<<<<<<<<
+ * err = 'Requested mode %s is unknowed.' % mode
+ * raise ValueError(err)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_MODES); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 100, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_mode, __pyx_t_1, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "silx/math/medianfilter/medianfilter.pyx":101
+ * """
+ * if mode not in MODES:
+ * err = 'Requested mode %s is unknowed.' % mode # <<<<<<<<<<<<<<
+ * raise ValueError(err)
+ *
+ */
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_Requested_mode_s_is_unknowed, __pyx_v_mode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_err = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":102
+ * if mode not in MODES:
+ * err = 'Requested mode %s is unknowed.' % mode
+ * raise ValueError(err) # <<<<<<<<<<<<<<
+ *
+ * reshaped = False
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_err);
+ __Pyx_GIVEREF(__pyx_v_err);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_err);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 102, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":100
+ * :returns: the array with the median value for each pixel.
+ * """
+ * if mode not in MODES: # <<<<<<<<<<<<<<
+ * err = 'Requested mode %s is unknowed.' % mode
+ * raise ValueError(err)
+ */
+ }
+
+ /* "silx/math/medianfilter/medianfilter.pyx":104
+ * raise ValueError(err)
+ *
* reshaped = False # <<<<<<<<<<<<<<
* if len(data.shape) == 1:
* data = data.reshape(data.shape[0], 1)
*/
__pyx_v_reshaped = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":97
- * """
+ /* "silx/math/medianfilter/medianfilter.pyx":105
+ *
* reshaped = False
* if len(data.shape) == 1: # <<<<<<<<<<<<<<
* data = data.reshape(data.shape[0], 1)
* reshaped = True
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = ((__pyx_t_2 == 1) != 0);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 105, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = ((__pyx_t_5 == 1) != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":98
+ /* "silx/math/medianfilter/medianfilter.pyx":106
* reshaped = False
* if len(data.shape) == 1:
* data = data.reshape(data.shape[0], 1) # <<<<<<<<<<<<<<
* reshaped = True
* elif len(data.shape) > 2:
*/
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_reshape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_reshape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = NULL;
- __pyx_t_2 = 0;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
- if (likely(__pyx_t_5)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_4, function);
- __pyx_t_2 = 1;
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_7 = PyTuple_New(2+__pyx_t_2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (__pyx_t_5) {
- PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_int_1};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_int_1};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_6) {
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_7);
+ __Pyx_INCREF(__pyx_int_1);
+ __Pyx_GIVEREF(__pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_int_1);
+ __pyx_t_7 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_2, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_2, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_6 = 0;
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_1);
- __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
+ __pyx_t_4 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":99
+ /* "silx/math/medianfilter/medianfilter.pyx":107
* if len(data.shape) == 1:
* data = data.reshape(data.shape[0], 1)
* reshaped = True # <<<<<<<<<<<<<<
@@ -2418,117 +3009,169 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
* raise ValueError("Invalid data shape. Dimemsion of the arary should be 1 or 2")
*/
__pyx_v_reshaped = 1;
- goto __pyx_L3;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":105
+ *
+ * reshaped = False
+ * if len(data.shape) == 1: # <<<<<<<<<<<<<<
+ * data = data.reshape(data.shape[0], 1)
+ * reshaped = True
+ */
+ goto __pyx_L4;
}
- /* "silx/math/medianfilter/medianfilter.pyx":100
+ /* "silx/math/medianfilter/medianfilter.pyx":108
* data = data.reshape(data.shape[0], 1)
* reshaped = True
* elif len(data.shape) > 2: # <<<<<<<<<<<<<<
* raise ValueError("Invalid data shape. Dimemsion of the arary should be 1 or 2")
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = ((__pyx_t_2 > 2) != 0);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 108, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 108, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_3 = ((__pyx_t_5 > 2) != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":101
+ /* "silx/math/medianfilter/medianfilter.pyx":109
* reshaped = True
* elif len(data.shape) > 2:
* raise ValueError("Invalid data shape. Dimemsion of the arary should be 1 or 2") # <<<<<<<<<<<<<<
*
* # simple median filter apply into a 2D buffer
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); 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_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 109, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":108
+ * data = data.reshape(data.shape[0], 1)
+ * reshaped = True
+ * elif len(data.shape) > 2: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid data shape. Dimemsion of the arary should be 1 or 2")
+ *
+ */
}
- __pyx_L3:;
+ __pyx_L4:;
- /* "silx/math/medianfilter/medianfilter.pyx":104
+ /* "silx/math/medianfilter/medianfilter.pyx":112
*
* # simple median filter apply into a 2D buffer
* output_buffer = numpy.zeros_like(data) # <<<<<<<<<<<<<<
* check(data, output_buffer)
*
*/
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
- if (likely(__pyx_t_4)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
- __Pyx_INCREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros_like); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
}
}
- if (!__pyx_t_4) {
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
+ if (!__pyx_t_1) {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __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 = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_data};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_data);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_v_output_buffer = __pyx_t_1;
- __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_output_buffer = __pyx_t_4;
+ __pyx_t_4 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":105
+ /* "silx/math/medianfilter/medianfilter.pyx":113
* # simple median filter apply into a 2D buffer
* output_buffer = numpy.zeros_like(data)
* check(data, output_buffer) # <<<<<<<<<<<<<<
*
* if type(kernel_size) in (tuple, list):
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_check); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = NULL;
- __pyx_t_2 = 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_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_check); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_7);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
- __pyx_t_2 = 1;
+ __Pyx_DECREF_SET(__pyx_t_9, function);
+ __pyx_t_8 = 1;
}
}
- __pyx_t_4 = PyTuple_New(2+__pyx_t_2); 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);
- if (__pyx_t_6) {
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_data, __pyx_v_output_buffer};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_data, __pyx_v_output_buffer};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_8, __pyx_v_data);
+ __Pyx_INCREF(__pyx_v_output_buffer);
+ __Pyx_GIVEREF(__pyx_v_output_buffer);
+ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_8, __pyx_v_output_buffer);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_2, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __Pyx_INCREF(__pyx_v_output_buffer);
- PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_2, __pyx_v_output_buffer);
- __Pyx_GIVEREF(__pyx_v_output_buffer);
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); 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_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":107
+ /* "silx/math/medianfilter/medianfilter.pyx":115
* check(data, output_buffer)
*
* if type(kernel_size) in (tuple, list): # <<<<<<<<<<<<<<
@@ -2536,625 +3179,766 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
* ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32)
*/
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_kernel_size)));
- __pyx_t_1 = ((PyObject *)Py_TYPE(__pyx_v_kernel_size));
- __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyTuple_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (!__pyx_t_8) {
+ __pyx_t_4 = ((PyObject *)Py_TYPE(__pyx_v_kernel_size));
+ __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)(&PyTuple_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (!__pyx_t_2) {
} else {
- __pyx_t_3 = __pyx_t_8;
- goto __pyx_L5_bool_binop_done;
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L6_bool_binop_done;
}
- __pyx_t_7 = PyObject_RichCompare(((PyObject *)__pyx_t_1), ((PyObject *)((PyObject*)(&PyList_Type))), Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_3 = __pyx_t_8;
- __pyx_L5_bool_binop_done:;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_8 = (__pyx_t_3 != 0);
- if (__pyx_t_8) {
+ __pyx_t_9 = PyObject_RichCompare(((PyObject *)__pyx_t_4), ((PyObject *)(&PyList_Type)), Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L6_bool_binop_done:;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":108
+ /* "silx/math/medianfilter/medianfilter.pyx":116
*
* if type(kernel_size) in (tuple, list):
* if(len(kernel_size) == 1): # <<<<<<<<<<<<<<
* ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32)
* else:
*/
- __pyx_t_2 = PyObject_Length(__pyx_v_kernel_size); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = ((__pyx_t_2 == 1) != 0);
- if (__pyx_t_8) {
+ __pyx_t_5 = PyObject_Length(__pyx_v_kernel_size); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __pyx_t_2 = ((__pyx_t_5 == 1) != 0);
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":109
+ /* "silx/math/medianfilter/medianfilter.pyx":117
* if type(kernel_size) in (tuple, list):
* if(len(kernel_size) == 1):
* ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32) # <<<<<<<<<<<<<<
* else:
* ker_dim = numpy.array(kernel_size, dtype=numpy.int32)
*/
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); 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_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_kernel_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_array); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_kernel_size, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 117, __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 = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_INCREF(__pyx_int_1);
+ __Pyx_GIVEREF(__pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); 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_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_5) < 0) {__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_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_4); 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_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_ker_dim = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L7;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_ker_dim = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":116
+ *
+ * if type(kernel_size) in (tuple, list):
+ * if(len(kernel_size) == 1): # <<<<<<<<<<<<<<
+ * ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32)
+ * else:
+ */
+ goto __pyx_L8;
}
- /*else*/ {
- /* "silx/math/medianfilter/medianfilter.pyx":111
+ /* "silx/math/medianfilter/medianfilter.pyx":119
* ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32)
* else:
* ker_dim = numpy.array(kernel_size, dtype=numpy.int32) # <<<<<<<<<<<<<<
* else:
* ker_dim = numpy.array([kernel_size, kernel_size], dtype=numpy.int32)
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ /*else*/ {
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_INCREF(__pyx_v_kernel_size);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_kernel_size);
__Pyx_GIVEREF(__pyx_v_kernel_size);
- __pyx_t_1 = PyDict_New(); 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_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_kernel_size);
+ __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __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_1); __pyx_t_1 = 0;
- __pyx_v_ker_dim = __pyx_t_6;
- __pyx_t_6 = 0;
+ __pyx_v_ker_dim = __pyx_t_7;
+ __pyx_t_7 = 0;
}
- __pyx_L7:;
- goto __pyx_L4;
+ __pyx_L8:;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":115
+ * check(data, output_buffer)
+ *
+ * if type(kernel_size) in (tuple, list): # <<<<<<<<<<<<<<
+ * if(len(kernel_size) == 1):
+ * ker_dim = numpy.array(1, [kernel_size[0]], dtype=numpy.int32)
+ */
+ goto __pyx_L5;
}
- /*else*/ {
- /* "silx/math/medianfilter/medianfilter.pyx":113
+ /* "silx/math/medianfilter/medianfilter.pyx":121
* ker_dim = numpy.array(kernel_size, dtype=numpy.int32)
* else:
* ker_dim = numpy.array([kernel_size, kernel_size], dtype=numpy.int32) # <<<<<<<<<<<<<<
*
* if data.dtype == numpy.float64:
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
+ /*else*/ {
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
__Pyx_INCREF(__pyx_v_kernel_size);
- PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_kernel_size);
__Pyx_GIVEREF(__pyx_v_kernel_size);
+ PyList_SET_ITEM(__pyx_t_7, 0, __pyx_v_kernel_size);
__Pyx_INCREF(__pyx_v_kernel_size);
- PyList_SET_ITEM(__pyx_t_6, 1, __pyx_v_kernel_size);
__Pyx_GIVEREF(__pyx_v_kernel_size);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_7, 1, __pyx_v_kernel_size);
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __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_6); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 121, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_ker_dim = __pyx_t_7;
- __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_v_ker_dim = __pyx_t_9;
+ __pyx_t_9 = 0;
}
- __pyx_L4:;
+ __pyx_L5:;
- /* "silx/math/medianfilter/medianfilter.pyx":115
+ /* "silx/math/medianfilter/medianfilter.pyx":123
* ker_dim = numpy.array([kernel_size, kernel_size], dtype=numpy.int32)
*
* if data.dtype == numpy.float64: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_float64
* elif data.dtype == numpy.float32:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 123, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); 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_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 123, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":116
+ /* "silx/math/medianfilter/medianfilter.pyx":124
*
* if data.dtype == numpy.float64:
* medfilterfc = _median_filter_float64 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.float32:
* medfilterfc = _median_filter_float32
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_medfilterfc = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L8;
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_float64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_v_medfilterfc = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":123
+ * ker_dim = numpy.array([kernel_size, kernel_size], dtype=numpy.int32)
+ *
+ * if data.dtype == numpy.float64: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_float64
+ * elif data.dtype == numpy.float32:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":117
+ /* "silx/math/medianfilter/medianfilter.pyx":125
* if data.dtype == numpy.float64:
* medfilterfc = _median_filter_float64
* elif data.dtype == numpy.float32: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_float32
* elif data.dtype == numpy.int64:
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 125, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 125, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_8) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 125, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":118
+ /* "silx/math/medianfilter/medianfilter.pyx":126
* medfilterfc = _median_filter_float64
* elif data.dtype == numpy.float32:
* medfilterfc = _median_filter_float32 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.int64:
* medfilterfc = _median_filter_int64
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_medfilterfc = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L8;
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 126, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_medfilterfc = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":125
+ * if data.dtype == numpy.float64:
+ * medfilterfc = _median_filter_float64
+ * elif data.dtype == numpy.float32: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_float32
+ * elif data.dtype == numpy.int64:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":119
+ /* "silx/math/medianfilter/medianfilter.pyx":127
* elif data.dtype == numpy.float32:
* medfilterfc = _median_filter_float32
* elif data.dtype == numpy.int64: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_int64
* elif data.dtype == numpy.uint64:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); 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_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_int64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 127, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":120
+ /* "silx/math/medianfilter/medianfilter.pyx":128
* medfilterfc = _median_filter_float32
* elif data.dtype == numpy.int64:
* medfilterfc = _median_filter_int64 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.uint64:
* medfilterfc = _median_filter_uint64
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int64); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_medfilterfc = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L8;
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int64); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 128, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_v_medfilterfc = __pyx_t_9;
+ __pyx_t_9 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":127
+ * elif data.dtype == numpy.float32:
+ * medfilterfc = _median_filter_float32
+ * elif data.dtype == numpy.int64: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_int64
+ * elif data.dtype == numpy.uint64:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":121
+ /* "silx/math/medianfilter/medianfilter.pyx":129
* elif data.dtype == numpy.int64:
* medfilterfc = _median_filter_int64
* elif data.dtype == numpy.uint64: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_uint64
* elif data.dtype == numpy.int32:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 129, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 129, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 129, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":122
+ /* "silx/math/medianfilter/medianfilter.pyx":130
* medfilterfc = _median_filter_int64
* elif data.dtype == numpy.uint64:
* medfilterfc = _median_filter_uint64 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.int32:
* medfilterfc = _median_filter_int32
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_medfilterfc = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L8;
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint64); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_v_medfilterfc = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":129
+ * elif data.dtype == numpy.int64:
+ * medfilterfc = _median_filter_int64
+ * elif data.dtype == numpy.uint64: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_uint64
+ * elif data.dtype == numpy.int32:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":123
+ /* "silx/math/medianfilter/medianfilter.pyx":131
* elif data.dtype == numpy.uint64:
* medfilterfc = _median_filter_uint64
* elif data.dtype == numpy.int32: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_int32
* elif data.dtype == numpy.uint32:
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_8) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":124
+ /* "silx/math/medianfilter/medianfilter.pyx":132
* medfilterfc = _median_filter_uint64
* elif data.dtype == numpy.int32:
* medfilterfc = _median_filter_int32 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.uint32:
* medfilterfc = _median_filter_uint32
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_medfilterfc = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L8;
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_medfilterfc = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":131
+ * elif data.dtype == numpy.uint64:
+ * medfilterfc = _median_filter_uint64
+ * elif data.dtype == numpy.int32: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_int32
+ * elif data.dtype == numpy.uint32:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":125
+ /* "silx/math/medianfilter/medianfilter.pyx":133
* elif data.dtype == numpy.int32:
* medfilterfc = _median_filter_int32
* elif data.dtype == numpy.uint32: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_uint32
* elif data.dtype == numpy.int16:
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_uint32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_uint32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_9 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 133, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":126
+ /* "silx/math/medianfilter/medianfilter.pyx":134
* medfilterfc = _median_filter_int32
* elif data.dtype == numpy.uint32:
* medfilterfc = _median_filter_uint32 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.int16:
* medfilterfc = _median_filter_int16
*/
- __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint32); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_v_medfilterfc = __pyx_t_7;
- __pyx_t_7 = 0;
- goto __pyx_L8;
+ __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_v_medfilterfc = __pyx_t_9;
+ __pyx_t_9 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":133
+ * elif data.dtype == numpy.int32:
+ * medfilterfc = _median_filter_int32
+ * elif data.dtype == numpy.uint32: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_uint32
+ * elif data.dtype == numpy.int16:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":127
+ /* "silx/math/medianfilter/medianfilter.pyx":135
* elif data.dtype == numpy.uint32:
* medfilterfc = _median_filter_uint32
* elif data.dtype == numpy.int16: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_int16
* elif data.dtype == numpy.uint16:
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_int16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 135, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_int16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_t_6, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_8) {
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":128
+ /* "silx/math/medianfilter/medianfilter.pyx":136
* medfilterfc = _median_filter_uint32
* elif data.dtype == numpy.int16:
* medfilterfc = _median_filter_int16 # <<<<<<<<<<<<<<
* elif data.dtype == numpy.uint16:
* medfilterfc = _median_filter_uint16
*/
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int16); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_v_medfilterfc = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L8;
+ __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_int16); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_v_medfilterfc = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":135
+ * elif data.dtype == numpy.uint32:
+ * medfilterfc = _median_filter_uint32
+ * elif data.dtype == numpy.int16: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_int16
+ * elif data.dtype == numpy.uint16:
+ */
+ goto __pyx_L9;
}
- /* "silx/math/medianfilter/medianfilter.pyx":129
+ /* "silx/math/medianfilter/medianfilter.pyx":137
* elif data.dtype == numpy.int16:
* medfilterfc = _median_filter_int16
* elif data.dtype == numpy.uint16: # <<<<<<<<<<<<<<
* medfilterfc = _median_filter_uint16
* else:
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_uint16); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_8) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":130
+ /* "silx/math/medianfilter/medianfilter.pyx":138
* medfilterfc = _median_filter_int16
* elif data.dtype == numpy.uint16:
* medfilterfc = _median_filter_uint16 # <<<<<<<<<<<<<<
* else:
* raise ValueError("%s type is not managed by the median filter" % data.dtype)
*/
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint16); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_v_medfilterfc = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L8;
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_median_filter_uint16); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_medfilterfc = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":137
+ * elif data.dtype == numpy.int16:
+ * medfilterfc = _median_filter_int16
+ * elif data.dtype == numpy.uint16: # <<<<<<<<<<<<<<
+ * medfilterfc = _median_filter_uint16
+ * else:
+ */
+ goto __pyx_L9;
}
- /*else*/ {
- /* "silx/math/medianfilter/medianfilter.pyx":132
+ /* "silx/math/medianfilter/medianfilter.pyx":140
* medfilterfc = _median_filter_uint16
* else:
* raise ValueError("%s type is not managed by the median filter" % data.dtype) # <<<<<<<<<<<<<<
*
* medfilterfc(input_buffer=data,
*/
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_s_type_is_not_managed_by_the_me, __pyx_t_5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __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 = 132; __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 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_Raise(__pyx_t_7, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_s_type_is_not_managed_by_the_me, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_9, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __PYX_ERR(0, 140, __pyx_L1_error)
}
- __pyx_L8:;
+ __pyx_L9:;
- /* "silx/math/medianfilter/medianfilter.pyx":134
+ /* "silx/math/medianfilter/medianfilter.pyx":142
* raise ValueError("%s type is not managed by the median filter" % data.dtype)
*
* medfilterfc(input_buffer=data, # <<<<<<<<<<<<<<
* output_buffer=output_buffer,
* kernel_size=ker_dim,
*/
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_input_buffer, __pyx_v_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = PyDict_New(); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_input_buffer, __pyx_v_data) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":135
+ /* "silx/math/medianfilter/medianfilter.pyx":143
*
* medfilterfc(input_buffer=data,
* output_buffer=output_buffer, # <<<<<<<<<<<<<<
* kernel_size=ker_dim,
- * conditional=conditional)
+ * conditional=conditional,
*/
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_output_buffer, __pyx_v_output_buffer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_output_buffer, __pyx_v_output_buffer) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":136
+ /* "silx/math/medianfilter/medianfilter.pyx":144
* medfilterfc(input_buffer=data,
* output_buffer=output_buffer,
* kernel_size=ker_dim, # <<<<<<<<<<<<<<
- * conditional=conditional)
- *
+ * conditional=conditional,
+ * mode=MODES[mode])
*/
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_kernel_size, __pyx_v_ker_dim) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_kernel_size, __pyx_v_ker_dim) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":137
+ /* "silx/math/medianfilter/medianfilter.pyx":145
* output_buffer=output_buffer,
* kernel_size=ker_dim,
- * conditional=conditional) # <<<<<<<<<<<<<<
+ * conditional=conditional, # <<<<<<<<<<<<<<
+ * mode=MODES[mode])
+ *
+ */
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_conditional, __pyx_t_6) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":146
+ * kernel_size=ker_dim,
+ * conditional=conditional,
+ * mode=MODES[mode]) # <<<<<<<<<<<<<<
*
* if reshaped:
*/
- __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_conditional); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_conditional, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_MODES); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = PyObject_GetItem(__pyx_t_6, __pyx_v_mode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_mode, __pyx_t_7) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":134
+ /* "silx/math/medianfilter/medianfilter.pyx":142
* raise ValueError("%s type is not managed by the median filter" % data.dtype)
*
* medfilterfc(input_buffer=data, # <<<<<<<<<<<<<<
* output_buffer=output_buffer,
* kernel_size=ker_dim,
*/
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_v_medfilterfc, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_medfilterfc, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":139
- * conditional=conditional)
+ /* "silx/math/medianfilter/medianfilter.pyx":148
+ * mode=MODES[mode])
*
* if reshaped: # <<<<<<<<<<<<<<
* data = data.reshape(data.shape[0])
* output_buffer = output_buffer.reshape(data.shape[0])
*/
- __pyx_t_8 = (__pyx_v_reshaped != 0);
- if (__pyx_t_8) {
+ __pyx_t_2 = (__pyx_v_reshaped != 0);
+ if (__pyx_t_2) {
- /* "silx/math/medianfilter/medianfilter.pyx":140
+ /* "silx/math/medianfilter/medianfilter.pyx":149
*
* if reshaped:
* data = data.reshape(data.shape[0]) # <<<<<<<<<<<<<<
* output_buffer = output_buffer.reshape(data.shape[0])
*
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_6 = NULL;
- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_7))) {
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
if (likely(__pyx_t_6)) {
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
__Pyx_INCREF(__pyx_t_6);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
}
}
if (!__pyx_t_6) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
- } else {
- __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __pyx_t_6 = NULL;
- PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5);
- __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_7);
+ __pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":141
+ /* "silx/math/medianfilter/medianfilter.pyx":150
* if reshaped:
* data = data.reshape(data.shape[0])
* output_buffer = output_buffer.reshape(data.shape[0]) # <<<<<<<<<<<<<<
*
* return output_buffer
*/
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_reshape); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_reshape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __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_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
+ __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9);
+ if (likely(__pyx_t_1)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(function);
- __Pyx_DECREF_SET(__pyx_t_7, function);
+ __Pyx_DECREF_SET(__pyx_t_9, function);
}
}
- if (!__pyx_t_4) {
- __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_GOTREF(__pyx_t_5);
+ if (!__pyx_t_1) {
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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 = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = NULL;
- PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_t_4};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF_SET(__pyx_v_output_buffer, __pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L9;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF_SET(__pyx_v_output_buffer, __pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":148
+ * mode=MODES[mode])
+ *
+ * if reshaped: # <<<<<<<<<<<<<<
+ * data = data.reshape(data.shape[0])
+ * output_buffer = output_buffer.reshape(data.shape[0])
+ */
}
- __pyx_L9:;
- /* "silx/math/medianfilter/medianfilter.pyx":143
+ /* "silx/math/medianfilter/medianfilter.pyx":152
* output_buffer = output_buffer.reshape(data.shape[0])
*
* return output_buffer # <<<<<<<<<<<<<<
@@ -3166,10 +3950,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
__pyx_r = __pyx_v_output_buffer;
goto __pyx_L0;
- /* "silx/math/medianfilter/medianfilter.pyx":81
+ /* "silx/math/medianfilter/medianfilter.pyx":83
*
*
- * def medfilt(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
@@ -3178,12 +3962,13 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
__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_7);
+ __Pyx_XDECREF(__pyx_t_9);
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter.medfilt", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_err);
__Pyx_XDECREF(__pyx_v_output_buffer);
__Pyx_XDECREF(__pyx_v_ker_dim);
__Pyx_XDECREF(__pyx_v_medfilterfc);
@@ -3193,7 +3978,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_4medfilt(CYT
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":146
+/* "silx/math/medianfilter/medianfilter.pyx":155
*
*
* def check(input_buffer, output_buffer): # <<<<<<<<<<<<<<
@@ -3208,9 +3993,6 @@ static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_7check =
static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_7check(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_input_buffer = 0;
PyObject *__pyx_v_output_buffer = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("check (wrapper)", 0);
@@ -3234,11 +4016,11 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_7check(PyObj
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("check", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("check", 1, 2, 2, 1); __PYX_ERR(0, 155, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) __PYX_ERR(0, 155, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
goto __pyx_L5_argtuple_error;
@@ -3251,7 +4033,7 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_7check(PyObj
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("check", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("check", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 155, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
@@ -3273,21 +4055,18 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHO
int __pyx_t_4;
Py_ssize_t __pyx_t_5;
PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("check", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":149
+ /* "silx/math/medianfilter/medianfilter.pyx":158
* """Simple check on the two buffers to make sure we can apply the median filter
* """
* if (input_buffer.flags['C_CONTIGUOUS'] is False): # <<<<<<<<<<<<<<
* raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.')
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_n_s_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = (__pyx_t_2 == Py_False);
@@ -3295,30 +4074,38 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHO
__pyx_t_4 = (__pyx_t_3 != 0);
if (__pyx_t_4) {
- /* "silx/math/medianfilter/medianfilter.pyx":150
+ /* "silx/math/medianfilter/medianfilter.pyx":159
* """
* if (input_buffer.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if (output_buffer.flags['C_CONTIGUOUS'] is False):
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_Raise(__pyx_t_2, 0, 0, 0);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 159, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":158
+ * """Simple check on the two buffers to make sure we can apply the median filter
+ * """
+ * if (input_buffer.flags['C_CONTIGUOUS'] is False): # <<<<<<<<<<<<<<
+ * raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":152
+ /* "silx/math/medianfilter/medianfilter.pyx":161
* raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.')
*
* if (output_buffer.flags['C_CONTIGUOUS'] is False): # <<<<<<<<<<<<<<
* raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.')
*
*/
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_C_CONTIGUOUS); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ __pyx_t_1 = PyObject_GetItem(__pyx_t_2, __pyx_n_s_C_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_4 = (__pyx_t_1 == Py_False);
@@ -3326,143 +4113,183 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHO
__pyx_t_3 = (__pyx_t_4 != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":153
+ /* "silx/math/medianfilter/medianfilter.pyx":162
*
* if (output_buffer.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if not (len(input_buffer.shape) <= 2):
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 162, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":161
+ * raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.')
+ *
+ * if (output_buffer.flags['C_CONTIGUOUS'] is False): # <<<<<<<<<<<<<<
+ * raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":155
+ /* "silx/math/medianfilter/medianfilter.pyx":164
* raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.')
*
* if not (len(input_buffer.shape) <= 2): # <<<<<<<<<<<<<<
* raise ValueError('<input_buffer> dimension must mo higher than 2.')
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 164, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = ((!((__pyx_t_5 <= 2) != 0)) != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":156
+ /* "silx/math/medianfilter/medianfilter.pyx":165
*
* if not (len(input_buffer.shape) <= 2):
* raise ValueError('<input_buffer> dimension must mo higher than 2.') # <<<<<<<<<<<<<<
*
* if not (len(output_buffer.shape) <= 2):
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 165, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":164
+ * raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.')
+ *
+ * if not (len(input_buffer.shape) <= 2): # <<<<<<<<<<<<<<
+ * raise ValueError('<input_buffer> dimension must mo higher than 2.')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":158
+ /* "silx/math/medianfilter/medianfilter.pyx":167
* raise ValueError('<input_buffer> dimension must mo higher than 2.')
*
* if not (len(output_buffer.shape) <= 2): # <<<<<<<<<<<<<<
* raise ValueError('<output_buffer> dimension must mo higher than 2.')
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 167, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = ((!((__pyx_t_5 <= 2) != 0)) != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":159
+ /* "silx/math/medianfilter/medianfilter.pyx":168
*
* if not (len(output_buffer.shape) <= 2):
* raise ValueError('<output_buffer> dimension must mo higher than 2.') # <<<<<<<<<<<<<<
*
* if not(input_buffer.dtype == output_buffer.dtype):
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 168, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":167
+ * raise ValueError('<input_buffer> dimension must mo higher than 2.')
+ *
+ * if not (len(output_buffer.shape) <= 2): # <<<<<<<<<<<<<<
+ * raise ValueError('<output_buffer> dimension must mo higher than 2.')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":161
+ /* "silx/math/medianfilter/medianfilter.pyx":170
* raise ValueError('<output_buffer> dimension must mo higher than 2.')
*
* if not(input_buffer.dtype == output_buffer.dtype): # <<<<<<<<<<<<<<
* raise ValueError('input buffer and output_buffer must be of the same type')
*
*/
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_4 = ((!__pyx_t_3) != 0);
if (__pyx_t_4) {
- /* "silx/math/medianfilter/medianfilter.pyx":162
+ /* "silx/math/medianfilter/medianfilter.pyx":171
*
* if not(input_buffer.dtype == output_buffer.dtype):
* raise ValueError('input buffer and output_buffer must be of the same type') # <<<<<<<<<<<<<<
*
* if not (input_buffer.shape == output_buffer.shape):
*/
- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
__Pyx_Raise(__pyx_t_6, 0, 0, 0);
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 171, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":170
+ * raise ValueError('<output_buffer> dimension must mo higher than 2.')
+ *
+ * if not(input_buffer.dtype == output_buffer.dtype): # <<<<<<<<<<<<<<
+ * raise ValueError('input buffer and output_buffer must be of the same type')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":164
+ /* "silx/math/medianfilter/medianfilter.pyx":173
* raise ValueError('input buffer and output_buffer must be of the same type')
*
* if not (input_buffer.shape == output_buffer.shape): # <<<<<<<<<<<<<<
* raise ValueError('input buffer and output_buffer must be of the same dimension and same dimension')
*
*/
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_input_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_output_buffer, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = ((!__pyx_t_4) != 0);
if (__pyx_t_3) {
- /* "silx/math/medianfilter/medianfilter.pyx":165
+ /* "silx/math/medianfilter/medianfilter.pyx":174
*
* if not (input_buffer.shape == output_buffer.shape):
* raise ValueError('input buffer and output_buffer must be of the same dimension and same dimension') # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_Raise(__pyx_t_1, 0, 0, 0);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(0, 174, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":173
+ * raise ValueError('input buffer and output_buffer must be of the same type')
+ *
+ * if not (input_buffer.shape == output_buffer.shape): # <<<<<<<<<<<<<<
+ * raise ValueError('input buffer and output_buffer must be of the same dimension and same dimension')
+ *
+ */
}
- /* "silx/math/medianfilter/medianfilter.pyx":146
+ /* "silx/math/medianfilter/medianfilter.pyx":155
*
*
* def check(input_buffer, output_buffer): # <<<<<<<<<<<<<<
@@ -3485,7 +4312,221 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHO
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":173
+/* "silx/math/medianfilter/medianfilter.pyx":182
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def reflect(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in reflect mode
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9reflect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_8reflect[] = "reflect(int index, int length_max)\nfind the correct index into [0, length_max-1] for index in reflect mode\n\n :param int index: the index to move into [0, length_max-1] in reflect mode\n :param int length_max: the higher bound limit\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_9reflect = {"reflect", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9reflect, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_8reflect};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9reflect(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_index;
+ int __pyx_v_length_max;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("reflect (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_length_max,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_index)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length_max)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("reflect", 1, 2, 2, 1); __PYX_ERR(0, 182, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reflect") < 0)) __PYX_ERR(0, 182, __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_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error)
+ __pyx_v_length_max = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_length_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L3_error)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("reflect", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 182, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.medianfilter.medianfilter.reflect", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_8reflect(__pyx_self, __pyx_v_index, __pyx_v_length_max);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8reflect(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_index, int __pyx_v_length_max) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("reflect", 0);
+
+ /* "silx/math/medianfilter/medianfilter.pyx":188
+ * :param int length_max: the higher bound limit
+ * """
+ * return median_filter.reflect(index, length_max) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(reflect(__pyx_v_index, __pyx_v_length_max)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":182
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def reflect(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in reflect mode
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("silx.math.medianfilter.medianfilter.reflect", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "silx/math/medianfilter/medianfilter.pyx":195
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def mirror(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in mirror mode
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11mirror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_10mirror[] = "mirror(int index, int length_max)\nfind the correct index into [0, length_max-1] for index in mirror mode\n\n :param int index: the index to move into [0, length_max-1] in mirror mode\n :param int length_max: the higher bound limit\n ";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_11mirror = {"mirror", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11mirror, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_10mirror};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11mirror(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_v_index;
+ int __pyx_v_length_max;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("mirror (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_length_max,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_index)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ case 1:
+ if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_length_max)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("mirror", 1, 2, 2, 1); __PYX_ERR(0, 195, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mirror") < 0)) __PYX_ERR(0, 195, __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_index = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
+ __pyx_v_length_max = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_length_max == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("mirror", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("silx.math.medianfilter.medianfilter.mirror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_10mirror(__pyx_self, __pyx_v_index, __pyx_v_length_max);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10mirror(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_index, int __pyx_v_length_max) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("mirror", 0);
+
+ /* "silx/math/medianfilter/medianfilter.pyx":201
+ * :param int length_max: the higher bound limit
+ * """
+ * return median_filter.mirror(index, length_max) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(mirror(__pyx_v_index, __pyx_v_length_max)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":195
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def mirror(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in mirror mode
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("silx.math.medianfilter.medianfilter.mirror", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "silx/math/medianfilter/medianfilter.pyx":208
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float32(float[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -3494,27 +4535,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_6check(CYTHO
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9_median_filter_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_8_median_filter_float32[] = "_median_filter_float32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_9_median_filter_float32 = {"_median_filter_float32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9_median_filter_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_8_median_filter_float32};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9_median_filter_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_12_median_filter_float32[] = "_median_filter_float32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_13_median_filter_float32 = {"_median_filter_float32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_float32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_12_median_filter_float32};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_float32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_float32 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -3530,53 +4570,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9_median_fil
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 5, 5, 1); __PYX_ERR(0, 208, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 5, 5, 2); __PYX_ERR(0, 208, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 5, 5, 3); __PYX_ERR(0, 208, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 5, 5, 4); __PYX_ERR(0, 208, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_float32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_float32") < 0)) __PYX_ERR(0, 208, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 208, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 209, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 210, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 211, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 208, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_float32", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 208, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 209, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 210, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_filter_float32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_float32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -3587,8 +4634,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_9_median_fil
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_filter_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_float32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -3603,25 +4650,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_float32", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":179
+ /* "silx/math/medianfilter/medianfilter.pyx":215
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":180
+ /* "silx/math/medianfilter/medianfilter.pyx":216
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":182
+ /* "silx/math/medianfilter/medianfilter.pyx":218
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -3630,19 +4677,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":183
+ /* "silx/math/medianfilter/medianfilter.pyx":219
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":185
+ /* "silx/math/medianfilter/medianfilter.pyx":221
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[float](<float*> & input_buffer[0,0],
* <float*> & output_buffer[0,0],
*/
@@ -3661,23 +4708,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":186
+ /* "silx/math/medianfilter/medianfilter.pyx":222
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[float](<float*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <float*> & output_buffer[0,0],
* <int*>& kernel_size[0],
@@ -3685,8 +4732,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":187
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":223
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[float](<float*> & input_buffer[0,0],
* <float*> & output_buffer[0,0], # <<<<<<<<<<<<<<
* <int*>& kernel_size[0],
@@ -3695,23 +4742,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":188
+ /* "silx/math/medianfilter/medianfilter.pyx":224
* median_filter.median_filter[float](<float*> & input_buffer[0,0],
* <float*> & output_buffer[0,0],
* <int*>& kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":186
+ /* "silx/math/medianfilter/medianfilter.pyx":222
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[float](<float*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <float*> & output_buffer[0,0],
* <int*>& kernel_size[0],
*/
- median_filter<float>(((float *)(&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((float *)(&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<float>(((float *)(&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((float *)(&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -3725,10 +4772,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":185
+ /* "silx/math/medianfilter/medianfilter.pyx":221
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[float](<float*> & input_buffer[0,0],
* <float*> & output_buffer[0,0],
*/
@@ -3743,7 +4790,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":173
+ /* "silx/math/medianfilter/medianfilter.pyx":208
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float32(float[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -3761,7 +4808,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":200
+/* "silx/math/medianfilter/medianfilter.pyx":237
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float64(double[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -3770,27 +4817,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_8_median_fil
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11_median_filter_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_10_median_filter_float64[] = "_median_filter_float64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_11_median_filter_float64 = {"_median_filter_float64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11_median_filter_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_10_median_filter_float64};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11_median_filter_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_14_median_filter_float64[] = "_median_filter_float64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_15_median_filter_float64 = {"_median_filter_float64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_float64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_14_median_filter_float64};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_float64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_float64 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -3806,53 +4852,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 5, 5, 1); __PYX_ERR(0, 237, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 5, 5, 2); __PYX_ERR(0, 237, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 5, 5, 3); __PYX_ERR(0, 237, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 5, 5, 4); __PYX_ERR(0, 237, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_float64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_float64") < 0)) __PYX_ERR(0, 237, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 237, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 238, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 239, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 240, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_float64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 237, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_float64", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 237, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 238, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 239, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_filter_float64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_float64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -3863,8 +4916,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_11_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_filter_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_float64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -3879,25 +4932,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_float64", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":206
+ /* "silx/math/medianfilter/medianfilter.pyx":244
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":207
+ /* "silx/math/medianfilter/medianfilter.pyx":245
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":209
+ /* "silx/math/medianfilter/medianfilter.pyx":247
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -3906,19 +4959,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":210
+ /* "silx/math/medianfilter/medianfilter.pyx":248
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":212
+ /* "silx/math/medianfilter/medianfilter.pyx":250
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[double](<double*> & input_buffer[0, 0],
* <double*> & output_buffer[0, 0],
*/
@@ -3937,23 +4990,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":213
+ /* "silx/math/medianfilter/medianfilter.pyx":251
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[double](<double*> & input_buffer[0, 0], # <<<<<<<<<<<<<<
* <double*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -3961,8 +5014,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":214
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":252
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[double](<double*> & input_buffer[0, 0],
* <double*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -3971,23 +5024,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":215
+ /* "silx/math/medianfilter/medianfilter.pyx":253
* median_filter.median_filter[double](<double*> & input_buffer[0, 0],
* <double*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":213
+ /* "silx/math/medianfilter/medianfilter.pyx":251
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[double](<double*> & input_buffer[0, 0], # <<<<<<<<<<<<<<
* <double*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<double>(((double *)(&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((double *)(&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<double>(((double *)(&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((double *)(&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -4001,10 +5054,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":212
+ /* "silx/math/medianfilter/medianfilter.pyx":250
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[double](<double*> & input_buffer[0, 0],
* <double*> & output_buffer[0, 0],
*/
@@ -4019,7 +5072,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":200
+ /* "silx/math/medianfilter/medianfilter.pyx":237
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float64(double[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4037,7 +5090,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":227
+/* "silx/math/medianfilter/medianfilter.pyx":266
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int64(cnumpy.int64_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4046,27 +5099,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_10_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_12_median_filter_int64[] = "_median_filter_int64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_13_median_filter_int64 = {"_median_filter_int64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_12_median_filter_int64};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_filter_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int64[] = "_median_filter_int64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int64 = {"_median_filter_int64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int64};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_int64 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -4082,53 +5134,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 5, 5, 1); __PYX_ERR(0, 266, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 5, 5, 2); __PYX_ERR(0, 266, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 5, 5, 3); __PYX_ERR(0, 266, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 5, 5, 4); __PYX_ERR(0, 266, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int64") < 0)) __PYX_ERR(0, 266, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 266, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 267, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 268, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 266, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_int64", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 266, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 267, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 268, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_int64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -4139,8 +5198,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_13_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_filter_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -4155,25 +5214,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_int64", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":233
+ /* "silx/math/medianfilter/medianfilter.pyx":273
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":234
+ /* "silx/math/medianfilter/medianfilter.pyx":274
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":236
+ /* "silx/math/medianfilter/medianfilter.pyx":276
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -4182,19 +5241,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":237
+ /* "silx/math/medianfilter/medianfilter.pyx":277
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":239
+ /* "silx/math/medianfilter/medianfilter.pyx":279
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[long](<long*> & input_buffer[0,0],
* <long*> & output_buffer[0, 0],
*/
@@ -4213,23 +5272,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":240
+ /* "silx/math/medianfilter/medianfilter.pyx":280
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[long](<long*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <long*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -4237,8 +5296,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":241
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":281
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[long](<long*> & input_buffer[0,0],
* <long*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -4247,23 +5306,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":242
+ /* "silx/math/medianfilter/medianfilter.pyx":282
* median_filter.median_filter[long](<long*> & input_buffer[0,0],
* <long*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":240
+ /* "silx/math/medianfilter/medianfilter.pyx":280
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[long](<long*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <long*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<long>(((long *)(&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((long *)(&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<long>(((long *)(&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((long *)(&(*((__pyx_t_5numpy_int64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int64_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -4277,10 +5336,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":239
+ /* "silx/math/medianfilter/medianfilter.pyx":279
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[long](<long*> & input_buffer[0,0],
* <long*> & output_buffer[0, 0],
*/
@@ -4295,7 +5354,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":227
+ /* "silx/math/medianfilter/medianfilter.pyx":266
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int64(cnumpy.int64_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4313,7 +5372,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":253
+/* "silx/math/medianfilter/medianfilter.pyx":294
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint64( # <<<<<<<<<<<<<<
@@ -4322,27 +5381,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_12_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_uint64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_14_median_filter_uint64[] = "_median_filter_uint64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_15_median_filter_uint64 = {"_median_filter_uint64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_uint64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_14_median_filter_uint64};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_filter_uint64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint64[] = "_median_filter_uint64(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint64 = {"_median_filter_uint64", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint64, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint64};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint64(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_uint64 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -4358,53 +5416,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 5, 5, 1); __PYX_ERR(0, 294, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 5, 5, 2); __PYX_ERR(0, 294, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 5, 5, 3); __PYX_ERR(0, 294, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 5, 5, 4); __PYX_ERR(0, 294, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint64") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint64") < 0)) __PYX_ERR(0, 294, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 295, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 296, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 297, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint64", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 294, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 295, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 296, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 297, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_uint64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint64(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -4415,8 +5480,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_15_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_filter_uint64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint64(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -4431,25 +5496,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_uint64", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":260
+ /* "silx/math/medianfilter/medianfilter.pyx":302
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":261
+ /* "silx/math/medianfilter/medianfilter.pyx":303
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":263
+ /* "silx/math/medianfilter/medianfilter.pyx":305
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -4458,19 +5523,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":264
+ /* "silx/math/medianfilter/medianfilter.pyx":306
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":266
+ /* "silx/math/medianfilter/medianfilter.pyx":308
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0],
* <uint64*> & output_buffer[0, 0],
*/
@@ -4489,23 +5554,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":267
+ /* "silx/math/medianfilter/medianfilter.pyx":309
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <uint64*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -4513,8 +5578,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":268
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":310
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0],
* <uint64*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -4523,23 +5588,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":269
+ /* "silx/math/medianfilter/medianfilter.pyx":311
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0],
* <uint64*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":267
+ /* "silx/math/medianfilter/medianfilter.pyx":309
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <uint64*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64 *)(&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64 *)(&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64 *)(&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint64 *)(&(*((__pyx_t_5numpy_uint64_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint64_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -4553,10 +5618,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":266
+ /* "silx/math/medianfilter/medianfilter.pyx":308
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0],
* <uint64*> & output_buffer[0, 0],
*/
@@ -4571,7 +5636,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":253
+ /* "silx/math/medianfilter/medianfilter.pyx":294
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint64( # <<<<<<<<<<<<<<
@@ -4589,7 +5654,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":281
+/* "silx/math/medianfilter/medianfilter.pyx":324
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4598,27 +5663,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_14_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int32[] = "_median_filter_int32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int32 = {"_median_filter_int32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int32};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int32[] = "_median_filter_int32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int32 = {"_median_filter_int32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int32};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_int32 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -4634,53 +5698,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 5, 5, 1); __PYX_ERR(0, 324, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 5, 5, 2); __PYX_ERR(0, 324, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 5, 5, 3); __PYX_ERR(0, 324, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 5, 5, 4); __PYX_ERR(0, 324, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int32") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 324, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 325, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 326, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_int32", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 324, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 325, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 326, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -4691,8 +5762,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_17_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_filter_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -4707,25 +5778,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_int32", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":287
+ /* "silx/math/medianfilter/medianfilter.pyx":331
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":288
+ /* "silx/math/medianfilter/medianfilter.pyx":332
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":290
+ /* "silx/math/medianfilter/medianfilter.pyx":334
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -4734,19 +5805,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":291
+ /* "silx/math/medianfilter/medianfilter.pyx":335
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":293
+ /* "silx/math/medianfilter/medianfilter.pyx":337
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[int](<int*> & input_buffer[0,0],
* <int*> & output_buffer[0, 0],
*/
@@ -4765,23 +5836,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":294
+ /* "silx/math/medianfilter/medianfilter.pyx":338
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[int](<int*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <int*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -4789,8 +5860,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":295
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":339
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[int](<int*> & input_buffer[0,0],
* <int*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -4799,23 +5870,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":296
+ /* "silx/math/medianfilter/medianfilter.pyx":340
* median_filter.median_filter[int](<int*> & input_buffer[0,0],
* <int*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":294
+ /* "silx/math/medianfilter/medianfilter.pyx":338
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[int](<int*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <int*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<int>(((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<int>(((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -4829,10 +5900,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":293
+ /* "silx/math/medianfilter/medianfilter.pyx":337
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[int](<int*> & input_buffer[0,0],
* <int*> & output_buffer[0, 0],
*/
@@ -4847,7 +5918,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":281
+ /* "silx/math/medianfilter/medianfilter.pyx":324
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4865,7 +5936,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":308
+/* "silx/math/medianfilter/medianfilter.pyx":353
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -4874,27 +5945,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_16_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint32[] = "_median_filter_uint32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint32 = {"_median_filter_uint32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint32};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint32[] = "_median_filter_uint32(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint32 = {"_median_filter_uint32", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint32, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint32};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint32(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_uint32 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -4910,53 +5980,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 5, 5, 1); __PYX_ERR(0, 353, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 5, 5, 2); __PYX_ERR(0, 353, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 5, 5, 3); __PYX_ERR(0, 353, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 5, 5, 4); __PYX_ERR(0, 353, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint32") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint32") < 0)) __PYX_ERR(0, 353, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 353, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 354, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 355, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint32", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 353, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_uint32", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 353, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 354, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 355, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint32(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -4967,8 +6044,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_19_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_filter_uint32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint32(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -4983,25 +6060,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_uint32", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":314
+ /* "silx/math/medianfilter/medianfilter.pyx":360
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":315
+ /* "silx/math/medianfilter/medianfilter.pyx":361
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":317
+ /* "silx/math/medianfilter/medianfilter.pyx":363
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -5010,19 +6087,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":318
+ /* "silx/math/medianfilter/medianfilter.pyx":364
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":320
+ /* "silx/math/medianfilter/medianfilter.pyx":366
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0],
* <uint32*> & output_buffer[0, 0],
*/
@@ -5041,23 +6118,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":321
+ /* "silx/math/medianfilter/medianfilter.pyx":367
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <uint32*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -5065,8 +6142,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":322
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":368
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0],
* <uint32*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -5075,23 +6152,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":323
+ /* "silx/math/medianfilter/medianfilter.pyx":369
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0],
* <uint32*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":321
+ /* "silx/math/medianfilter/medianfilter.pyx":367
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <uint32*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32 *)(&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32 *)(&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32 *)(&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint32 *)(&(*((__pyx_t_5numpy_uint32_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_uint32_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -5105,10 +6182,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":320
+ /* "silx/math/medianfilter/medianfilter.pyx":366
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0],
* <uint32*> & output_buffer[0, 0],
*/
@@ -5123,7 +6200,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":308
+ /* "silx/math/medianfilter/medianfilter.pyx":353
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -5141,7 +6218,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":335
+/* "silx/math/medianfilter/medianfilter.pyx":382
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int16(cnumpy.int16_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -5150,27 +6227,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_18_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int16[] = "_median_filter_int16(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int16 = {"_median_filter_int16", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int16};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_25_median_filter_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_24_median_filter_int16[] = "_median_filter_int16(__Pyx_memviewslice input_buffer, __Pyx_memviewslice output_buffer, __Pyx_memviewslice kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_25_median_filter_int16 = {"_median_filter_int16", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_25_median_filter_int16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_24_median_filter_int16};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_25_median_filter_int16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
__Pyx_memviewslice __pyx_v_input_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_output_buffer = { 0, 0, { 0 }, { 0 }, { 0 } };
__Pyx_memviewslice __pyx_v_kernel_size = { 0, 0, { 0 }, { 0 }, { 0 } };
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_int16 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -5186,53 +6262,60 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 5, 5, 1); __PYX_ERR(0, 382, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 5, 5, 2); __PYX_ERR(0, 382, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 5, 5, 3); __PYX_ERR(0, 382, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 5, 5, 4); __PYX_ERR(0, 382, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int16") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_int16") < 0)) __PYX_ERR(0, 382, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_input_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(values[0]); if (unlikely(!__pyx_v_input_buffer.memview)) __PYX_ERR(0, 382, __pyx_L3_error)
+ __pyx_v_output_buffer = __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(values[1]); if (unlikely(!__pyx_v_output_buffer.memview)) __PYX_ERR(0, 383, __pyx_L3_error)
+ __pyx_v_kernel_size = __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(values[2]); if (unlikely(!__pyx_v_kernel_size.memview)) __PYX_ERR(0, 384, __pyx_L3_error)
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 385, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 386, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_int16", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 382, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_int16", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
if (unlikely(((PyObject *)__pyx_v_input_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "input_buffer"); __PYX_ERR(0, 382, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_output_buffer.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_buffer"); __PYX_ERR(0, 383, __pyx_L1_error)
}
if (unlikely(((PyObject *)__pyx_v_kernel_size.memview) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "kernel_size"); __PYX_ERR(0, 384, __pyx_L1_error)
}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int16(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_24_median_filter_int16(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -5243,8 +6326,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_21_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_filter_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_24_median_filter_int16(CYTHON_UNUSED PyObject *__pyx_self, __Pyx_memviewslice __pyx_v_input_buffer, __Pyx_memviewslice __pyx_v_output_buffer, __Pyx_memviewslice __pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
PyObject *__pyx_r = NULL;
@@ -5259,25 +6342,25 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_int16", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":341
+ /* "silx/math/medianfilter/medianfilter.pyx":389
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":342
+ /* "silx/math/medianfilter/medianfilter.pyx":390
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer.shape[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":344
+ /* "silx/math/medianfilter/medianfilter.pyx":392
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -5286,19 +6369,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer.shape[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":345
+ /* "silx/math/medianfilter/medianfilter.pyx":393
* int[2] buffer_shape
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer.shape[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":347
+ /* "silx/math/medianfilter/medianfilter.pyx":395
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[short](<short*> & input_buffer[0,0],
* <short*> & output_buffer[0, 0],
*/
@@ -5317,23 +6400,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_5, __pyx_t_6)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":348
+ /* "silx/math/medianfilter/medianfilter.pyx":396
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[short](<short*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <short*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -5341,8 +6424,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":349
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":397
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[short](<short*> & input_buffer[0,0],
* <short*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -5351,23 +6434,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":350
+ /* "silx/math/medianfilter/medianfilter.pyx":398
* median_filter.median_filter[short](<short*> & input_buffer[0,0],
* <short*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":348
+ /* "silx/math/medianfilter/medianfilter.pyx":396
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[short](<short*> & input_buffer[0,0], # <<<<<<<<<<<<<<
* <short*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<short>(((short *)(&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((short *)(&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<short>(((short *)(&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_input_buffer.data + __pyx_t_4 * __pyx_v_input_buffer.strides[0]) )) + __pyx_t_5)) ))))), ((short *)(&(*((__pyx_t_5numpy_int16_t *) ( /* dim=1 */ ((char *) (((__pyx_t_5numpy_int16_t *) ( /* dim=0 */ (__pyx_v_output_buffer.data + __pyx_t_6 * __pyx_v_output_buffer.strides[0]) )) + __pyx_t_7)) ))))), ((int *)(&(*((__pyx_t_5numpy_int32_t *) ( /* dim=0 */ ((char *) (((__pyx_t_5numpy_int32_t *) __pyx_v_kernel_size.data) + __pyx_t_8)) ))))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -5381,10 +6464,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":347
+ /* "silx/math/medianfilter/medianfilter.pyx":395
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[short](<short*> & input_buffer[0,0],
* <short*> & output_buffer[0, 0],
*/
@@ -5399,7 +6482,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":335
+ /* "silx/math/medianfilter/medianfilter.pyx":382
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int16(cnumpy.int16_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
@@ -5417,7 +6500,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
return __pyx_r;
}
-/* "silx/math/medianfilter/medianfilter.pyx":362
+/* "silx/math/medianfilter/medianfilter.pyx":411
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint16( # <<<<<<<<<<<<<<
@@ -5426,27 +6509,26 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_20_median_fi
*/
/* Python wrapper */
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint16[] = "_median_filter_uint16(ndarray input_buffer, ndarray output_buffer, ndarray kernel_size, bool conditional)";
-static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint16 = {"_median_filter_uint16", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint16};
-static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_27_median_filter_uint16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_4silx_4math_12medianfilter_12medianfilter_26_median_filter_uint16[] = "_median_filter_uint16(ndarray input_buffer, ndarray output_buffer, ndarray kernel_size, bool conditional, int mode)";
+static PyMethodDef __pyx_mdef_4silx_4math_12medianfilter_12medianfilter_27_median_filter_uint16 = {"_median_filter_uint16", (PyCFunction)__pyx_pw_4silx_4math_12medianfilter_12medianfilter_27_median_filter_uint16, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4silx_4math_12medianfilter_12medianfilter_26_median_filter_uint16};
+static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_27_median_filter_uint16(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyArrayObject *__pyx_v_input_buffer = 0;
PyArrayObject *__pyx_v_output_buffer = 0;
PyArrayObject *__pyx_v_kernel_size = 0;
bool __pyx_v_conditional;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ int __pyx_v_mode;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("_median_filter_uint16 (wrapper)", 0);
{
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,0};
- PyObject* values[4] = {0,0,0,0};
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_input_buffer,&__pyx_n_s_output_buffer,&__pyx_n_s_kernel_size,&__pyx_n_s_conditional,&__pyx_n_s_mode,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);
@@ -5462,47 +6544,54 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_fi
case 1:
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_output_buffer)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 5, 5, 1); __PYX_ERR(0, 411, __pyx_L3_error)
}
case 2:
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_kernel_size)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 5, 5, 2); __PYX_ERR(0, 411, __pyx_L3_error)
}
case 3:
if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conditional)) != 0)) kw_args--;
else {
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 5, 5, 3); __PYX_ERR(0, 411, __pyx_L3_error)
+ }
+ case 4:
+ if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mode)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 5, 5, 4); __PYX_ERR(0, 411, __pyx_L3_error)
}
}
if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint16") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_median_filter_uint16") < 0)) __PYX_ERR(0, 411, __pyx_L3_error)
}
- } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+ } 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_input_buffer = ((PyArrayObject *)values[0]);
__pyx_v_output_buffer = ((PyArrayObject *)values[1]);
__pyx_v_kernel_size = ((PyArrayObject *)values[2]);
- __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == (bool)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __pyx_v_conditional = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_conditional == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 415, __pyx_L3_error)
+ __pyx_v_mode = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_mode == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 416, __pyx_L3_error)
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+ __Pyx_RaiseArgtupleInvalid("_median_filter_uint16", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 411, __pyx_L3_error)
__pyx_L3_error:;
__Pyx_AddTraceback("silx.math.medianfilter.medianfilter._median_filter_uint16", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_buffer), __pyx_ptype_5numpy_ndarray, 0, "input_buffer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_buffer), __pyx_ptype_5numpy_ndarray, 0, "output_buffer", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel_size), __pyx_ptype_5numpy_ndarray, 0, "kernel_size", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint16(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional);
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_input_buffer), __pyx_ptype_5numpy_ndarray, 0, "input_buffer", 0))) __PYX_ERR(0, 412, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_output_buffer), __pyx_ptype_5numpy_ndarray, 0, "output_buffer", 0))) __PYX_ERR(0, 413, __pyx_L1_error)
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kernel_size), __pyx_ptype_5numpy_ndarray, 0, "kernel_size", 0))) __PYX_ERR(0, 414, __pyx_L1_error)
+ __pyx_r = __pyx_pf_4silx_4math_12medianfilter_12medianfilter_26_median_filter_uint16(__pyx_self, __pyx_v_input_buffer, __pyx_v_output_buffer, __pyx_v_kernel_size, __pyx_v_conditional, __pyx_v_mode);
/* function exit code */
goto __pyx_L0;
@@ -5513,8 +6602,8 @@ static PyObject *__pyx_pw_4silx_4math_12medianfilter_12medianfilter_23_median_fi
return __pyx_r;
}
-static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_filter_uint16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_buffer, PyArrayObject *__pyx_v_output_buffer, PyArrayObject *__pyx_v_kernel_size, bool __pyx_v_conditional) {
- int __pyx_v_x;
+static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_26_median_filter_uint16(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_input_buffer, PyArrayObject *__pyx_v_output_buffer, PyArrayObject *__pyx_v_kernel_size, bool __pyx_v_conditional, int __pyx_v_mode) {
+ int __pyx_v_y;
int __pyx_v_image_dim;
int __pyx_v_buffer_shape[2];
__Pyx_LocalBuf_ND __pyx_pybuffernd_input_buffer;
@@ -5528,14 +6617,11 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
npy_intp __pyx_t_1;
npy_intp __pyx_t_2;
npy_intp __pyx_t_3;
- long __pyx_t_4;
- long __pyx_t_5;
- long __pyx_t_6;
- long __pyx_t_7;
- long __pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
__Pyx_RefNannySetupContext("_median_filter_uint16", 0);
__pyx_pybuffer_input_buffer.pybuffer.buf = NULL;
__pyx_pybuffer_input_buffer.refcount = 0;
@@ -5551,39 +6637,39 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
__pyx_pybuffernd_kernel_size.rcbuffer = &__pyx_pybuffer_kernel_size;
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_input_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_input_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 411, __pyx_L1_error)
}
__pyx_pybuffernd_input_buffer.diminfo[0].strides = __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_input_buffer.diminfo[0].shape = __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_input_buffer.diminfo[1].strides = __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_input_buffer.diminfo[1].shape = __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_output_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_output_buffer.rcbuffer->pybuffer, (PyObject*)__pyx_v_output_buffer, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint16_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 411, __pyx_L1_error)
}
__pyx_pybuffernd_output_buffer.diminfo[0].strides = __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_output_buffer.diminfo[0].shape = __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_output_buffer.diminfo[1].strides = __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_output_buffer.diminfo[1].shape = __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.shape[1];
{
__Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_kernel_size.rcbuffer->pybuffer, (PyObject*)__pyx_v_kernel_size, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_kernel_size.rcbuffer->pybuffer, (PyObject*)__pyx_v_kernel_size, &__Pyx_TypeInfo_nn___pyx_t_5numpy_int32_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 411, __pyx_L1_error)
}
__pyx_pybuffernd_kernel_size.diminfo[0].strides = __pyx_pybuffernd_kernel_size.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_kernel_size.diminfo[0].shape = __pyx_pybuffernd_kernel_size.rcbuffer->pybuffer.shape[0];
- /* "silx/math/medianfilter/medianfilter.pyx":369
+ /* "silx/math/medianfilter/medianfilter.pyx":419
*
* cdef:
- * int x = 0 # <<<<<<<<<<<<<<
+ * int y = 0 # <<<<<<<<<<<<<<
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape,
*/
- __pyx_v_x = 0;
+ __pyx_v_y = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":370
+ /* "silx/math/medianfilter/medianfilter.pyx":420
* cdef:
- * int x = 0
+ * int y = 0
* int image_dim = input_buffer.shape[1] - 1 # <<<<<<<<<<<<<<
* int[2] buffer_shape,
* buffer_shape[0] = input_buffer.shape[0]
*/
__pyx_v_image_dim = ((__pyx_v_input_buffer->dimensions[1]) - 1);
- /* "silx/math/medianfilter/medianfilter.pyx":372
+ /* "silx/math/medianfilter/medianfilter.pyx":422
* int image_dim = input_buffer.shape[1] - 1
* int[2] buffer_shape,
* buffer_shape[0] = input_buffer.shape[0] # <<<<<<<<<<<<<<
@@ -5592,19 +6678,19 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
*/
(__pyx_v_buffer_shape[0]) = (__pyx_v_input_buffer->dimensions[0]);
- /* "silx/math/medianfilter/medianfilter.pyx":373
+ /* "silx/math/medianfilter/medianfilter.pyx":423
* int[2] buffer_shape,
* buffer_shape[0] = input_buffer.shape[0]
* buffer_shape[1] = input_buffer.shape[1] # <<<<<<<<<<<<<<
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
*/
(__pyx_v_buffer_shape[1]) = (__pyx_v_input_buffer->dimensions[1]);
- /* "silx/math/medianfilter/medianfilter.pyx":375
+ /* "silx/math/medianfilter/medianfilter.pyx":425
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0],
* <uint16*> & output_buffer[0, 0],
*/
@@ -5623,23 +6709,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
#define likely(x) (x)
#define unlikely(x) (x)
#endif
- __pyx_t_3 = (__pyx_t_1 - 0) / 1;
+ __pyx_t_3 = (__pyx_t_1 - 0 + 1 - 1/abs(1)) / 1;
if (__pyx_t_3 > 0)
{
#ifdef _OPENMP
- #pragma omp parallel private(__pyx_t_8, __pyx_t_5, __pyx_t_6, __pyx_t_4, __pyx_t_7)
+ #pragma omp parallel private(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8)
#endif /* _OPENMP */
{
#ifdef _OPENMP
- #pragma omp for firstprivate(__pyx_v_x) lastprivate(__pyx_v_x)
+ #pragma omp for firstprivate(__pyx_v_y) lastprivate(__pyx_v_y)
#endif /* _OPENMP */
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2++){
{
- __pyx_v_x = 0 + 1 * __pyx_t_2;
+ __pyx_v_y = (int)(0 + 1 * __pyx_t_2);
- /* "silx/math/medianfilter/medianfilter.pyx":376
+ /* "silx/math/medianfilter/medianfilter.pyx":426
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0], # <<<<<<<<<<<<<<
* <uint16*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
@@ -5647,8 +6733,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
__pyx_t_4 = 0;
__pyx_t_5 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":377
- * for x in prange(input_buffer.shape[0], nogil=True):
+ /* "silx/math/medianfilter/medianfilter.pyx":427
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0],
* <uint16*> & output_buffer[0, 0], # <<<<<<<<<<<<<<
* <int*>&kernel_size[0],
@@ -5657,23 +6743,23 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
__pyx_t_6 = 0;
__pyx_t_7 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":378
+ /* "silx/math/medianfilter/medianfilter.pyx":428
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0],
* <uint16*> & output_buffer[0, 0],
* <int*>&kernel_size[0], # <<<<<<<<<<<<<<
* <int*>buffer_shape,
- * x,
+ * y,
*/
__pyx_t_8 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":376
+ /* "silx/math/medianfilter/medianfilter.pyx":426
*
- * for x in prange(input_buffer.shape[0], nogil=True):
+ * for y in prange(input_buffer.shape[0], nogil=True):
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0], # <<<<<<<<<<<<<<
* <uint16*> & output_buffer[0, 0],
* <int*>&kernel_size[0],
*/
- median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16 *)(&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_uint16_t *, __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_input_buffer.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_input_buffer.diminfo[1].strides)))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16 *)(&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_uint16_t *, __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_output_buffer.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_output_buffer.diminfo[1].strides)))), ((int *)(&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_kernel_size.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_kernel_size.diminfo[0].strides)))), ((int *)__pyx_v_buffer_shape), __pyx_v_x, 0, __pyx_v_image_dim, __pyx_v_conditional);
+ median_filter<__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16>(((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16 *)(&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_uint16_t *, __pyx_pybuffernd_input_buffer.rcbuffer->pybuffer.buf, __pyx_t_4, __pyx_pybuffernd_input_buffer.diminfo[0].strides, __pyx_t_5, __pyx_pybuffernd_input_buffer.diminfo[1].strides)))), ((__pyx_t_4silx_4math_12medianfilter_12medianfilter_uint16 *)(&(*__Pyx_BufPtrCContig2d(__pyx_t_5numpy_uint16_t *, __pyx_pybuffernd_output_buffer.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_output_buffer.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_output_buffer.diminfo[1].strides)))), ((int *)(&(*__Pyx_BufPtrCContig1d(__pyx_t_5numpy_int32_t *, __pyx_pybuffernd_kernel_size.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_kernel_size.diminfo[0].strides)))), ((int *)__pyx_v_buffer_shape), __pyx_v_y, 0, __pyx_v_image_dim, __pyx_v_conditional, __pyx_v_mode);
}
}
}
@@ -5687,10 +6773,10 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
#endif
}
- /* "silx/math/medianfilter/medianfilter.pyx":375
+ /* "silx/math/medianfilter/medianfilter.pyx":425
* buffer_shape[1] = input_buffer.shape[1]
*
- * for x in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
+ * for y in prange(input_buffer.shape[0], nogil=True): # <<<<<<<<<<<<<<
* median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0],
* <uint16*> & output_buffer[0, 0],
*/
@@ -5705,7 +6791,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
}
}
- /* "silx/math/medianfilter/medianfilter.pyx":362
+ /* "silx/math/medianfilter/medianfilter.pyx":411
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint16( # <<<<<<<<<<<<<<
@@ -5718,6 +6804,8 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
goto __pyx_L0;
__pyx_L1_error:;
{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_input_buffer.rcbuffer->pybuffer);
__Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_kernel_size.rcbuffer->pybuffer);
@@ -5736,7 +6824,7 @@ static PyObject *__pyx_pf_4silx_4math_12medianfilter_12medianfilter_22_median_fi
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -5777,16 +6865,13 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
* # of flags
*
* if info == NULL: return # <<<<<<<<<<<<<<
@@ -5799,7 +6884,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L0;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":203
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
*
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1 # <<<<<<<<<<<<<<
@@ -5808,7 +6893,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_endian_detector = 1;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":204
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":207
* cdef int copy_shape, i, ndim
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
@@ -5817,7 +6902,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":206
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":209
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
*
* ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -5826,7 +6911,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":208
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
* ndim = PyArray_NDIM(self)
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -5836,7 +6921,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":212
*
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* copy_shape = 1 # <<<<<<<<<<<<<<
@@ -5844,22 +6929,30 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* copy_shape = 0
*/
__pyx_v_copy_shape = 1;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ * ndim = PyArray_NDIM(self)
+ *
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * copy_shape = 1
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":211
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
* copy_shape = 1
* else:
* copy_shape = 0 # <<<<<<<<<<<<<<
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
*/
+ /*else*/ {
__pyx_v_copy_shape = 0;
}
__pyx_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":213
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
* copy_shape = 0
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -5873,7 +6966,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L6_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":214
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
*
* if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -5883,23 +6976,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L6_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 218, __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;}
+ __PYX_ERR(1, 218, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":216
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":217
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
* raise ValueError(u"ndarray is not C contiguous")
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
@@ -5913,7 +7022,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
goto __pyx_L9_bool_binop_done;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
*
* if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
* and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
@@ -5923,23 +7032,39 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L9_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 222, __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;}
+ __PYX_ERR(1, 222, __pyx_L1_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":220
+ * 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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":221
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":224
* raise ValueError(u"ndarray is not Fortran contiguous")
*
* info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
@@ -5948,7 +7073,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":225
*
* info.buf = PyArray_DATA(self)
* info.ndim = ndim # <<<<<<<<<<<<<<
@@ -5957,7 +7082,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->ndim = __pyx_v_ndim;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":223
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
* info.buf = PyArray_DATA(self)
* info.ndim = ndim
* if copy_shape: # <<<<<<<<<<<<<<
@@ -5967,7 +7092,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = (__pyx_v_copy_shape != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":229
* # 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) # <<<<<<<<<<<<<<
@@ -5976,7 +7101,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":227
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
* # 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 # <<<<<<<<<<<<<<
@@ -5985,7 +7110,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":228
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":231
* 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): # <<<<<<<<<<<<<<
@@ -5996,7 +7121,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
* info.shape = info.strides + ndim
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
@@ -6005,7 +7130,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":230
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
* for i in range(ndim):
* info.strides[i] = PyArray_STRIDES(self)[i]
* info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
@@ -6014,20 +7139,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
}
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":226
+ * 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.
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":232
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
* 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
*/
+ /*else*/ {
__pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":233
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
* else:
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -6038,7 +7171,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L11:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":234
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":237
* info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -6047,7 +7180,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->suboffsets = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":235
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":238
* info.shape = <Py_ssize_t*>PyArray_DIMS(self)
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
@@ -6056,7 +7189,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":236
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
* info.suboffsets = NULL
* info.itemsize = PyArray_ITEMSIZE(self)
* info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
@@ -6065,28 +7198,28 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":239
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":242
*
* cdef int t
* cdef char* f = NULL # <<<<<<<<<<<<<<
* cdef dtype descr = self.descr
- * cdef list stack
+ * cdef int offset
*/
__pyx_v_f = NULL;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":240
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":243
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
* cdef int offset
*
* cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
@@ -6095,7 +7228,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":246
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
* cdef bint hasfields = PyDataType_HASFIELDS(descr)
*
* if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
@@ -6113,7 +7246,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_L15_bool_binop_done:;
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":250
* if not hasfields and not copy_shape:
* # do not call releasebuffer
* info.obj = None # <<<<<<<<<<<<<<
@@ -6125,17 +7258,25 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__Pyx_GOTREF(__pyx_v_info->obj);
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = Py_None;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":248
+ * cdef bint hasfields = PyDataType_HASFIELDS(descr)
+ *
+ * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
+ * # do not call releasebuffer
+ * info.obj = None
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":251
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
* else:
* # need to call releasebuffer
* info.obj = self # <<<<<<<<<<<<<<
*
* if not hasfields:
*/
+ /*else*/ {
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
__Pyx_GOTREF(__pyx_v_info->obj);
@@ -6144,7 +7285,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L14:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":253
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
* info.obj = self
*
* if not hasfields: # <<<<<<<<<<<<<<
@@ -6154,7 +7295,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":254
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
*
* if not hasfields:
* t = descr.type_num # <<<<<<<<<<<<<<
@@ -6164,7 +7305,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
* if not hasfields:
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
@@ -6184,7 +7325,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
}
__pyx_L20_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":256
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
* t = descr.type_num
* if ((descr.byteorder == c'>' and little_endian) or
* (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
@@ -6200,43 +7341,51 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
__pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_1 = __pyx_t_2;
__pyx_L19_bool_binop_done:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
+ */
if (__pyx_t_1) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 259, __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;}
- }
+ __PYX_ERR(1, 259, __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)
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ * 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")
*/
- switch (__pyx_v_t) {
+ }
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":258
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
* (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"
*/
+ switch (__pyx_v_t) {
case NPY_BYTE:
- __pyx_v_f = __pyx_k_b;
+ __pyx_v_f = ((char *)"b");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
* raise ValueError(u"Non-native byte order not supported")
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
@@ -6244,10 +7393,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_USHORT: f = "H"
*/
case NPY_UBYTE:
- __pyx_v_f = __pyx_k_B;
+ __pyx_v_f = ((char *)"B");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":260
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
* if t == NPY_BYTE: f = "b"
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
@@ -6255,10 +7404,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_INT: f = "i"
*/
case NPY_SHORT:
- __pyx_v_f = __pyx_k_h;
+ __pyx_v_f = ((char *)"h");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":261
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
* elif t == NPY_UBYTE: f = "B"
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
@@ -6266,10 +7415,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_UINT: f = "I"
*/
case NPY_USHORT:
- __pyx_v_f = __pyx_k_H;
+ __pyx_v_f = ((char *)"H");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":262
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
* elif t == NPY_SHORT: f = "h"
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
@@ -6277,10 +7426,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONG: f = "l"
*/
case NPY_INT:
- __pyx_v_f = __pyx_k_i;
+ __pyx_v_f = ((char *)"i");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":263
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
* elif t == NPY_USHORT: f = "H"
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
@@ -6288,10 +7437,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONG: f = "L"
*/
case NPY_UINT:
- __pyx_v_f = __pyx_k_I;
+ __pyx_v_f = ((char *)"I");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":264
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
* elif t == NPY_INT: f = "i"
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
@@ -6299,10 +7448,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGLONG: f = "q"
*/
case NPY_LONG:
- __pyx_v_f = __pyx_k_l;
+ __pyx_v_f = ((char *)"l");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":265
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
* elif t == NPY_UINT: f = "I"
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
@@ -6310,10 +7459,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_ULONGLONG: f = "Q"
*/
case NPY_ULONG:
- __pyx_v_f = __pyx_k_L;
+ __pyx_v_f = ((char *)"L");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":266
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
* elif t == NPY_LONG: f = "l"
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
@@ -6321,10 +7470,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_FLOAT: f = "f"
*/
case NPY_LONGLONG:
- __pyx_v_f = __pyx_k_q;
+ __pyx_v_f = ((char *)"q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":267
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
* elif t == NPY_ULONG: f = "L"
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
@@ -6332,10 +7481,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_DOUBLE: f = "d"
*/
case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k_Q;
+ __pyx_v_f = ((char *)"Q");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":268
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
* elif t == NPY_LONGLONG: f = "q"
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
@@ -6343,10 +7492,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_LONGDOUBLE: f = "g"
*/
case NPY_FLOAT:
- __pyx_v_f = __pyx_k_f;
+ __pyx_v_f = ((char *)"f");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":269
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
* elif t == NPY_ULONGLONG: f = "Q"
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
@@ -6354,10 +7503,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CFLOAT: f = "Zf"
*/
case NPY_DOUBLE:
- __pyx_v_f = __pyx_k_d;
+ __pyx_v_f = ((char *)"d");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":270
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
* elif t == NPY_FLOAT: f = "f"
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
@@ -6365,10 +7514,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CDOUBLE: f = "Zd"
*/
case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k_g;
+ __pyx_v_f = ((char *)"g");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":271
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
* elif t == NPY_DOUBLE: f = "d"
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
@@ -6376,10 +7525,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_CLONGDOUBLE: f = "Zg"
*/
case NPY_CFLOAT:
- __pyx_v_f = __pyx_k_Zf;
+ __pyx_v_f = ((char *)"Zf");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":272
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
* elif t == NPY_LONGDOUBLE: f = "g"
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
@@ -6387,10 +7536,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* elif t == NPY_OBJECT: f = "O"
*/
case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k_Zd;
+ __pyx_v_f = ((char *)"Zd");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":273
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":275
* elif t == NPY_CFLOAT: f = "Zf"
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
@@ -6398,10 +7547,10 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* else:
*/
case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k_Zg;
+ __pyx_v_f = ((char *)"Zg");
break;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":274
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
* elif t == NPY_CDOUBLE: f = "Zd"
* elif t == NPY_CLONGDOUBLE: f = "Zg"
* elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
@@ -6409,37 +7558,37 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
*/
case NPY_OBJECT:
- __pyx_v_f = __pyx_k_O;
+ __pyx_v_f = ((char *)"O");
break;
default:
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":276
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __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_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 278, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __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_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __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;}
+ __PYX_ERR(1, 278, __pyx_L1_error)
break;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":277
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":279
* else:
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f # <<<<<<<<<<<<<<
@@ -6448,7 +7597,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_info->format = __pyx_v_f;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":278
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
* raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
* info.format = f
* return # <<<<<<<<<<<<<<
@@ -6457,19 +7606,27 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":255
+ * info.obj = self
+ *
+ * if not hasfields: # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":280
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
* 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));
+ /*else*/ {
+ __pyx_v_info->format = ((char *)malloc(0xFF));
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":281
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
* else:
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
@@ -6478,7 +7635,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
(__pyx_v_info->format[0]) = '^';
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":282
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":284
* info.format = <char*>stdlib.malloc(_buffer_format_string_len)
* info.format[0] = c'^' # Native data types, manual alignment
* offset = 0 # <<<<<<<<<<<<<<
@@ -6487,17 +7644,17 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
*/
__pyx_v_offset = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":283
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":285
* 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_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(1, 285, __pyx_L1_error)
__pyx_v_f = __pyx_t_7;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":286
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
* info.format + _buffer_format_string_len,
* &offset)
* f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
@@ -6507,7 +7664,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
(__pyx_v_f[0]) = '\x00';
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":194
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":197
* # experimental exception made for __getbuffer__ and __releasebuffer__
* # -- the details of this may change.
* def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
@@ -6539,7 +7696,7 @@ static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, P
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -6563,7 +7720,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
int __pyx_t_1;
__Pyx_RefNannySetupContext("__releasebuffer__", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":289
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
*
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
@@ -6573,7 +7730,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":292
* def __releasebuffer__(ndarray self, Py_buffer* info):
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format) # <<<<<<<<<<<<<<
@@ -6581,11 +7738,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
* stdlib.free(info.strides)
*/
free(__pyx_v_info->format);
- goto __pyx_L3;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * stdlib.free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
}
- __pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":291
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
* if PyArray_HASFIELDS(self):
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
@@ -6595,7 +7758,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":294
* stdlib.free(info.format)
* if sizeof(npy_intp) != sizeof(Py_ssize_t):
* stdlib.free(info.strides) # <<<<<<<<<<<<<<
@@ -6603,11 +7766,17 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
*
*/
free(__pyx_v_info->strides);
- goto __pyx_L4;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":293
+ * 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_L4:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":288
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":290
* f[0] = c'\0' # Terminate format string
*
* def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
@@ -6619,7 +7788,7 @@ static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_s
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":768
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -6631,12 +7800,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
*
* cdef inline object PyArray_MultiIterNew1(a):
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -6644,13 +7810,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 771, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":770
* ctypedef npy_cdouble complex_t
*
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -6669,7 +7835,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":771
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -6681,12 +7847,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
*
* cdef inline object PyArray_MultiIterNew2(a, b):
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -6694,13 +7857,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 774, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":773
* return PyArray_MultiIterNew(1, <void*>a)
*
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -6719,7 +7882,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":774
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -6731,12 +7894,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
*
* cdef inline object PyArray_MultiIterNew3(a, b, c):
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -6744,13 +7904,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
* 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_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 777, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":776
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
*
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -6769,7 +7929,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":777
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -6781,12 +7941,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -6794,13 +7951,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
* 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_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_ERR(1, 780, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":779
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
*
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -6819,7 +7976,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":780
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -6831,12 +7988,9 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -6844,13 +7998,13 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
* 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_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_ERR(1, 783, __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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":782
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
*
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -6869,7 +8023,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -6896,22 +8050,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":790
+ *
+ * cdef dtype child
* 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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":791
+ * cdef dtype child
* cdef int endian_detector = 1
* cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
* cdef tuple fields
@@ -6919,7 +8070,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -6928,33 +8079,38 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
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_ERR(1, 794, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(1, 794, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 794, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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
+ /* "../../../../../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;};
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 795, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 795, __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;}
+ 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_ERR(1, 795, __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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -6963,7 +8119,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
if (likely(__pyx_v_fields != Py_None)) {
PyObject* sequence = __pyx_v_fields;
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -6971,60 +8127,68 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
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;}
+ __PYX_ERR(1, 796, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 796, __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_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 796, __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;}
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 796, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 796, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 798, __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_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 798, __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_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 798, __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
+ /* "../../../../../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__11, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 799, __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;}
+ __PYX_ERR(1, 799, __pyx_L1_error)
+
+ /* "../../../../../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")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":801
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7044,7 +8208,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__pyx_L8_next_or:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":802
+ /* "../../../../../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)): # <<<<<<<<<<<<<<
@@ -7060,23 +8224,39 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
__pyx_t_6 = __pyx_t_7;
__pyx_L7_bool_binop_done:;
+
+ /* "../../../../../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")
+ */
if (__pyx_t_6) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__12, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(1, 803, __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")
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":813
*
* # Output padding bytes
* while offset[0] < new_offset: # <<<<<<<<<<<<<<
@@ -7084,24 +8264,24 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* 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_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 813, __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_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 813, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 813, __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
+ /* "../../../../../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;
+ (__pyx_v_f[0]) = 0x78;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":815
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7110,7 +8290,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
*/
__pyx_v_f = (__pyx_v_f + 1);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":816
* f[0] = 120 # "x"; pad byte
* f += 1
* offset[0] += 1 # <<<<<<<<<<<<<<
@@ -7121,7 +8301,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
(__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":818
* offset[0] += 1
*
* offset[0] += child.itemsize # <<<<<<<<<<<<<<
@@ -7131,7 +8311,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":820
* offset[0] += child.itemsize
*
* if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
@@ -7141,19 +8321,19 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 821, __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
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -7163,357 +8343,365 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__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
+ /* "../../../../../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__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 823, __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;}
+ __PYX_ERR(1, 823, __pyx_L1_error)
+
+ /* "../../../../../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.")
+ *
+ */
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":826
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 826, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 826, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 826, __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
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 827, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 827, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 828, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 828, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 828, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 104;
+ (__pyx_v_f[0]) = 0x68;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":829
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 829, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 829, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 829, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 830, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 830, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 830, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 105;
+ (__pyx_v_f[0]) = 0x69;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":831
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 831, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 831, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 831, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 832, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 832, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 108;
+ (__pyx_v_f[0]) = 0x6C;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":833
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 833, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 833, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 833, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 834, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 834, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 113;
+ (__pyx_v_f[0]) = 0x71;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":835
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 835, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 835, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 835, __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
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 836, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 836, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 836, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 102;
+ (__pyx_v_f[0]) = 0x66;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":837
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 837, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 100;
+ (__pyx_v_f[0]) = 0x64;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":838
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 838, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
if (__pyx_t_6) {
- (__pyx_v_f[0]) = 103;
+ (__pyx_v_f[0]) = 0x67;
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":839
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 839, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __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[1]) = 0x66;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":840
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 840, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __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[1]) = 0x64;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":841
+ /* "../../../../../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_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 841, __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_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __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[1]) = 0x67;
__pyx_v_f = (__pyx_v_f + 1);
goto __pyx_L15;
}
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":842
+ /* "../../../../../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_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 842, __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_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __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_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __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
+ /* "../../../../../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;}
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 844, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __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_ERR(1, 844, __pyx_L1_error)
}
__pyx_L15:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":845
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7521,23 +8709,31 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
* # Cython ignores struct boundary information ("T{...}"),
*/
__pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../../../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:
+ */
goto __pyx_L13;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":849
+ /* "../../../../../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;}
+ /*else*/ {
+ __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_ERR(1, 849, __pyx_L1_error)
__pyx_v_f = __pyx_t_9;
}
__pyx_L13:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":794
* cdef tuple fields
*
* for childname in descr.names: # <<<<<<<<<<<<<<
@@ -7547,7 +8743,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":850
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7557,7 +8753,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
__pyx_r = __pyx_v_f;
goto __pyx_L0;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":783
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":785
* 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: # <<<<<<<<<<<<<<
@@ -7582,7 +8778,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx
return __pyx_r;
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -7597,7 +8793,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
int __pyx_t_2;
__Pyx_RefNannySetupContext("set_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":968
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -7608,7 +8804,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":969
* cdef PyObject* baseptr
* if base is None:
* baseptr = NULL # <<<<<<<<<<<<<<
@@ -7616,20 +8812,28 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
* Py_INCREF(base) # important to do this before decref below!
*/
__pyx_v_baseptr = NULL;
+
+ /* "../../../../../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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":971
+ /* "../../../../../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)
*/
+ /*else*/ {
Py_INCREF(__pyx_v_base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":972
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7640,7 +8844,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
}
__pyx_L3:;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":973
+ /* "../../../../../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) # <<<<<<<<<<<<<<
@@ -7649,7 +8853,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
Py_XDECREF(__pyx_v_arr->base);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":974
* baseptr = <PyObject*>base
* Py_XDECREF(arr.base)
* arr.base = baseptr # <<<<<<<<<<<<<<
@@ -7658,7 +8862,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
*/
__pyx_v_arr->base = __pyx_v_baseptr;
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":966
*
*
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -7670,7 +8874,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
__Pyx_RefNannyFinishContext();
}
-/* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -7684,7 +8888,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
int __pyx_t_1;
__Pyx_RefNannySetupContext("get_array_base", 0);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":977
+ /* "../../../../../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: # <<<<<<<<<<<<<<
@@ -7694,7 +8898,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__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
+ /* "../../../../../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 # <<<<<<<<<<<<<<
@@ -7705,21 +8909,31 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "../../../../../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:
+ */
}
- /*else*/ {
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":980
* return None
* else:
* return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
*/
+ /*else*/ {
__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
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":976
* arr.base = baseptr
*
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -7734,7 +8948,397 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
return __pyx_r;
}
-/* "View.MemoryView":116
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":987
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 987, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":988
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 988, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 989, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 989, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":986
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":985
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":993
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 993, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":994
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 994, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 995, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 995, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":992
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":991
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":999
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(1, 999, __pyx_L3_error)
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L10_try_end;
+ __pyx_L3_error:;
+ __Pyx_PyThreadState_assign
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1001, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":998
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_PyThreadState_assign
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L10_try_end:;
+ }
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":997
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -7750,9 +9354,6 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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);
@@ -7780,12 +9381,12 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 120, __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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 120, __pyx_L3_error)
}
case 3:
if (kw_args > 0) {
@@ -7799,7 +9400,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 120, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -7813,14 +9414,14 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
}
__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_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 120, __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;}
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
} else {
- /* "View.MemoryView":117
+ /* "View.MemoryView":121
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
* mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
@@ -7832,19 +9433,19 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
}
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_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 120, __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(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 120, __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;}
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 120, __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);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -7861,7 +9462,7 @@ static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, P
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) {
+static int __pyx_array___pyx_pf_15View_dot_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;
@@ -7873,19 +9474,16 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
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;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
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
+ /* "View.MemoryView":127
* cdef PyObject **p
*
* self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
@@ -7894,12 +9492,12 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
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_ERR(2, 127, __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_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(2, 127, __pyx_L1_error)
__pyx_v_self->ndim = ((int)__pyx_t_1);
- /* "View.MemoryView":124
+ /* "View.MemoryView":128
*
* self.ndim = <int> len(shape)
* self.itemsize = itemsize # <<<<<<<<<<<<<<
@@ -7908,7 +9506,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->itemsize = __pyx_v_itemsize;
- /* "View.MemoryView":126
+ /* "View.MemoryView":130
* self.itemsize = itemsize
*
* if not self.ndim: # <<<<<<<<<<<<<<
@@ -7918,21 +9516,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":127
+ /* "View.MemoryView":131
*
* 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__14, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 131, __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;}
+ __PYX_ERR(2, 131, __pyx_L1_error)
+
+ /* "View.MemoryView":130
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
}
- /* "View.MemoryView":129
+ /* "View.MemoryView":133
* raise ValueError("Empty shape tuple for cython.array")
*
* if itemsize <= 0: # <<<<<<<<<<<<<<
@@ -7942,95 +9548,108 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 134, __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;}
+ __PYX_ERR(2, 134, __pyx_L1_error)
+
+ /* "View.MemoryView":133
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
}
- /* "View.MemoryView":132
+ /* "View.MemoryView":136
* raise ValueError("itemsize <= 0 for cython.array")
*
- * if isinstance(format, unicode): # <<<<<<<<<<<<<<
- * format = (<unicode>format).encode('ASCII')
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = 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);
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":133
+ /* "View.MemoryView":137
*
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII') # <<<<<<<<<<<<<<
+ * if not isinstance(format, bytes):
+ * format = 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_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 137, __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_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":136
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":134
- * if isinstance(format, unicode):
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":138
+ * if not isinstance(format, bytes):
+ * format = 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);
+ 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_ERR(2, 138, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_v_self->_format);
__Pyx_DECREF(__pyx_v_self->_format);
- __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
- /* "View.MemoryView":135
- * format = (<unicode>format).encode('ASCII')
+ /* "View.MemoryView":139
+ * format = 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;
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 139, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
- /* "View.MemoryView":138
+ /* "View.MemoryView":142
*
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._shape = <Py_ssize_t *> PyObject_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)));
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
- /* "View.MemoryView":139
+ /* "View.MemoryView":143
*
- * self._shape = <Py_ssize_t *> PyMem_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._shape = <Py_ssize_t *> PyObject_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
+ /* "View.MemoryView":145
* self._strides = self._shape + self.ndim
*
* if not self._shape: # <<<<<<<<<<<<<<
@@ -8040,43 +9659,52 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":142
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 146, __pyx_L1_error)
+
+ /* "View.MemoryView":145
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
}
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* 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;
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __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;}
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 149, __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;}
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
#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_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__pyx_v_dim = __pyx_t_8;
- __pyx_v_idx = __pyx_t_6;
- __pyx_t_6 = (__pyx_t_6 + 1);
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
- /* "View.MemoryView":146
+ /* "View.MemoryView":150
*
* for idx, dim in enumerate(shape):
* if dim <= 0: # <<<<<<<<<<<<<<
@@ -8086,42 +9714,50 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":147
+ /* "View.MemoryView":151
* 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_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __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_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_7 = 0;
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 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_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 151, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9);
__Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __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_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 151, __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;}
+ __PYX_ERR(2, 151, __pyx_L1_error)
+
+ /* "View.MemoryView":150
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
}
- /* "View.MemoryView":148
+ /* "View.MemoryView":152
* if dim <= 0:
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
* self._shape[idx] = dim # <<<<<<<<<<<<<<
@@ -8130,7 +9766,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
- /* "View.MemoryView":145
+ /* "View.MemoryView":149
*
*
* for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
@@ -8138,19 +9774,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
*/
}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- /* "View.MemoryView":151
+ /* "View.MemoryView":155
*
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 155, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":152
+ /* "View.MemoryView":156
* cdef char order
* if mode == 'fortran':
* order = b'F' # <<<<<<<<<<<<<<
@@ -8159,7 +9795,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'F';
- /* "View.MemoryView":153
+ /* "View.MemoryView":157
* if mode == 'fortran':
* order = b'F'
* self.mode = u'fortran' # <<<<<<<<<<<<<<
@@ -8171,20 +9807,28 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":155
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
goto __pyx_L10;
}
- /* "View.MemoryView":154
+ /* "View.MemoryView":158
* 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;}
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 158, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":155
+ /* "View.MemoryView":159
* self.mode = u'fortran'
* elif mode == 'c':
* order = b'C' # <<<<<<<<<<<<<<
@@ -8193,7 +9837,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_order = 'C';
- /* "View.MemoryView":156
+ /* "View.MemoryView":160
* elif mode == 'c':
* order = b'C'
* self.mode = u'c' # <<<<<<<<<<<<<<
@@ -8205,34 +9849,42 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__Pyx_GOTREF(__pyx_v_self->mode);
__Pyx_DECREF(__pyx_v_self->mode);
__pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":158
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":158
+ /* "View.MemoryView":162
* 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;}
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 162, __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_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__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_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 162, __pyx_L1_error)
}
__pyx_L10:;
- /* "View.MemoryView":160
+ /* "View.MemoryView":164
* raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
*
* self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
@@ -8241,7 +9893,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__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
+ /* "View.MemoryView":167
* itemsize, self.ndim, order)
*
* self.free_data = allocate_buffer # <<<<<<<<<<<<<<
@@ -8250,19 +9902,19 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->free_data = __pyx_v_allocate_buffer;
- /* "View.MemoryView":164
+ /* "View.MemoryView":168
*
* 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_t_5 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 168, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 168, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_self->dtype_is_object = __pyx_t_4;
- /* "View.MemoryView":165
+ /* "View.MemoryView":169
* self.free_data = allocate_buffer
* self.dtype_is_object = format == b'O'
* if allocate_buffer: # <<<<<<<<<<<<<<
@@ -8272,7 +9924,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_allocate_buffer != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":168
+ /* "View.MemoryView":172
*
*
* self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
@@ -8281,7 +9933,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
- /* "View.MemoryView":169
+ /* "View.MemoryView":173
*
* self.data = <char *>malloc(self.len)
* if not self.data: # <<<<<<<<<<<<<<
@@ -8291,21 +9943,29 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* 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__17, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 174, __pyx_L1_error)
+
+ /* "View.MemoryView":173
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
}
- /* "View.MemoryView":172
+ /* "View.MemoryView":176
* raise MemoryError("unable to allocate array data.")
*
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -8315,7 +9975,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
__pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_4) {
- /* "View.MemoryView":173
+ /* "View.MemoryView":177
*
* if self.dtype_is_object:
* p = <PyObject **> self.data # <<<<<<<<<<<<<<
@@ -8324,7 +9984,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
__pyx_v_p = ((PyObject **)__pyx_v_self->data);
- /* "View.MemoryView":174
+ /* "View.MemoryView":178
* if self.dtype_is_object:
* p = <PyObject **> self.data
* for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
@@ -8332,30 +9992,18 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
* 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;}
+ __PYX_ERR(2, 178, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
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_ERR(2, 178, __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
+ /* "View.MemoryView":179
* p = <PyObject **> self.data
* for i in range(self.len / itemsize):
* p[i] = Py_None # <<<<<<<<<<<<<<
@@ -8364,7 +10012,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
(__pyx_v_p[__pyx_v_i]) = Py_None;
- /* "View.MemoryView":176
+ /* "View.MemoryView":180
* for i in range(self.len / itemsize):
* p[i] = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -8373,14 +10021,26 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
*/
Py_INCREF(Py_None);
}
- goto __pyx_L13;
+
+ /* "View.MemoryView":176
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
}
- __pyx_L13:;
- goto __pyx_L11;
+
+ /* "View.MemoryView":169
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":116
+ /* "View.MemoryView":120
* cdef bint dtype_is_object
*
* def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
@@ -8393,7 +10053,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -8404,7 +10064,7 @@ static int __pyx_array_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":179
+/* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8418,14 +10078,14 @@ static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
@@ -8436,16 +10096,13 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
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
+ /* "View.MemoryView":184
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* cdef int bufmode = -1 # <<<<<<<<<<<<<<
@@ -8454,18 +10111,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_bufmode = -1;
- /* "View.MemoryView":181
+ /* "View.MemoryView":185
* 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_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 185, __pyx_L1_error)
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":182
+ /* "View.MemoryView":186
* cdef int bufmode = -1
* if self.mode == u"c":
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -8473,21 +10130,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
*/
__pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":185
+ * 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":
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":183
+ /* "View.MemoryView":187
* 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_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 187, __pyx_L1_error)
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":184
+ /* "View.MemoryView":188
* bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -8495,11 +10160,18 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
* raise ValueError("Can only create a buffer that is contiguous in memory.")
*/
__pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
+
+ /* "View.MemoryView":187
+ * 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_L3:;
- /* "View.MemoryView":185
+ /* "View.MemoryView":189
* elif self.mode == u"fortran":
* bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
* if not (flags & bufmode): # <<<<<<<<<<<<<<
@@ -8509,21 +10181,29 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__18, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 190, __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;}
+ __PYX_ERR(2, 190, __pyx_L1_error)
+
+ /* "View.MemoryView":189
+ * 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
+ */
}
- /* "View.MemoryView":187
+ /* "View.MemoryView":191
* if not (flags & bufmode):
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data # <<<<<<<<<<<<<<
@@ -8533,7 +10213,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_4 = __pyx_v_self->data;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":188
+ /* "View.MemoryView":192
* raise ValueError("Can only create a buffer that is contiguous in memory.")
* info.buf = self.data
* info.len = self.len # <<<<<<<<<<<<<<
@@ -8543,7 +10223,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->len;
__pyx_v_info->len = __pyx_t_5;
- /* "View.MemoryView":189
+ /* "View.MemoryView":193
* info.buf = self.data
* info.len = self.len
* info.ndim = self.ndim # <<<<<<<<<<<<<<
@@ -8553,7 +10233,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_6 = __pyx_v_self->ndim;
__pyx_v_info->ndim = __pyx_t_6;
- /* "View.MemoryView":190
+ /* "View.MemoryView":194
* info.len = self.len
* info.ndim = self.ndim
* info.shape = self._shape # <<<<<<<<<<<<<<
@@ -8563,7 +10243,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_shape;
__pyx_v_info->shape = __pyx_t_7;
- /* "View.MemoryView":191
+ /* "View.MemoryView":195
* info.ndim = self.ndim
* info.shape = self._shape
* info.strides = self._strides # <<<<<<<<<<<<<<
@@ -8573,7 +10253,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_7 = __pyx_v_self->_strides;
__pyx_v_info->strides = __pyx_t_7;
- /* "View.MemoryView":192
+ /* "View.MemoryView":196
* info.shape = self._shape
* info.strides = self._strides
* info.suboffsets = NULL # <<<<<<<<<<<<<<
@@ -8582,7 +10262,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->suboffsets = NULL;
- /* "View.MemoryView":193
+ /* "View.MemoryView":197
* info.strides = self._strides
* info.suboffsets = NULL
* info.itemsize = self.itemsize # <<<<<<<<<<<<<<
@@ -8592,7 +10272,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_5 = __pyx_v_self->itemsize;
__pyx_v_info->itemsize = __pyx_t_5;
- /* "View.MemoryView":194
+ /* "View.MemoryView":198
* info.suboffsets = NULL
* info.itemsize = self.itemsize
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -8601,7 +10281,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":196
+ /* "View.MemoryView":200
* info.readonly = 0
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -8611,7 +10291,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":197
+ /* "View.MemoryView":201
*
* if flags & PyBUF_FORMAT:
* info.format = self.format # <<<<<<<<<<<<<<
@@ -8620,22 +10300,30 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
*/
__pyx_t_4 = __pyx_v_self->format;
__pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":200
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":199
+ /* "View.MemoryView":203
* info.format = self.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.obj = self
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":201
+ /* "View.MemoryView":205
* info.format = NULL
*
* info.obj = self # <<<<<<<<<<<<<<
@@ -8648,7 +10336,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":179
+ /* "View.MemoryView":183
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -8678,7 +10366,7 @@ static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_a
return __pyx_r;
}
-/* "View.MemoryView":205
+/* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -8691,18 +10379,18 @@ 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));
+ __pyx_array___pyx_pf_15View_dot_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) {
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
int __pyx_t_1;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":206
+ /* "View.MemoryView":210
*
* def __dealloc__(array self):
* if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
@@ -8712,7 +10400,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":207
+ /* "View.MemoryView":211
* def __dealloc__(array self):
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data) # <<<<<<<<<<<<<<
@@ -8720,10 +10408,18 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* if self.dtype_is_object:
*/
__pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":210
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":208
+ /* "View.MemoryView":212
* if self.callback_free_data != NULL:
* self.callback_free_data(self.data)
* elif self.free_data: # <<<<<<<<<<<<<<
@@ -8733,7 +10429,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->free_data != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":209
+ /* "View.MemoryView":213
* self.callback_free_data(self.data)
* elif self.free_data:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -8743,7 +10439,7 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":210
+ /* "View.MemoryView":214
* elif self.free_data:
* if self.dtype_is_object:
* refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
@@ -8751,32 +10447,45 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
* 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;
+
+ /* "View.MemoryView":213
+ * 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_L4:;
- /* "View.MemoryView":212
+ /* "View.MemoryView":216
* refcount_objects_in_slice(self.data, self._shape,
* self._strides, self.ndim, False)
* free(self.data) # <<<<<<<<<<<<<<
- * PyMem_Free(self._shape)
+ * PyObject_Free(self._shape)
*
*/
free(__pyx_v_self->data);
- goto __pyx_L3;
+
+ /* "View.MemoryView":212
+ * 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_L3:;
- /* "View.MemoryView":213
+ /* "View.MemoryView":217
* self._strides, self.ndim, False)
* free(self.data)
- * PyMem_Free(self._shape) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
*
- * property memview:
+ * @property
*/
- PyMem_Free(__pyx_v_self->_shape);
+ PyObject_Free(__pyx_v_self->_shape);
- /* "View.MemoryView":205
+ /* "View.MemoryView":209
* __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
*
* def __dealloc__(array self): # <<<<<<<<<<<<<<
@@ -8788,84 +10497,128 @@ static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *_
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":217
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
+/* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
*
- * 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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":221
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 221, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":220
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __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":224
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(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);
+ __Pyx_RefNannySetupContext("get_memview", 0);
- /* "View.MemoryView":219
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
+ /* "View.MemoryView":225
+ * @cname('get_memview')
+ * cdef get_memview(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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":226
+ * cdef get_memview(self):
+ * 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 226, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 226, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 226, __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): # <<<<<<<<<<<<<<
+ /* "View.MemoryView":224
*
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
*/
/* function exit code */
@@ -8873,15 +10626,15 @@ static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_arr
__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_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
__pyx_L0:;
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":223
+/* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -8895,24 +10648,21 @@ static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":230
*
* def __getattr__(self, attr):
* return getattr(self.memview, attr) # <<<<<<<<<<<<<<
@@ -8920,16 +10670,16 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 230, __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_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 230, __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
+ /* "View.MemoryView":229
*
*
* def __getattr__(self, attr): # <<<<<<<<<<<<<<
@@ -8949,7 +10699,7 @@ static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":226
+/* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -8963,24 +10713,21 @@ static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":233
*
* def __getitem__(self, item):
* return self.memview[item] # <<<<<<<<<<<<<<
@@ -8988,16 +10735,16 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __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_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __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
+ /* "View.MemoryView":232
* return getattr(self.memview, attr)
*
* def __getitem__(self, item): # <<<<<<<<<<<<<<
@@ -9017,7 +10764,7 @@ static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_o
return __pyx_r;
}
-/* "View.MemoryView":229
+/* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -9031,35 +10778,32 @@ static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ite
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));
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_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) {
+static int __pyx_array___pyx_pf_15View_dot_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
+ /* "View.MemoryView":236
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __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;}
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 236, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":229
+ /* "View.MemoryView":235
* return self.memview[item]
*
* def __setitem__(self, item, value): # <<<<<<<<<<<<<<
@@ -9079,7 +10823,7 @@ static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *_
return __pyx_r;
}
-/* "View.MemoryView":234
+/* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -9096,12 +10840,9 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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
+ /* "View.MemoryView":244
* cdef array result
*
* if buf == NULL: # <<<<<<<<<<<<<<
@@ -9111,96 +10852,104 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":239
+ /* "View.MemoryView":245
*
* 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_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 245, __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_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 245, __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_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 245, __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);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __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_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 245, __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;
+
+ /* "View.MemoryView":244
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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;}
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 247, __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_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 247, __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_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 247, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
__Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __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
+ /* "View.MemoryView":248
* 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;}
+ __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 248, __pyx_L1_error)
- /* "View.MemoryView":241
+ /* "View.MemoryView":247
* 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_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 247, __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
+ /* "View.MemoryView":249
* result = array(shape, itemsize, format, mode.decode('ASCII'),
* allocate_buffer=False)
* result.data = buf # <<<<<<<<<<<<<<
@@ -9211,7 +10960,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
}
__pyx_L3:;
- /* "View.MemoryView":245
+ /* "View.MemoryView":251
* result.data = buf
*
* return result # <<<<<<<<<<<<<<
@@ -9223,7 +10972,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":234
+ /* "View.MemoryView":240
*
* @cname("__pyx_array_new")
* cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
@@ -9246,7 +10995,7 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
return __pyx_r;
}
-/* "View.MemoryView":271
+/* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -9258,9 +11007,6 @@ static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize
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);
@@ -9282,7 +11028,7 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 277, __pyx_L3_error)
}
} else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
goto __pyx_L5_argtuple_error;
@@ -9293,25 +11039,25 @@ static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
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_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 277, __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);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_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
+ /* "View.MemoryView":278
* cdef object name
* def __init__(self, name):
* self.name = name # <<<<<<<<<<<<<<
@@ -9324,7 +11070,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
__Pyx_DECREF(__pyx_v_self->name);
__pyx_v_self->name = __pyx_v_name;
- /* "View.MemoryView":271
+ /* "View.MemoryView":277
* cdef class Enum(object):
* cdef object name
* def __init__(self, name): # <<<<<<<<<<<<<<
@@ -9338,7 +11084,7 @@ static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_
return __pyx_r;
}
-/* "View.MemoryView":273
+/* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9352,19 +11098,19 @@ 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));
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__repr__", 0);
- /* "View.MemoryView":274
+ /* "View.MemoryView":280
* self.name = name
* def __repr__(self):
* return self.name # <<<<<<<<<<<<<<
@@ -9376,7 +11122,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
__pyx_r = __pyx_v_self->name;
goto __pyx_L0;
- /* "View.MemoryView":273
+ /* "View.MemoryView":279
* def __init__(self, name):
* self.name = name
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -9391,7 +11137,7 @@ static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_Memvi
return __pyx_r;
}
-/* "View.MemoryView":288
+/* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -9405,7 +11151,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
void *__pyx_r;
int __pyx_t_1;
- /* "View.MemoryView":290
+ /* "View.MemoryView":296
* 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 # <<<<<<<<<<<<<<
@@ -9414,7 +11160,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
- /* "View.MemoryView":294
+ /* "View.MemoryView":300
*
* with cython.cdivision(True):
* offset = aligned_p % alignment # <<<<<<<<<<<<<<
@@ -9423,7 +11169,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
*/
__pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
- /* "View.MemoryView":296
+ /* "View.MemoryView":302
* offset = aligned_p % alignment
*
* if offset > 0: # <<<<<<<<<<<<<<
@@ -9433,7 +11179,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
__pyx_t_1 = ((__pyx_v_offset > 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":297
+ /* "View.MemoryView":303
*
* if offset > 0:
* aligned_p += alignment - offset # <<<<<<<<<<<<<<
@@ -9441,21 +11187,27 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
* return <void *> aligned_p
*/
__pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
+
+ /* "View.MemoryView":302
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":299
+ /* "View.MemoryView":305
* aligned_p += alignment - offset
*
* return <void *> aligned_p # <<<<<<<<<<<<<<
*
- * @cname('__pyx_memoryview')
+ *
*/
__pyx_r = ((void *)__pyx_v_aligned_p);
goto __pyx_L0;
- /* "View.MemoryView":288
+ /* "View.MemoryView":294
*
* @cname('__pyx_align_pointer')
* cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
@@ -9468,7 +11220,7 @@ static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment)
return __pyx_r;
}
-/* "View.MemoryView":317
+/* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -9482,9 +11234,6 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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);
@@ -9509,7 +11258,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
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;}
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 341, __pyx_L3_error)
}
case 2:
if (kw_args > 0) {
@@ -9518,7 +11267,7 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
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;}
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 341, __pyx_L3_error)
}
} else {
switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9530,43 +11279,38 @@ static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_ar
}
}
__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;}
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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;}
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 341, __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_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 341, __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);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":342
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj # <<<<<<<<<<<<<<
@@ -9579,7 +11323,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__Pyx_DECREF(__pyx_v_self->obj);
__pyx_v_self->obj = __pyx_v_obj;
- /* "View.MemoryView":319
+ /* "View.MemoryView":343
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
* self.obj = obj
* self.flags = flags # <<<<<<<<<<<<<<
@@ -9588,14 +11332,14 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->flags = __pyx_v_flags;
- /* "View.MemoryView":320
+ /* "View.MemoryView":344
* 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_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
__pyx_t_3 = (__pyx_t_2 != 0);
if (!__pyx_t_3) {
} else {
@@ -9608,16 +11352,16 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_L4_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":321
+ /* "View.MemoryView":345
* 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;}
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 345, __pyx_L1_error)
- /* "View.MemoryView":322
+ /* "View.MemoryView":346
* if type(self) is memoryview or obj is not None:
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
@@ -9627,7 +11371,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":323
+ /* "View.MemoryView":347
* __Pyx_GetBuffer(obj, &self.view, flags)
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -9636,90 +11380,177 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
- /* "View.MemoryView":324
+ /* "View.MemoryView":348
* if <PyObject *> self.view.obj == NULL:
* (<__pyx_buffer *> &self.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
*
- * self.lock = PyThread_allocate_lock()
+ * global __pyx_memoryview_thread_locks_used
*/
Py_INCREF(Py_None);
- goto __pyx_L6;
+
+ /* "View.MemoryView":346
+ * 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_L6:;
- goto __pyx_L3;
+
+ /* "View.MemoryView":344
+ * 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_L3:;
- /* "View.MemoryView":326
- * Py_INCREF(Py_None)
+ /* "View.MemoryView":351
*
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
*/
- __pyx_v_self->lock = PyThread_allocate_lock();
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
- /* "View.MemoryView":327
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
+ /* "View.MemoryView":352
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":353
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":351
*
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
*/
__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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":355
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":357
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyErr_NoMemory(); __PYX_ERR(2, 357, __pyx_L1_error)
+
+ /* "View.MemoryView":356
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":354
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
}
- /* "View.MemoryView":330
- * raise MemoryError
+ /* "View.MemoryView":359
+ * raise MemoryError
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
*/
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":331
+ /* "View.MemoryView":360
*
* if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
* 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_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
__pyx_v_self->dtype_is_object = __pyx_t_1;
- goto __pyx_L8;
+
+ /* "View.MemoryView":359
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
}
- /*else*/ {
- /* "View.MemoryView":333
- * self.dtype_is_object = self.view.format == b'O'
+ /* "View.MemoryView":362
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
* else:
* self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
*/
+ /*else*/ {
__pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
}
- __pyx_L8:;
+ __pyx_L10:;
- /* "View.MemoryView":335
+ /* "View.MemoryView":364
* self.dtype_is_object = dtype_is_object
*
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
@@ -9728,7 +11559,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__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
+ /* "View.MemoryView":366
* self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
* <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
* self.typeinfo = NULL # <<<<<<<<<<<<<<
@@ -9737,7 +11568,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
*/
__pyx_v_self->typeinfo = NULL;
- /* "View.MemoryView":317
+ /* "View.MemoryView":341
* cdef __Pyx_TypeInfo *typeinfo
*
* def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
@@ -9749,8 +11580,6 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
__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:;
@@ -9758,7 +11587,7 @@ static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":339
+/* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -9771,19 +11600,24 @@ 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));
+ __pyx_memoryview___pyx_pf_15View_dot_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) {
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ PyThread_type_lock __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":340
+ /* "View.MemoryView":369
*
* def __dealloc__(memoryview self):
* if self.obj is not None: # <<<<<<<<<<<<<<
@@ -9794,41 +11628,144 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":341
+ /* "View.MemoryView":370
* def __dealloc__(memoryview self):
* if self.obj is not None:
* __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
*
- * if self.lock != NULL:
+ * cdef int i
*/
__Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
- /* "View.MemoryView":343
+ /* "View.MemoryView":369
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
* __Pyx_ReleaseBuffer(&self.view)
*
+ */
+ }
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
*/
__pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":344
- *
+ /* "View.MemoryView":375
+ * global __pyx_memoryview_thread_locks_used
* if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":377
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_5 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":379
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_6;
+
+ /* "View.MemoryView":378
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":381
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":376
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":383
+ * break
+ * else:
+ * 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;
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":374
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":339
+ /* "View.MemoryView":368
* self.typeinfo = NULL
*
* def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
@@ -9840,8 +11777,8 @@ static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_m
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+/* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -9861,12 +11798,9 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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
+ /* "View.MemoryView":387
* cdef char *get_item_pointer(memoryview self, object index) except NULL:
* cdef Py_ssize_t dim
* cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
@@ -9875,7 +11809,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
*/
__pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -9887,25 +11821,27 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__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_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 389, __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;}
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 389, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 389, __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;}
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 389, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
#endif
}
} else {
@@ -9914,7 +11850,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
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;}
+ else __PYX_ERR(2, 389, __pyx_L1_error)
}
break;
}
@@ -9925,18 +11861,18 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_v_dim = __pyx_t_1;
__pyx_t_1 = (__pyx_t_1 + 1);
- /* "View.MemoryView":351
+ /* "View.MemoryView":390
*
* 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_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 390, __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_ERR(2, 390, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_7;
- /* "View.MemoryView":350
+ /* "View.MemoryView":389
* cdef char *itemp = <char *> self.view.buf
*
* for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
@@ -9946,7 +11882,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":353
+ /* "View.MemoryView":392
* itemp = pybuffer_index(&self.view, itemp, idx, dim)
*
* return itemp # <<<<<<<<<<<<<<
@@ -9956,8 +11892,8 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
__pyx_r = __pyx_v_itemp;
goto __pyx_L0;
- /* "View.MemoryView":346
- * PyThread_free_lock(self.lock)
+ /* "View.MemoryView":385
+ * PyThread_free_lock(self.lock)
*
* cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
* cdef Py_ssize_t dim
@@ -9976,7 +11912,7 @@ static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__py
return __pyx_r;
}
-/* "View.MemoryView":356
+/* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -9990,14 +11926,14 @@ static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -10009,12 +11945,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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
+ /* "View.MemoryView":396
*
* def __getitem__(memoryview self, object index):
* if index is Ellipsis: # <<<<<<<<<<<<<<
@@ -10025,7 +11958,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":358
+ /* "View.MemoryView":397
* def __getitem__(memoryview self, object index):
* if index is Ellipsis:
* return self # <<<<<<<<<<<<<<
@@ -10036,20 +11969,28 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
__Pyx_INCREF(((PyObject *)__pyx_v_self));
__pyx_r = ((PyObject *)__pyx_v_self);
goto __pyx_L0;
+
+ /* "View.MemoryView":396
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
}
- /* "View.MemoryView":360
+ /* "View.MemoryView":399
* 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_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 399, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -10057,39 +11998,39 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
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;}
+ __PYX_ERR(2, 399, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 399, __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_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 399, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 399, __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
+ /* "View.MemoryView":402
*
* 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;}
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 402, __pyx_L1_error)
if (__pyx_t_2) {
- /* "View.MemoryView":364
+ /* "View.MemoryView":403
* cdef char *itemp
* if have_slices:
* return memview_slice(self, indices) # <<<<<<<<<<<<<<
@@ -10097,25 +12038,33 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 403, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":402
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":366
+ /* "View.MemoryView":405
* 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;}
+ /*else*/ {
+ __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_ERR(2, 405, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_6;
- /* "View.MemoryView":367
+ /* "View.MemoryView":406
* else:
* itemp = self.get_item_pointer(indices)
* return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
@@ -10123,14 +12072,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
* 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_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_ERR(2, 406, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_r = __pyx_t_3;
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":356
+ /* "View.MemoryView":395
*
*
* def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
@@ -10153,7 +12102,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __
return __pyx_r;
}
-/* "View.MemoryView":369
+/* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -10167,14 +12116,14 @@ static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -10183,24 +12132,21 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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
+ /* "View.MemoryView":409
*
* 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_t_1 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 409, __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
+ #if !CYTHON_COMPILING_IN_PYPY
Py_ssize_t size = Py_SIZE(sequence);
#else
Py_ssize_t size = PySequence_Size(sequence);
@@ -10208,111 +12154,127 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
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;}
+ __PYX_ERR(2, 409, __pyx_L1_error)
}
- #if CYTHON_COMPILING_IN_CPYTHON
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
__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_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 409, __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_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 409, __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_RaiseNoneNotIterableError(); __PYX_ERR(2, 409, __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
+ /* "View.MemoryView":411
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 411, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":373
+ /* "View.MemoryView":412
*
* 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_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_ERR(2, 412, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_obj = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":374
+ /* "View.MemoryView":413
* 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;}
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 413, __pyx_L1_error)
if (__pyx_t_4) {
- /* "View.MemoryView":375
+ /* "View.MemoryView":414
* 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_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 414, __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_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_ERR(2, 414, __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;
+
+ /* "View.MemoryView":413
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":377
+ /* "View.MemoryView":416
* 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;};
+ /*else*/ {
+ __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 416, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 416, __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_ERR(2, 416, __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:;
+
+ /* "View.MemoryView":411
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":379
+ /* "View.MemoryView":418
* 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;}
+ /*else*/ {
+ __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_ERR(2, 418, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":369
+ /* "View.MemoryView":408
* return self.convert_item_to_object(itemp)
*
* def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
@@ -10337,7 +12299,7 @@ static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":381
+/* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -10357,24 +12319,21 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
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
+ /* "View.MemoryView":421
*
* 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_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":383
+ /* "View.MemoryView":422
* cdef is_slice(self, obj):
* if not isinstance(obj, memoryview):
* try: # <<<<<<<<<<<<<<
@@ -10382,81 +12341,92 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
* self.dtype_is_object)
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
__Pyx_XGOTREF(__pyx_t_3);
__Pyx_XGOTREF(__pyx_t_4);
__Pyx_XGOTREF(__pyx_t_5);
/*try:*/ {
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 423, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":385
+ /* "View.MemoryView":424
* 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_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 424, __pyx_L4_error)
__Pyx_GOTREF(__pyx_t_7);
- /* "View.MemoryView":384
+ /* "View.MemoryView":423
* 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_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 423, __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);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
__Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __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_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 423, __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;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
}
__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_PyThreadState_assign
__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
+ /* "View.MemoryView":425
* obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
* self.dtype_is_object)
* except TypeError: # <<<<<<<<<<<<<<
* return None
*
*/
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ __pyx_t_9 = __Pyx_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;}
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 425, __pyx_L6_except_error)
__Pyx_GOTREF(__pyx_t_7);
__Pyx_GOTREF(__pyx_t_8);
__Pyx_GOTREF(__pyx_t_6);
- /* "View.MemoryView":387
+ /* "View.MemoryView":426
* self.dtype_is_object)
* except TypeError:
* return None # <<<<<<<<<<<<<<
@@ -10473,12 +12443,22 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
}
goto __pyx_L6_except_error;
__pyx_L6_except_error:;
+
+ /* "View.MemoryView":422
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
goto __pyx_L1_error;
__pyx_L7_except_return:;
+ __Pyx_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
__Pyx_XGIVEREF(__pyx_t_5);
@@ -10486,11 +12466,17 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
goto __pyx_L0;
__pyx_L11_try_end:;
}
- goto __pyx_L3;
+
+ /* "View.MemoryView":421
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":389
+ /* "View.MemoryView":428
* return None
*
* return obj # <<<<<<<<<<<<<<
@@ -10502,7 +12488,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
__pyx_r = __pyx_v_obj;
goto __pyx_L0;
- /* "View.MemoryView":381
+ /* "View.MemoryView":420
* self.setitem_indexed(index, value)
*
* cdef is_slice(self, obj): # <<<<<<<<<<<<<<
@@ -10524,7 +12510,7 @@ static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_
return __pyx_r;
}
-/* "View.MemoryView":391
+/* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -10541,55 +12527,52 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
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
+ /* "View.MemoryView":434
* 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;}
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":396
+ /* "View.MemoryView":435
*
* 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;}
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 435, __pyx_L1_error)
- /* "View.MemoryView":397
+ /* "View.MemoryView":436
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 436, __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_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 436, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":395
+ /* "View.MemoryView":434
* 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;}
+ __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_ERR(2, 434, __pyx_L1_error)
- /* "View.MemoryView":391
+ /* "View.MemoryView":430
* return obj
*
* cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
@@ -10610,7 +12593,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
return __pyx_r;
}
-/* "View.MemoryView":399
+/* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -10619,7 +12602,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryvi
*/
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];
+ int __pyx_v_array[0x80];
void *__pyx_v_tmp;
void *__pyx_v_item;
__Pyx_memviewslice *__pyx_v_dst_slice;
@@ -10637,12 +12620,9 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
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
+ /* "View.MemoryView":440
* cdef setitem_slice_assign_scalar(self, memoryview dst, value):
* cdef int array[128]
* cdef void *tmp = NULL # <<<<<<<<<<<<<<
@@ -10651,7 +12631,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = NULL;
- /* "View.MemoryView":406
+ /* "View.MemoryView":445
* cdef __Pyx_memviewslice *dst_slice
* cdef __Pyx_memviewslice tmp_slice
* dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
@@ -10660,7 +12640,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
- /* "View.MemoryView":408
+ /* "View.MemoryView":447
* dst_slice = get_slice_from_memview(dst, &tmp_slice)
*
* if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
@@ -10670,7 +12650,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":409
+ /* "View.MemoryView":448
*
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
@@ -10679,7 +12659,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
__pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
- /* "View.MemoryView":410
+ /* "View.MemoryView":449
* if <size_t>self.view.itemsize > sizeof(array):
* tmp = PyMem_Malloc(self.view.itemsize)
* if tmp == NULL: # <<<<<<<<<<<<<<
@@ -10689,17 +12669,25 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":411
+ /* "View.MemoryView":450
* 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;}
+ PyErr_NoMemory(); __PYX_ERR(2, 450, __pyx_L1_error)
+
+ /* "View.MemoryView":449
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
}
- /* "View.MemoryView":412
+ /* "View.MemoryView":451
* if tmp == NULL:
* raise MemoryError
* item = tmp # <<<<<<<<<<<<<<
@@ -10707,22 +12695,30 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* item = <void *> array
*/
__pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":447
+ * 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:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":414
+ /* "View.MemoryView":453
* item = tmp
* else:
* item = <void *> array # <<<<<<<<<<<<<<
*
* try:
*/
+ /*else*/ {
__pyx_v_item = ((void *)__pyx_v_array);
}
__pyx_L3:;
- /* "View.MemoryView":416
+ /* "View.MemoryView":455
* item = <void *> array
*
* try: # <<<<<<<<<<<<<<
@@ -10731,7 +12727,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
*/
/*try:*/ {
- /* "View.MemoryView":417
+ /* "View.MemoryView":456
*
* try:
* if self.dtype_is_object: # <<<<<<<<<<<<<<
@@ -10741,7 +12737,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":418
+ /* "View.MemoryView":457
* try:
* if self.dtype_is_object:
* (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
@@ -10749,24 +12745,32 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
* self.assign_item_from_object(<char *> item, value)
*/
(((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":456
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
goto __pyx_L8;
}
- /*else*/ {
- /* "View.MemoryView":420
+ /* "View.MemoryView":459
* (<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;}
+ /*else*/ {
+ __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_ERR(2, 459, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
}
__pyx_L8:;
- /* "View.MemoryView":424
+ /* "View.MemoryView":463
*
*
* if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -10776,21 +12780,27 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":425
+ /* "View.MemoryView":464
*
* 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_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 464, __pyx_L6_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L9;
+
+ /* "View.MemoryView":463
+ *
+ *
+ * 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_L9:;
- /* "View.MemoryView":426
+ /* "View.MemoryView":465
* 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, # <<<<<<<<<<<<<<
@@ -10800,7 +12810,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__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
+ /* "View.MemoryView":468
* item, self.dtype_is_object)
* finally:
* PyMem_Free(tmp) # <<<<<<<<<<<<<<
@@ -10813,8 +12823,10 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
goto __pyx_L7;
}
/*exception exit:*/{
+ __Pyx_PyThreadState_declare
__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_PyThreadState_assign
__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);
@@ -10828,6 +12840,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
{
PyMem_Free(__pyx_v_tmp);
}
+ __Pyx_PyThreadState_assign
if (PY_MAJOR_VERSION >= 3) {
__Pyx_XGIVEREF(__pyx_t_9);
__Pyx_XGIVEREF(__pyx_t_10);
@@ -10845,7 +12858,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
__pyx_L7:;
}
- /* "View.MemoryView":399
+ /* "View.MemoryView":438
* src.ndim, dst.ndim, self.dtype_is_object)
*
* cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
@@ -10866,7 +12879,7 @@ static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":431
+/* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -10880,33 +12893,30 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
__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
+ /* "View.MemoryView":471
*
* 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_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_ERR(2, 471, __pyx_L1_error)
__pyx_v_itemp = __pyx_t_1;
- /* "View.MemoryView":433
+ /* "View.MemoryView":472
* 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_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_ERR(2, 472, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":431
+ /* "View.MemoryView":470
* PyMem_Free(tmp)
*
* cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
@@ -10927,7 +12937,7 @@ static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *_
return __pyx_r;
}
-/* "View.MemoryView":435
+/* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -10948,41 +12958,37 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
PyObject *__pyx_t_7 = NULL;
- Py_ssize_t __pyx_t_8;
+ int __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
+ /* "View.MemoryView":477
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 477, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":441
+ /* "View.MemoryView":480
* 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_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 480, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
__pyx_t_1 = 0;
- /* "View.MemoryView":442
+ /* "View.MemoryView":481
*
* bytesitem = itemp[:self.view.itemsize]
* try: # <<<<<<<<<<<<<<
@@ -10990,26 +12996,28 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
* except struct.error:
*/
{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":482
* 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_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 482, __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_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 482, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -11019,38 +13027,66 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __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_ERR(2, 482, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
}
- 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;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
}
- /*else:*/ {
- /* "View.MemoryView":447
+ /* "View.MemoryView":486
* raise ValueError("Unable to convert item to object")
* else:
* if len(self.view.format) == 1: # <<<<<<<<<<<<<<
* return result[0]
* return result
*/
+ /*else:*/ {
__pyx_t_10 = strlen(__pyx_v_self->view.format);
__pyx_t_11 = ((__pyx_t_10 == 1) != 0);
if (__pyx_t_11) {
- /* "View.MemoryView":448
+ /* "View.MemoryView":487
* else:
* if len(self.view.format) == 1:
* return result[0] # <<<<<<<<<<<<<<
@@ -11058,14 +13094,22 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
*
*/
__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_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 487, __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":486
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
}
- /* "View.MemoryView":449
+ /* "View.MemoryView":488
* if len(self.view.format) == 1:
* return result[0]
* return result # <<<<<<<<<<<<<<
@@ -11078,51 +13122,62 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L6_except_return;
}
__pyx_L3_error:;
+ __Pyx_PyThreadState_assign
__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
+ /* "View.MemoryView":483
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
- __pyx_t_12 = PyErr_ExceptionMatches(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_t_1);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_12) {
+ if (__pyx_t_8) {
__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;}
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(2, 483, __pyx_L5_except_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_t_5);
__Pyx_GOTREF(__pyx_t_9);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__19, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 484, __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;}
+ __PYX_ERR(2, 484, __pyx_L5_except_error)
}
goto __pyx_L5_except_error;
__pyx_L5_except_error:;
+
+ /* "View.MemoryView":481
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_PyThreadState_assign
__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_PyThreadState_assign
__Pyx_XGIVEREF(__pyx_t_2);
__Pyx_XGIVEREF(__pyx_t_3);
__Pyx_XGIVEREF(__pyx_t_4);
@@ -11130,7 +13185,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
goto __pyx_L0;
}
- /* "View.MemoryView":435
+ /* "View.MemoryView":474
* self.assign_item_from_object(itemp, value)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -11156,7 +13211,7 @@ static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":451
+/* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -11177,31 +13232,29 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
PyObject *__pyx_t_4 = NULL;
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
+ int __pyx_t_7;
PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- char *__pyx_t_10;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
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;
+ char *__pyx_t_14;
__Pyx_RefNannySetupContext("assign_item_from_object", 0);
- /* "View.MemoryView":454
+ /* "View.MemoryView":493
* """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_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 493, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_v_struct = __pyx_t_1;
__pyx_t_1 = 0;
- /* "View.MemoryView":459
+ /* "View.MemoryView":498
* cdef Py_ssize_t i
*
* if isinstance(value, tuple): # <<<<<<<<<<<<<<
@@ -11212,53 +13265,61 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__pyx_t_3 = (__pyx_t_2 != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":460
+ /* "View.MemoryView":499
*
* 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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 499, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __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_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 499, __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_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 499, __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;}
+ 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_ERR(2, 499, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
+
+ /* "View.MemoryView":498
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":462
+ /* "View.MemoryView":501
* 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;}
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 501, __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_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 501, __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))) {
+ if (CYTHON_UNPACK_METHODS && 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);
@@ -11268,66 +13329,86 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __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_ERR(2, 501, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
}
- 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;}
+ 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_ERR(2, 501, __pyx_L1_error)
__pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
__pyx_t_4 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = 0;
+ __pyx_t_9 = 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_ERR(2, 503, __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]);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
*
* @cname('getbuffer')
*/
- __pyx_v_i = __pyx_t_7;
+ __pyx_v_i = __pyx_t_9;
- /* "View.MemoryView":464
+ /* "View.MemoryView":503
* bytesvalue = struct.pack(self.view.format, value)
*
* for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
* itemp[i] = c
*
*/
- __pyx_t_7 = (__pyx_t_7 + 1);
+ __pyx_t_9 = (__pyx_t_9 + 1);
- /* "View.MemoryView":465
+ /* "View.MemoryView":504
*
* for i, c in enumerate(bytesvalue):
* itemp[i] = c # <<<<<<<<<<<<<<
@@ -11336,9 +13417,9 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
*/
(__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- /* "View.MemoryView":451
+ /* "View.MemoryView":490
* return result
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -11355,7 +13436,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -11366,7 +13447,7 @@ static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryvie
return __pyx_r;
}
-/* "View.MemoryView":468
+/* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -11380,14 +13461,14 @@ static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_b
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static int __pyx_memoryview___pyx_pf_15View_dot_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;
@@ -11402,7 +13483,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_GIVEREF(__pyx_v_info->obj);
}
- /* "View.MemoryView":469
+ /* "View.MemoryView":508
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -11412,7 +13493,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":470
+ /* "View.MemoryView":509
* def __getbuffer__(self, Py_buffer *info, int flags):
* if flags & PyBUF_STRIDES:
* info.shape = self.view.shape # <<<<<<<<<<<<<<
@@ -11421,22 +13502,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.shape;
__pyx_v_info->shape = __pyx_t_2;
+
+ /* "View.MemoryView":508
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":472
+ /* "View.MemoryView":511
* info.shape = self.view.shape
* else:
* info.shape = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_STRIDES:
*/
+ /*else*/ {
__pyx_v_info->shape = NULL;
}
__pyx_L3:;
- /* "View.MemoryView":474
+ /* "View.MemoryView":513
* info.shape = NULL
*
* if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
@@ -11446,7 +13535,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":475
+ /* "View.MemoryView":514
*
* if flags & PyBUF_STRIDES:
* info.strides = self.view.strides # <<<<<<<<<<<<<<
@@ -11455,22 +13544,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.strides;
__pyx_v_info->strides = __pyx_t_2;
+
+ /* "View.MemoryView":513
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":477
+ /* "View.MemoryView":516
* info.strides = self.view.strides
* else:
* info.strides = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_INDIRECT:
*/
+ /*else*/ {
__pyx_v_info->strides = NULL;
}
__pyx_L4:;
- /* "View.MemoryView":479
+ /* "View.MemoryView":518
* info.strides = NULL
*
* if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
@@ -11480,7 +13577,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":480
+ /* "View.MemoryView":519
*
* if flags & PyBUF_INDIRECT:
* info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
@@ -11489,22 +13586,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_2 = __pyx_v_self->view.suboffsets;
__pyx_v_info->suboffsets = __pyx_t_2;
+
+ /* "View.MemoryView":518
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":482
+ /* "View.MemoryView":521
* info.suboffsets = self.view.suboffsets
* else:
* info.suboffsets = NULL # <<<<<<<<<<<<<<
*
* if flags & PyBUF_FORMAT:
*/
+ /*else*/ {
__pyx_v_info->suboffsets = NULL;
}
__pyx_L5:;
- /* "View.MemoryView":484
+ /* "View.MemoryView":523
* info.suboffsets = NULL
*
* if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
@@ -11514,7 +13619,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":485
+ /* "View.MemoryView":524
*
* if flags & PyBUF_FORMAT:
* info.format = self.view.format # <<<<<<<<<<<<<<
@@ -11523,22 +13628,30 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_t_3 = __pyx_v_self->view.format;
__pyx_v_info->format = __pyx_t_3;
+
+ /* "View.MemoryView":523
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":487
+ /* "View.MemoryView":526
* info.format = self.view.format
* else:
* info.format = NULL # <<<<<<<<<<<<<<
*
* info.buf = self.view.buf
*/
+ /*else*/ {
__pyx_v_info->format = NULL;
}
__pyx_L6:;
- /* "View.MemoryView":489
+ /* "View.MemoryView":528
* info.format = NULL
*
* info.buf = self.view.buf # <<<<<<<<<<<<<<
@@ -11548,7 +13661,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_4 = __pyx_v_self->view.buf;
__pyx_v_info->buf = __pyx_t_4;
- /* "View.MemoryView":490
+ /* "View.MemoryView":529
*
* info.buf = self.view.buf
* info.ndim = self.view.ndim # <<<<<<<<<<<<<<
@@ -11558,7 +13671,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_5 = __pyx_v_self->view.ndim;
__pyx_v_info->ndim = __pyx_t_5;
- /* "View.MemoryView":491
+ /* "View.MemoryView":530
* info.buf = self.view.buf
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
@@ -11568,7 +13681,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.itemsize;
__pyx_v_info->itemsize = __pyx_t_6;
- /* "View.MemoryView":492
+ /* "View.MemoryView":531
* info.ndim = self.view.ndim
* info.itemsize = self.view.itemsize
* info.len = self.view.len # <<<<<<<<<<<<<<
@@ -11578,7 +13691,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__pyx_t_6 = __pyx_v_self->view.len;
__pyx_v_info->len = __pyx_t_6;
- /* "View.MemoryView":493
+ /* "View.MemoryView":532
* info.itemsize = self.view.itemsize
* info.len = self.view.len
* info.readonly = 0 # <<<<<<<<<<<<<<
@@ -11587,7 +13700,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
*/
__pyx_v_info->readonly = 0;
- /* "View.MemoryView":494
+ /* "View.MemoryView":533
* info.len = self.view.len
* info.readonly = 0
* info.obj = self # <<<<<<<<<<<<<<
@@ -11600,7 +13713,7 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
__Pyx_DECREF(__pyx_v_info->obj);
__pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- /* "View.MemoryView":468
+ /* "View.MemoryView":507
*
* @cname('getbuffer')
* def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
@@ -11618,78 +13731,75 @@ static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(str
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)
+/* "View.MemoryView":539
+ *
+ * @property
+ * def T(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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
+ /* "View.MemoryView":540
+ * @property
+ * def T(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_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 540, __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;}
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 540, __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
+ /* "View.MemoryView":541
+ * def T(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;}
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 541, __pyx_L1_error)
- /* "View.MemoryView":504
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
+ /* "View.MemoryView":542
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
__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)
+ /* "View.MemoryView":539
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
*/
/* function exit code */
@@ -11704,49 +13814,49 @@ static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(s
return __pyx_r;
}
-/* "View.MemoryView":508
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
+/* "View.MemoryView":545
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":546
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
*
- * property shape:
+ * @property
*/
__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
+ /* "View.MemoryView":545
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
*
*/
@@ -11757,77 +13867,76 @@ static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get
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)])
+/* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[: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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
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;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__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)]) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":550
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property strides:
+ * @property
*/
__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_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 550, __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_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 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)])
+ /* "View.MemoryView":549
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -11836,102 +13945,109 @@ static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get
return __pyx_r;
}
-/* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+/* "View.MemoryView":553
+ *
+ * @property
+ * def strides(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":519
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
*
- * raise ValueError("Buffer view does not expose strides")
+ * 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:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 556, __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;}
+ __PYX_ERR(2, 556, __pyx_L1_error)
+
+ /* "View.MemoryView":554
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
}
- /* "View.MemoryView":523
- * raise ValueError("Buffer view does not expose strides")
+ /* "View.MemoryView":558
+ * raise ValueError("Buffer view does not expose strides")
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property suboffsets:
+ * @property
*/
__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_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 558, __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_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 558, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
goto __pyx_L0;
- /* "View.MemoryView":518
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
+ /* "View.MemoryView":553
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
*
*/
/* function exit code */
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -11940,110 +14056,113 @@ static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides__
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
+/* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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;
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
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;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
__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
+ /* "View.MemoryView":562
+ * @property
+ * def suboffsets(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
+ * return tuple([suboffset for suboffset in self.view.suboffsets[: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_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 563, __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;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__25, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 563, __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":562
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
}
- /* "View.MemoryView":531
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":565
+ * return (-1,) * self.view.ndim
*
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
*
- * property ndim:
+ * @property
*/
__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_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __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":527
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
+ /* "View.MemoryView":561
+ *
+ * @property
+ * def suboffsets(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_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -12052,55 +14171,52 @@ static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10subof
return __pyx_r;
}
-/* "View.MemoryView":535
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
+/* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":569
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
*
- * property itemsize:
+ * @property
*/
__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_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 569, __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
+ /* "View.MemoryView":568
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
*
*/
@@ -12115,55 +14231,52 @@ static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__
return __pyx_r;
}
-/* "View.MemoryView":540
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
+/* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":573
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
*
- * property nbytes:
+ * @property
*/
__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_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 573, __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
+ /* "View.MemoryView":572
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
*
*/
@@ -12178,51 +14291,48 @@ static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize
return __pyx_r;
}
-/* "View.MemoryView":545
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
+/* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":577
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
*
- * property size:
+ * @property
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 577, __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_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 577, __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_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 577, __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;
@@ -12230,11 +14340,11 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
__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
+ /* "View.MemoryView":576
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
*
*/
@@ -12251,156 +14361,115 @@ static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___g
return __pyx_r;
}
-/* "View.MemoryView":550
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
+/* "View.MemoryView":580
+ *
+ * @property
+ * def size(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
__Pyx_RefNannySetupContext("__get__", 0);
- /* "View.MemoryView":551
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
+ /* "View.MemoryView":581
+ * @property
+ * def size(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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":582
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
*
- * for length in self.shape:
+ * for length in self.view.shape[:self.view.ndim]:
*/
__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
+ /* "View.MemoryView":584
+ * result = 1
*
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * 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;
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 584, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
- /* "View.MemoryView":554
- * result = 1
+ /* "View.MemoryView":585
*
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
*
+ * self._size = result
*/
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 585, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- /* "View.MemoryView":557
- * result *= length
+ /* "View.MemoryView":587
+ * result *= length
*
- * self._size = result # <<<<<<<<<<<<<<
+ * self._size = result # <<<<<<<<<<<<<<
*
- * return self._size
+ * 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;
+
+ /* "View.MemoryView":581
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":559
- * self._size = result
+ /* "View.MemoryView":589
+ * self._size = result
*
- * return self._size # <<<<<<<<<<<<<<
+ * return self._size # <<<<<<<<<<<<<<
*
* def __len__(self):
*/
@@ -12409,18 +14478,17 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
__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
+ /* "View.MemoryView":580
+ *
+ * @property
+ * def size(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_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
@@ -12431,8 +14499,8 @@ static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__
return __pyx_r;
}
-/* "View.MemoryView":561
- * return self._size
+/* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -12445,20 +14513,20 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":592
*
* def __len__(self):
* if self.view.ndim >= 1: # <<<<<<<<<<<<<<
@@ -12468,7 +14536,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":563
+ /* "View.MemoryView":593
* def __len__(self):
* if self.view.ndim >= 1:
* return self.view.shape[0] # <<<<<<<<<<<<<<
@@ -12477,9 +14545,17 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
*/
__pyx_r = (__pyx_v_self->view.shape[0]);
goto __pyx_L0;
+
+ /* "View.MemoryView":592
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
}
- /* "View.MemoryView":565
+ /* "View.MemoryView":595
* return self.view.shape[0]
*
* return 0 # <<<<<<<<<<<<<<
@@ -12489,8 +14565,8 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":561
- * return self._size
+ /* "View.MemoryView":591
+ * return self._size
*
* def __len__(self): # <<<<<<<<<<<<<<
* if self.view.ndim >= 1:
@@ -12503,7 +14579,7 @@ static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":567
+/* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -12517,25 +14593,22 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":598
*
* def __repr__(self):
* return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
@@ -12543,54 +14616,54 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 598, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":569
+ /* "View.MemoryView":599
* 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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 599, __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;}
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 599, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- /* "View.MemoryView":568
+ /* "View.MemoryView":598
*
* 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_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 598, __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);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 598, __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
+ /* "View.MemoryView":597
* return 0
*
* def __repr__(self): # <<<<<<<<<<<<<<
@@ -12611,7 +14684,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __py
return __pyx_r;
}
-/* "View.MemoryView":571
+/* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -12625,24 +14698,21 @@ 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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":602
*
* def __str__(self):
* return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
@@ -12650,27 +14720,27 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
*
*/
__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_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 602, __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, 0, __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_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 602, __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
+ /* "View.MemoryView":601
* id(self))
*
* def __str__(self): # <<<<<<<<<<<<<<
@@ -12690,7 +14760,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx
return __pyx_r;
}
-/* "View.MemoryView":575
+/* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -12704,48 +14774,45 @@ static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":608
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":579
+ /* "View.MemoryView":609
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 609, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":575
+ /* "View.MemoryView":605
*
*
* def is_c_contig(self): # <<<<<<<<<<<<<<
@@ -12764,8 +14831,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":581
- * return slice_is_contig(mslice, 'C', self.view.ndim)
+/* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -12778,49 +14845,46 @@ static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNU
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":614
* cdef __Pyx_memviewslice *mslice
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
*/
__pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
- /* "View.MemoryView":585
+ /* "View.MemoryView":615
* cdef __Pyx_memviewslice tmp
* mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], '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_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 615, __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)
+ /* "View.MemoryView":611
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
*
* def is_f_contig(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice *mslice
@@ -12838,8 +14902,8 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct _
return __pyx_r;
}
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'F', self.view.ndim)
+/* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -12852,26 +14916,23 @@ static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyO
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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
+ /* "View.MemoryView":619
* def copy(self):
* cdef __Pyx_memviewslice mslice
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12880,7 +14941,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
- /* "View.MemoryView":591
+ /* "View.MemoryView":621
* cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
*
* slice_copy(self, &mslice) # <<<<<<<<<<<<<<
@@ -12889,17 +14950,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
- /* "View.MemoryView":592
+ /* "View.MemoryView":622
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"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_ERR(2, 622, __pyx_L1_error)
__pyx_v_mslice = __pyx_t_1;
- /* "View.MemoryView":597
+ /* "View.MemoryView":627
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
@@ -12907,14 +14968,14 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
* 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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 627, __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)
+ /* "View.MemoryView":617
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
*
* def copy(self): # <<<<<<<<<<<<<<
* cdef __Pyx_memviewslice mslice
@@ -12932,7 +14993,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_me
return __pyx_r;
}
-/* "View.MemoryView":599
+/* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -12946,14 +15007,14 @@ static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UN
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));
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_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) {
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_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;
@@ -12961,12 +15022,9 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
__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
+ /* "View.MemoryView":631
* def copy_fortran(self):
* cdef __Pyx_memviewslice src, dst
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
@@ -12975,7 +15033,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
- /* "View.MemoryView":603
+ /* "View.MemoryView":633
* cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
*
* slice_copy(self, &src) # <<<<<<<<<<<<<<
@@ -12984,17 +15042,17 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*/
__pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
- /* "View.MemoryView":604
+ /* "View.MemoryView":634
*
* 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_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"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_ERR(2, 634, __pyx_L1_error)
__pyx_v_dst = __pyx_t_1;
- /* "View.MemoryView":609
+ /* "View.MemoryView":639
* self.dtype_is_object)
*
* return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
@@ -13002,13 +15060,13 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
*
*/
__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_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 639, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
- /* "View.MemoryView":599
+ /* "View.MemoryView":629
* return memoryview_copy_from_slice(self, &mslice)
*
* def copy_fortran(self): # <<<<<<<<<<<<<<
@@ -13027,7 +15085,7 @@ static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct
return __pyx_r;
}
-/* "View.MemoryView":613
+/* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -13042,40 +15100,37 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
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
+ /* "View.MemoryView":644
* @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_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 644, __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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 644, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
__Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 644, __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
+ /* "View.MemoryView":645
* 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 # <<<<<<<<<<<<<<
@@ -13084,7 +15139,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
*/
__pyx_v_result->typeinfo = __pyx_v_typeinfo;
- /* "View.MemoryView":616
+ /* "View.MemoryView":646
* cdef memoryview result = memoryview(o, flags, dtype_is_object)
* result.typeinfo = typeinfo
* return result # <<<<<<<<<<<<<<
@@ -13096,7 +15151,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":613
+ /* "View.MemoryView":643
*
* @cname('__pyx_memoryview_new')
* cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
@@ -13118,7 +15173,7 @@ static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, in
return __pyx_r;
}
-/* "View.MemoryView":619
+/* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -13132,18 +15187,18 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
int __pyx_t_1;
__Pyx_RefNannySetupContext("memoryview_check", 0);
- /* "View.MemoryView":620
+ /* "View.MemoryView":650
* @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_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
__pyx_r = __pyx_t_1;
goto __pyx_L0;
- /* "View.MemoryView":619
+ /* "View.MemoryView":649
*
* @cname('__pyx_memoryview_check')
* cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
@@ -13157,7 +15212,7 @@ static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
return __pyx_r;
}
-/* "View.MemoryView":622
+/* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -13186,12 +15241,9 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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
+ /* "View.MemoryView":657
* full slices.
* """
* if not isinstance(index, tuple): # <<<<<<<<<<<<<<
@@ -13202,49 +15254,57 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":628
+ /* "View.MemoryView":658
* """
* 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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 658, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
__pyx_v_tup = __pyx_t_3;
__pyx_t_3 = 0;
+
+ /* "View.MemoryView":657
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":630
+ /* "View.MemoryView":660
* tup = (index,)
* else:
* tup = index # <<<<<<<<<<<<<<
*
* result = []
*/
+ /*else*/ {
__Pyx_INCREF(__pyx_v_index);
__pyx_v_tup = __pyx_v_index;
}
__pyx_L3:;
- /* "View.MemoryView":632
+ /* "View.MemoryView":662
* 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_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 662, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_result = ((PyObject*)__pyx_t_3);
__pyx_t_3 = 0;
- /* "View.MemoryView":633
+ /* "View.MemoryView":663
*
* result = []
* have_slices = False # <<<<<<<<<<<<<<
@@ -13253,7 +15313,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_have_slices = 0;
- /* "View.MemoryView":634
+ /* "View.MemoryView":664
* result = []
* have_slices = False
* seen_ellipsis = False # <<<<<<<<<<<<<<
@@ -13262,7 +15322,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
*/
__pyx_v_seen_ellipsis = 0;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -13275,25 +15335,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 665, __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;}
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 665, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 665, __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;}
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
#endif
}
} else {
@@ -13302,7 +15364,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
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;}
+ else __PYX_ERR(2, 665, __pyx_L1_error)
}
break;
}
@@ -13312,13 +15374,13 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__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_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 665, __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
+ /* "View.MemoryView":666
* seen_ellipsis = False
* for idx, item in enumerate(tup):
* if item is Ellipsis: # <<<<<<<<<<<<<<
@@ -13329,7 +15391,7 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":637
+ /* "View.MemoryView":667
* for idx, item in enumerate(tup):
* if item is Ellipsis:
* if not seen_ellipsis: # <<<<<<<<<<<<<<
@@ -13339,27 +15401,27 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* 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_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 668, __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_ERR(2, 668, __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__21);
- PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __Pyx_INCREF(__pyx_slice__26);
+ __Pyx_GIVEREF(__pyx_slice__26);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__26);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 668, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- /* "View.MemoryView":639
+ /* "View.MemoryView":669
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1))
* seen_ellipsis = True # <<<<<<<<<<<<<<
@@ -13367,22 +15429,30 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* result.append(slice(None))
*/
__pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":667
+ * 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
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__22); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__27); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 671, __pyx_L1_error)
}
__pyx_L7:;
- /* "View.MemoryView":642
+ /* "View.MemoryView":672
* else:
* result.append(slice(None))
* have_slices = True # <<<<<<<<<<<<<<
@@ -13390,17 +15460,25 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
* if not isinstance(item, slice) and not PyIndex_Check(item):
*/
__pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":666
+ * 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))
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":644
+ /* "View.MemoryView":674
* have_slices = True
* else:
* if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
* raise TypeError("Cannot index with type '%s'" % type(item))
*
*/
+ /*else*/ {
__pyx_t_2 = PySlice_Check(__pyx_v_item);
__pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
if (__pyx_t_10) {
@@ -13413,29 +15491,37 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L9_bool_binop_done:;
if (__pyx_t_1) {
- /* "View.MemoryView":645
+ /* "View.MemoryView":675
* 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_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_ERR(2, 675, __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_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 675, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_11);
- PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7);
__Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __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_t_7 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 675, __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;}
+ __PYX_ERR(2, 675, __pyx_L1_error)
+
+ /* "View.MemoryView":674
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
}
- /* "View.MemoryView":647
+ /* "View.MemoryView":677
* raise TypeError("Cannot index with type '%s'" % type(item))
*
* have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
@@ -13454,18 +15540,18 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_L11_bool_binop_done:;
__pyx_v_have_slices = __pyx_t_1;
- /* "View.MemoryView":648
+ /* "View.MemoryView":678
*
* 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_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 678, __pyx_L1_error)
}
__pyx_L6:;
- /* "View.MemoryView":635
+ /* "View.MemoryView":665
* have_slices = False
* seen_ellipsis = False
* for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
@@ -13476,17 +15562,17 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":650
+ /* "View.MemoryView":680
* 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_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(2, 680, __pyx_L1_error)
__pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
- /* "View.MemoryView":651
+ /* "View.MemoryView":681
*
* nslices = ndim - len(result)
* if nslices: # <<<<<<<<<<<<<<
@@ -13496,29 +15582,35 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
__pyx_t_1 = (__pyx_v_nslices != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* 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_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 682, __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__23);
- PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __Pyx_INCREF(__pyx_slice__28);
+ __Pyx_GIVEREF(__pyx_slice__28);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__28);
}
}
- __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_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(2, 682, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":681
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
}
- __pyx_L13:;
- /* "View.MemoryView":654
+ /* "View.MemoryView":684
* result.extend([slice(None)] * nslices)
*
* return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
@@ -13528,32 +15620,32 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_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_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 684, __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_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __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);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __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
+ /* "View.MemoryView":652
* return isinstance(o, memoryview)
*
* cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
@@ -13579,76 +15671,83 @@ static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
return __pyx_r;
}
-/* "View.MemoryView":656
+/* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
+ Py_ssize_t __pyx_v_suboffset;
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;
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
__Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
- /* "View.MemoryView":658
+ /* "View.MemoryView":687
+ *
* cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 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;
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
- /* "View.MemoryView":659
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
* raise ValueError("Indirect dimensions not supported")
*
*/
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_4) {
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, 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;}
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 689, __pyx_L1_error)
+
+ /* "View.MemoryView":688
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
}
}
- /* "View.MemoryView":656
+ /* "View.MemoryView":686
* 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):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
*/
/* function exit code */
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
@@ -13657,7 +15756,7 @@ static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __
return __pyx_r;
}
-/* "View.MemoryView":667
+/* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -13696,12 +15795,9 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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
+ /* "View.MemoryView":697
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices):
* cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
@@ -13711,7 +15807,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_new_ndim = 0;
__pyx_v_suboffset_dim = -1;
- /* "View.MemoryView":675
+ /* "View.MemoryView":704
*
*
* memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
@@ -13720,7 +15816,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
- /* "View.MemoryView":679
+ /* "View.MemoryView":708
* cdef _memoryviewslice memviewsliceobj
*
* assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
@@ -13731,36 +15827,36 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ __PYX_ERR(2, 708, __pyx_L1_error)
}
}
#endif
- /* "View.MemoryView":681
+ /* "View.MemoryView":710
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":682
+ /* "View.MemoryView":711
*
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 711, __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
+ /* "View.MemoryView":712
* if isinstance(memview, _memoryviewslice):
* memviewsliceobj = memview
* p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
@@ -13768,20 +15864,28 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* slice_copy(memview, &src)
*/
__pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":710
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":685
+ /* "View.MemoryView":714
* p_src = &memviewsliceobj.from_slice
* else:
* slice_copy(memview, &src) # <<<<<<<<<<<<<<
* p_src = &src
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
- /* "View.MemoryView":686
+ /* "View.MemoryView":715
* else:
* slice_copy(memview, &src)
* p_src = &src # <<<<<<<<<<<<<<
@@ -13792,7 +15896,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L3:;
- /* "View.MemoryView":692
+ /* "View.MemoryView":721
*
*
* dst.memview = p_src.memview # <<<<<<<<<<<<<<
@@ -13802,7 +15906,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_4 = __pyx_v_p_src->memview;
__pyx_v_dst.memview = __pyx_t_4;
- /* "View.MemoryView":693
+ /* "View.MemoryView":722
*
* dst.memview = p_src.memview
* dst.data = p_src.data # <<<<<<<<<<<<<<
@@ -13812,7 +15916,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_5 = __pyx_v_p_src->data;
__pyx_v_dst.data = __pyx_t_5;
- /* "View.MemoryView":698
+ /* "View.MemoryView":727
*
*
* cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
@@ -13821,7 +15925,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_dst = (&__pyx_v_dst);
- /* "View.MemoryView":699
+ /* "View.MemoryView":728
*
* cdef __Pyx_memviewslice *p_dst = &dst
* cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
@@ -13830,7 +15934,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -13842,25 +15946,27 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__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_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 732, __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;}
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 732, __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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#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;}
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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_ERR(2, 732, __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;}
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 732, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
#endif
}
} else {
@@ -13869,7 +15975,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
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;}
+ else __PYX_ERR(2, 732, __pyx_L1_error)
}
break;
}
@@ -13880,7 +15986,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_v_dim = __pyx_t_6;
__pyx_t_6 = (__pyx_t_6 + 1);
- /* "View.MemoryView":704
+ /* "View.MemoryView":733
*
* for dim, index in enumerate(indices):
* if PyIndex_Check(index): # <<<<<<<<<<<<<<
@@ -13890,27 +15996,35 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":708
+ /* "View.MemoryView":737
* 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;}
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 737, __pyx_L1_error)
- /* "View.MemoryView":705
+ /* "View.MemoryView":734
* 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;}
+ __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_ERR(2, 734, __pyx_L1_error)
+
+ /* "View.MemoryView":733
+ *
+ * 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],
+ */
goto __pyx_L6;
}
- /* "View.MemoryView":711
+ /* "View.MemoryView":740
* 0, 0, 0, # have_{start,stop,step}
* False)
* elif index is None: # <<<<<<<<<<<<<<
@@ -13921,7 +16035,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_t_1 = (__pyx_t_2 != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":712
+ /* "View.MemoryView":741
* False)
* elif index is None:
* p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
@@ -13930,7 +16044,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
- /* "View.MemoryView":713
+ /* "View.MemoryView":742
* elif index is None:
* p_dst.shape[new_ndim] = 1
* p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
@@ -13939,16 +16053,16 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
(__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
- /* "View.MemoryView":714
+ /* "View.MemoryView":743
* 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;
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
- /* "View.MemoryView":715
+ /* "View.MemoryView":744
* p_dst.strides[new_ndim] = 0
* p_dst.suboffsets[new_ndim] = -1
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -13956,24 +16070,32 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
* start = index.start or 0
*/
__pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":740
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":717
+ /* "View.MemoryView":746
* 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;}
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 746, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 746, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L7_bool_binop_done;
@@ -13982,20 +16104,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L7_bool_binop_done:;
__pyx_v_start = __pyx_t_10;
- /* "View.MemoryView":718
+ /* "View.MemoryView":747
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 747, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 747, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 747, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L9_bool_binop_done;
@@ -14004,20 +16126,20 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L9_bool_binop_done:;
__pyx_v_stop = __pyx_t_10;
- /* "View.MemoryView":719
+ /* "View.MemoryView":748
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 748, __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;}
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 748, __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_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 748, __pyx_L1_error)
__pyx_t_10 = __pyx_t_12;
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
goto __pyx_L11_bool_binop_done;
@@ -14026,55 +16148,55 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
__pyx_L11_bool_binop_done:;
__pyx_v_step = __pyx_t_10;
- /* "View.MemoryView":721
+ /* "View.MemoryView":750
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 750, __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
+ /* "View.MemoryView":751
*
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 751, __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
+ /* "View.MemoryView":752
* 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_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 752, __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
+ /* "View.MemoryView":754
* 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;}
+ __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_ERR(2, 754, __pyx_L1_error)
- /* "View.MemoryView":731
+ /* "View.MemoryView":760
* have_start, have_stop, have_step,
* True)
* new_ndim += 1 # <<<<<<<<<<<<<<
@@ -14085,7 +16207,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__pyx_L6:;
- /* "View.MemoryView":703
+ /* "View.MemoryView":732
* cdef bint have_start, have_stop, have_step
*
* for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
@@ -14095,18 +16217,18 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- /* "View.MemoryView":733
+ /* "View.MemoryView":762
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* if isinstance(memview, _memoryviewslice):
* return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
@@ -14115,73 +16237,81 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
*/
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":735
+ /* "View.MemoryView":764
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 764, __pyx_L1_error) }
- /* "View.MemoryView":736
+ /* "View.MemoryView":765
* 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;} }
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 765, __pyx_L1_error) }
- /* "View.MemoryView":734
+ /* "View.MemoryView":763
*
* 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_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_ERR(2, 763, __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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 763, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":762
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
}
- /*else*/ {
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* memview.dtype_is_object)
* else:
* return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
* memview.dtype_is_object)
*
*/
+ /*else*/ {
__Pyx_XDECREF(((PyObject *)__pyx_r));
- /* "View.MemoryView":740
+ /* "View.MemoryView":769
* 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_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_ERR(2, 768, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- /* "View.MemoryView":739
+ /* "View.MemoryView":768
* 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;}
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 768, __pyx_L1_error)
__pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":667
+ /* "View.MemoryView":696
*
* @cname('__pyx_memview_slice')
* cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
@@ -14203,7 +16333,7 @@ static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_
return __pyx_r;
}
-/* "View.MemoryView":764
+/* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -14218,11 +16348,8 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
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
+ /* "View.MemoryView":813
* cdef bint negative_step
*
* if not is_slice: # <<<<<<<<<<<<<<
@@ -14232,7 +16359,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":786
+ /* "View.MemoryView":815
* if not is_slice:
*
* if start < 0: # <<<<<<<<<<<<<<
@@ -14242,7 +16369,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_1 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":787
+ /* "View.MemoryView":816
*
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -14250,11 +16377,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
+
+ /* "View.MemoryView":815
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
}
- __pyx_L4:;
- /* "View.MemoryView":788
+ /* "View.MemoryView":817
* if start < 0:
* start += shape
* if not 0 <= start < shape: # <<<<<<<<<<<<<<
@@ -14268,28 +16401,42 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":789
+ /* "View.MemoryView":818
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 818, __pyx_L1_error)
+
+ /* "View.MemoryView":817
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
}
- __pyx_L5:;
+
+ /* "View.MemoryView":813
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":792
+ /* "View.MemoryView":821
* else:
*
* negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
*
* if have_step and step == 0:
*/
+ /*else*/ {
__pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
if (__pyx_t_1) {
} else {
@@ -14301,7 +16448,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L6_bool_binop_done:;
__pyx_v_negative_step = __pyx_t_2;
- /* "View.MemoryView":794
+ /* "View.MemoryView":823
* negative_step = have_step != 0 and step < 0
*
* if have_step and step == 0: # <<<<<<<<<<<<<<
@@ -14319,19 +16466,25 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_L9_bool_binop_done:;
if (__pyx_t_2) {
- /* "View.MemoryView":795
+ /* "View.MemoryView":824
*
* 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_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 824, __pyx_L1_error)
+
+ /* "View.MemoryView":823
+ * 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_L8:;
- /* "View.MemoryView":798
+ /* "View.MemoryView":827
*
*
* if have_start: # <<<<<<<<<<<<<<
@@ -14341,7 +16494,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_start != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":799
+ /* "View.MemoryView":828
*
* if have_start:
* if start < 0: # <<<<<<<<<<<<<<
@@ -14351,7 +16504,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":800
+ /* "View.MemoryView":829
* if have_start:
* if start < 0:
* start += shape # <<<<<<<<<<<<<<
@@ -14360,7 +16513,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- /* "View.MemoryView":801
+ /* "View.MemoryView":830
* if start < 0:
* start += shape
* if start < 0: # <<<<<<<<<<<<<<
@@ -14370,7 +16523,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":802
+ /* "View.MemoryView":831
* start += shape
* if start < 0:
* start = 0 # <<<<<<<<<<<<<<
@@ -14378,13 +16531,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_start = 0;
- goto __pyx_L13;
+
+ /* "View.MemoryView":830
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
}
- __pyx_L13:;
+
+ /* "View.MemoryView":828
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
goto __pyx_L12;
}
- /* "View.MemoryView":803
+ /* "View.MemoryView":832
* if start < 0:
* start = 0
* elif start >= shape: # <<<<<<<<<<<<<<
@@ -14394,7 +16561,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":804
+ /* "View.MemoryView":833
* start = 0
* elif start >= shape:
* if negative_step: # <<<<<<<<<<<<<<
@@ -14404,7 +16571,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":805
+ /* "View.MemoryView":834
* elif start >= shape:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -14412,38 +16579,61 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = shape
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":833
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L14;
}
- /*else*/ {
- /* "View.MemoryView":807
+ /* "View.MemoryView":836
* start = shape - 1
* else:
* start = shape # <<<<<<<<<<<<<<
* else:
* if negative_step:
*/
+ /*else*/ {
__pyx_v_start = __pyx_v_shape;
}
__pyx_L14:;
- goto __pyx_L12;
+
+ /* "View.MemoryView":832
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
}
__pyx_L12:;
+
+ /* "View.MemoryView":827
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
goto __pyx_L11;
}
- /*else*/ {
- /* "View.MemoryView":809
+ /* "View.MemoryView":838
* start = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* start = shape - 1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":810
+ /* "View.MemoryView":839
* else:
* if negative_step:
* start = shape - 1 # <<<<<<<<<<<<<<
@@ -14451,24 +16641,32 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* start = 0
*/
__pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":838
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
goto __pyx_L15;
}
- /*else*/ {
- /* "View.MemoryView":812
+ /* "View.MemoryView":841
* start = shape - 1
* else:
* start = 0 # <<<<<<<<<<<<<<
*
* if have_stop:
*/
+ /*else*/ {
__pyx_v_start = 0;
}
__pyx_L15:;
}
__pyx_L11:;
- /* "View.MemoryView":814
+ /* "View.MemoryView":843
* start = 0
*
* if have_stop: # <<<<<<<<<<<<<<
@@ -14478,7 +16676,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (__pyx_v_have_stop != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":815
+ /* "View.MemoryView":844
*
* if have_stop:
* if stop < 0: # <<<<<<<<<<<<<<
@@ -14488,7 +16686,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":816
+ /* "View.MemoryView":845
* if have_stop:
* if stop < 0:
* stop += shape # <<<<<<<<<<<<<<
@@ -14497,7 +16695,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
- /* "View.MemoryView":817
+ /* "View.MemoryView":846
* if stop < 0:
* stop += shape
* if stop < 0: # <<<<<<<<<<<<<<
@@ -14507,7 +16705,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":818
+ /* "View.MemoryView":847
* stop += shape
* if stop < 0:
* stop = 0 # <<<<<<<<<<<<<<
@@ -14515,13 +16713,27 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* stop = shape
*/
__pyx_v_stop = 0;
- goto __pyx_L18;
+
+ /* "View.MemoryView":846
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
}
- __pyx_L18:;
+
+ /* "View.MemoryView":844
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
goto __pyx_L17;
}
- /* "View.MemoryView":819
+ /* "View.MemoryView":848
* if stop < 0:
* stop = 0
* elif stop > shape: # <<<<<<<<<<<<<<
@@ -14531,7 +16743,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":820
+ /* "View.MemoryView":849
* stop = 0
* elif stop > shape:
* stop = shape # <<<<<<<<<<<<<<
@@ -14539,49 +16751,72 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if negative_step:
*/
__pyx_v_stop = __pyx_v_shape;
- goto __pyx_L17;
+
+ /* "View.MemoryView":848
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
}
__pyx_L17:;
+
+ /* "View.MemoryView":843
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
goto __pyx_L16;
}
- /*else*/ {
- /* "View.MemoryView":822
+ /* "View.MemoryView":851
* stop = shape
* else:
* if negative_step: # <<<<<<<<<<<<<<
* stop = -1
* else:
*/
+ /*else*/ {
__pyx_t_2 = (__pyx_v_negative_step != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":823
+ /* "View.MemoryView":852
* else:
* if negative_step:
* stop = -1 # <<<<<<<<<<<<<<
* else:
* stop = shape
*/
- __pyx_v_stop = -1;
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":851
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
goto __pyx_L19;
}
- /*else*/ {
- /* "View.MemoryView":825
+ /* "View.MemoryView":854
* stop = -1
* else:
* stop = shape # <<<<<<<<<<<<<<
*
* if not have_step:
*/
+ /*else*/ {
__pyx_v_stop = __pyx_v_shape;
}
__pyx_L19:;
}
__pyx_L16:;
- /* "View.MemoryView":827
+ /* "View.MemoryView":856
* stop = shape
*
* if not have_step: # <<<<<<<<<<<<<<
@@ -14591,7 +16826,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":828
+ /* "View.MemoryView":857
*
* if not have_step:
* step = 1 # <<<<<<<<<<<<<<
@@ -14599,11 +16834,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_step = 1;
- goto __pyx_L20;
+
+ /* "View.MemoryView":856
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
}
- __pyx_L20:;
- /* "View.MemoryView":832
+ /* "View.MemoryView":861
*
* with cython.cdivision(True):
* new_shape = (stop - start) // step # <<<<<<<<<<<<<<
@@ -14612,7 +16853,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
__pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
- /* "View.MemoryView":834
+ /* "View.MemoryView":863
* new_shape = (stop - start) // step
*
* if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
@@ -14622,7 +16863,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":835
+ /* "View.MemoryView":864
*
* if (stop - start) - step * new_shape:
* new_shape += 1 # <<<<<<<<<<<<<<
@@ -14630,11 +16871,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* if new_shape < 0:
*/
__pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L21;
+
+ /* "View.MemoryView":863
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
}
- __pyx_L21:;
- /* "View.MemoryView":837
+ /* "View.MemoryView":866
* new_shape += 1
*
* if new_shape < 0: # <<<<<<<<<<<<<<
@@ -14644,7 +16891,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":838
+ /* "View.MemoryView":867
*
* if new_shape < 0:
* new_shape = 0 # <<<<<<<<<<<<<<
@@ -14652,11 +16899,17 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*
*/
__pyx_v_new_shape = 0;
- goto __pyx_L22;
+
+ /* "View.MemoryView":866
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
}
- __pyx_L22:;
- /* "View.MemoryView":841
+ /* "View.MemoryView":870
*
*
* dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
@@ -14665,7 +16918,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
- /* "View.MemoryView":842
+ /* "View.MemoryView":871
*
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
@@ -14674,7 +16927,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
*/
(__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
- /* "View.MemoryView":843
+ /* "View.MemoryView":872
* dst.strides[new_ndim] = stride * step
* dst.shape[new_ndim] = new_shape
* dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
@@ -14685,7 +16938,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
}
__pyx_L3:;
- /* "View.MemoryView":846
+ /* "View.MemoryView":875
*
*
* if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
@@ -14695,7 +16948,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":847
+ /* "View.MemoryView":876
*
* if suboffset_dim[0] < 0:
* dst.data += start * stride # <<<<<<<<<<<<<<
@@ -14703,23 +16956,31 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* dst.suboffsets[suboffset_dim[0]] += start * stride
*/
__pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":875
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
goto __pyx_L23;
}
- /*else*/ {
- /* "View.MemoryView":849
+ /* "View.MemoryView":878
* dst.data += start * stride
* else:
* dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
*
* if suboffset >= 0:
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":880
* dst.suboffsets[suboffset_dim[0]] += start * stride
*
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -14729,7 +16990,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":852
+ /* "View.MemoryView":881
*
* if suboffset >= 0:
* if not is_slice: # <<<<<<<<<<<<<<
@@ -14739,7 +17000,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":853
+ /* "View.MemoryView":882
* if suboffset >= 0:
* if not is_slice:
* if new_ndim == 0: # <<<<<<<<<<<<<<
@@ -14749,7 +17010,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":854
+ /* "View.MemoryView":883
* if not is_slice:
* if new_ndim == 0:
* dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
@@ -14757,39 +17018,69 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
* _err_dim(IndexError, "All dimensions preceding dimension %d "
*/
__pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":882
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
goto __pyx_L26;
}
- /*else*/ {
- /* "View.MemoryView":856
+ /* "View.MemoryView":885
* 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;}
+ /*else*/ {
+
+ /* "View.MemoryView":886
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 885, __pyx_L1_error)
}
__pyx_L26:;
+
+ /* "View.MemoryView":881
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
goto __pyx_L25;
}
- /*else*/ {
- /* "View.MemoryView":859
+ /* "View.MemoryView":888
* "must be indexed and not sliced", dim)
* else:
* suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
*
* return 0
*/
+ /*else*/ {
(__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
}
__pyx_L25:;
- goto __pyx_L24;
+
+ /* "View.MemoryView":880
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
}
- __pyx_L24:;
- /* "View.MemoryView":861
+ /* "View.MemoryView":890
* suboffset_dim[0] = new_ndim
*
* return 0 # <<<<<<<<<<<<<<
@@ -14799,7 +17090,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":764
+ /* "View.MemoryView":793
*
* @cname('__pyx_memoryview_slice_memviewslice')
* cdef int slice_memviewslice( # <<<<<<<<<<<<<<
@@ -14823,7 +17114,7 @@ static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst,
return __pyx_r;
}
-/* "View.MemoryView":867
+/* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -14843,21 +17134,18 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
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
+ /* "View.MemoryView":898
* 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;
+ __pyx_v_suboffset = -1L;
- /* "View.MemoryView":870
+ /* "View.MemoryView":899
* Py_ssize_t dim) except NULL:
* cdef Py_ssize_t shape, stride, suboffset = -1
* cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
@@ -14867,7 +17155,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_1 = __pyx_v_view->itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":873
+ /* "View.MemoryView":902
* cdef char *resultp
*
* if view.ndim == 0: # <<<<<<<<<<<<<<
@@ -14877,7 +17165,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":874
+ /* "View.MemoryView":903
*
* if view.ndim == 0:
* shape = view.len / itemsize # <<<<<<<<<<<<<<
@@ -14885,28 +17173,16 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* 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;}
+ __PYX_ERR(2, 903, __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
+ else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
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_ERR(2, 903, __pyx_L1_error)
}
__pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
- /* "View.MemoryView":875
+ /* "View.MemoryView":904
* if view.ndim == 0:
* shape = view.len / itemsize
* stride = itemsize # <<<<<<<<<<<<<<
@@ -14914,20 +17190,28 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* shape = view.shape[dim]
*/
__pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":902
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":877
+ /* "View.MemoryView":906
* stride = itemsize
* else:
* shape = view.shape[dim] # <<<<<<<<<<<<<<
* stride = view.strides[dim]
* if view.suboffsets != NULL:
*/
+ /*else*/ {
__pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
- /* "View.MemoryView":878
+ /* "View.MemoryView":907
* else:
* shape = view.shape[dim]
* stride = view.strides[dim] # <<<<<<<<<<<<<<
@@ -14936,7 +17220,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
- /* "View.MemoryView":879
+ /* "View.MemoryView":908
* shape = view.shape[dim]
* stride = view.strides[dim]
* if view.suboffsets != NULL: # <<<<<<<<<<<<<<
@@ -14946,7 +17230,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":880
+ /* "View.MemoryView":909
* stride = view.strides[dim]
* if view.suboffsets != NULL:
* suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
@@ -14954,13 +17238,19 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* if index < 0:
*/
__pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
+
+ /* "View.MemoryView":908
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
}
- __pyx_L4:;
}
__pyx_L3:;
- /* "View.MemoryView":882
+ /* "View.MemoryView":911
* suboffset = view.suboffsets[dim]
*
* if index < 0: # <<<<<<<<<<<<<<
@@ -14970,7 +17260,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":883
+ /* "View.MemoryView":912
*
* if index < 0:
* index += view.shape[dim] # <<<<<<<<<<<<<<
@@ -14979,7 +17269,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
- /* "View.MemoryView":884
+ /* "View.MemoryView":913
* if index < 0:
* index += view.shape[dim]
* if index < 0: # <<<<<<<<<<<<<<
@@ -14989,35 +17279,49 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index < 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":885
+ /* "View.MemoryView":914
* 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_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __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_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 914, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
__pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_Call(__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_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 914, __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;}
+ __PYX_ERR(2, 914, __pyx_L1_error)
+
+ /* "View.MemoryView":913
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
}
- goto __pyx_L5;
+
+ /* "View.MemoryView":911
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
}
- __pyx_L5:;
- /* "View.MemoryView":887
+ /* "View.MemoryView":916
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* if index >= shape: # <<<<<<<<<<<<<<
@@ -15027,32 +17331,40 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":888
+ /* "View.MemoryView":917
*
* 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_t_4 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 917, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_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_t_3 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 917, __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;}
+ __PYX_ERR(2, 917, __pyx_L1_error)
+
+ /* "View.MemoryView":916
+ * 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)
+ *
+ */
}
- /* "View.MemoryView":890
+ /* "View.MemoryView":919
* raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
*
* resultp = bufp + index * stride # <<<<<<<<<<<<<<
@@ -15061,7 +17373,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
*/
__pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
- /* "View.MemoryView":891
+ /* "View.MemoryView":920
*
* resultp = bufp + index * stride
* if suboffset >= 0: # <<<<<<<<<<<<<<
@@ -15071,7 +17383,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":892
+ /* "View.MemoryView":921
* resultp = bufp + index * stride
* if suboffset >= 0:
* resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
@@ -15079,11 +17391,17 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
* return resultp
*/
__pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
+
+ /* "View.MemoryView":920
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
}
- __pyx_L8:;
- /* "View.MemoryView":894
+ /* "View.MemoryView":923
* resultp = (<char **> resultp)[0] + suboffset
*
* return resultp # <<<<<<<<<<<<<<
@@ -15093,7 +17411,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
__pyx_r = __pyx_v_resultp;
goto __pyx_L0;
- /* "View.MemoryView":867
+ /* "View.MemoryView":896
*
* @cname('__pyx_pybuffer_index')
* cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
@@ -15112,7 +17430,7 @@ static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, P
return __pyx_r;
}
-/* "View.MemoryView":900
+/* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -15135,11 +17453,8 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
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
+ /* "View.MemoryView":930
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
* cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
@@ -15149,7 +17464,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
__pyx_v_ndim = __pyx_t_1;
- /* "View.MemoryView":903
+ /* "View.MemoryView":932
* cdef int ndim = memslice.memview.view.ndim
*
* cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
@@ -15159,7 +17474,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->shape;
__pyx_v_shape = __pyx_t_2;
- /* "View.MemoryView":904
+ /* "View.MemoryView":933
*
* cdef Py_ssize_t *shape = memslice.shape
* cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
@@ -15169,7 +17484,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_t_2 = __pyx_v_memslice->strides;
__pyx_v_strides = __pyx_t_2;
- /* "View.MemoryView":908
+ /* "View.MemoryView":937
*
* cdef int i, j
* for i in range(ndim / 2): # <<<<<<<<<<<<<<
@@ -15180,7 +17495,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":909
+ /* "View.MemoryView":938
* cdef int i, j
* for i in range(ndim / 2):
* j = ndim - 1 - i # <<<<<<<<<<<<<<
@@ -15189,7 +17504,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
*/
__pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
- /* "View.MemoryView":910
+ /* "View.MemoryView":939
* for i in range(ndim / 2):
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
@@ -15201,7 +17516,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
(__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
- /* "View.MemoryView":911
+ /* "View.MemoryView":940
* j = ndim - 1 - i
* strides[i], strides[j] = strides[j], strides[i]
* shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
@@ -15213,7 +17528,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
(__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
(__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
- /* "View.MemoryView":913
+ /* "View.MemoryView":942
* shape[i], shape[j] = shape[j], shape[i]
*
* if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
@@ -15231,20 +17546,26 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_L6_bool_binop_done:;
if (__pyx_t_6) {
- /* "View.MemoryView":914
+ /* "View.MemoryView":943
*
* 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_t_8 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(2, 943, __pyx_L1_error)
+
+ /* "View.MemoryView":942
+ * 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_L5:;
}
- /* "View.MemoryView":916
+ /* "View.MemoryView":945
* _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
*
* return 1 # <<<<<<<<<<<<<<
@@ -15254,7 +17575,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
__pyx_r = 1;
goto __pyx_L0;
- /* "View.MemoryView":900
+ /* "View.MemoryView":929
*
* @cname('__pyx_memslice_transpose')
* cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
@@ -15278,7 +17599,7 @@ static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
return __pyx_r;
}
-/* "View.MemoryView":933
+/* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -15291,17 +17612,17 @@ 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));
+ __pyx_memoryviewslice___pyx_pf_15View_dot_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) {
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__dealloc__", 0);
- /* "View.MemoryView":934
+ /* "View.MemoryView":963
*
* def __dealloc__(self):
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
@@ -15310,7 +17631,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
*/
__PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
- /* "View.MemoryView":933
+ /* "View.MemoryView":962
* cdef int (*to_dtype_func)(char *, object) except 0
*
* def __dealloc__(self): # <<<<<<<<<<<<<<
@@ -15322,7 +17643,7 @@ static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(stru
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":936
+/* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15335,12 +17656,9 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__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
+ /* "View.MemoryView":966
*
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL: # <<<<<<<<<<<<<<
@@ -15350,7 +17668,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
__pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":938
+ /* "View.MemoryView":967
* cdef convert_item_to_object(self, char *itemp):
* if self.to_object_func != NULL:
* return self.to_object_func(itemp) # <<<<<<<<<<<<<<
@@ -15358,30 +17676,38 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
* 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_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 967, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":966
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":940
+ /* "View.MemoryView":969
* 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):
*/
+ /*else*/ {
__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_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 969, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__pyx_r = __pyx_t_2;
__pyx_t_2 = 0;
goto __pyx_L0;
}
- /* "View.MemoryView":936
+ /* "View.MemoryView":965
* __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
*
* cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
@@ -15400,7 +17726,7 @@ static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memor
return __pyx_r;
}
-/* "View.MemoryView":942
+/* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15414,12 +17740,9 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
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
+ /* "View.MemoryView":972
*
* cdef assign_item_from_object(self, char *itemp, object value):
* if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
@@ -15429,32 +17752,40 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
__pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":944
+ /* "View.MemoryView":973
* 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;}
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) __PYX_ERR(2, 973, __pyx_L1_error)
+
+ /* "View.MemoryView":972
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":946
+ /* "View.MemoryView":975
* self.to_dtype_func(itemp, value)
* else:
* memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
*
- * property base:
+ * @property
*/
- __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;}
+ /*else*/ {
+ __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_ERR(2, 975, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_3);
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
}
__pyx_L3:;
- /* "View.MemoryView":942
+ /* "View.MemoryView":971
* return memoryview.convert_item_to_object(self, itemp)
*
* cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
@@ -15475,36 +17806,36 @@ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memo
return __pyx_r;
}
-/* "View.MemoryView":950
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
+/* "View.MemoryView":978
+ *
+ * @property
+ * def base(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) {
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(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));
+ __pyx_r = __pyx_pf_15View_dot_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) {
+static PyObject *__pyx_pf_15View_dot_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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":979
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
*
* __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
*/
@@ -15513,11 +17844,11 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
__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
+ /* "View.MemoryView":978
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
*
*/
@@ -15528,7 +17859,7 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
return __pyx_r;
}
-/* "View.MemoryView":957
+/* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -15538,7 +17869,8 @@ static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_
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;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
@@ -15546,16 +17878,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
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;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
__Pyx_RefNannySetupContext("memoryview_fromslice", 0);
- /* "View.MemoryView":966
- * cdef int i
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
*
* if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
* return None
@@ -15564,7 +17894,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":967
+ /* "View.MemoryView":994
*
* if <PyObject *> memviewslice.memview == Py_None:
* return None # <<<<<<<<<<<<<<
@@ -15575,35 +17905,43 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__Pyx_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;
+
+ /* "View.MemoryView":993
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
}
- /* "View.MemoryView":972
+ /* "View.MemoryView":999
*
*
* 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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 999, __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);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, 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);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
__Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __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_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 999, __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
+ /* "View.MemoryView":1001
* result = _memoryviewslice(None, 0, dtype_is_object)
*
* result.from_slice = memviewslice # <<<<<<<<<<<<<<
@@ -15612,7 +17950,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->from_slice = __pyx_v_memviewslice;
- /* "View.MemoryView":975
+ /* "View.MemoryView":1002
*
* result.from_slice = memviewslice
* __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
@@ -15621,14 +17959,14 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
- /* "View.MemoryView":977
+ /* "View.MemoryView":1004
* __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_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1004, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_result->from_object);
@@ -15636,7 +17974,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_v_result->from_object = __pyx_t_2;
__pyx_t_2 = 0;
- /* "View.MemoryView":978
+ /* "View.MemoryView":1005
*
* result.from_object = (<memoryview> memviewslice.memview).base
* result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
@@ -15646,7 +17984,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
__pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
- /* "View.MemoryView":980
+ /* "View.MemoryView":1007
* result.typeinfo = memviewslice.memview.typeinfo
*
* result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
@@ -15656,7 +17994,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_t_5 = __pyx_v_memviewslice.memview->view;
__pyx_v_result->__pyx_base.view = __pyx_t_5;
- /* "View.MemoryView":981
+ /* "View.MemoryView":1008
*
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
@@ -15665,7 +18003,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
- /* "View.MemoryView":982
+ /* "View.MemoryView":1009
* result.view = memviewslice.memview.view
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim # <<<<<<<<<<<<<<
@@ -15674,7 +18012,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
- /* "View.MemoryView":983
+ /* "View.MemoryView":1010
* result.view.buf = <void *> memviewslice.data
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
@@ -15683,7 +18021,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
- /* "View.MemoryView":984
+ /* "View.MemoryView":1011
* result.view.ndim = ndim
* (<__pyx_buffer *> &result.view).obj = Py_None
* Py_INCREF(Py_None) # <<<<<<<<<<<<<<
@@ -15692,7 +18030,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
Py_INCREF(Py_None);
- /* "View.MemoryView":986
+ /* "View.MemoryView":1013
* Py_INCREF(Py_None)
*
* result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
@@ -15701,66 +18039,128 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
- /* "View.MemoryView":988
+ /* "View.MemoryView":1015
* 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
+ /* "View.MemoryView":1016
*
* 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 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1019
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1020
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1022
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1023
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
*
* result.view.len = result.view.itemsize
*/
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+ goto __pyx_L5_break;
- /* "View.MemoryView":992
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ /* "View.MemoryView":1021
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L5_break:;
+
+ /* "View.MemoryView":1025
+ * break
*
* result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
*/
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
- /* "View.MemoryView":993
+ /* "View.MemoryView":1026
*
* result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
*
*/
- __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;
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1026, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
- /* "View.MemoryView":994
+ /* "View.MemoryView":1027
* result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
*
* 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]));
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1027, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
}
- /* "View.MemoryView":996
- * result.view.len *= result.view.shape[i]
+ /* "View.MemoryView":1029
+ * result.view.len *= length
*
* result.to_object_func = to_object_func # <<<<<<<<<<<<<<
* result.to_dtype_func = to_dtype_func
@@ -15768,7 +18168,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_object_func = __pyx_v_to_object_func;
- /* "View.MemoryView":997
+ /* "View.MemoryView":1030
*
* result.to_object_func = to_object_func
* result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
@@ -15777,7 +18177,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
*/
__pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
- /* "View.MemoryView":999
+ /* "View.MemoryView":1032
* result.to_dtype_func = to_dtype_func
*
* return result # <<<<<<<<<<<<<<
@@ -15789,7 +18189,7 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;
- /* "View.MemoryView":957
+ /* "View.MemoryView":985
*
* @cname('__pyx_memoryview_fromslice')
* cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
@@ -15805,12 +18205,13 @@ static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewsl
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
-/* "View.MemoryView":1002
+/* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -15825,36 +18226,33 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
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
+ /* "View.MemoryView":1038
* __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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1006
+ /* "View.MemoryView":1039
* 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;}
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1039, __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
+ /* "View.MemoryView":1040
* if isinstance(memview, _memoryviewslice):
* obj = memview
* return &obj.from_slice # <<<<<<<<<<<<<<
@@ -15863,19 +18261,27 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
*/
__pyx_r = (&__pyx_v_obj->from_slice);
goto __pyx_L0;
+
+ /* "View.MemoryView":1038
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
}
- /*else*/ {
- /* "View.MemoryView":1009
+ /* "View.MemoryView":1042
* return &obj.from_slice
* else:
* slice_copy(memview, mslice) # <<<<<<<<<<<<<<
* return mslice
*
*/
+ /*else*/ {
__pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
- /* "View.MemoryView":1010
+ /* "View.MemoryView":1043
* else:
* slice_copy(memview, mslice)
* return mslice # <<<<<<<<<<<<<<
@@ -15886,7 +18292,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
goto __pyx_L0;
}
- /* "View.MemoryView":1002
+ /* "View.MemoryView":1035
*
* @cname('__pyx_memoryview_get_slice_from_memoryview')
* cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
@@ -15897,7 +18303,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
/* 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_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF((PyObject *)__pyx_v_obj);
@@ -15905,7 +18311,7 @@ static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __p
return __pyx_r;
}
-/* "View.MemoryView":1013
+/* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -15922,10 +18328,10 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
Py_ssize_t *__pyx_t_1;
int __pyx_t_2;
int __pyx_t_3;
- int __pyx_t_4;
+ Py_ssize_t __pyx_t_4;
__Pyx_RefNannySetupContext("slice_copy", 0);
- /* "View.MemoryView":1017
+ /* "View.MemoryView":1050
* cdef (Py_ssize_t*) shape, strides, suboffsets
*
* shape = memview.view.shape # <<<<<<<<<<<<<<
@@ -15935,7 +18341,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.shape;
__pyx_v_shape = __pyx_t_1;
- /* "View.MemoryView":1018
+ /* "View.MemoryView":1051
*
* shape = memview.view.shape
* strides = memview.view.strides # <<<<<<<<<<<<<<
@@ -15945,7 +18351,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.strides;
__pyx_v_strides = __pyx_t_1;
- /* "View.MemoryView":1019
+ /* "View.MemoryView":1052
* shape = memview.view.shape
* strides = memview.view.strides
* suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
@@ -15955,7 +18361,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__pyx_t_1 = __pyx_v_memview->view.suboffsets;
__pyx_v_suboffsets = __pyx_t_1;
- /* "View.MemoryView":1021
+ /* "View.MemoryView":1054
* suboffsets = memview.view.suboffsets
*
* dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
@@ -15964,7 +18370,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
- /* "View.MemoryView":1022
+ /* "View.MemoryView":1055
*
* dst.memview = <__pyx_memoryview *> memview
* dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
@@ -15973,7 +18379,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
*/
__pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
- /* "View.MemoryView":1024
+ /* "View.MemoryView":1057
* dst.data = <char *> memview.view.buf
*
* for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
@@ -15984,59 +18390,40 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_dim = __pyx_t_3;
- /* "View.MemoryView":1025
+ /* "View.MemoryView":1058
*
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
* dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
*/
(__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
- /* "View.MemoryView":1026
+ /* "View.MemoryView":1059
* for dim in range(memview.view.ndim):
* dst.shape[dim] = shape[dim]
* dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
*/
(__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
- /* "View.MemoryView":1027
+ /* "View.MemoryView":1060
* 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] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_object')
*/
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_4 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_4 = -1L;
}
- __pyx_L5:;
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_4;
}
- /* "View.MemoryView":1013
+ /* "View.MemoryView":1046
*
* @cname('__pyx_memoryview_slice_copy')
* cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
@@ -16048,7 +18435,7 @@ static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_mem
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1033
+/* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -16061,12 +18448,9 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
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
+ /* "View.MemoryView":1066
* "Create a new memoryview object"
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -16075,7 +18459,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
*/
__pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
- /* "View.MemoryView":1037
+ /* "View.MemoryView":1067
* cdef __Pyx_memviewslice memviewslice
* slice_copy(memview, &memviewslice)
* return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
@@ -16083,13 +18467,13 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
* @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_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1067, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__pyx_r = __pyx_t_1;
__pyx_t_1 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1033
+ /* "View.MemoryView":1063
*
* @cname('__pyx_memoryview_copy_object')
* cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
@@ -16108,7 +18492,7 @@ static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx
return __pyx_r;
}
-/* "View.MemoryView":1040
+/* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -16126,23 +18510,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
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
+ /* "View.MemoryView":1077
* 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_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
__pyx_t_2 = (__pyx_t_1 != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1048
+ /* "View.MemoryView":1078
*
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
@@ -16152,7 +18533,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
__pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
__pyx_v_to_object_func = __pyx_t_3;
- /* "View.MemoryView":1049
+ /* "View.MemoryView":1079
* if isinstance(memview, _memoryviewslice):
* to_object_func = (<_memoryviewslice> memview).to_object_func
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
@@ -16161,20 +18542,28 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
__pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1077
+ * 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
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1051
+ /* "View.MemoryView":1081
* to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
* else:
* to_object_func = NULL # <<<<<<<<<<<<<<
* to_dtype_func = NULL
*
*/
+ /*else*/ {
__pyx_v_to_object_func = NULL;
- /* "View.MemoryView":1052
+ /* "View.MemoryView":1082
* else:
* to_object_func = NULL
* to_dtype_func = NULL # <<<<<<<<<<<<<<
@@ -16185,7 +18574,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
}
__pyx_L3:;
- /* "View.MemoryView":1054
+ /* "View.MemoryView":1084
* to_dtype_func = NULL
*
* return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
@@ -16194,20 +18583,20 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
*/
__Pyx_XDECREF(__pyx_r);
- /* "View.MemoryView":1056
+ /* "View.MemoryView":1086
* 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_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_ERR(2, 1084, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_5);
__pyx_r = __pyx_t_5;
__pyx_t_5 = 0;
goto __pyx_L0;
- /* "View.MemoryView":1040
+ /* "View.MemoryView":1070
*
* @cname('__pyx_memoryview_copy_object_from_slice')
* cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
@@ -16226,7 +18615,7 @@ static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview
return __pyx_r;
}
-/* "View.MemoryView":1062
+/* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -16238,7 +18627,7 @@ 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
+ /* "View.MemoryView":1093
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0: # <<<<<<<<<<<<<<
@@ -16248,7 +18637,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
__pyx_t_1 = ((__pyx_v_arg < 0) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1064
+ /* "View.MemoryView":1094
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
* if arg < 0:
* return -arg # <<<<<<<<<<<<<<
@@ -16257,21 +18646,29 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
*/
__pyx_r = (-__pyx_v_arg);
goto __pyx_L0;
+
+ /* "View.MemoryView":1093
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1066
+ /* "View.MemoryView":1096
* return -arg
* else:
* return arg # <<<<<<<<<<<<<<
*
* @cname('__pyx_get_best_slice_order')
*/
+ /*else*/ {
__pyx_r = __pyx_v_arg;
goto __pyx_L0;
}
- /* "View.MemoryView":1062
+ /* "View.MemoryView":1092
*
*
* cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
@@ -16284,7 +18681,7 @@ static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
return __pyx_r;
}
-/* "View.MemoryView":1069
+/* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -16301,7 +18698,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1074
+ /* "View.MemoryView":1104
* """
* cdef int i
* cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
@@ -16310,7 +18707,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = 0;
- /* "View.MemoryView":1075
+ /* "View.MemoryView":1105
* cdef int i
* cdef Py_ssize_t c_stride = 0
* cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
@@ -16319,17 +18716,17 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = 0;
- /* "View.MemoryView":1077
+ /* "View.MemoryView":1107
* 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) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1078
+ /* "View.MemoryView":1108
*
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -16339,7 +18736,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1079
+ /* "View.MemoryView":1109
* for i in range(ndim - 1, -1, -1):
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -16348,7 +18745,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1080
+ /* "View.MemoryView":1110
* if mslice.shape[i] > 1:
* c_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -16356,11 +18753,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* for i in range(ndim):
*/
goto __pyx_L4_break;
+
+ /* "View.MemoryView":1108
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L4_break:;
- /* "View.MemoryView":1082
+ /* "View.MemoryView":1112
* break
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -16371,7 +18776,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1083
+ /* "View.MemoryView":1113
*
* for i in range(ndim):
* if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
@@ -16381,7 +18786,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1084
+ /* "View.MemoryView":1114
* for i in range(ndim):
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
@@ -16390,7 +18795,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
- /* "View.MemoryView":1085
+ /* "View.MemoryView":1115
* if mslice.shape[i] > 1:
* f_stride = mslice.strides[i]
* break # <<<<<<<<<<<<<<
@@ -16398,11 +18803,19 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
*/
goto __pyx_L7_break;
+
+ /* "View.MemoryView":1113
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
}
}
__pyx_L7_break:;
- /* "View.MemoryView":1087
+ /* "View.MemoryView":1117
* break
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
@@ -16412,7 +18825,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
__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
+ /* "View.MemoryView":1118
*
* if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
* return 'C' # <<<<<<<<<<<<<<
@@ -16421,21 +18834,29 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
*/
__pyx_r = 'C';
goto __pyx_L0;
+
+ /* "View.MemoryView":1117
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1090
+ /* "View.MemoryView":1120
* return 'C'
* else:
* return 'F' # <<<<<<<<<<<<<<
*
* @cython.cdivision(True)
*/
+ /*else*/ {
__pyx_r = 'F';
goto __pyx_L0;
}
- /* "View.MemoryView":1069
+ /* "View.MemoryView":1099
*
* @cname('__pyx_get_best_slice_order')
* cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -16448,7 +18869,7 @@ static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int _
return __pyx_r;
}
-/* "View.MemoryView":1093
+/* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -16468,7 +18889,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
Py_ssize_t __pyx_t_4;
Py_ssize_t __pyx_t_5;
- /* "View.MemoryView":1100
+ /* "View.MemoryView":1130
*
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
@@ -16477,7 +18898,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_extent = (__pyx_v_src_shape[0]);
- /* "View.MemoryView":1101
+ /* "View.MemoryView":1131
* cdef Py_ssize_t i
* cdef Py_ssize_t src_extent = src_shape[0]
* cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
@@ -16486,7 +18907,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
- /* "View.MemoryView":1102
+ /* "View.MemoryView":1132
* 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] # <<<<<<<<<<<<<<
@@ -16495,7 +18916,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_stride = (__pyx_v_src_strides[0]);
- /* "View.MemoryView":1103
+ /* "View.MemoryView":1133
* 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] # <<<<<<<<<<<<<<
@@ -16504,7 +18925,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
- /* "View.MemoryView":1105
+ /* "View.MemoryView":1135
* cdef Py_ssize_t dst_stride = dst_strides[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -16514,7 +18935,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1106
+ /* "View.MemoryView":1136
*
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
@@ -16534,7 +18955,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
goto __pyx_L5_bool_binop_done;
}
- /* "View.MemoryView":1107
+ /* "View.MemoryView":1137
* if ndim == 1:
* if (src_stride > 0 and dst_stride > 0 and
* <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
@@ -16548,9 +18969,17 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
__pyx_t_3 = (__pyx_t_2 != 0);
__pyx_t_1 = __pyx_t_3;
__pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
if (__pyx_t_1) {
- /* "View.MemoryView":1108
+ /* "View.MemoryView":1138
* 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) # <<<<<<<<<<<<<<
@@ -16558,22 +18987,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
* for i in range(dst_extent):
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
+
+ /* "View.MemoryView":1136
+ *
+ * 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)
+ */
goto __pyx_L4;
}
- /*else*/ {
- /* "View.MemoryView":1110
+ /* "View.MemoryView":1140
* 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
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1141
* else:
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
@@ -16582,7 +19019,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
- /* "View.MemoryView":1112
+ /* "View.MemoryView":1142
* for i in range(dst_extent):
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -16591,7 +19028,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1113
+ /* "View.MemoryView":1143
* memcpy(dst_data, src_data, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -16602,22 +19039,30 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
}
__pyx_L4:;
+
+ /* "View.MemoryView":1135
+ * 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):
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1115
+ /* "View.MemoryView":1145
* 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,
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1146
* else:
* for i in range(dst_extent):
* _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
@@ -16626,7 +19071,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
_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
+ /* "View.MemoryView":1150
* src_shape + 1, dst_shape + 1,
* ndim - 1, itemsize)
* src_data += src_stride # <<<<<<<<<<<<<<
@@ -16635,7 +19080,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
*/
__pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
- /* "View.MemoryView":1121
+ /* "View.MemoryView":1151
* ndim - 1, itemsize)
* src_data += src_stride
* dst_data += dst_stride # <<<<<<<<<<<<<<
@@ -16647,7 +19092,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
}
__pyx_L3:;
- /* "View.MemoryView":1093
+ /* "View.MemoryView":1123
*
* @cython.cdivision(True)
* cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
@@ -16658,7 +19103,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
/* function exit code */
}
-/* "View.MemoryView":1123
+/* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -16668,7 +19113,7 @@ static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v
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
+ /* "View.MemoryView":1156
* __Pyx_memviewslice *dst,
* int ndim, size_t itemsize) nogil:
* _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
@@ -16677,7 +19122,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
*/
_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
+ /* "View.MemoryView":1153
* dst_data += dst_stride
*
* cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -16688,7 +19133,7 @@ static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memvi
/* function exit code */
}
-/* "View.MemoryView":1130
+/* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -16704,7 +19149,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1133
+ /* "View.MemoryView":1163
* "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 # <<<<<<<<<<<<<<
@@ -16714,7 +19159,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_size = __pyx_t_1;
- /* "View.MemoryView":1135
+ /* "View.MemoryView":1165
* cdef Py_ssize_t size = src.memview.view.itemsize
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -16725,7 +19170,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1136
+ /* "View.MemoryView":1166
*
* for i in range(ndim):
* size *= src.shape[i] # <<<<<<<<<<<<<<
@@ -16735,7 +19180,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
}
- /* "View.MemoryView":1138
+ /* "View.MemoryView":1168
* size *= src.shape[i]
*
* return size # <<<<<<<<<<<<<<
@@ -16745,7 +19190,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
__pyx_r = __pyx_v_size;
goto __pyx_L0;
- /* "View.MemoryView":1130
+ /* "View.MemoryView":1160
*
* @cname('__pyx_memoryview_slice_get_size')
* cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
@@ -16758,7 +19203,7 @@ static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_sr
return __pyx_r;
}
-/* "View.MemoryView":1141
+/* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -16773,7 +19218,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
int __pyx_t_2;
int __pyx_t_3;
- /* "View.MemoryView":1150
+ /* "View.MemoryView":1180
* cdef int idx
*
* if order == 'F': # <<<<<<<<<<<<<<
@@ -16783,7 +19228,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_t_1 = ((__pyx_v_order == 'F') != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1151
+ /* "View.MemoryView":1181
*
* if order == 'F':
* for idx in range(ndim): # <<<<<<<<<<<<<<
@@ -16794,7 +19239,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_idx = __pyx_t_3;
- /* "View.MemoryView":1152
+ /* "View.MemoryView":1182
* if order == 'F':
* for idx in range(ndim):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -16803,7 +19248,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1153
+ /* "View.MemoryView":1183
* for idx in range(ndim):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -16812,21 +19257,29 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
__pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
}
+
+ /* "View.MemoryView":1180
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1155
+ /* "View.MemoryView":1185
* 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) {
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1L; __pyx_t_2-=1) {
__pyx_v_idx = __pyx_t_2;
- /* "View.MemoryView":1156
+ /* "View.MemoryView":1186
* else:
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride # <<<<<<<<<<<<<<
@@ -16835,7 +19288,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
*/
(__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
- /* "View.MemoryView":1157
+ /* "View.MemoryView":1187
* for idx in range(ndim - 1, -1, -1):
* strides[idx] = stride
* stride = stride * shape[idx] # <<<<<<<<<<<<<<
@@ -16847,7 +19300,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
}
__pyx_L3:;
- /* "View.MemoryView":1159
+ /* "View.MemoryView":1189
* stride = stride * shape[idx]
*
* return stride # <<<<<<<<<<<<<<
@@ -16857,7 +19310,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
__pyx_r = __pyx_v_stride;
goto __pyx_L0;
- /* "View.MemoryView":1141
+ /* "View.MemoryView":1171
*
* @cname('__pyx_fill_contig_strides_array')
* cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
@@ -16870,7 +19323,7 @@ static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_
return __pyx_r;
}
-/* "View.MemoryView":1162
+/* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -16889,11 +19342,8 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
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
+ /* "View.MemoryView":1203
* cdef void *result
*
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -16903,7 +19353,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_1 = __pyx_v_src->memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1174
+ /* "View.MemoryView":1204
*
* cdef size_t itemsize = src.memview.view.itemsize
* cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
@@ -16912,7 +19362,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
- /* "View.MemoryView":1176
+ /* "View.MemoryView":1206
* cdef size_t size = slice_get_size(src, ndim)
*
* result = malloc(size) # <<<<<<<<<<<<<<
@@ -16921,7 +19371,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_result = malloc(__pyx_v_size);
- /* "View.MemoryView":1177
+ /* "View.MemoryView":1207
*
* result = malloc(size)
* if not result: # <<<<<<<<<<<<<<
@@ -16931,19 +19381,25 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1178
+ /* "View.MemoryView":1208
* 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_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(2, 1208, __pyx_L1_error)
+
+ /* "View.MemoryView":1207
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1181
+ /* "View.MemoryView":1211
*
*
* tmpslice.data = <char *> result # <<<<<<<<<<<<<<
@@ -16952,7 +19408,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__pyx_v_tmpslice->data = ((char *)__pyx_v_result);
- /* "View.MemoryView":1182
+ /* "View.MemoryView":1212
*
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview # <<<<<<<<<<<<<<
@@ -16962,7 +19418,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_4 = __pyx_v_src->memview;
__pyx_v_tmpslice->memview = __pyx_t_4;
- /* "View.MemoryView":1183
+ /* "View.MemoryView":1213
* tmpslice.data = <char *> result
* tmpslice.memview = src.memview
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -16973,7 +19429,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1184
+ /* "View.MemoryView":1214
* tmpslice.memview = src.memview
* for i in range(ndim):
* tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
@@ -16982,17 +19438,17 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
(__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
- /* "View.MemoryView":1185
+ /* "View.MemoryView":1215
* 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;
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1187
+ /* "View.MemoryView":1217
* tmpslice.suboffsets[i] = -1
*
* fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
@@ -17001,7 +19457,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
*/
__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
+ /* "View.MemoryView":1221
*
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -17012,7 +19468,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
__pyx_v_i = __pyx_t_5;
- /* "View.MemoryView":1192
+ /* "View.MemoryView":1222
*
* for i in range(ndim):
* if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -17022,53 +19478,67 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1193
+ /* "View.MemoryView":1223
* for i in range(ndim):
* if tmpslice.shape[i] == 1:
* tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], order, ndim):
*/
(__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
+
+ /* "View.MemoryView":1222
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1195
+ /* "View.MemoryView":1225
* tmpslice.strides[i] = 0
*
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * if slice_is_contig(src[0], 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1196
+ /* "View.MemoryView":1226
*
- * if slice_is_contig(src, order, ndim):
+ * if slice_is_contig(src[0], 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);
+
+ /* "View.MemoryView":1225
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
goto __pyx_L9;
}
- /*else*/ {
- /* "View.MemoryView":1198
+ /* "View.MemoryView":1228
* memcpy(result, src.data, size)
* else:
* copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
*
* return result
*/
+ /*else*/ {
copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
}
__pyx_L9:;
- /* "View.MemoryView":1200
+ /* "View.MemoryView":1230
* copy_strided_to_strided(src, tmpslice, ndim, itemsize)
*
* return result # <<<<<<<<<<<<<<
@@ -17078,7 +19548,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
__pyx_r = __pyx_v_result;
goto __pyx_L0;
- /* "View.MemoryView":1162
+ /* "View.MemoryView":1192
*
* @cname('__pyx_memoryview_copy_data_to_temp')
* cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
@@ -17102,7 +19572,7 @@ static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src,
return __pyx_r;
}
-/* "View.MemoryView":1205
+/* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -17117,62 +19587,59 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
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
+ /* "View.MemoryView":1238
* 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_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1238, __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_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1238, __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_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1238, __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_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1238, __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);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
__Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
__pyx_t_1 = 0;
__pyx_t_2 = 0;
__pyx_t_3 = 0;
- /* "View.MemoryView":1207
+ /* "View.MemoryView":1237
* 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_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
__pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1237, __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;}
+ __PYX_ERR(2, 1237, __pyx_L1_error)
- /* "View.MemoryView":1205
+ /* "View.MemoryView":1235
*
* @cname('__pyx_memoryview_err_extents')
* cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
@@ -17195,7 +19662,7 @@ static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent
return __pyx_r;
}
-/* "View.MemoryView":1211
+/* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -17211,33 +19678,30 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
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
+ /* "View.MemoryView":1242
* @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_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1242, __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_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1242, __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_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1242, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
if (likely(__pyx_t_2)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
@@ -17247,26 +19711,46 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
}
}
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_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __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_ERR(2, 1242, __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;}
+ __PYX_ERR(2, 1242, __pyx_L1_error)
- /* "View.MemoryView":1211
+ /* "View.MemoryView":1241
*
* @cname('__pyx_memoryview_err_dim')
* cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
@@ -17291,7 +19775,7 @@ static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg,
return __pyx_r;
}
-/* "View.MemoryView":1215
+/* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -17308,16 +19792,13 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
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
+ /* "View.MemoryView":1246
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil:
* if msg != NULL: # <<<<<<<<<<<<<<
@@ -17327,18 +19808,18 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
__pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1217
+ /* "View.MemoryView":1247
* 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_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1247, __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))) {
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
if (likely(__pyx_t_5)) {
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
@@ -17348,39 +19829,67 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
}
}
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_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1247, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1247, __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;}
+ __PYX_ERR(2, 1247, __pyx_L1_error)
+
+ /* "View.MemoryView":1246
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
}
- /*else*/ {
- /* "View.MemoryView":1219
+ /* "View.MemoryView":1249
* raise error(msg.decode('ascii'))
* else:
* raise error # <<<<<<<<<<<<<<
*
* @cname('__pyx_memoryview_copy_contents')
*/
+ /*else*/ {
__Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __PYX_ERR(2, 1249, __pyx_L1_error)
}
- /* "View.MemoryView":1215
+ /* "View.MemoryView":1245
*
* @cname('__pyx_memoryview_err')
* cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
@@ -17405,7 +19914,7 @@ static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
return __pyx_r;
}
-/* "View.MemoryView":1222
+/* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -17430,11 +19939,8 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
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
+ /* "View.MemoryView":1260
* Check for overlapping memory and verify the shapes.
* """
* cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
@@ -17443,7 +19949,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_tmpdata = NULL;
- /* "View.MemoryView":1231
+ /* "View.MemoryView":1261
* """
* cdef void *tmpdata = NULL
* cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
@@ -17453,7 +19959,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_1 = __pyx_v_src.memview->view.itemsize;
__pyx_v_itemsize = __pyx_t_1;
- /* "View.MemoryView":1233
+ /* "View.MemoryView":1263
* cdef size_t itemsize = src.memview.view.itemsize
* cdef int i
* cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
@@ -17462,7 +19968,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
- /* "View.MemoryView":1234
+ /* "View.MemoryView":1264
* cdef int i
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False # <<<<<<<<<<<<<<
@@ -17471,7 +19977,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 0;
- /* "View.MemoryView":1235
+ /* "View.MemoryView":1265
* cdef char order = get_best_order(&src, src_ndim)
* cdef bint broadcasting = False
* cdef bint direct_copy = False # <<<<<<<<<<<<<<
@@ -17480,7 +19986,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_direct_copy = 0;
- /* "View.MemoryView":1238
+ /* "View.MemoryView":1268
* cdef __Pyx_memviewslice tmp
*
* if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
@@ -17490,7 +19996,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1239
+ /* "View.MemoryView":1269
*
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -17498,10 +20004,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* broadcast_leading(&dst, dst_ndim, src_ndim)
*/
__pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1268
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
goto __pyx_L3;
}
- /* "View.MemoryView":1240
+ /* "View.MemoryView":1270
* if src_ndim < dst_ndim:
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
@@ -17511,7 +20025,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1241
+ /* "View.MemoryView":1271
* broadcast_leading(&src, src_ndim, dst_ndim)
* elif dst_ndim < src_ndim:
* broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
@@ -17519,11 +20033,18 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* 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;
+
+ /* "View.MemoryView":1270
+ * 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_L3:;
- /* "View.MemoryView":1243
+ /* "View.MemoryView":1273
* broadcast_leading(&dst, dst_ndim, src_ndim)
*
* cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
@@ -17539,7 +20060,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
}
__pyx_v_ndim = __pyx_t_5;
- /* "View.MemoryView":1245
+ /* "View.MemoryView":1275
* cdef int ndim = max(src_ndim, dst_ndim)
*
* for i in range(ndim): # <<<<<<<<<<<<<<
@@ -17550,7 +20071,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1246
+ /* "View.MemoryView":1276
*
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
@@ -17560,7 +20081,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__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
+ /* "View.MemoryView":1277
* for i in range(ndim):
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1: # <<<<<<<<<<<<<<
@@ -17570,7 +20091,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1248
+ /* "View.MemoryView":1278
* if src.shape[i] != dst.shape[i]:
* if src.shape[i] == 1:
* broadcasting = True # <<<<<<<<<<<<<<
@@ -17579,7 +20100,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_v_broadcasting = 1;
- /* "View.MemoryView":1249
+ /* "View.MemoryView":1279
* if src.shape[i] == 1:
* broadcasting = True
* src.strides[i] = 0 # <<<<<<<<<<<<<<
@@ -17587,25 +20108,39 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* _err_extents(i, dst.shape[i], src.shape[i])
*/
(__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1277
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
goto __pyx_L7;
}
- /*else*/ {
- /* "View.MemoryView":1251
+ /* "View.MemoryView":1281
* 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;}
+ /*else*/ {
+ __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_ERR(2, 1281, __pyx_L1_error)
}
__pyx_L7:;
- goto __pyx_L6;
+
+ /* "View.MemoryView":1276
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
}
- __pyx_L6:;
- /* "View.MemoryView":1253
+ /* "View.MemoryView":1283
* _err_extents(i, dst.shape[i], src.shape[i])
*
* if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
@@ -17615,62 +20150,74 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1254
+ /* "View.MemoryView":1284
*
* 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_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(2, 1284, __pyx_L1_error)
+
+ /* "View.MemoryView":1283
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
}
- __pyx_L8:;
}
- /* "View.MemoryView":1256
+ /* "View.MemoryView":1286
* _err_dim(ValueError, "Dimension %d is not direct", i)
*
* if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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
+ /* "View.MemoryView":1288
* if slices_overlap(&src, &dst, ndim, itemsize):
*
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
+ * 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);
+ __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
+ /* "View.MemoryView":1289
*
- * if not slice_is_contig(&src, order, ndim):
+ * 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;
+
+ /* "View.MemoryView":1288
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
}
- __pyx_L10:;
- /* "View.MemoryView":1261
+ /* "View.MemoryView":1291
* 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_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_ERR(2, 1291, __pyx_L1_error)
__pyx_v_tmpdata = __pyx_t_6;
- /* "View.MemoryView":1262
+ /* "View.MemoryView":1292
*
* tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
* src = tmp # <<<<<<<<<<<<<<
@@ -17678,11 +20225,17 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
* if not broadcasting:
*/
__pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
+
+ /* "View.MemoryView":1286
+ * _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_L9:;
- /* "View.MemoryView":1264
+ /* "View.MemoryView":1294
* src = tmp
*
* if not broadcasting: # <<<<<<<<<<<<<<
@@ -17692,51 +20245,66 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1267
+ /* "View.MemoryView":1297
*
*
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
+ * 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);
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1268
+ /* "View.MemoryView":1298
*
- * 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)
+ * 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);
+
+ /* "View.MemoryView":1297
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, '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)
+ /* "View.MemoryView":1299
+ * 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);
+ __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) # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1300
+ * 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_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1299
+ * 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_L12:;
- /* "View.MemoryView":1272
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
*
* if direct_copy: # <<<<<<<<<<<<<<
*
@@ -17745,7 +20313,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_2 = (__pyx_v_direct_copy != 0);
if (__pyx_t_2) {
- /* "View.MemoryView":1274
+ /* "View.MemoryView":1304
* if direct_copy:
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -17754,7 +20322,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1275
+ /* "View.MemoryView":1305
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
@@ -17763,7 +20331,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
- /* "View.MemoryView":1276
+ /* "View.MemoryView":1306
* 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) # <<<<<<<<<<<<<<
@@ -17772,7 +20340,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1277
+ /* "View.MemoryView":1307
* memcpy(dst.data, src.data, slice_get_size(&src, ndim))
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -17781,7 +20349,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1278
+ /* "View.MemoryView":1308
* refcount_copying(&dst, dtype_is_object, ndim, True)
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -17790,12 +20358,26 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_r = 0;
goto __pyx_L0;
+
+ /* "View.MemoryView":1302
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
}
- goto __pyx_L11;
+
+ /* "View.MemoryView":1294
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L11:;
- /* "View.MemoryView":1280
+ /* "View.MemoryView":1310
* return 0
*
* if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
@@ -17809,28 +20391,34 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_t_7 = (__pyx_t_2 != 0);
if (__pyx_t_7) {
- /* "View.MemoryView":1283
+ /* "View.MemoryView":1313
*
*
* 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;}
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1313, __pyx_L1_error)
- /* "View.MemoryView":1284
+ /* "View.MemoryView":1314
*
* 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_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) __PYX_ERR(2, 1314, __pyx_L1_error)
+
+ /* "View.MemoryView":1310
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
}
- __pyx_L14:;
- /* "View.MemoryView":1286
+ /* "View.MemoryView":1316
* transpose_memslice(&dst)
*
* refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -17839,7 +20427,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1287
+ /* "View.MemoryView":1317
*
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
@@ -17848,7 +20436,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
- /* "View.MemoryView":1288
+ /* "View.MemoryView":1318
* refcount_copying(&dst, dtype_is_object, ndim, False)
* copy_strided_to_strided(&src, &dst, ndim, itemsize)
* refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -17857,7 +20445,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
__pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1290
+ /* "View.MemoryView":1320
* refcount_copying(&dst, dtype_is_object, ndim, True)
*
* free(tmpdata) # <<<<<<<<<<<<<<
@@ -17866,7 +20454,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
*/
free(__pyx_v_tmpdata);
- /* "View.MemoryView":1291
+ /* "View.MemoryView":1321
*
* free(tmpdata)
* return 0 # <<<<<<<<<<<<<<
@@ -17876,7 +20464,7 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
__pyx_r = 0;
goto __pyx_L0;
- /* "View.MemoryView":1222
+ /* "View.MemoryView":1252
*
* @cname('__pyx_memoryview_copy_contents')
* cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
@@ -17900,21 +20488,21 @@ static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_
return __pyx_r;
}
-/* "View.MemoryView":1294
+/* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* 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) {
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, 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
+ /* "View.MemoryView":1328
* int ndim_other) nogil:
* cdef int i
* cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
@@ -17923,87 +20511,87 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
*/
__pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
- /* "View.MemoryView":1300
+ /* "View.MemoryView":1330
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
*/
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1L; __pyx_t_1-=1) {
__pyx_v_i = __pyx_t_1;
- /* "View.MemoryView":1301
+ /* "View.MemoryView":1331
*
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*/
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
- /* "View.MemoryView":1302
+ /* "View.MemoryView":1332
* 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]
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
*/
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->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] # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1333
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
*
* for i in range(offset):
*/
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
}
- /* "View.MemoryView":1305
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
+ /* "View.MemoryView":1335
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
*
* for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.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
+ /* "View.MemoryView":1336
*
* for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
*/
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
- /* "View.MemoryView":1307
+ /* "View.MemoryView":1337
* for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
*
*/
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
- /* "View.MemoryView":1308
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ /* "View.MemoryView":1338
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
*
*
*/
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
}
- /* "View.MemoryView":1294
+ /* "View.MemoryView":1324
*
* @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
* int ndim,
* int ndim_other) nogil:
*/
@@ -18011,7 +20599,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
/* function exit code */
}
-/* "View.MemoryView":1316
+/* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -18022,7 +20610,7 @@ static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice
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
+ /* "View.MemoryView":1350
*
*
* if dtype_is_object: # <<<<<<<<<<<<<<
@@ -18032,7 +20620,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
__pyx_t_1 = (__pyx_v_dtype_is_object != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1321
+ /* "View.MemoryView":1351
*
* if dtype_is_object:
* refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
@@ -18040,11 +20628,17 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
*
*/
__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;
+
+ /* "View.MemoryView":1350
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
}
- __pyx_L3:;
- /* "View.MemoryView":1316
+ /* "View.MemoryView":1346
*
* @cname('__pyx_memoryview_refcount_copying')
* cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
@@ -18055,7 +20649,7 @@ static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, i
/* function exit code */
}
-/* "View.MemoryView":1325
+/* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18070,7 +20664,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
__Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
- /* "View.MemoryView":1328
+ /* "View.MemoryView":1358
* Py_ssize_t *strides, int ndim,
* bint inc) with gil:
* refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
@@ -18079,7 +20673,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
*/
__pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
- /* "View.MemoryView":1325
+ /* "View.MemoryView":1355
*
* @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
* cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18094,7 +20688,7 @@ static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_da
#endif
}
-/* "View.MemoryView":1331
+/* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18110,7 +20704,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
int __pyx_t_3;
__Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
- /* "View.MemoryView":1335
+ /* "View.MemoryView":1365
* cdef Py_ssize_t i
*
* for i in range(shape[0]): # <<<<<<<<<<<<<<
@@ -18121,7 +20715,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
__pyx_v_i = __pyx_t_2;
- /* "View.MemoryView":1336
+ /* "View.MemoryView":1366
*
* for i in range(shape[0]):
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -18131,7 +20725,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1337
+ /* "View.MemoryView":1367
* for i in range(shape[0]):
* if ndim == 1:
* if inc: # <<<<<<<<<<<<<<
@@ -18141,7 +20735,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_t_3 = (__pyx_v_inc != 0);
if (__pyx_t_3) {
- /* "View.MemoryView":1338
+ /* "View.MemoryView":1368
* if ndim == 1:
* if inc:
* Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
@@ -18149,36 +20743,60 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
* Py_DECREF((<PyObject **> data)[0])
*/
Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1367
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
goto __pyx_L6;
}
- /*else*/ {
- /* "View.MemoryView":1340
+ /* "View.MemoryView":1370
* Py_INCREF((<PyObject **> data)[0])
* else:
* Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1,
*/
+ /*else*/ {
Py_DECREF((((PyObject **)__pyx_v_data)[0]));
}
__pyx_L6:;
+
+ /* "View.MemoryView":1366
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
goto __pyx_L5;
}
- /*else*/ {
- /* "View.MemoryView":1342
+ /* "View.MemoryView":1372
* Py_DECREF((<PyObject **> data)[0])
* else:
* refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
* ndim - 1, inc)
*
*/
+ /*else*/ {
+
+ /* "View.MemoryView":1373
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
__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
+ /* "View.MemoryView":1375
* ndim - 1, inc)
*
* data += strides[0] # <<<<<<<<<<<<<<
@@ -18188,7 +20806,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
}
- /* "View.MemoryView":1331
+ /* "View.MemoryView":1361
*
* @cname('__pyx_memoryview_refcount_objects_in_slice')
* cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18200,7 +20818,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
__Pyx_RefNannyFinishContext();
}
-/* "View.MemoryView":1351
+/* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -18210,7 +20828,7 @@ static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ss
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
+ /* "View.MemoryView":1384
* size_t itemsize, void *item,
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
@@ -18219,7 +20837,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
- /* "View.MemoryView":1355
+ /* "View.MemoryView":1385
* bint dtype_is_object) nogil:
* refcount_copying(dst, dtype_is_object, ndim, False)
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
@@ -18228,7 +20846,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__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
+ /* "View.MemoryView":1387
* _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
* itemsize, item)
* refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
@@ -18237,7 +20855,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
*/
__pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
- /* "View.MemoryView":1351
+ /* "View.MemoryView":1381
*
* @cname('__pyx_memoryview_slice_assign_scalar')
* cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
@@ -18248,7 +20866,7 @@ static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst
/* function exit code */
}
-/* "View.MemoryView":1361
+/* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18264,7 +20882,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
Py_ssize_t __pyx_t_2;
Py_ssize_t __pyx_t_3;
- /* "View.MemoryView":1365
+ /* "View.MemoryView":1395
* size_t itemsize, void *item) nogil:
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
@@ -18273,7 +20891,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_stride = (__pyx_v_strides[0]);
- /* "View.MemoryView":1366
+ /* "View.MemoryView":1396
* cdef Py_ssize_t i
* cdef Py_ssize_t stride = strides[0]
* cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
@@ -18282,7 +20900,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_extent = (__pyx_v_shape[0]);
- /* "View.MemoryView":1368
+ /* "View.MemoryView":1398
* cdef Py_ssize_t extent = shape[0]
*
* if ndim == 1: # <<<<<<<<<<<<<<
@@ -18292,7 +20910,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
__pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
if (__pyx_t_1) {
- /* "View.MemoryView":1369
+ /* "View.MemoryView":1399
*
* if ndim == 1:
* for i in range(extent): # <<<<<<<<<<<<<<
@@ -18303,7 +20921,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
__pyx_v_i = __pyx_t_3;
- /* "View.MemoryView":1370
+ /* "View.MemoryView":1400
* if ndim == 1:
* for i in range(extent):
* memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
@@ -18312,7 +20930,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
- /* "View.MemoryView":1371
+ /* "View.MemoryView":1401
* for i in range(extent):
* memcpy(data, item, itemsize)
* data += stride # <<<<<<<<<<<<<<
@@ -18321,22 +20939,30 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__pyx_v_data = (__pyx_v_data + __pyx_v_stride);
}
+
+ /* "View.MemoryView":1398
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
goto __pyx_L3;
}
- /*else*/ {
- /* "View.MemoryView":1373
+ /* "View.MemoryView":1403
* data += stride
* else:
* for i in range(extent): # <<<<<<<<<<<<<<
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
*/
+ /*else*/ {
__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
+ /* "View.MemoryView":1404
* else:
* for i in range(extent):
* _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
@@ -18345,7 +20971,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
*/
__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
+ /* "View.MemoryView":1406
* _slice_assign_scalar(data, shape + 1, strides + 1,
* ndim - 1, itemsize, item)
* data += stride # <<<<<<<<<<<<<<
@@ -18357,7 +20983,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
}
__pyx_L3:;
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -18367,6 +20993,7 @@ static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t
/* function exit code */
}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_array_obj *p;
@@ -18378,12 +21005,14 @@ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
}
if (unlikely(!o)) return 0;
p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
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;
- }
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_array(PyObject *o) {
@@ -18434,7 +21063,7 @@ static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
}
static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
}
static PyMethodDef __pyx_methods_array[] = {
@@ -18443,7 +21072,7 @@ static PyMethodDef __pyx_methods_array[] = {
};
static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -18494,8 +21123,9 @@ static PyTypeObject __pyx_type___pyx_array = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
0, /*tp_repr*/
0, /*tp_as_number*/
@@ -18599,8 +21229,9 @@ static PyTypeObject __pyx_type___pyx_MemviewEnum = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_MemviewEnum___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -18661,10 +21292,11 @@ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject
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;
- }
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
}
static void __pyx_tp_dealloc_memoryview(PyObject *o) {
@@ -18742,39 +21374,39 @@ static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject
}
static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
}
static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
}
static PyMethodDef __pyx_methods_memoryview[] = {
@@ -18786,15 +21418,15 @@ static PyMethodDef __pyx_methods_memoryview[] = {
};
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},
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -18845,8 +21477,9 @@ static PyTypeObject __pyx_type___pyx_memoryview = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
__pyx_memoryview___repr__, /*tp_repr*/
0, /*tp_as_number*/
@@ -18946,7 +21579,7 @@ static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
}
static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
}
static PyMethodDef __pyx_methods__memoryviewslice[] = {
@@ -18954,7 +21587,7 @@ static PyMethodDef __pyx_methods__memoryviewslice[] = {
};
static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
{0, 0, 0, 0, 0}
};
@@ -18969,8 +21602,9 @@ static PyTypeObject __pyx_type___pyx_memoryviewslice = {
0, /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
0, /*tp_compare*/
- #else
- 0, /*reserved*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
#endif
#if CYTHON_COMPILING_IN_PYPY
__pyx_memoryview___repr__, /*tp_repr*/
@@ -19047,6 +21681,7 @@ static struct PyModuleDef __pyx_moduledef = {
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_kp_s_02_05_2017, __pyx_k_02_05_2017, sizeof(__pyx_k_02_05_2017), 0, 0, 1, 0},
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 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_n_s_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 0, 1, 1},
{&__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},
@@ -19056,6 +21691,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_H_Payno, __pyx_k_H_Payno, sizeof(__pyx_k_H_Payno), 0, 0, 1, 0},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
{&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
{&__pyx_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_data_shape_Dimemsion_of, __pyx_k_Invalid_data_shape_Dimemsion_of, sizeof(__pyx_k_Invalid_data_shape_Dimemsion_of), 0, 0, 1, 0},
@@ -19063,12 +21699,14 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_J_Kieffer, __pyx_k_J_Kieffer, sizeof(__pyx_k_J_Kieffer), 0, 0, 1, 0},
{&__pyx_n_s_MIT, __pyx_k_MIT, sizeof(__pyx_k_MIT), 0, 0, 1, 1},
+ {&__pyx_n_s_MODES, __pyx_k_MODES, sizeof(__pyx_k_MODES), 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_kp_s_Requested_mode_s_is_unknowed, __pyx_k_Requested_mode_s_is_unknowed, sizeof(__pyx_k_Requested_mode_s_is_unknowed), 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},
@@ -19089,7 +21727,9 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 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_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
{&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_err, __pyx_k_err, sizeof(__pyx_k_err), 0, 0, 1, 1},
{&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
{&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
{&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
@@ -19102,6 +21742,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_image, __pyx_k_image, sizeof(__pyx_k_image), 0, 0, 1, 1},
{&__pyx_n_s_image_dim, __pyx_k_image_dim, sizeof(__pyx_k_image_dim), 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_buffer, __pyx_k_input_buffer, sizeof(__pyx_k_input_buffer), 0, 0, 1, 1},
{&__pyx_kp_s_input_buffer_and_output_buffer_m, __pyx_k_input_buffer_and_output_buffer_m, sizeof(__pyx_k_input_buffer_and_output_buffer_m), 0, 0, 1, 0},
{&__pyx_kp_s_input_buffer_and_output_buffer_m_2, __pyx_k_input_buffer_and_output_buffer_m_2, sizeof(__pyx_k_input_buffer_and_output_buffer_m_2), 0, 0, 1, 0},
@@ -19114,6 +21755,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_ker_dim, __pyx_k_ker_dim, sizeof(__pyx_k_ker_dim), 0, 0, 1, 1},
{&__pyx_n_s_kernel_size, __pyx_k_kernel_size, sizeof(__pyx_k_kernel_size), 0, 0, 1, 1},
+ {&__pyx_n_s_length_max, __pyx_k_length_max, sizeof(__pyx_k_length_max), 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_medfilt, __pyx_k_medfilt, sizeof(__pyx_k_medfilt), 0, 0, 1, 1},
@@ -19129,13 +21771,17 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_n_s_median_filter_uint32, __pyx_k_median_filter_uint32, sizeof(__pyx_k_median_filter_uint32), 0, 0, 1, 1},
{&__pyx_n_s_median_filter_uint64, __pyx_k_median_filter_uint64, sizeof(__pyx_k_median_filter_uint64), 0, 0, 1, 1},
{&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_mirror, __pyx_k_mirror, sizeof(__pyx_k_mirror), 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_nearest, __pyx_k_nearest, sizeof(__pyx_k_nearest), 0, 0, 1, 1},
{&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
+ {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
{&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
{&__pyx_n_s_output_buffer, __pyx_k_output_buffer, sizeof(__pyx_k_output_buffer), 0, 0, 1, 1},
{&__pyx_kp_s_output_buffer_dimension_must_mo, __pyx_k_output_buffer_dimension_must_mo, sizeof(__pyx_k_output_buffer_dimension_must_mo), 0, 0, 1, 0},
@@ -19144,10 +21790,12 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_reflect, __pyx_k_reflect, sizeof(__pyx_k_reflect), 0, 0, 1, 1},
{&__pyx_n_s_reshape, __pyx_k_reshape, sizeof(__pyx_k_reshape), 0, 0, 1, 1},
{&__pyx_n_s_reshaped, __pyx_k_reshaped, sizeof(__pyx_k_reshaped), 0, 0, 1, 1},
{&__pyx_kp_s_s_type_is_not_managed_by_the_me, __pyx_k_s_type_is_not_managed_by_the_me, sizeof(__pyx_k_s_type_is_not_managed_by_the_me), 0, 0, 1, 0},
{&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_shrink, __pyx_k_shrink, sizeof(__pyx_k_shrink), 0, 0, 1, 1},
{&__pyx_n_s_silx_math_medianfilter_medianfil, __pyx_k_silx_math_medianfilter_medianfil, sizeof(__pyx_k_silx_math_medianfilter_medianfil), 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},
@@ -19165,27 +21813,22 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__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_users_payno_Documents_dev_esrf, __pyx_k_users_payno_Documents_dev_esrf, sizeof(__pyx_k_users_payno_Documents_dev_esrf), 0, 0, 1, 0},
- {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
- {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
+ {&__pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_k_users_kieffer_workspace_400_rel, sizeof(__pyx_k_users_kieffer_workspace_400_rel), 0, 0, 1, 0},
+ {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
{&__pyx_n_s_zeros_like, __pyx_k_zeros_like, sizeof(__pyx_k_zeros_like), 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[0]; __pyx_lineno = 101; __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;}
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 102, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 231, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 799, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 989, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 146, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 149, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 396, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 425, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 599, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 818, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -19195,468 +21838,548 @@ static int __Pyx_InitCachedConstants(void) {
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
- /* "silx/math/medianfilter/medianfilter.pyx":101
+ /* "silx/math/medianfilter/medianfilter.pyx":109
* reshaped = True
* elif len(data.shape) > 2:
* raise ValueError("Invalid data shape. Dimemsion of the arary should be 1 or 2") # <<<<<<<<<<<<<<
*
* # simple median filter apply into a 2D buffer
*/
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Invalid_data_shape_Dimemsion_of); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Invalid_data_shape_Dimemsion_of); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 109, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple_);
__Pyx_GIVEREF(__pyx_tuple_);
- /* "silx/math/medianfilter/medianfilter.pyx":150
+ /* "silx/math/medianfilter/medianfilter.pyx":159
* """
* if (input_buffer.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<input_buffer> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if (output_buffer.flags['C_CONTIGUOUS'] is False):
*/
- __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_must_be_a_C_CONTIG); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_must_be_a_C_CONTIG); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 159, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__2);
__Pyx_GIVEREF(__pyx_tuple__2);
- /* "silx/math/medianfilter/medianfilter.pyx":153
+ /* "silx/math/medianfilter/medianfilter.pyx":162
*
* if (output_buffer.flags['C_CONTIGUOUS'] is False):
* raise ValueError('<output_buffer> must be a C_CONTIGUOUS numpy array.') # <<<<<<<<<<<<<<
*
* if not (len(input_buffer.shape) <= 2):
*/
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_output_buffer_must_be_a_C_CONTI); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_output_buffer_must_be_a_C_CONTI); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 162, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__3);
__Pyx_GIVEREF(__pyx_tuple__3);
- /* "silx/math/medianfilter/medianfilter.pyx":156
+ /* "silx/math/medianfilter/medianfilter.pyx":165
*
* if not (len(input_buffer.shape) <= 2):
* raise ValueError('<input_buffer> dimension must mo higher than 2.') # <<<<<<<<<<<<<<
*
* if not (len(output_buffer.shape) <= 2):
*/
- __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_dimension_must_mo); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_dimension_must_mo); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 165, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__4);
__Pyx_GIVEREF(__pyx_tuple__4);
- /* "silx/math/medianfilter/medianfilter.pyx":159
+ /* "silx/math/medianfilter/medianfilter.pyx":168
*
* if not (len(output_buffer.shape) <= 2):
* raise ValueError('<output_buffer> dimension must mo higher than 2.') # <<<<<<<<<<<<<<
*
* if not(input_buffer.dtype == output_buffer.dtype):
*/
- __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_output_buffer_dimension_must_mo); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_output_buffer_dimension_must_mo); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 168, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__5);
__Pyx_GIVEREF(__pyx_tuple__5);
- /* "silx/math/medianfilter/medianfilter.pyx":162
+ /* "silx/math/medianfilter/medianfilter.pyx":171
*
* if not(input_buffer.dtype == output_buffer.dtype):
* raise ValueError('input buffer and output_buffer must be of the same type') # <<<<<<<<<<<<<<
*
* if not (input_buffer.shape == output_buffer.shape):
*/
- __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_and_output_buffer_m); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_and_output_buffer_m); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 171, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__6);
__Pyx_GIVEREF(__pyx_tuple__6);
- /* "silx/math/medianfilter/medianfilter.pyx":165
+ /* "silx/math/medianfilter/medianfilter.pyx":174
*
* if not (input_buffer.shape == output_buffer.shape):
* raise ValueError('input buffer and output_buffer must be of the same dimension and same dimension') # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_and_output_buffer_m_2); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_input_buffer_and_output_buffer_m_2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 174, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__7);
__Pyx_GIVEREF(__pyx_tuple__7);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":215
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":218
* 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__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 218, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__8);
__Pyx_GIVEREF(__pyx_tuple__8);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":219
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":222
* 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__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 222, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__9);
__Pyx_GIVEREF(__pyx_tuple__9);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":257
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":259
* 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__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 259, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__10);
__Pyx_GIVEREF(__pyx_tuple__10);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":799
+ /* "../../../../../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__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 799, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__11);
__Pyx_GIVEREF(__pyx_tuple__11);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":803
+ /* "../../../../../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__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 803, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__12);
__Pyx_GIVEREF(__pyx_tuple__12);
- /* "../../../../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":823
+ /* "../../../../../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__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 823, __pyx_L1_error)
__Pyx_GOTREF(__pyx_tuple__13);
__Pyx_GIVEREF(__pyx_tuple__13);
- /* "View.MemoryView":127
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":989
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 989, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":995
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 995, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
+
+ /* "../../../../../usr/lib/python2.7/dist-packages/Cython/Includes/numpy/__init__.pxd":1001
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1001, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+
+ /* "View.MemoryView":131
*
* if not self.ndim:
* raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
*
* if itemsize <= 0:
*/
- __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__14);
- __Pyx_GIVEREF(__pyx_tuple__14);
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
- /* "View.MemoryView":130
+ /* "View.MemoryView":134
*
* if itemsize <= 0:
* raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
*
- * if isinstance(format, unicode):
+ * if not isinstance(format, bytes):
*/
- __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__15);
- __Pyx_GIVEREF(__pyx_tuple__15);
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
- /* "View.MemoryView":142
+ /* "View.MemoryView":137
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "View.MemoryView":146
*
* if not self._shape:
* raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__16);
- __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
- /* "View.MemoryView":170
+ /* "View.MemoryView":174
* self.data = <char *>malloc(self.len)
* if not self.data:
* raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
*
* if self.dtype_is_object:
*/
- __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__17);
- __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 174, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
- /* "View.MemoryView":186
+ /* "View.MemoryView":190
* 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__18 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__18);
- __Pyx_GIVEREF(__pyx_tuple__18);
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
- /* "View.MemoryView":445
+ /* "View.MemoryView":484
* 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__19 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__19);
- __Pyx_GIVEREF(__pyx_tuple__19);
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
- /* "View.MemoryView":521
- * if self.view.strides == NULL:
+ /* "View.MemoryView":556
+ * if self.view.strides == NULL:
*
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
*
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
*/
- __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__20);
- __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 556, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+
+ /* "View.MemoryView":563
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__25 = PyTuple_New(1); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 563, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__25, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__25);
- /* "View.MemoryView":638
+ /* "View.MemoryView":668
* if item is Ellipsis:
* if not seen_ellipsis:
* result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
* seen_ellipsis = True
* else:
*/
- __pyx_slice__21 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__21)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__21);
- __Pyx_GIVEREF(__pyx_slice__21);
+ __pyx_slice__26 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__26)) __PYX_ERR(2, 668, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__26);
+ __Pyx_GIVEREF(__pyx_slice__26);
- /* "View.MemoryView":641
+ /* "View.MemoryView":671
* seen_ellipsis = True
* else:
* result.append(slice(None)) # <<<<<<<<<<<<<<
* have_slices = True
* else:
*/
- __pyx_slice__22 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__22);
- __Pyx_GIVEREF(__pyx_slice__22);
+ __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(2, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__27);
+ __Pyx_GIVEREF(__pyx_slice__27);
- /* "View.MemoryView":652
+ /* "View.MemoryView":682
* nslices = ndim - len(result)
* if nslices:
* result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
*
* return have_slices or nslices, tuple(result)
*/
- __pyx_slice__23 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__23)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_slice__23);
- __Pyx_GIVEREF(__pyx_slice__23);
+ __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(2, 682, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__28);
+ __Pyx_GIVEREF(__pyx_slice__28);
- /* "View.MemoryView":660
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
+ /* "View.MemoryView":689
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
* raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 660; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__24);
- __Pyx_GIVEREF(__pyx_tuple__24);
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 689, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
- /* "silx/math/medianfilter/medianfilter.pyx":46
+ /* "silx/math/medianfilter/medianfilter.pyx":48
*
*
- * def medfilt1d(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_tuple__25 = PyTuple_Pack(3, __pyx_n_s_data, __pyx_n_s_kernel_size, __pyx_n_s_conditional); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__25);
- __Pyx_GIVEREF(__pyx_tuple__25);
- __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_medfilt1d, 46, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__30 = PyTuple_Pack(4, __pyx_n_s_data, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 48, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
+ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_medfilt1d, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 48, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":63
+ /* "silx/math/medianfilter/medianfilter.pyx":65
*
*
- * def medfilt2d(image, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_image, __pyx_n_s_kernel_size, __pyx_n_s_conditional); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__27);
- __Pyx_GIVEREF(__pyx_tuple__27);
- __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_medfilt2d, 63, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__32 = PyTuple_Pack(4, __pyx_n_s_image, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
+ __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_medfilt2d, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 65, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":81
+ /* "silx/math/medianfilter/medianfilter.pyx":83
*
*
- * def medfilt(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_tuple__29 = PyTuple_Pack(7, __pyx_n_s_data, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_reshaped, __pyx_n_s_output_buffer, __pyx_n_s_ker_dim, __pyx_n_s_medfilterfc); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__29);
- __Pyx_GIVEREF(__pyx_tuple__29);
- __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_medfilt, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__34 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_err, __pyx_n_s_reshaped, __pyx_n_s_output_buffer, __pyx_n_s_ker_dim, __pyx_n_s_medfilterfc); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
+ __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_medfilt, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 83, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":146
+ /* "silx/math/medianfilter/medianfilter.pyx":155
*
*
* def check(input_buffer, output_buffer): # <<<<<<<<<<<<<<
* """Simple check on the two buffers to make sure we can apply the median filter
* """
*/
- __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__31);
- __Pyx_GIVEREF(__pyx_tuple__31);
- __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_check, 146, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__36 = PyTuple_Pack(2, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 155, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
+ __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_check, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 155, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":173
+ /* "silx/math/medianfilter/medianfilter.pyx":182
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def reflect(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in reflect mode
+ *
+ */
+ __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_index, __pyx_n_s_length_max); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 182, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
+ __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_reflect, 182, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 182, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":195
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def mirror(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in mirror mode
+ *
+ */
+ __pyx_tuple__40 = PyTuple_Pack(2, __pyx_n_s_index, __pyx_n_s_length_max); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__40);
+ __Pyx_GIVEREF(__pyx_tuple__40);
+ __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_mirror, 195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 195, __pyx_L1_error)
+
+ /* "silx/math/medianfilter/medianfilter.pyx":208
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float32(float[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* float[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__33 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__33);
- __Pyx_GIVEREF(__pyx_tuple__33);
- __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_float32, 173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__42 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__42);
+ __Pyx_GIVEREF(__pyx_tuple__42);
+ __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_float32, 208, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 208, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":200
+ /* "silx/math/medianfilter/medianfilter.pyx":237
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float64(double[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* double[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__35 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__35);
- __Pyx_GIVEREF(__pyx_tuple__35);
- __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_float64, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__44 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 237, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__44);
+ __Pyx_GIVEREF(__pyx_tuple__44);
+ __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_float64, 237, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 237, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":227
+ /* "silx/math/medianfilter/medianfilter.pyx":266
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int64(cnumpy.int64_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int64_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__37 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__37);
- __Pyx_GIVEREF(__pyx_tuple__37);
- __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_int64, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__46 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__46);
+ __Pyx_GIVEREF(__pyx_tuple__46);
+ __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_int64, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) __PYX_ERR(0, 266, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":253
+ /* "silx/math/medianfilter/medianfilter.pyx":294
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint64( # <<<<<<<<<<<<<<
* cnumpy.uint64_t[:, ::1] input_buffer not None,
* cnumpy.uint64_t[:, ::1] output_buffer not None,
*/
- __pyx_tuple__39 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__39);
- __Pyx_GIVEREF(__pyx_tuple__39);
- __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_uint64, 253, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__48 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 294, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__48);
+ __Pyx_GIVEREF(__pyx_tuple__48);
+ __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_uint64, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 294, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":281
+ /* "silx/math/medianfilter/medianfilter.pyx":324
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int32_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__41 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__41);
- __Pyx_GIVEREF(__pyx_tuple__41);
- __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_int32, 281, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__50 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 324, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__50);
+ __Pyx_GIVEREF(__pyx_tuple__50);
+ __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_int32, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 324, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":308
+ /* "silx/math/medianfilter/medianfilter.pyx":353
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.uint32_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__43 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__43);
- __Pyx_GIVEREF(__pyx_tuple__43);
- __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_uint32, 308, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__52 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 353, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
+ __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_uint32, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 353, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":335
+ /* "silx/math/medianfilter/medianfilter.pyx":382
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int16(cnumpy.int16_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int16_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_tuple__45 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__45);
- __Pyx_GIVEREF(__pyx_tuple__45);
- __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_int16, 335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__54 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 382, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
+ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_int16, 382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 382, __pyx_L1_error)
- /* "silx/math/medianfilter/medianfilter.pyx":362
+ /* "silx/math/medianfilter/medianfilter.pyx":411
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint16( # <<<<<<<<<<<<<<
* cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] input_buffer not None,
* cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] output_buffer not None,
*/
- __pyx_tuple__47 = PyTuple_Pack(7, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_x, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__47);
- __Pyx_GIVEREF(__pyx_tuple__47);
- __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_payno_Documents_dev_esrf, __pyx_n_s_median_filter_uint16, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_tuple__56 = PyTuple_Pack(8, __pyx_n_s_input_buffer, __pyx_n_s_output_buffer, __pyx_n_s_kernel_size, __pyx_n_s_conditional, __pyx_n_s_mode, __pyx_n_s_y, __pyx_n_s_image_dim, __pyx_n_s_buffer_shape); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__56);
+ __Pyx_GIVEREF(__pyx_tuple__56);
+ __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_users_kieffer_workspace_400_rel, __pyx_n_s_median_filter_uint16, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 411, __pyx_L1_error)
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__49);
- __Pyx_GIVEREF(__pyx_tuple__49);
+ __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(2, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__58);
+ __Pyx_GIVEREF(__pyx_tuple__58);
- /* "View.MemoryView":277
+ /* "View.MemoryView":283
*
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
* cdef indirect = Enum("<strided and indirect>")
*
*/
- __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__50);
- __Pyx_GIVEREF(__pyx_tuple__50);
+ __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(2, 283, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__59);
+ __Pyx_GIVEREF(__pyx_tuple__59);
- /* "View.MemoryView":278
+ /* "View.MemoryView":284
* cdef generic = Enum("<strided and direct or indirect>")
* cdef strided = Enum("<strided and direct>") # default
* cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__51);
- __Pyx_GIVEREF(__pyx_tuple__51);
+ __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(2, 284, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__60);
+ __Pyx_GIVEREF(__pyx_tuple__60);
- /* "View.MemoryView":281
+ /* "View.MemoryView":287
*
*
* cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
* cdef indirect_contiguous = Enum("<contiguous and indirect>")
*
*/
- __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__52);
- __Pyx_GIVEREF(__pyx_tuple__52);
+ __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__61);
+ __Pyx_GIVEREF(__pyx_tuple__61);
- /* "View.MemoryView":282
+ /* "View.MemoryView":288
*
* cdef contiguous = Enum("<contiguous and direct>")
* cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
*
*
*/
- __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_tuple__53);
- __Pyx_GIVEREF(__pyx_tuple__53);
+ __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(2, 288, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__62);
+ __Pyx_GIVEREF(__pyx_tuple__62);
__Pyx_RefNannyFinishContext();
return 0;
__pyx_L1_error:;
@@ -19670,13 +22393,14 @@ static int __Pyx_InitGlobals(void) {
PyEval_InitThreads();
#endif
-if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
- 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_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_int_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;}
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
return 0;
__pyx_L1_error:;
return -1;
@@ -19691,9 +22415,7 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
#endif
{
PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
+ static PyThread_type_lock __pyx_t_2[8];
__Pyx_RefNannyDeclarations
#if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -19705,17 +22427,24 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
}
#endif
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_medianfilter(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;}
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
#ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __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;}
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
#ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
/*--- Library function declarations ---*/
/*--- Threads initialization code ---*/
@@ -19730,34 +22459,34 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
#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;}
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
Py_INCREF(__pyx_d);
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
#if CYTHON_COMPILING_IN_PYPY
Py_INCREF(__pyx_b);
#endif
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
/*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
#endif
if (__pyx_module_is_main_silx__math__medianfilter__medianfilter) {
- 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 (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
}
#if PY_MAJOR_VERSION >= 3
{
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
if (!PyDict_GetItemString(modules, "silx.math.medianfilter.medianfilter")) {
- if (unlikely(PyDict_SetItemString(modules, "silx.math.medianfilter.medianfilter", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (unlikely(PyDict_SetItemString(modules, "silx.math.medianfilter.medianfilter", __pyx_m) < 0)) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __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;}
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
/*--- Global init code ---*/
generic = Py_None; Py_INCREF(Py_None);
strided = Py_None; Py_INCREF(Py_None);
@@ -19767,10 +22496,13 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
/*--- 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_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 103, __pyx_L1_error)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 275, __pyx_L1_error)
__pyx_type___pyx_MemviewEnum.tp_print = 0;
__pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
__pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
@@ -19781,18 +22513,18 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
__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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 326, __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;}
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 951, __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;}
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 951, __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",
@@ -19801,15 +22533,18 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
#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;}
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 155, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 168, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 172, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 181, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 861, __pyx_L1_error)
/*--- Variable import code ---*/
/*--- Function import code ---*/
/*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
/* "silx/math/medianfilter/medianfilter.pyx":28
* """
@@ -19818,15 +22553,15 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
* __license__ = "MIT"
* __date__ = "02/05/2017"
*/
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
__Pyx_INCREF(__pyx_kp_s_H_Payno);
- PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_H_Payno);
__Pyx_GIVEREF(__pyx_kp_s_H_Payno);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_H_Payno);
__Pyx_INCREF(__pyx_kp_s_J_Kieffer);
- PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_J_Kieffer);
__Pyx_GIVEREF(__pyx_kp_s_J_Kieffer);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_s_J_Kieffer);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_authors, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/math/medianfilter/medianfilter.pyx":29
@@ -19836,7 +22571,7 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
* __date__ = "02/05/2017"
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_license, __pyx_n_s_MIT) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
/* "silx/math/medianfilter/medianfilter.pyx":30
* __authors__ = ["H. Payno", "J. Kieffer"]
@@ -19845,171 +22580,202 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
*
*
*/
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_02_05_2017) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_kp_s_02_05_2017) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
/* "silx/math/medianfilter/medianfilter.pyx":36
* cimport cython
* cimport median_filter
* import numpy # <<<<<<<<<<<<<<
* cimport numpy as cnumpy
- * cdef Py_ssize_t size = 10
+ * from libcpp cimport bool
*/
- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __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 = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":38
- * import numpy
- * cimport numpy as cnumpy
- * cdef Py_ssize_t size = 10 # <<<<<<<<<<<<<<
- * from libcpp cimport bool
+ /* "silx/math/medianfilter/medianfilter.pyx":45
+ *
+ *
+ * MODES = {'nearest':0, 'reflect':1, 'mirror':2, 'shrink':3} # <<<<<<<<<<<<<<
+ *
*
*/
- __pyx_v_4silx_4math_12medianfilter_12medianfilter_size = 10;
+ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_nearest, __pyx_int_0) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_reflect, __pyx_int_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_mirror, __pyx_int_2) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_shrink, __pyx_int_3) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_MODES, __pyx_t_1) < 0) __PYX_ERR(0, 45, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":46
+ /* "silx/math/medianfilter/medianfilter.pyx":48
*
*
- * def medfilt1d(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_1medfilt1d, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_1medfilt1d, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt1d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt1d, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":63
+ /* "silx/math/medianfilter/medianfilter.pyx":65
*
*
- * def medfilt2d(image, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_3medfilt2d, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_3medfilt2d, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt2d, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt2d, __pyx_t_1) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":81
+ /* "silx/math/medianfilter/medianfilter.pyx":83
*
*
- * def medfilt(data, kernel_size=3, bool conditional=False): # <<<<<<<<<<<<<<
+ * def medfilt(data, kernel_size=3, bool conditional=False, mode='nearest'): # <<<<<<<<<<<<<<
* """Function computing the median filter of the given input.
* Behavior at boundaries: the algorithm is reducing the size of the
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_5medfilt, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_5medfilt, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_medfilt, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":146
+ /* "silx/math/medianfilter/medianfilter.pyx":155
*
*
* def check(input_buffer, output_buffer): # <<<<<<<<<<<<<<
* """Simple check on the two buffers to make sure we can apply the median filter
* """
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_7check, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_7check, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_check, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_check, __pyx_t_1) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":173
+ /* "silx/math/medianfilter/medianfilter.pyx":182
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def reflect(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in reflect mode
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_9reflect, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_reflect, __pyx_t_1) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":195
+ * @cython.wraparound(False)
+ * @cython.initializedcheck(False)
+ * def mirror(int index, int length_max): # <<<<<<<<<<<<<<
+ * """find the correct index into [0, length_max-1] for index in mirror mode
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_11mirror, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_mirror, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "silx/math/medianfilter/medianfilter.pyx":208
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float32(float[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* float[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_9_median_filter_float32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_13_median_filter_float32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_float32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_float32, __pyx_t_1) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":200
+ /* "silx/math/medianfilter/medianfilter.pyx":237
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_float64(double[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* double[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_11_median_filter_float64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_15_median_filter_float64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_float64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_float64, __pyx_t_1) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":227
+ /* "silx/math/medianfilter/medianfilter.pyx":266
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int64(cnumpy.int64_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int64_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_13_median_filter_int64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int64, __pyx_t_1) < 0) __PYX_ERR(0, 266, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":253
+ /* "silx/math/medianfilter/medianfilter.pyx":294
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint64( # <<<<<<<<<<<<<<
* cnumpy.uint64_t[:, ::1] input_buffer not None,
* cnumpy.uint64_t[:, ::1] output_buffer not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_15_median_filter_uint64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint64, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint64, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint64, __pyx_t_1) < 0) __PYX_ERR(0, 294, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":281
+ /* "silx/math/medianfilter/medianfilter.pyx":324
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int32_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_17_median_filter_int32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int32, __pyx_t_1) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":308
+ /* "silx/math/medianfilter/medianfilter.pyx":353
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.uint32_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_19_median_filter_uint32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint32, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint32, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint32, __pyx_t_1) < 0) __PYX_ERR(0, 353, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":335
+ /* "silx/math/medianfilter/medianfilter.pyx":382
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_int16(cnumpy.int16_t[:, ::1] input_buffer not None, # <<<<<<<<<<<<<<
* cnumpy.int16_t[:, ::1] output_buffer not None,
* cnumpy.int32_t[::1] kernel_size not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_21_median_filter_int16, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_25_median_filter_int16, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_int16, __pyx_t_1) < 0) __PYX_ERR(0, 382, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "silx/math/medianfilter/medianfilter.pyx":362
+ /* "silx/math/medianfilter/medianfilter.pyx":411
* @cython.wraparound(False)
* @cython.initializedcheck(False)
* def _median_filter_uint16( # <<<<<<<<<<<<<<
* cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] input_buffer not None,
* cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] output_buffer not None,
*/
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_23_median_filter_uint16, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_4silx_4math_12medianfilter_12medianfilter_27_median_filter_uint16, NULL, __pyx_n_s_silx_math_medianfilter_medianfil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint16, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_median_filter_uint16, __pyx_t_1) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "silx/math/medianfilter/medianfilter.pyx":1
@@ -20017,121 +22783,147 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
* # /[inserted by cython to avoid comment start]*##########################################################################
* #
*/
- __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_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- /* "View.MemoryView":203
+ /* "View.MemoryView":207
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 207, __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;}
+ if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 207, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_array_type);
- /* "View.MemoryView":276
+ /* "View.MemoryView":282
* 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__49, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 282, __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
+ /* "View.MemoryView":283
*
* 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__50, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 283, __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
+ /* "View.MemoryView":284
* 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__51, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 284, __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
+ /* "View.MemoryView":287
*
*
* 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__52, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __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
+ /* "View.MemoryView":288
*
* 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__53, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 288, __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
+ /* "View.MemoryView":312
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":313
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_2[0] = PyThread_allocate_lock();
+ __pyx_t_2[1] = PyThread_allocate_lock();
+ __pyx_t_2[2] = PyThread_allocate_lock();
+ __pyx_t_2[3] = PyThread_allocate_lock();
+ __pyx_t_2[4] = PyThread_allocate_lock();
+ __pyx_t_2[5] = PyThread_allocate_lock();
+ __pyx_t_2[6] = PyThread_allocate_lock();
+ __pyx_t_2[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":535
* 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 535, __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;}
+ if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 535, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryview_type);
- /* "View.MemoryView":953
- * return self.from_object
+ /* "View.MemoryView":981
+ * 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_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 981, __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;}
+ if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 981, __pyx_L1_error)
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
PyType_Modified(__pyx_memoryviewslice_type);
- /* "View.MemoryView":1361
+ /* "View.MemoryView":1391
*
* @cname('__pyx_memoryview__slice_assign_scalar')
* cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
@@ -20161,7 +22953,8 @@ PyMODINIT_FUNC PyInit_medianfilter(void)
#endif
}
-/* Runtime support code */
+/* --- Runtime support code --- */
+/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
PyObject *m = NULL, *p = NULL;
@@ -20178,6 +22971,7 @@ end:
}
#endif
+/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
if (unlikely(!result)) {
@@ -20191,6 +22985,7 @@ static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
return result;
}
+/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name,
PyObject* kw_name)
@@ -20204,6 +22999,7 @@ static void __Pyx_RaiseDoubleKeywordsError(
#endif
}
+/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
PyObject *kwds,
PyObject **argnames[],
@@ -20305,6 +23101,7 @@ bad:
return -1;
}
+/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
@@ -20330,9 +23127,10 @@ static void __Pyx_RaiseArgtupleInvalid(
(num_expected == 1) ? "" : "s", num_found);
}
+/* GetModuleGlobalName */
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
+#if !CYTHON_AVOID_BORROWED_REFS
result = PyDict_GetItem(__pyx_d, name);
if (likely(result)) {
Py_INCREF(result);
@@ -20347,7 +23145,146 @@ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
return result;
}
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = PyThreadState_GET();
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif // CPython < 3.6
+#endif // CYTHON_FAST_PYCALL
+
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
+}
+#endif // CYTHON_FAST_PYCCALL
+
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
PyObject *result;
ternaryfunc call = func->ob_type->tp_call;
@@ -20366,88 +23303,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
}
#endif
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return NULL;
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
tmp_type = tstate->curexc_type;
tmp_value = tstate->curexc_value;
tmp_tb = tstate->curexc_traceback;
@@ -20457,27 +23316,22 @@ static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyOb
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();
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
*type = tstate->curexc_type;
*value = tstate->curexc_value;
*tb = tstate->curexc_traceback;
tstate->curexc_type = 0;
tstate->curexc_value = 0;
tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
}
+#endif
-#if PY_MAJOR_VERSION < 3
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
Py_XINCREF(type);
if (!value || value == Py_None)
value = NULL;
@@ -20516,6 +23370,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
goto raise_error;
}
}
+ __Pyx_PyThreadState_assign
__Pyx_ErrRestore(type, value, tb);
return;
raise_error:
@@ -20549,10 +23404,13 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
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 {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
}
}
}
@@ -20612,7 +23470,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
if (tb) {
#if CYTHON_COMPILING_IN_PYPY
PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyErr_Fetch(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);
@@ -20632,7 +23490,89 @@ bad:
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* GetItemInt */
+ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
PyObject *self, *result;
PyCFunction cfunc;
@@ -20651,7 +23591,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
}
#endif
-#if CYTHON_COMPILING_IN_CPYTHON
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
PyObject *result;
PyObject *args = PyTuple_New(1);
@@ -20663,6 +23604,11 @@ static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
#ifdef __Pyx_CyFunction_USED
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
@@ -20670,18 +23616,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObjec
#endif
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
}
}
return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
- PyObject* args = PyTuple_Pack(1, arg);
- return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
}
#endif
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
+/* BufferFormatCheck */
+ static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
unsigned int n = 1;
return *(unsigned char*)(&n) != 0;
}
@@ -21230,7 +24185,8 @@ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
__Pyx_ReleaseBuffer(info);
}
-static int
+/* MemviewSliceInit */
+ static int
__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
int ndim,
__Pyx_memviewslice *memviewslice,
@@ -21286,7 +24242,6 @@ no_fail:
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
@@ -21365,7 +24320,8 @@ static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
}
}
-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
+/* ArgTypeTest */
+ static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
PyErr_Format(PyExc_TypeError,
"Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
name, type->tp_name, Py_TYPE(obj)->tp_name);
@@ -21391,22 +24347,26 @@ static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, in
return 0;
}
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
PyErr_Format(PyExc_ValueError,
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
PyErr_Format(PyExc_ValueError,
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
index, (index == 1) ? "" : "s");
}
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+/* RaiseNoneIterError */
+ 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) {
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
if (unlikely(!type)) {
PyErr_SetString(PyExc_SystemError, "Missing type object");
return 0;
@@ -21418,7 +24378,103 @@ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
return 0;
}
-static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ return PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -21455,7 +24511,8 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
#endif
}
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
@@ -21538,14 +24595,16 @@ return_ne:
#endif
}
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+/* None */
+ 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) {
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
if (likely(PyUnicode_Check(n)))
@@ -21557,13 +24616,20 @@ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
return PyObject_GetAttr(o, n);
}
-static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
const char* cstring, Py_ssize_t start, Py_ssize_t stop,
const char* encoding, const char* errors,
PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
Py_ssize_t length;
if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
if (start < 0) {
start += length;
if (start < 0)
@@ -21583,129 +24649,250 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
}
}
-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
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
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
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
}
-
-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()))
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
#endif
+
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_VERSION_HEX < 0x03030000
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (local_tb) {
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ #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
+ }
}
- #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;
+ #if PY_VERSION_HEX < 0x03030000
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
}
-static CYTHON_INLINE void __Pyx_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);
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
#endif
- *type = tmp_type;
- *value = tmp_value;
- *tb = tmp_tb;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
+#endif
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+/* None */
+ 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) {
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
long q = a / b;
long r = a - q*b;
q -= ((r != 0) & ((r ^ b) < 0));
return q;
}
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+/* WriteUnraisableException */
+ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
- int full_traceback) {
+ int full_traceback, CYTHON_UNUSED int nogil) {
PyObject *old_exc, *old_val, *old_tb;
PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
if (full_traceback) {
Py_XINCREF(old_exc);
@@ -21726,9 +24913,14 @@ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
PyErr_WriteUnraisable(ctx);
Py_DECREF(ctx);
}
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
}
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
@@ -21745,13 +24937,14 @@ bad:
return -1;
}
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
int start = 0, mid = 0, end = count - 1;
if (end >= 0 && code_line > entries[end].code_line) {
return count;
}
while (start < end) {
- mid = (start + end) / 2;
+ mid = start + (end - start) / 2;
if (code_line < entries[mid].code_line) {
end = mid;
} else if (code_line > entries[mid].code_line) {
@@ -21824,7 +25017,8 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
Py_INCREF(code_object);
}
-#include "compile.h"
+/* AddTraceback */
+ #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
@@ -21897,7 +25091,7 @@ static void __Pyx_AddTraceback(const char *funcname, int c_line,
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_code);
@@ -21927,80 +25121,102 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
#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;
+ /* MemviewSliceIsContig */
+ 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;
}
- 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
- }
+ 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];
}
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
+ return 1;
}
+/* OverlappingSlices */
+ 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);
+}
+
+/* Capsule */
+ 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;
+}
+
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* TypeInfoCompare */
+ static int
__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
{
int i;
@@ -22040,7 +25256,8 @@ __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
return 1;
}
-static int
+/* MemviewSliceValidateAndInit */
+ static int
__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
{
if (buf->shape[dim] <= 1)
@@ -22221,7 +25438,8 @@ no_fail:
return retval;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(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) };
@@ -22243,7 +25461,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ 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) };
@@ -22265,7 +25484,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(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) };
@@ -22287,7 +25507,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int64_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_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_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -22309,7 +25530,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint64_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) };
@@ -22331,7 +25553,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ 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) };
@@ -22353,7 +25576,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_uint32_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ 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) };
@@ -22375,7 +25599,8 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_nn___pyx_t_5numpy_int16_t(PyObject *obj) {
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_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_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
@@ -22397,22 +25622,27 @@ __pyx_fail:
return result;
}
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
if (sizeof(long) < sizeof(long)) {
return PyInt_FromLong((long) value);
} else if (sizeof(long) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(long) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
if (sizeof(long) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(long) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
@@ -22423,7 +25653,39 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
}
-#if CYTHON_CCOMPLEX
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* Declarations */
+ #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);
@@ -22442,60 +25704,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
}
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__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) {
+ static CYTHON_INLINE float __Pyx_c_abs_float(__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) {
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__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) {
@@ -22513,24 +25801,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
case 1:
return a;
case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_absf(a);
+ r = __Pyx_c_abs_float(a);
theta = atan2f(a.imag, a.real);
}
lnr = logf(r);
@@ -22543,7 +25839,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#endif
#endif
-#if CYTHON_CCOMPLEX
+/* Declarations */
+ #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);
@@ -22562,60 +25859,86 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
}
#endif
-#if CYTHON_CCOMPLEX
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ static CYTHON_INLINE int __Pyx_c_eq_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__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;
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
}
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__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) {
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__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) {
+ static CYTHON_INLINE double __Pyx_c_abs_double(__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) {
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__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) {
@@ -22633,24 +25956,32 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
case 1:
return a;
case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
}
}
if (a.imag == 0) {
if (a.real == 0) {
return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
}
- r = a.real;
- theta = 0;
} else {
- r = __Pyx_c_abs(a);
+ r = __Pyx_c_abs_double(a);
theta = atan2(a.imag, a.real);
}
lnr = log(r);
@@ -22663,55 +25994,107 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#endif
#endif
-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
- const int neg_one = (int) -1, const_zero = 0;
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
const int is_unsigned = neg_one > const_zero;
if (is_unsigned) {
- if (sizeof(int) < sizeof(long)) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(unsigned long)) {
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
return PyLong_FromUnsignedLong((unsigned long) value);
- } else if (sizeof(int) <= sizeof(unsigned long long)) {
- return PyLong_FromUnsignedLongLong((unsigned long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
}
} else {
- if (sizeof(int) <= sizeof(long)) {
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
return PyInt_FromLong((long) value);
- } else if (sizeof(int) <= sizeof(long long)) {
- return PyLong_FromLongLong((long long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
}
}
{
int one = 1; int little = (int)*(unsigned char *)&one;
unsigned char *bytes = (unsigned char *)&value;
- return _PyLong_FromByteArray(bytes, sizeof(int),
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
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; \
+/* MemviewSliceCopyTemplate */
+ 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;
+}
-#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;
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -22728,36 +26111,129 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(int, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(int) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -22766,7 +26242,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
int val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -22789,7 +26265,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
}
} else {
int val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (int) -1;
val = __Pyx_PyInt_As_int(tmp);
Py_DECREF(tmp);
@@ -22805,143 +26281,9 @@ raise_neg_overflow:
return (int) -1;
}
-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;
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -22958,36 +26300,129 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(char, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
}
- #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))
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -22996,7 +26431,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
char val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -23019,7 +26454,7 @@ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
}
} else {
char val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (char) -1;
val = __Pyx_PyInt_As_char(tmp);
Py_DECREF(tmp);
@@ -23035,8 +26470,9 @@ raise_neg_overflow:
return (char) -1;
}
-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
- const long neg_one = (long) -1, const_zero = 0;
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
if (likely(PyInt_Check(x))) {
@@ -23053,36 +26489,129 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#endif
if (likely(PyLong_Check(x))) {
if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: __PYX_VERIFY_RETURN_INT(long, digit, ((PyLongObject*)x)->ob_digit[0]);
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
}
- #endif
#endif
+#if CYTHON_COMPILING_IN_CPYTHON
if (unlikely(Py_SIZE(x) < 0)) {
goto raise_neg_overflow;
}
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
if (sizeof(long) <= sizeof(unsigned long)) {
- __PYX_VERIFY_RETURN_INT(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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
}
} else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
- #if CYTHON_USE_PYLONG_INTERNALS
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
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]);
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
}
- #endif
#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))
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
}
}
{
@@ -23091,7 +26620,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
long val;
- PyObject *v = __Pyx_PyNumber_Int(x);
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
#if PY_MAJOR_VERSION < 3
if (likely(v) && !PyLong_Check(v)) {
PyObject *tmp = v;
@@ -23114,7 +26643,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
}
} else {
long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
if (!tmp) return (long) -1;
val = __Pyx_PyInt_As_long(tmp);
Py_DECREF(tmp);
@@ -23130,7 +26659,8 @@ raise_neg_overflow:
return (long) -1;
}
-static int __Pyx_check_binary_version(void) {
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
char ctversion[4], rtversion[4];
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
@@ -23145,7 +26675,8 @@ static int __Pyx_check_binary_version(void) {
return 0;
}
-#ifndef __PYX_HAVE_RT_ImportModule
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
PyObject *py_name = 0;
@@ -23162,7 +26693,8 @@ bad:
}
#endif
-#ifndef __PYX_HAVE_RT_ImportType
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
size_t size, int strict)
@@ -23208,14 +26740,14 @@ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class
#endif
if (!strict && (size_t)basicsize > size) {
PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
}
else if ((size_t)basicsize != size) {
PyErr_Format(PyExc_ValueError,
- "%.200s.%.200s has the wrong size, try recompiling",
- module_name, class_name);
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
goto bad;
}
return (PyTypeObject *)result;
@@ -23226,7 +26758,8 @@ bad:
}
#endif
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
#if PY_MAJOR_VERSION < 3
if (t->is_unicode) {
@@ -23264,7 +26797,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
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 CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
__Pyx_sys_getdefaultencoding_not_ascii &&
@@ -23305,7 +26838,7 @@ static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_
#endif
} else
#endif
-#if !CYTHON_COMPILING_IN_PYPY
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
if (PyByteArray_Check(o)) {
*length = PyByteArray_GET_SIZE(o);
return PyByteArray_AS_STRING(o);
@@ -23326,8 +26859,10 @@ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
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) {
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
PyNumberMethods *m;
+#endif
const char *name = NULL;
PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
@@ -23335,9 +26870,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
#else
if (PyLong_Check(x))
#endif
- return Py_INCREF(x), x;
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
+ #if PY_MAJOR_VERSION < 3
if (m && m->nb_int) {
name = "int";
res = PyNumber_Int(x);
@@ -23346,11 +26882,14 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
name = "long";
res = PyNumber_Long(x);
}
-#else
+ #else
if (m && m->nb_int) {
name = "int";
res = PyNumber_Long(x);
}
+ #endif
+#else
+ res = PyNumber_Int(x);
#endif
if (res) {
#if PY_MAJOR_VERSION < 3
@@ -23375,18 +26914,55 @@ 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);
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
#endif
if (likely(PyLong_CheckExact(b))) {
- #if CYTHON_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
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
#endif
return PyLong_AsSsize_t(b);
}
diff --git a/silx/math/medianfilter/medianfilter.pyx b/silx/math/medianfilter/medianfilter.pyx
index c7c9497..4d0a1e9 100644
--- a/silx/math/medianfilter/medianfilter.pyx
+++ b/silx/math/medianfilter/medianfilter.pyx
@@ -35,7 +35,6 @@ cimport cython
cimport median_filter
import numpy
cimport numpy as cnumpy
-cdef Py_ssize_t size = 10
from libcpp cimport bool
ctypedef unsigned long uint64
@@ -43,7 +42,10 @@ ctypedef unsigned int uint32
ctypedef unsigned short uint16
-def medfilt1d(data, kernel_size=3, bool conditional=False):
+MODES = {'nearest':0, 'reflect':1, 'mirror':2, 'shrink':3}
+
+
+def medfilt1d(data, kernel_size=3, bool conditional=False, mode='nearest'):
"""Function computing the median filter of the given input.
Behavior at boundaries: the algorithm is reducing the size of the
window/kernel for pixels at boundaries (there is no mirroring).
@@ -57,10 +59,10 @@ def medfilt1d(data, kernel_size=3, bool conditional=False):
:returns: the array with the median value for each pixel.
"""
- return medfilt(data, kernel_size, conditional)
+ return medfilt(data, kernel_size, conditional, mode)
-def medfilt2d(image, kernel_size=3, bool conditional=False):
+def medfilt2d(image, kernel_size=3, bool conditional=False, mode='nearest'):
"""Function computing the median filter of the given input.
Behavior at boundaries: the algorithm is reducing the size of the
window/kernel for pixels at boundaries (there is no mirroring).
@@ -75,10 +77,10 @@ def medfilt2d(image, kernel_size=3, bool conditional=False):
:returns: the array with the median value for each pixel.
"""
- return medfilt(image, kernel_size, conditional)
+ return medfilt(image, kernel_size, conditional, mode)
-def medfilt(data, kernel_size=3, bool conditional=False):
+def medfilt(data, kernel_size=3, bool conditional=False, mode='nearest'):
"""Function computing the median filter of the given input.
Behavior at boundaries: the algorithm is reducing the size of the
window/kernel for pixels at boundaries (there is no mirroring).
@@ -90,9 +92,15 @@ def medfilt(data, kernel_size=3, bool conditional=False):
a list of (kernel_height, kernel_width)
:param bool conditional: True if we want to apply a conditional median
filtering.
+ :param str mode: the algorithm used to determine how values at borders
+ are determined.
:returns: the array with the median value for each pixel.
"""
+ if mode not in MODES:
+ err = 'Requested mode %s is unknowed.' % mode
+ raise ValueError(err)
+
reshaped = False
if len(data.shape) == 1:
data = data.reshape(data.shape[0], 1)
@@ -134,7 +142,8 @@ def medfilt(data, kernel_size=3, bool conditional=False):
medfilterfc(input_buffer=data,
output_buffer=output_buffer,
kernel_size=ker_dim,
- conditional=conditional)
+ conditional=conditional,
+ mode=MODES[mode])
if reshaped:
data = data.reshape(data.shape[0])
@@ -170,27 +179,55 @@ def check(input_buffer, output_buffer):
@cython.boundscheck(False)
@cython.wraparound(False)
@cython.initializedcheck(False)
+def reflect(int index, int length_max):
+ """find the correct index into [0, length_max-1] for index in reflect mode
+
+ :param int index: the index to move into [0, length_max-1] in reflect mode
+ :param int length_max: the higher bound limit
+ """
+ return median_filter.reflect(index, length_max)
+
+
+@cython.cdivision(True)
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.initializedcheck(False)
+def mirror(int index, int length_max):
+ """find the correct index into [0, length_max-1] for index in mirror mode
+
+ :param int index: the index to move into [0, length_max-1] in mirror mode
+ :param int length_max: the higher bound limit
+ """
+ return median_filter.mirror(index, length_max)
+
+
+@cython.cdivision(True)
+@cython.boundscheck(False)
+@cython.wraparound(False)
+@cython.initializedcheck(False)
def _median_filter_float32(float[:, ::1] input_buffer not None,
float[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[float](<float*> & input_buffer[0,0],
<float*> & output_buffer[0,0],
<int*>& kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -200,24 +237,26 @@ def _median_filter_float32(float[:, ::1] input_buffer not None,
def _median_filter_float64(double[:, ::1] input_buffer not None,
double[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[double](<double*> & input_buffer[0, 0],
<double*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -227,24 +266,26 @@ def _median_filter_float64(double[:, ::1] input_buffer not None,
def _median_filter_int64(cnumpy.int64_t[:, ::1] input_buffer not None,
cnumpy.int64_t[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[long](<long*> & input_buffer[0,0],
<long*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional);
+ conditional,
+ mode)
@cython.cdivision(True)
@cython.boundscheck(False)
@@ -254,24 +295,26 @@ def _median_filter_uint64(
cnumpy.uint64_t[:, ::1] input_buffer not None,
cnumpy.uint64_t[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[uint64](<uint64*> & input_buffer[0,0],
<uint64*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -281,24 +324,26 @@ def _median_filter_uint64(
def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None,
cnumpy.int32_t[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[int](<int*> & input_buffer[0,0],
<int*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -308,24 +353,26 @@ def _median_filter_int32(cnumpy.int32_t[:, ::1] input_buffer not None,
def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None,
cnumpy.uint32_t[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[uint32](<uint32*> & input_buffer[0,0],
<uint32*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -335,24 +382,26 @@ def _median_filter_uint32(cnumpy.uint32_t[:, ::1] input_buffer not None,
def _median_filter_int16(cnumpy.int16_t[:, ::1] input_buffer not None,
cnumpy.int16_t[:, ::1] output_buffer not None,
cnumpy.int32_t[::1] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[short](<short*> & input_buffer[0,0],
<short*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
@cython.cdivision(True)
@@ -363,21 +412,23 @@ def _median_filter_uint16(
cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] input_buffer not None,
cnumpy.ndarray[cnumpy.uint16_t, ndim=2, mode='c'] output_buffer not None,
cnumpy.ndarray[cnumpy.int32_t, ndim=1, mode='c'] kernel_size not None,
- bool conditional):
+ bool conditional,
+ int mode):
cdef:
- int x = 0
+ int y = 0
int image_dim = input_buffer.shape[1] - 1
int[2] buffer_shape,
buffer_shape[0] = input_buffer.shape[0]
buffer_shape[1] = input_buffer.shape[1]
- for x in prange(input_buffer.shape[0], nogil=True):
+ for y in prange(input_buffer.shape[0], nogil=True):
median_filter.median_filter[uint16](<uint16*> & input_buffer[0, 0],
<uint16*> & output_buffer[0, 0],
<int*>&kernel_size[0],
<int*>buffer_shape,
- x,
+ y,
0,
image_dim,
- conditional)
+ conditional,
+ mode)
diff --git a/silx/math/medianfilter/test/test_medianfilter.py b/silx/math/medianfilter/test/test_medianfilter.py
index 8a26d3a..a4c55b2 100644
--- a/silx/math/medianfilter/test/test_medianfilter.py
+++ b/silx/math/medianfilter/test/test_medianfilter.py
@@ -1,5 +1,5 @@
# coding: utf-8
-# /*##########################################################################
+# ##########################################################################
# Copyright (C) 2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,7 +20,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
-# ############################################################################*/
+# ############################################################################
"""Tests of the median filter"""
__authors__ = ["H. Payno"]
@@ -29,8 +29,9 @@ __date__ = "02/05/2017"
import unittest
import numpy
-import os
from silx.math.medianfilter import medfilt2d
+from silx.math.medianfilter.medianfilter import reflect, mirror
+from silx.math.medianfilter.medianfilter import MODES as silx_mf_modes
from silx.test.utils import ParametricTestCase
try:
import scipy
@@ -43,17 +44,23 @@ else:
import logging
_logger = logging.getLogger(__name__)
+RANDOM_FLOAT_MAT = numpy.array([
+ [0.05564293, 0.62717157, 0.75002406, 0.40555336, 0.70278975],
+ [0.76532598, 0.02839148, 0.05272484, 0.65166994, 0.42161216],
+ [0.23067427, 0.74219128, 0.56049024, 0.44406320, 0.28773158],
+ [0.81025249, 0.20303021, 0.68382382, 0.46372299, 0.81281709],
+ [0.94691602, 0.07813661, 0.81651256, 0.84220106, 0.33623165]])
+
+RANDOM_INT_MAT = numpy.array([
+ [0, 5, 2, 6, 1],
+ [2, 3, 1, 7, 1],
+ [9, 8, 6, 7, 8],
+ [5, 6, 8, 2, 4]])
+
class TestMedianFilterNearest(ParametricTestCase):
"""Unit tests for the median filter in nearest mode"""
- random_mat = numpy.array([
- [0.05564293, 0.62717157, 0.75002406, 0.40555336, 0.70278975],
- [0.76532598, 0.02839148, 0.05272484, 0.65166994, 0.42161216],
- [0.23067427, 0.74219128, 0.56049024, 0.44406320, 0.28773158],
- [0.81025249, 0.20303021, 0.68382382, 0.46372299, 0.81281709],
- [0.94691602, 0.07813661, 0.81651256, 0.84220106, 0.33623165]])
-
def testFilter3_100(self):
"""Test median filter on a 10x10 matrix with a 3x3 kernel."""
dataIn = numpy.arange(100, dtype=numpy.int32)
@@ -61,7 +68,8 @@ class TestMedianFilterNearest(ParametricTestCase):
dataOut = medfilt2d(image=dataIn,
kernel_size=(3, 3),
- conditional=False)
+ conditional=False,
+ mode='nearest')
self.assertTrue(dataOut[0, 0] == 1)
self.assertTrue(dataOut[9, 0] == 90)
self.assertTrue(dataOut[9, 9] == 98)
@@ -72,7 +80,7 @@ class TestMedianFilterNearest(ParametricTestCase):
self.assertTrue(dataOut[4, 4] == 44)
def testFilter3_9(self):
- "Test median filter on a 3x3 matrix a 3x3 kernel."
+ "Test median filter on a 3x3 matrix with a 3x3 kernel."
dataIn = numpy.array([0, -1, 1,
12, 6, -2,
100, 4, 12],
@@ -80,7 +88,8 @@ class TestMedianFilterNearest(ParametricTestCase):
dataIn = dataIn.reshape((3, 3))
dataOut = medfilt2d(image=dataIn,
kernel_size=(3, 3),
- conditional=False)
+ conditional=False,
+ mode='nearest')
self.assertTrue(dataOut.shape == dataIn.shape)
self.assertTrue(dataOut[1, 1] == 4)
self.assertTrue(dataOut[0, 0] == 0)
@@ -95,146 +104,379 @@ class TestMedianFilterNearest(ParametricTestCase):
dataOut = medfilt2d(image=dataIn,
kernel_size=(1, 1),
- conditional=False)
+ conditional=False,
+ mode='nearest')
self.assertTrue(numpy.array_equal(dataIn, dataOut))
- def testInputDataIsNotModify(self):
- """Make sure input data is not modify by the median filter"""
- dataIn = numpy.arange(100, dtype=numpy.int32)
- dataIn = dataIn.reshape((10, 10))
- dataInCopy = dataIn.copy()
-
- medfilt2d(image=dataIn,
- kernel_size=(3, 3),
- conditional=False)
- self.assertTrue(numpy.array_equal(dataIn, dataInCopy))
-
- def testThreads(self):
- """Make sure the result doesn't depends on the number of threads used
- """
- dataIn = numpy.random.rand(100, 100)
-
- former = os.environ.get("OMP_NUM_THREADS")
- os.environ["OMP_NUM_THREADS"] = "1"
- dataOut1Thr = medfilt2d(image=dataIn,
- kernel_size=(3, 3),
- conditional=False,
- )
- os.environ["OMP_NUM_THREADS"] = "2"
- dataOut2Thr = medfilt2d(image=dataIn,
- kernel_size=(3, 3),
- conditional=False)
- os.environ["OMP_NUM_THREADS"] = "4"
- dataOut4Thr = medfilt2d(image=dataIn,
- kernel_size=(3, 3),
- conditional=False)
- os.environ["OMP_NUM_THREADS"] = "8"
- dataOut8Thr = medfilt2d(image=dataIn,
- kernel_size=(3, 3),
- conditional=False)
- if former is None:
- os.environ.pop("OMP_NUM_THREADS")
- else:
- os.environ["OMP_NUM_THREADS"] = former
-
- self.assertTrue(numpy.array_equal(dataOut1Thr, dataOut2Thr))
- self.assertTrue(numpy.array_equal(dataOut1Thr, dataOut4Thr))
- self.assertTrue(numpy.array_equal(dataOut1Thr, dataOut8Thr))
-
def testFilter3Conditionnal(self):
- """Test that the conditional filter apply correctly"""
+ """Test that the conditional filter apply correctly in a 10x10 matrix
+ with a 3x3 kernel
+ """
dataIn = numpy.arange(100, dtype=numpy.int32)
dataIn = dataIn.reshape((10, 10))
dataOut = medfilt2d(image=dataIn,
kernel_size=(3, 3),
- conditional=True)
+ conditional=True,
+ mode='nearest')
self.assertTrue(dataOut[0, 0] == 1)
self.assertTrue(dataOut[0, 1] == 1)
self.assertTrue(numpy.array_equal(dataOut[1:8, 1:8], dataIn[1:8, 1:8]))
self.assertTrue(dataOut[9, 9] == 98)
- def testTypes(self):
- """Test that all needed types have their implementation of the median
- filter
- """
- for testType in [numpy.float32, numpy.float64, numpy.int16,
- numpy.uint16, numpy.int32, numpy.int64, numpy.uint64]:
- data = (numpy.random.rand(10, 10) * 65000).astype(testType)
- out = medfilt2d(image=data,
- kernel_size=(3, 3),
- conditional=False)
- self.assertTrue(out.dtype.type is testType)
-
def testFilter3_1D(self):
- """Simple test of a three by three kernel median filter"""
+ """Simple test of a 3x3 median filter on a 1D array"""
dataIn = numpy.arange(100, dtype=numpy.int32)
dataOut = medfilt2d(image=dataIn,
kernel_size=(5),
- conditional=False)
+ conditional=False,
+ mode='nearest')
self.assertTrue(dataOut[0] == 0)
self.assertTrue(dataOut[9] == 9)
self.assertTrue(dataOut[99] == 99)
- @unittest.skipUnless(scipy, "scipy not available")
+
+class TestMedianFilterReflect(ParametricTestCase):
+ """Unit test for the median filter in reflect mode"""
+
+ def testArange9(self):
+ """Test from a 3x3 window to RANDOM_FLOAT_MAT"""
+ img = numpy.arange(9, dtype=numpy.int32)
+ img = img.reshape(3, 3)
+ kernel = (3, 3)
+ res = medfilt2d(image=img,
+ kernel_size=kernel,
+ conditional=False,
+ mode='reflect')
+ self.assertTrue(
+ numpy.array_equal(res.ravel(), [1, 2, 2, 3, 4, 5, 6, 6, 7]))
+
+ def testRandom10(self):
+ """Test a (5, 3) window to a RANDOM_FLOAT_MAT"""
+ kernel = (5, 3)
+
+ thRes = numpy.array([
+ [0.23067427, 0.56049024, 0.56049024, 0.4440632, 0.42161216],
+ [0.23067427, 0.62717157, 0.56049024, 0.56049024, 0.46372299],
+ [0.62717157, 0.62717157, 0.56049024, 0.56049024, 0.4440632],
+ [0.76532598, 0.68382382, 0.56049024, 0.56049024, 0.42161216],
+ [0.81025249, 0.68382382, 0.56049024, 0.68382382, 0.46372299]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=False,
+ mode='reflect')
+
+ self.assertTrue(numpy.array_equal(thRes, res))
+
+ def testApplyReflect1D(self):
+ """Test the reflect function used for the median filter in reflect mode
+ """
+ # test for inside values
+ self.assertTrue(reflect(2, 3) == 2)
+ # test for boundaries values
+ self.assertTrue(reflect(3, 3) == 2)
+ self.assertTrue(reflect(4, 3) == 1)
+ self.assertTrue(reflect(5, 3) == 0)
+ self.assertTrue(reflect(6, 3) == 0)
+ self.assertTrue(reflect(7, 3) == 1)
+ self.assertTrue(reflect(-1, 3) == 0)
+ self.assertTrue(reflect(-2, 3) == 1)
+ self.assertTrue(reflect(-3, 3) == 2)
+ self.assertTrue(reflect(-4, 3) == 2)
+ self.assertTrue(reflect(-5, 3) == 1)
+ self.assertTrue(reflect(-6, 3) == 0)
+ self.assertTrue(reflect(-7, 3) == 0)
+
+ def testRandom10Conditionnal(self):
+ """Test the median filter in reflect mode and with the conditionnal
+ option"""
+ kernel = (3, 1)
+
+ thRes = numpy.array([
+ [0.05564293, 0.62717157, 0.75002406, 0.40555336, 0.70278975],
+ [0.23067427, 0.62717157, 0.56049024, 0.44406320, 0.42161216],
+ [0.76532598, 0.20303021, 0.56049024, 0.46372299, 0.42161216],
+ [0.81025249, 0.20303021, 0.68382382, 0.46372299, 0.33623165],
+ [0.94691602, 0.07813661, 0.81651256, 0.84220106, 0.33623165]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=True,
+ mode='reflect')
+ self.assertTrue(numpy.array_equal(thRes, res))
+
+
+class TestMedianFilterMirror(ParametricTestCase):
+ """Unit test for the median filter in mirror mode
+ """
+
+ def testApplyMirror1D(self):
+ """Test the reflect function used for the median filter in mirror mode
+ """
+ # test for inside values
+ self.assertTrue(mirror(2, 3) == 2)
+ # test for boundaries values
+ self.assertTrue(mirror(4, 4) == 2)
+ self.assertTrue(mirror(5, 4) == 1)
+ self.assertTrue(mirror(6, 4) == 0)
+ self.assertTrue(mirror(7, 4) == 1)
+ self.assertTrue(mirror(8, 4) == 2)
+ self.assertTrue(mirror(-1, 4) == 1)
+ self.assertTrue(mirror(-2, 4) == 2)
+ self.assertTrue(mirror(-3, 4) == 3)
+ self.assertTrue(mirror(-4, 4) == 2)
+ self.assertTrue(mirror(-5, 4) == 1)
+ self.assertTrue(mirror(-6, 4) == 0)
+
+ def testRandom10(self):
+ """Test a (5, 3) window to a random array"""
+ kernel = (3, 5)
+
+ thRes = numpy.array([
+ [0.05272484, 0.40555336, 0.42161216, 0.42161216, 0.42161216],
+ [0.56049024, 0.56049024, 0.4440632, 0.4440632, 0.4440632],
+ [0.56049024, 0.46372299, 0.46372299, 0.46372299, 0.46372299],
+ [0.68382382, 0.56049024, 0.56049024, 0.46372299, 0.56049024],
+ [0.68382382, 0.46372299, 0.68382382, 0.46372299, 0.68382382]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=False,
+ mode='mirror')
+
+ self.assertTrue(numpy.array_equal(thRes, res))
+
+ def testRandom10Conditionnal(self):
+ """Test the median filter in reflect mode and with the conditionnal
+ option"""
+ kernel = (1, 3)
+
+ thRes = numpy.array([
+ [0.62717157, 0.62717157, 0.62717157, 0.70278975, 0.40555336],
+ [0.02839148, 0.05272484, 0.05272484, 0.42161216, 0.65166994],
+ [0.74219128, 0.56049024, 0.56049024, 0.44406320, 0.44406320],
+ [0.20303021, 0.68382382, 0.46372299, 0.68382382, 0.46372299],
+ [0.07813661, 0.81651256, 0.81651256, 0.81651256, 0.84220106]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=True,
+ mode='mirror')
+
+ self.assertTrue(numpy.array_equal(thRes, res))
+
+
+class TestMedianFilterShrink(ParametricTestCase):
+ """Unit test for the median filter in mirror mode
+ """
+
+ def testRandom_3x3(self):
+ """Test the median filter in shrink mode and with the conditionnal
+ option"""
+ kernel = (3, 3)
+
+ thRes = numpy.array([
+ [0.62717157, 0.62717157, 0.62717157, 0.65166994, 0.65166994],
+ [0.62717157, 0.56049024, 0.56049024, 0.44406320, 0.44406320],
+ [0.74219128, 0.56049024, 0.46372299, 0.46372299, 0.46372299],
+ [0.74219128, 0.68382382, 0.56049024, 0.56049024, 0.46372299],
+ [0.81025249, 0.81025249, 0.68382382, 0.81281709, 0.81281709]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=False,
+ mode='shrink')
+
+ self.assertTrue(numpy.array_equal(thRes, res))
+
+ def testBounds(self):
+ """Test the median filter in shrink mode with 3 different kernels
+ which should return the same result due to the large values of kernels
+ used.
+ """
+ kernel1 = (1, 9)
+ kernel2 = (1, 11)
+ kernel3 = (1, 21)
+
+ thRes = numpy.array([[2, 2, 2, 2, 2],
+ [2, 2, 2, 2, 2],
+ [8, 8, 8, 8, 8],
+ [5, 5, 5, 5, 5]])
+
+ resK1 = medfilt2d(image=RANDOM_INT_MAT,
+ kernel_size=kernel1,
+ conditional=False,
+ mode='shrink')
+
+ resK2 = medfilt2d(image=RANDOM_INT_MAT,
+ kernel_size=kernel2,
+ conditional=False,
+ mode='shrink')
+
+ resK3 = medfilt2d(image=RANDOM_INT_MAT,
+ kernel_size=kernel3,
+ conditional=False,
+ mode='shrink')
+
+ self.assertTrue(numpy.array_equal(resK1, thRes))
+ self.assertTrue(numpy.array_equal(resK2, resK1))
+ self.assertTrue(numpy.array_equal(resK3, resK1))
+
+ def testRandom_3x3Conditionnal(self):
+ """Test the median filter in reflect mode and with the conditionnal
+ option"""
+ kernel = (3, 3)
+
+ thRes = numpy.array([
+ [0.05564293, 0.62717157, 0.62717157, 0.40555336, 0.65166994],
+ [0.62717157, 0.56049024, 0.05272484, 0.65166994, 0.42161216],
+ [0.23067427, 0.74219128, 0.56049024, 0.44406320, 0.46372299],
+ [0.81025249, 0.20303021, 0.68382382, 0.46372299, 0.81281709],
+ [0.81025249, 0.81025249, 0.81651256, 0.81281709, 0.81281709]])
+
+ res = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=True,
+ mode='shrink')
+
+ self.assertTrue(numpy.array_equal(res, thRes))
+
+ def testRandomInt(self):
+ """Test 3x3 kernel on RANDOM_INT_MAT
+ """
+ kernel = (3, 3)
+
+ thRes = numpy.array([[3, 2, 5, 2, 6],
+ [5, 3, 6, 6, 7],
+ [6, 6, 6, 6, 7],
+ [8, 8, 7, 7, 7]])
+
+ resK1 = medfilt2d(image=RANDOM_INT_MAT,
+ kernel_size=kernel,
+ conditional=False,
+ mode='shrink')
+
+ self.assertTrue(numpy.array_equal(resK1, thRes))
+
+
+class TestGeneralExecution(ParametricTestCase):
+ """Some general test on median filter application"""
+
+ def testTypes(self):
+ """Test that all needed types have their implementation of the median
+ filter
+ """
+ for mode in silx_mf_modes:
+ for testType in [numpy.float32, numpy.float64, numpy.int16,
+ numpy.uint16, numpy.int32, numpy.int64,
+ numpy.uint64]:
+ with self.subTest(mode=mode, type=testType):
+ data = (numpy.random.rand(10, 10) * 65000).astype(testType)
+ out = medfilt2d(image=data,
+ kernel_size=(3, 3),
+ conditional=False,
+ mode=mode)
+ self.assertTrue(out.dtype.type is testType)
+
+ def testInputDataIsNotModify(self):
+ """Make sure input data is not modify by the median filter"""
+ dataIn = numpy.arange(100, dtype=numpy.int32)
+ dataIn = dataIn.reshape((10, 10))
+ dataInCopy = dataIn.copy()
+
+ for mode in silx_mf_modes:
+ with self.subTest(mode=mode):
+ medfilt2d(image=dataIn,
+ kernel_size=(3, 3),
+ conditional=False,
+ mode=mode)
+ self.assertTrue(numpy.array_equal(dataIn, dataInCopy))
+
+
+def _getScipyAndSilxCommonModes():
+ """return the mode which are comparable between silx and scipy"""
+ modes = silx_mf_modes.copy()
+ del modes['shrink']
+ return modes
+
+
+@unittest.skipUnless(scipy is not None, "scipy not available")
+class TestVsScipy(ParametricTestCase):
+ """Compare scipy.ndimage.median_filter vs silx.math.medianfilter
+ on comparable
+ """
def testWithArange(self):
+ """Test vs scipy with different kernels on arange matrix"""
data = numpy.arange(10000, dtype=numpy.int32)
data = data.reshape(100, 100)
kernels = [(3, 7), (7, 5), (1, 1), (3, 3)]
+ modesToTest = _getScipyAndSilxCommonModes()
for kernel in kernels:
- with self.subTest(kernel=kernel):
- resScipy = scipy.ndimage.median_filter(input=data,
- size=kernel,
- mode='nearest')
- resSilx = medfilt2d(image=data,
- kernel_size=kernel,
- conditional=False)
-
- self.assertTrue(numpy.array_equal(resScipy, resSilx))
+ for mode in modesToTest:
+ with self.subTest(kernel=kernel, mode=mode):
+ resScipy = scipy.ndimage.median_filter(input=data,
+ size=kernel,
+ mode=mode)
+ resSilx = medfilt2d(image=data,
+ kernel_size=kernel,
+ conditional=False,
+ mode=mode)
+
+ self.assertTrue(numpy.array_equal(resScipy, resSilx))
- @unittest.skipUnless(scipy, "scipy not available")
def testRandomMatrice(self):
+ """Test vs scipy with different kernels on RANDOM_FLOAT_MAT"""
kernels = [(3, 7), (7, 5), (1, 1), (3, 3)]
+ modesToTest = _getScipyAndSilxCommonModes()
for kernel in kernels:
- with self.subTest(kernel=kernel):
- resScipy = scipy.ndimage.median_filter(input=self.random_mat,
- size=kernel,
- mode='nearest')
+ for mode in modesToTest:
+ with self.subTest(kernel=kernel, mode=mode):
+ resScipy = scipy.ndimage.median_filter(input=RANDOM_FLOAT_MAT,
+ size=kernel,
+ mode=mode)
- resSilx = medfilt2d(image=self.random_mat,
- kernel_size=kernel,
- conditional=False)
+ resSilx = medfilt2d(image=RANDOM_FLOAT_MAT,
+ kernel_size=kernel,
+ conditional=False,
+ mode=mode)
- self.assertTrue(numpy.array_equal(resScipy, resSilx))
+ self.assertTrue(numpy.array_equal(resScipy, resSilx))
- @unittest.skipUnless(scipy, "scipy not available")
def testAscentOrLena(self):
+ """Test vs scipy with """
if hasattr(scipy.misc, 'ascent'):
img = scipy.misc.ascent()
else:
img = scipy.misc.lena()
kernels = [(3, 1), (3, 5), (5, 9), (9, 3)]
+ modesToTest = _getScipyAndSilxCommonModes()
+
for kernel in kernels:
- with self.subTest(kernel=kernel):
- resScipy = scipy.ndimage.median_filter(input=img,
- size=kernel,
- mode='nearest')
+ for mode in modesToTest:
+ with self.subTest(kernel=kernel, mode=mode):
+ resScipy = scipy.ndimage.median_filter(input=img,
+ size=kernel,
+ mode=mode)
- resSilx = medfilt2d(image=img,
- kernel_size=kernel,
- conditional=False)
+ resSilx = medfilt2d(image=img,
+ kernel_size=kernel,
+ conditional=False,
+ mode=mode)
- self.assertTrue(numpy.array_equal(resScipy, resSilx))
+ self.assertTrue(numpy.array_equal(resScipy, resSilx))
def suite():
test_suite = unittest.TestSuite()
- for test in [TestMedianFilterNearest, ]:
+ for test in [TestGeneralExecution, TestVsScipy,
+ TestMedianFilterNearest, TestMedianFilterReflect,
+ TestMedianFilterMirror, TestMedianFilterShrink]:
test_suite.addTest(
unittest.defaultTestLoader.loadTestsFromTestCase(test))
return test_suite
diff --git a/silx/math/setup.py b/silx/math/setup.py
index 288eaf6..8d54576 100644
--- a/silx/math/setup.py
+++ b/silx/math/setup.py
@@ -42,50 +42,37 @@ def configuration(parent_package='', top_path=None):
# =====================================
# histogramnd
# =====================================
- histo_dir = 'histogramnd'
- histo_src = [os.path.join(histo_dir, srcf)
- for srcf in ['chistogramnd.pyx',
- 'src/histogramnd_c.c']]
- histo_inc = [os.path.join(histo_dir, 'include'),
+ histo_src = [os.path.join('histogramnd', 'src', 'histogramnd_c.c'),
+ 'chistogramnd.pyx']
+ histo_inc = [os.path.join('histogramnd', 'include'),
numpy.get_include()]
config.add_extension('chistogramnd',
sources=histo_src,
include_dirs=histo_inc,
language='c')
- # =====================================
- # =====================================
# =====================================
# histogramnd_lut
# =====================================
- histo_dir = 'histogramnd'
- histo_src = [os.path.join(histo_dir, srcf)
- for srcf in ['chistogramnd_lut.pyx']]
- histo_inc = [os.path.join(histo_dir, 'include'),
- numpy.get_include()]
-
config.add_extension('chistogramnd_lut',
- sources=histo_src,
+ sources=['chistogramnd_lut.pyx'],
include_dirs=histo_inc,
language='c')
# =====================================
- # =====================================
-
# marching cubes
- mc_dir = 'marchingcubes'
- mc_src = [os.path.join(mc_dir, srcf)
- for srcf in ['marchingcubes.pyx', 'mc_lut.cpp']]
+ # =====================================
+ mc_src = [os.path.join('marchingcubes', 'mc_lut.cpp'),
+ 'marchingcubes.pyx']
config.add_extension('marchingcubes',
sources=mc_src,
- include_dirs=[mc_dir, numpy.get_include()],
+ include_dirs=['marchingcubes', numpy.get_include()],
language='c++')
# min/max
- combo_dir = 'combo'
config.add_extension('combo',
- sources=[os.path.join(combo_dir, 'combo.pyx')],
- include_dirs=[combo_dir],
+ sources=['combo.pyx'],
+ include_dirs=['include'],
language='c')
return config
diff --git a/silx/math/test/benchmark_combo.py b/silx/math/test/benchmark_combo.py
index 4acc26b..ad5ae41 100644
--- a/silx/math/test/benchmark_combo.py
+++ b/silx/math/test/benchmark_combo.py
@@ -27,7 +27,7 @@ from __future__ import division
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "27/03/2017"
+__date__ = "15/05/2017"
import logging
@@ -41,8 +41,6 @@ from silx.test.utils import ParametricTestCase, temp_dir
from silx.math import combo
-
-logging.basicConfig()
_logger = logging.getLogger(__name__)
_logger.setLevel(logging.DEBUG)
diff --git a/silx/math/test/test_HistogramndLut_nominal.py b/silx/math/test/test_HistogramndLut_nominal.py
index 9c356bd..9450326 100644
--- a/silx/math/test/test_HistogramndLut_nominal.py
+++ b/silx/math/test/test_HistogramndLut_nominal.py
@@ -536,6 +536,21 @@ class _TestHistogramndLut_nominal(unittest.TestCase):
self.assertTrue(np.array_equal(histo, expected_h))
self.assertTrue(np.array_equal(w_histo, expected_c))
+ def testNoneNativeTypes(self):
+ type = self.sample.dtype.newbyteorder("B")
+ sampleB = self.sample.astype(type)
+
+ type = self.sample.dtype.newbyteorder("L")
+ sampleL = self.sample.astype(type)
+
+ histo_inst = HistogramndLut(sampleB,
+ self.histo_range,
+ self.n_bins)
+
+ histo_inst = HistogramndLut(sampleL,
+ self.histo_range,
+ self.n_bins)
+
class TestHistogramndLut_nominal_1d(_TestHistogramndLut_nominal):
ndims = 1
diff --git a/silx/math/test/test_combo.py b/silx/math/test/test_combo.py
index 92eb8b4..b985cbd 100644
--- a/silx/math/test/test_combo.py
+++ b/silx/math/test/test_combo.py
@@ -1,6 +1,6 @@
# coding: utf-8
# /*##########################################################################
-# Copyright (C) 2016 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2017 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
@@ -47,46 +47,76 @@ class TestMinMax(ParametricTestCase):
UNSIGNED_INT_DTYPES = 'uint8', 'uint16', 'uint32', 'uint64'
DTYPES = FLOATING_DTYPES + SIGNED_INT_DTYPES + UNSIGNED_INT_DTYPES
- def _test_min_max(self, data, min_positive):
- """Compare min_max with numpy for the given dataset
+ def _numpy_min_max(self, data, min_positive=False, finite=False):
+ """Reference numpy implementation of min_max
:param numpy.ndarray data: Data set to use for test
:param bool min_positive: True to test with positive min
+ :param bool finite: True to only test finite values
"""
- result = min_max(data, min_positive)
+ data = numpy.array(data, copy=False)
+ if data.size == 0:
+ raise ValueError('Zero-sized array')
+
+ minimum = None
+ argmin = None
+ maximum = None
+ argmax = None
+ min_pos = None
+ argmin_pos = None
+
+ if finite:
+ filtered_data = data[numpy.isfinite(data)]
+ else:
+ filtered_data = data
- minimum = numpy.nanmin(data)
- if numpy.isnan(minimum): # All NaNs
- self.assertTrue(numpy.isnan(result.minimum))
- self.assertEqual(result.argmin, 0)
+ if filtered_data.size > 0:
+ minimum = numpy.nanmin(filtered_data)
+ if numpy.isnan(minimum):
+ argmin = 0
+ else:
+ # nanargmin equivalent
+ argmin = numpy.where(data == minimum)[0][0]
- else:
- self.assertEqual(result.minimum, minimum)
+ maximum = numpy.nanmax(filtered_data)
+ if numpy.isnan(maximum):
+ argmax = 0
+ else:
+ # nanargmax equivalent
+ argmax = numpy.where(data == maximum)[0][0]
- argmin = numpy.where(data == minimum)[0][0]
- self.assertEqual(result.argmin, argmin)
+ if min_positive:
+ pos_data = filtered_data[filtered_data > 0]
+ if pos_data.size > 0:
+ min_pos = numpy.min(pos_data)
+ argmin_pos = numpy.where(data == min_pos)[0][0]
- maximum = numpy.nanmax(data)
- if numpy.isnan(maximum): # All NaNs
- self.assertTrue(numpy.isnan(result.maximum))
- self.assertEqual(result.argmax, 0)
+ return minimum, min_pos, maximum, argmin, argmin_pos, argmax
- else:
- self.assertEqual(result.maximum, maximum)
+ def _test_min_max(self, data, min_positive, finite=False):
+ """Compare min_max with numpy for the given dataset
- argmax = numpy.where(data == maximum)[0][0]
- self.assertEqual(result.argmax, argmax)
+ :param numpy.ndarray data: Data set to use for test
+ :param bool min_positive: True to test with positive min
+ :param bool finite: True to only test finite values
+ """
+ minimum, min_pos, maximum, argmin, argmin_pos, argmax = \
+ self._numpy_min_max(data, min_positive, finite)
- if min_positive:
- pos_data = data[data > 0]
- if len(pos_data) > 0:
- min_pos = numpy.min(pos_data)
- argmin_pos = numpy.where(data == min_pos)[0][0]
- else:
- min_pos = None
- argmin_pos = None
- self.assertEqual(result.min_positive, min_pos)
- self.assertEqual(result.argmin_positive, argmin_pos)
+ result = min_max(data, min_positive, finite)
+
+ self.assertSimilar(minimum, result.minimum)
+ self.assertSimilar(min_pos, result.min_positive)
+ self.assertSimilar(maximum, result.maximum)
+ self.assertSimilar(argmin, result.argmin)
+ self.assertSimilar(argmin_pos, result.argmin_positive)
+ self.assertSimilar(argmax, result.argmax)
+
+ def assertSimilar(self, a, b):
+ """Assert that a and b are both None or NaN or that a == b."""
+ self.assertTrue((a is None and b is None) or
+ (numpy.isnan(a) and numpy.isnan(b)) or
+ a == b)
def test_different_datasets(self):
"""Test min_max with different numpy.arange datasets."""
@@ -122,39 +152,56 @@ class TestMinMax(ParametricTestCase):
with self.assertRaises(ValueError):
min_max(data)
+ NAN_TEST_DATA = [
+ (float('nan'), float('nan')), # All NaNs
+ (float('nan'), 1.0), # NaN first and positive
+ (float('nan'), -1.0), # NaN first and negative
+ (1.0, 2.0, float('nan')), # NaN last and positive
+ (-1.0, -2.0, float('nan')), # NaN last and negative
+ (1.0, float('nan'), -1.0), # Some NaN
+ ]
+
def test_nandata(self):
"""Test min_max with NaN in data"""
- tests = [
- (float('nan'), float('nan')), # All NaNs
- (float('nan'), 1.0), # NaN first and positive
- (float('nan'), -1.0), # NaN first and negative
- (1.0, 2.0, float('nan')), # NaN last and positive
- (-1.0, -2.0, float('nan')), # NaN last and negative
- (1.0, float('nan'), -1.0), # Some NaN
- ]
-
for dtype in self.FLOATING_DTYPES:
- for data in tests:
+ for data in self.NAN_TEST_DATA:
with self.subTest(dtype=dtype, data=data):
data = numpy.array(data, dtype=dtype)
self._test_min_max(data, min_positive=True)
+ INF_TEST_DATA = [
+ [float('inf')] * 3, # All +inf
+ [float('-inf')] * 3, # All -inf
+ (float('inf'), float('-inf')), # + and - inf
+ (float('inf'), float('-inf'), float('nan')), # +/-inf, nan last
+ (float('nan'), float('-inf'), float('inf')), # +/-inf, nan first
+ (float('inf'), float('nan'), float('-inf')), # +/-inf, nan center
+ ]
+
def test_infdata(self):
"""Test min_max with inf."""
+ for dtype in self.FLOATING_DTYPES:
+ for data in self.INF_TEST_DATA:
+ with self.subTest(dtype=dtype, data=data):
+ data = numpy.array(data, dtype=dtype)
+ self._test_min_max(data, min_positive=True)
+
+ def test_finite(self):
+ """Test min_max with finite=True"""
tests = [
- [float('inf')] * 3, # All +inf
- [float('inf')] * 3, # All -inf
- (float('inf'), float('-inf')), # + and - inf
- (float('inf'), float('-inf'), float('nan')), # +/-inf, nan last
- (float('nan'), float('-inf'), float('inf')), # +/-inf, nan first
- (float('inf'), float('nan'), float('-inf')), # +/-inf, nan center
+ (-1., 2., 0.), # Basic test
+ (float('nan'), float('inf'), float('-inf')), # NaN + Inf
+ (float('nan'), float('inf'), -2, float('-inf')), # NaN + Inf + 1 value
+ (float('inf'), -3, -2), # values + inf
]
+ tests += self.INF_TEST_DATA
+ tests += self.NAN_TEST_DATA
for dtype in self.FLOATING_DTYPES:
for data in tests:
with self.subTest(dtype=dtype, data=data):
data = numpy.array(data, dtype=dtype)
- self._test_min_max(data, min_positive=True)
+ self._test_min_max(data, min_positive=True, finite=True)
def suite():
diff --git a/silx/math/test/test_histogramnd_error.py b/silx/math/test/test_histogramnd_error.py
index 575eaf0..a8c66a0 100644
--- a/silx/math/test/test_histogramnd_error.py
+++ b/silx/math/test/test_histogramnd_error.py
@@ -426,6 +426,28 @@ class Test_chistogramnd_1D_errors(_Test_chistogramnd_errors):
(np.uint16, np.double),
(np.uint16, np.uint16))
+class Test_chistogramnd_ND_range(unittest.TestCase):
+ """
+
+ """
+
+ def test_invalid_histo_range(self):
+ data = np.random.random((60, 60))
+ nbins = 10
+
+ with self.assertRaises(ValueError):
+ histo_range = data.min(), np.inf
+
+ Histogramnd(sample=data.ravel(),
+ histo_range=histo_range,
+ n_bins=nbins)
+
+ histo_range = data.min(), np.nan
+
+ Histogramnd(sample=data.ravel(),
+ histo_range=histo_range,
+ n_bins=nbins)
+
class Test_chistogramnd_ND_errors(_Test_chistogramnd_errors):
"""
@@ -497,7 +519,8 @@ class Test_chistogramnd_ND_errors(_Test_chistogramnd_errors):
test_cases = (Test_chistogramnd_1D_errors,
- Test_chistogramnd_ND_errors,)
+ Test_chistogramnd_ND_errors,
+ Test_chistogramnd_ND_range)
def suite():
diff --git a/silx/math/test/test_histogramnd_nominal.py b/silx/math/test/test_histogramnd_nominal.py
index f4550e4..9f97521 100644
--- a/silx/math/test/test_histogramnd_nominal.py
+++ b/silx/math/test/test_histogramnd_nominal.py
@@ -666,8 +666,6 @@ class _Test_Histogramnd_nominal(unittest.TestCase):
self.assertTrue(np.array_equal(histo, expected_h))
self.assertTrue(cumul is None)
-
-
def test_nominal_last_bin_closed(self):
"""
"""
@@ -842,7 +840,6 @@ class _Test_Histogramnd_nominal(unittest.TestCase):
self.assertTrue(np.array_equal(histo, expected_h))
self.assertTrue(np.allclose(cumul, expected_c, rtol=10e-15))
-
def test_accumulate_no_weights_at_init(self):
"""
"""
@@ -883,6 +880,24 @@ class _Test_Histogramnd_nominal(unittest.TestCase):
self.assertTrue(np.array_equal(histo, expected_h))
self.assertTrue(np.array_equal(cumul, expected_c))
+ def testNoneNativeTypes(self):
+ type = self.sample.dtype.newbyteorder("B")
+ sampleB = self.sample.astype(type)
+
+ type = self.sample.dtype.newbyteorder("L")
+ sampleL = self.sample.astype(type)
+
+ histo_inst = Histogramnd(sampleB,
+ self.histo_range,
+ self.n_bins,
+ weights=self.weights)
+
+ histo_inst = Histogramnd(sampleL,
+ self.histo_range,
+ self.n_bins,
+ weights=self.weights)
+
+
class Test_chistogram_nominal_1d(_Test_chistogramnd_nominal):
ndims = 1
diff --git a/silx/opencl/__init__.py b/silx/opencl/__init__.py
index b970338..353b74b 100644
--- a/silx/opencl/__init__.py
+++ b/silx/opencl/__init__.py
@@ -40,7 +40,7 @@ __status__ = "stable"
import logging
-logger = logging.getLogger("silx.opencl")
+logger = logging.getLogger(__name__)
from .common import *
diff --git a/silx/opencl/backprojection.py b/silx/opencl/backprojection.py
new file mode 100644
index 0000000..15a03b9
--- /dev/null
+++ b/silx/opencl/backprojection.py
@@ -0,0 +1,488 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Module for (filtered) backprojection on the GPU"""
+
+from __future__ import absolute_import, print_function, with_statement, division
+
+__authors__ = ["A. Mirone, P. Paleo"]
+__license__ = "MIT"
+__date__ = "05/10/2017"
+
+import logging
+import numpy
+
+from .common import pyopencl
+from .processing import EventDescription, OpenclProcessing, BufferDescription
+from .utils import nextpower as nextpow2
+
+if pyopencl:
+ mf = pyopencl.mem_flags
+ import pyopencl.array as parray
+else:
+ raise ImportError("pyopencl is not installed")
+logger = logging.getLogger(__name__)
+
+# put in .common ?
+try:
+ from pyfft.cl import Plan as pyfft_Plan
+ _has_pyfft = True
+except ImportError:
+ _has_pyfft = False
+# For silx v0.6 we disable the use FFT on GPU.
+_has_pyfft = False
+
+
+def _sizeof(Type):
+ """
+ return the size (in bytes) of a scalar type, like the C behavior
+ """
+ return numpy.dtype(Type).itemsize
+
+
+def _idivup(a, b):
+ """
+ return the integer division, plus one if `a` is not a multiple of `b`
+ """
+ return (a + (b - 1)) // b
+
+
+def fourier_filter(sino, filter_=None, fft_size=None):
+ """Simple numpy based implementation of fourier space filter
+
+ :param sino: of shape shape = (num_projs, num_bins)
+ :param filter: filter function to apply in fourier space
+ :fft_size: size on which perform the fft. May be larger than the sino array
+ :return: filtered sinogram
+ """
+ assert sino.ndim == 2
+ num_projs, num_bins = sino.shape
+ if fft_size is None:
+ fft_size = nextpow2(num_bins * 2 - 1)
+ else:
+ assert fft_size >= num_bins
+ if fft_size == num_bins:
+ sino_zeropadded = sino.astype(numpy.float32)
+ else:
+ sino_zeropadded = numpy.zeros((num_projs, fft_size),
+ dtype=numpy.complex64)
+ sino_zeropadded[:, :num_bins] = sino.astype(numpy.float32)
+
+ if filter_ is None:
+ h = numpy.zeros(fft_size, dtype=numpy.float32)
+ L2 = fft_size // 2 + 1
+ h[0] = 1 / 4.
+ j = numpy.linspace(1, L2, L2 // 2, False)
+ h[1:L2:2] = -1. / (numpy.pi ** 2 * j ** 2)
+ h[L2:] = numpy.copy(h[1:L2 - 1][::-1])
+ filter_ = numpy.fft.fft(h).astype(numpy.complex64)
+
+ # Linear convolution
+ sino_f = numpy.fft.fft(sino, fft_size)
+ sino_f = sino_f * filter_
+ sino_filtered = numpy.fft.ifft(sino_f)[:, :num_bins].real
+ # Send the filtered sinogram to device
+ return numpy.ascontiguousarray(sino_filtered.real, dtype=numpy.float32)
+
+
+class Backprojection(OpenclProcessing):
+ """A class for performing the backprojection using OpenCL"""
+ kernel_files = ["backproj.cl", "array_utils.cl"]
+ if _has_pyfft:
+ kernel_files.append("backproj_helper.cl")
+
+ def __init__(self, sino_shape, slice_shape=None, axis_position=None,
+ angles=None, filter_name=None, ctx=None, devicetype="all",
+ platformid=None, deviceid=None, profile=False):
+ """Constructor of the OpenCL (filtered) backprojection
+
+ :param sino_shape: shape of the sinogram. The sinogram is in the format
+ (n_b, n_a) where n_b is the number of detector bins
+ and n_a is the number of angles.
+ :param slice_shape: Optional, shape of the reconstructed slice. By
+ default, it is a square slice where the dimension
+ is the "x dimension" of the sinogram (number of
+ bins).
+ :param axis_position: Optional, axis position. Default is
+ `(shape[1]-1)/2.0`.
+ :param angles: Optional, a list of custom angles in radian.
+ :param filter_name: Optional, name of the filter for FBP. Default is
+ the Ram-Lak filter.
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by
+ clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel
+ level, store profiling elements (makes code slightly
+ slower)
+ """
+ # OS X enforces a workgroup size of 1 when the kernel has
+ # synchronization barriers if sys.platform.startswith('darwin'):
+ # assuming no discrete GPU
+ # raise NotImplementedError("Backprojection is not implemented on CPU for OS X yet")
+
+ OpenclProcessing.__init__(self, ctx=ctx, devicetype=devicetype,
+ platformid=platformid, deviceid=deviceid,
+ profile=profile)
+ self.shape = sino_shape
+
+ self.num_bins = numpy.int32(sino_shape[1])
+ self.num_projs = numpy.int32(sino_shape[0])
+ self.angles = angles
+ if slice_shape is None:
+ self.slice_shape = (self.num_bins, self.num_bins)
+ else:
+ self.slice_shape = slice_shape
+ self.dimrec_shape = (
+ _idivup(self.slice_shape[0], 32) * 32,
+ _idivup(self.slice_shape[1], 32) * 32
+ )
+ self.slice = numpy.zeros(self.dimrec_shape, dtype=numpy.float32)
+ self.filter_name = filter_name if filter_name else "Ram-Lak"
+ if axis_position:
+ self.axis_pos = numpy.float32(axis_position)
+ else:
+ self.axis_pos = numpy.float32((sino_shape[1] - 1.) / 2)
+ self.axis_array = None # TODO: add axis correction front-end
+
+ self.is_cpu = False
+ if self.device.type == "CPU":
+ self.is_cpu = True
+
+ self.compute_fft_plans()
+ self.buffers = [
+ BufferDescription("_d_slice", numpy.prod(self.dimrec_shape), numpy.float32, mf.READ_WRITE),
+ BufferDescription("d_sino", self.num_projs * self.num_bins, numpy.float32, mf.READ_WRITE), # before transferring to texture (if available)
+ BufferDescription("d_cos", self.num_projs, numpy.float32, mf.READ_ONLY),
+ BufferDescription("d_sin", self.num_projs, numpy.float32, mf.READ_ONLY),
+ BufferDescription("d_axes", self.num_projs, numpy.float32, mf.READ_ONLY),
+ ]
+ self.allocate_buffers()
+ if not(self.is_cpu):
+ self.allocate_textures()
+ self.compute_filter()
+ if self.pyfft_plan:
+ self.add_to_cl_mem({
+ "d_filter": self.d_filter,
+ "d_sino_z": self.d_sino_z
+ })
+ self.d_sino = self.cl_mem["d_sino"] # shorthand
+ self.compute_angles()
+
+ self.local_mem = 256 * 3 * _sizeof(numpy.float32) # constant for all image sizes
+ OpenclProcessing.compile_kernels(self, self.kernel_files)
+ # check that workgroup can actually be (16, 16)
+ self.check_workgroup_size("backproj_cpu_kernel")
+ # Workgroup and ndrange sizes are always the same
+ self.wg = (16, 16)
+ self.ndrange = (
+ _idivup(int(self.dimrec_shape[1]), 32) * self.wg[0], # int(): pyopencl <= 2015.1
+ _idivup(int(self.dimrec_shape[0]), 32) * self.wg[1] # int(): pyopencl <= 2015.1
+ )
+
+ def compute_angles(self):
+ if self.angles is None:
+ self.angles = numpy.linspace(0, numpy.pi, self.num_projs, False)
+ h_cos = numpy.cos(self.angles).astype(numpy.float32)
+ h_sin = numpy.sin(self.angles).astype(numpy.float32)
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_cos"], h_cos)
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_sin"], h_sin)
+ if self.axis_array:
+ pyopencl.enqueue_copy(self.queue,
+ self.cl_mem["d_axes"],
+ self.axis_array.astype(numpy.float32))
+ else:
+ pyopencl.enqueue_copy(self.queue,
+ self.cl_mem["d_axes"],
+ numpy.ones(self.num_projs, dtype=numpy.float32) * self.axis_pos)
+
+ def allocate_textures(self):
+ """
+ Allocate the texture for the sinogram.
+ """
+ self.d_sino_tex = pyopencl.Image(
+ self.ctx,
+ mf.READ_ONLY | mf.USE_HOST_PTR,
+ pyopencl.ImageFormat(
+ pyopencl.channel_order.INTENSITY,
+ pyopencl.channel_type.FLOAT
+ ),
+ hostbuf=numpy.zeros(self.shape[::-1], dtype=numpy.float32)
+ )
+
+ def compute_fft_plans(self):
+ """
+ If pyfft is installed, prepare a batched 1D FFT plan for the filtering
+ of FBP
+
+ """
+ self.fft_size = nextpow2(self.num_bins * 2 - 1)
+ if _has_pyfft:
+ logger.debug("pyfft is available. Computing FFT plans...")
+ # batched 1D transform
+ self.pyfft_plan = pyfft_Plan(self.fft_size, queue=self.queue,
+ wait_for_finish=True)
+ self.d_sino_z = parray.zeros(self.queue,
+ (self.num_projs, self.fft_size),
+ dtype=numpy.complex64)
+ logger.debug("... done")
+ else:
+ logger.debug("pyfft not available, using numpy.fft")
+ self.pyfft_plan = None
+ # TODO: fall-back to fftw if present ?
+
+ def compute_filter(self):
+ """
+ Compute the filter for FBP
+ """
+ if self.filter_name == "Ram-Lak":
+ L = self.fft_size
+ h = numpy.zeros(L, dtype=numpy.float32)
+ L2 = L // 2 + 1
+ h[0] = 1 / 4.
+ j = numpy.linspace(1, L2, L2 // 2, False)
+ h[1:L2:2] = -1. / (numpy.pi ** 2 * j ** 2)
+ h[L2:] = numpy.copy(h[1:L2 - 1][::-1])
+ else:
+ # TODO: other filters
+ raise ValueError("Filter %s is not available" % self.filter_name)
+ self.filter = h
+ if self.pyfft_plan:
+ self.d_filter = parray.to_device(self.queue, h.astype(numpy.complex64))
+ self.pyfft_plan.execute(self.d_filter.data)
+ else:
+ self.filter = numpy.fft.fft(h).astype(numpy.complex64)
+ self.d_filter = None
+
+ def _get_local_mem(self):
+ return pyopencl.LocalMemory(self.local_mem) # constant for all image sizes
+
+ def cpy2d_to_slice(self, dst):
+ ndrange = (int(self.slice_shape[1]), int(self.slice_shape[0])) # pyopencl < 2015.2
+ slice_shape_ocl = numpy.int32(ndrange)
+ wg = None
+ kernel_args = (
+ dst.data,
+ self.cl_mem["_d_slice"],
+ numpy.int32(self.slice_shape[1]),
+ numpy.int32(self.dimrec_shape[1]),
+ numpy.int32((0, 0)),
+ numpy.int32((0, 0)),
+ slice_shape_ocl
+ )
+ return self.kernels.cpy2d(self.queue, ndrange, wg, *kernel_args)
+
+ def transfer_to_texture(self, sino):
+ sino2 = sino
+ if not(sino.flags["C_CONTIGUOUS"] and sino.dtype == numpy.float32):
+ sino2 = numpy.ascontiguousarray(sino, dtype=numpy.float32)
+ if self.is_cpu:
+ ev = pyopencl.enqueue_copy(
+ self.queue,
+ self.d_sino,
+ sino2
+ )
+ what = "transfer filtered sino H->D buffer"
+ else:
+ ev = pyopencl.enqueue_copy(
+ self.queue,
+ self.d_sino_tex,
+ sino2,
+ origin=(0, 0),
+ region=self.shape[::-1]
+ )
+ what = "transfer filtered sino H->D texture"
+ return EventDescription(what, ev)
+
+ def transfer_device_to_texture(self, d_sino):
+ if self.is_cpu:
+ if id(self.d_sino) == id(d_sino):
+ return
+ ev = pyopencl.enqueue_copy(
+ self.queue,
+ self.d_sino,
+ d_sino
+ )
+ what = "transfer filtered sino D->D buffer"
+ else:
+ ev = pyopencl.enqueue_copy(
+ self.queue,
+ self.d_sino_tex,
+ d_sino,
+ offset=0,
+ origin=(0, 0),
+ region=self.shape[::-1]
+ )
+ what = "transfer filtered sino D->D texture"
+ return EventDescription(what, ev)
+
+ def backprojection(self, sino=None, dst=None):
+ """Perform the backprojection on an input sinogram
+
+ :param sino: sinogram. If provided, it returns the plain backprojection.
+ :param dst: destination (pyopencl.Array). If provided, the result will be written in this array.
+ :return: backprojection of sinogram
+ """
+ events = []
+ with self.sem:
+
+ if sino is not None: # assuming numpy.ndarray
+ events.append(self.transfer_to_texture(sino))
+ # Prepare arguments for the kernel call
+ if self.is_cpu:
+ d_sino_ref = self.d_sino
+ else:
+ d_sino_ref = self.d_sino_tex
+ kernel_args = (
+ self.num_projs, # num of projections (int32)
+ self.num_bins, # num of bins (int32)
+ self.axis_pos, # axis position (float32)
+ self.cl_mem["_d_slice"], # d_slice (__global float32*)
+ d_sino_ref, # d_sino (__read_only image2d_t or float*)
+ numpy.float32(0), # gpu_offset_x (float32)
+ numpy.float32(0), # gpu_offset_y (float32)
+ self.cl_mem["d_cos"], # d_cos (__global float32*)
+ self.cl_mem["d_sin"], # d_sin (__global float32*)
+ self.cl_mem["d_axes"], # d_axis (__global float32*)
+ self._get_local_mem() # shared mem (__local float32*)
+ )
+ # Call the kernel
+ if self.is_cpu:
+ kernel_to_call = self.kernels.backproj_cpu_kernel
+ else:
+ kernel_to_call = self.kernels.backproj_kernel
+ event_bpj = kernel_to_call(
+ self.queue,
+ self.ndrange,
+ self.wg,
+ *kernel_args
+ )
+ if dst is None:
+ self.slice[:] = 0
+ events.append(EventDescription("backprojection", event_bpj))
+ ev = pyopencl.enqueue_copy(self.queue, self.slice,
+ self.cl_mem["_d_slice"])
+ events.append(EventDescription("copy D->H result", ev))
+ ev.wait()
+ res = numpy.copy(self.slice)
+ if self.dimrec_shape[0] > self.slice_shape[0] or self.dimrec_shape[1] > self.slice_shape[1]:
+ res = res[:self.slice_shape[0], :self.slice_shape[1]]
+ # if the slice is backprojected onto a bigger grid
+ if self.slice_shape[1] > self.num_bins:
+ res = res[:self.slice_shape[0], :self.slice_shape[1]]
+ else:
+ ev = self.cpy2d_to_slice(dst)
+ events.append(EventDescription("copy D->D result", ev))
+ ev.wait()
+ res = dst
+
+ # /with self.sem
+ if self.profile:
+ self.events += events
+
+ return res
+
+ def filter_projections(self, sino, rescale=True):
+ """
+ Performs the FBP on a given sinogram.
+
+ :param sinogram: sinogram to (filter-)backproject
+ :param rescale: if True (default), the sinogram is multiplied with
+ (pi/n_projs)
+ """
+ if sino.shape[0] != self.num_projs or sino.shape[1] != self.num_bins:
+ raise ValueError("Expected sinogram with (projs, bins) = (%d, %d)" % (self.num_projs, self.num_bins))
+ if rescale:
+ sino = sino * numpy.pi / self.num_projs
+ events = []
+ # if pyfft is available, all can be done on the device
+ if self.d_filter is not None:
+
+ # Zero-pad the sinogram.
+ # TODO: this can be done on GPU with a "Memcpy2D":
+ # cl.enqueue_copy(queue, dst, src, host_origin=(0,0), buffer_origin=(0,0), region=shape, host_pitches=(sino.shape[1],), buffer_pitches=(self.fft_size,))
+ # However it does not work properly, and raises an error for pyopencl < 2017.1
+ sino_zeropadded = numpy.zeros((sino.shape[0], self.fft_size), dtype=numpy.complex64)
+ sino_zeropadded[:, :self.num_bins] = sino.astype(numpy.float32)
+ sino_zeropadded = numpy.ascontiguousarray(sino_zeropadded, dtype=numpy.complex64)
+ with self.sem:
+ # send to GPU
+ ev = pyopencl.enqueue_copy(self.queue, self.d_sino_z.data, sino_zeropadded)
+ events.append(EventDescription("Send sino H->D", ev))
+
+ # FFT (in-place)
+ self.pyfft_plan.execute(self.d_sino_z.data, batch=self.num_projs)
+
+ # Multiply (complex-wise) with the the filter
+ ev = self.kernels.mult(self.queue,
+ tuple(int(i) for i in self.d_sino_z.shape[::-1]),
+ None,
+ self.d_sino_z.data,
+ self.d_filter.data,
+ numpy.int32(self.fft_size),
+ self.num_projs
+ )
+ events.append(EventDescription("complex 2D-1D multiplication", ev))
+ # Inverse FFT (in-place)
+ self.pyfft_plan.execute(self.d_sino_z.data, batch=self.num_projs, inverse=True)
+ # Copy the real part of d_sino_z[:, :self.num_bins] (complex64) to d_sino (float32)
+ ev = self.kernels.cpy2d_c2r(self.queue, self.shape[::-1], None,
+ self.d_sino,
+ self.d_sino_z.data,
+ self.num_bins,
+ self.num_projs,
+ numpy.int32(self.fft_size)
+ )
+ events.append(EventDescription("conversion from complex padded sinogram to sinogram", ev))
+ # debug
+# ev.wait()
+# h_sino = numpy.zeros(sino.shape, dtype=numpy.float32)
+# ev = pyopencl.enqueue_copy(self.queue, h_sino, self.d_sino)
+# ev.wait()
+# numpy.save("/tmp/filtered_sinogram_%s.npy" % self.ctx.devices[0].platform.name.split()[0], h_sino)
+ events.append(self.transfer_device_to_texture(self.d_sino))
+ # ------
+ else: # no pyfft
+ sino_filtered = fourier_filter(sino, filter_=self.filter, fft_size=self.fft_size)
+ with self.sem:
+ events.append(self.transfer_to_texture(sino_filtered))
+ if self.profile:
+ self.events += events
+
+ def filtered_backprojection(self, sino):
+ """
+ Compute the filtered backprojection (FBP) on a sinogram.
+
+ :param sino: sinogram (`numpy.ndarray`) in the format (projections,
+ bins)
+ """
+
+ self.filter_projections(sino)
+ res = self.backprojection()
+ return res
+
+ __call__ = filtered_backprojection
diff --git a/silx/opencl/common.py b/silx/opencl/common.py
index fcb4efa..ebf50c7 100644
--- a/silx/opencl/common.py
+++ b/silx/opencl/common.py
@@ -34,7 +34,7 @@ __author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "2012-2017 European Synchrotron Radiation Facility, Grenoble, France"
-__date__ = "15/03/2017"
+__date__ = "05/10/2017"
__status__ = "stable"
__all__ = ["ocl", "pyopencl", "mf", "release_cl_buffers", "allocate_cl_buffers",
"measure_workgroup_size", "kernel_workgroup_size"]
@@ -47,7 +47,7 @@ import numpy
from .utils import get_opencl_code
-logger = logging.getLogger("silx.opencl")
+logger = logging.getLogger(__name__)
if os.environ.get("SILX_OPENCL") in ["0", "False"]:
@@ -59,14 +59,17 @@ else:
except ImportError:
logger.warning("Unable to import pyOpenCl. Please install it from: http://pypi.python.org/pypi/pyopencl")
pyopencl = None
- class mf(object):
- WRITE_ONLY = 1
- READ_ONLY = 1
- READ_WRITE = 1
else:
import pyopencl.array as array
mf = pyopencl.mem_flags
+if pyopencl is None:
+ # Define default mem flags
+ class mf(object):
+ WRITE_ONLY = 1
+ READ_ONLY = 1
+ READ_WRITE = 1
+
FLOP_PER_CORE = {"GPU": 64, # GPU, Fermi at least perform 64 flops per cycle/multicore, G80 were at 24 or 48 ...
"CPU": 4, # CPU, at least intel's have 4 operation per cycle
@@ -362,6 +365,8 @@ class OpenCL(object):
:param memory: minimum amount of memory (int)
:param extensions: list of extensions to be present
:param best: shall we look for the
+ :returns: A tuple of plateform ID and device ID, else None if nothing
+ found
"""
if extensions is None:
extensions = []
@@ -391,6 +396,9 @@ class OpenCL(object):
if best_found:
return best_found[0], best_found[1]
+ # Nothing found
+ return None
+
def create_context(self, devicetype="ALL", useFp64=False, platformid=None,
deviceid=None, cached=True):
"""
@@ -411,14 +419,17 @@ class OpenCL(object):
if (platformid is not None) and (deviceid is not None):
platformid = int(platformid)
deviceid = int(deviceid)
+ elif "PYOPENCL_CTX" in os.environ:
+ pyopencl_ctx = [int(i) if i.isdigit() else 0 for i in os.environ["PYOPENCL_CTX"].split(":")]
+ pyopencl_ctx += [0] * (2 - len(pyopencl_ctx)) # pad with 0
+ platformid, deviceid = pyopencl_ctx
else:
if useFp64:
ids = ocl.select_device(type=devicetype, extensions=["cl_khr_int64_base_atomics"])
else:
ids = ocl.select_device(dtype=devicetype)
if ids:
- platformid = ids[0]
- deviceid = ids[1]
+ platformid, deviceid = ids
if (platformid is not None) and (deviceid is not None):
if (platformid, deviceid) in self.context_cache:
ctx = self.context_cache[(platformid, deviceid)]
@@ -444,6 +455,7 @@ class OpenCL(object):
platform_id = pyopencl.get_platforms().index(oplat)
return self.platforms[platform_id].devices[device_id]
+
if pyopencl:
ocl = OpenCL()
if ocl.nb_devices == 0:
@@ -558,4 +570,3 @@ def kernel_workgroup_size(program, kernel):
device = program.devices[0]
query_wg = pyopencl.kernel_work_group_info.WORK_GROUP_SIZE
return kernel.get_work_group_info(query_wg, device)
-
diff --git a/silx/opencl/linalg.py b/silx/opencl/linalg.py
new file mode 100644
index 0000000..fba3e9c
--- /dev/null
+++ b/silx/opencl/linalg.py
@@ -0,0 +1,218 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Module for basic linear algebra in OpenCL"""
+
+from __future__ import absolute_import, print_function, with_statement, division
+
+__authors__ = ["P. Paleo"]
+__license__ = "MIT"
+__date__ = "10/08/2017"
+
+import numpy as np
+
+from .common import pyopencl
+from .processing import EventDescription, OpenclProcessing
+
+import pyopencl.array as parray
+cl = pyopencl
+
+
+class LinAlg(OpenclProcessing):
+
+ kernel_files = ["linalg.cl"]
+
+ def __init__(self, shape, do_checks=False, ctx=None, devicetype="all", platformid=None, deviceid=None, profile=False):
+ """
+ Create a "Linear Algebra" plan for a given image shape.
+
+ :param shape: shape of the image (num_rows, num_columns)
+ :param do_checks (optional): if True, memory and data type checks are performed when possible.
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel level,
+ store profiling elements (makes code slightly slower)
+
+ """
+ OpenclProcessing.__init__(self, ctx=ctx, devicetype=devicetype,
+ platformid=platformid, deviceid=deviceid,
+ profile=profile)
+
+ self.d_gradient = parray.zeros(self.queue, shape, np.complex64)
+ self.d_image = parray.zeros(self.queue, shape, np.float32)
+ self.add_to_cl_mem({
+ "d_gradient": self.d_gradient,
+ "d_image": self.d_image
+ })
+
+ self.wg2D = None
+ self.shape = shape
+ self.ndrange2D = (
+ int(self.shape[1]),
+ int(self.shape[0])
+ )
+ self.do_checks = bool(do_checks)
+ OpenclProcessing.compile_kernels(self, self.kernel_files)
+
+ @staticmethod
+ def check_array(array, dtype, shape, arg_name):
+ if array.shape != shape or array.dtype != dtype:
+ raise ValueError("%s should be a %s array of type %s" %(arg_name, str(shape), str(dtype)))
+
+ def get_data_references(self, src, dst, default_src_ref, default_dst_ref):
+ """
+ From various types of src and dst arrays,
+ returns the references to the underlying data (Buffer) that will be used by the OpenCL kernels.
+ # TODO documentation
+
+ This function will make a copy host->device if the input is on host (eg. numpy array)
+ """
+ if dst is not None:
+ if isinstance(dst, cl.array.Array):
+ dst_ref = dst.data
+ elif isinstance(dst, cl.Buffer):
+ dst_ref = dst
+ else:
+ raise ValueError("dst should be either pyopencl.array.Array or pyopencl.Buffer")
+ else:
+ dst_ref = default_dst_ref
+
+ if isinstance(src, cl.array.Array):
+ src_ref = src.data
+ elif isinstance(src, cl.Buffer):
+ src_ref = src
+ else: # assuming numpy.ndarray
+ evt = cl.enqueue_copy(self.queue, default_src_ref, src)
+ self.events.append(EventDescription("copy H->D", evt))
+ src_ref = default_src_ref
+ return src_ref, dst_ref
+
+ def gradient(self, image, dst=None, return_to_host=False):
+ """
+ Compute the spatial gradient of an image.
+ The gradient is computed with first-order difference (not central difference).
+
+ :param image: image to compute the gradient from. It can be either a numpy.ndarray, a pyopencl Array or Buffer.
+ :param dst: optional, reference to a destination pyopencl Array or Buffer. It must be of complex64 data type.
+ :param return_to_host: optional, set to True if you want the result to be transferred back to host.
+
+ if dst is provided, it should be of type numpy.complex64 !
+ """
+ n_y, n_x = np.int32(self.shape)
+ if self.do_checks:
+ self.check_array(image, np.float32, self.shape, "image")
+ if dst is not None:
+ self.check_array(dst, np.complex64, self.shape, "dst")
+ img_ref, grad_ref = self.get_data_references(image, dst, self.d_image.data, self.d_gradient.data)
+
+ # Prepare the kernel call
+ kernel_args = [
+ img_ref,
+ grad_ref,
+ n_x,
+ n_y
+ ]
+ # Call the gradient kernel
+ evt = self.kernels.kern_gradient2D(
+ self.queue,
+ self.ndrange2D,
+ self.wg2D,
+ *kernel_args
+ )
+ self.events.append(EventDescription("gradient2D", evt))
+ # TODO: should the wait be done in any case ?
+ # In the case where dst=None, the wait() is mandatory since a user will be doing arithmetic on dst afterwards
+ if dst is None:
+ evt.wait()
+
+ if return_to_host:
+ if dst is not None:
+ res_tmp = self.d_gradient.get()
+ else:
+ res_tmp = np.zeros(self.shape, dtype=np.complex64)
+ cl.enqueue_copy(self.queue, res_tmp, grad_ref)
+ res = np.zeros((2,) + self.shape, dtype=np.float32)
+ res[0] = np.copy(res_tmp.real)
+ res[1] = np.copy(res_tmp.imag)
+ return res
+ else:
+ return dst
+
+ def divergence(self, gradient, dst=None, return_to_host=False):
+ """
+ Compute the spatial divergence of an image.
+ The divergence is designed to be the (negative) adjoint of the gradient.
+
+ :param gradient: gradient-like array to compute the divergence from. It can be either a numpy.ndarray, a pyopencl Array or Buffer.
+ :param dst: optional, reference to a destination pyopencl Array or Buffer. It must be of complex64 data type.
+ :param return_to_host: optional, set to True if you want the result to be transferred back to host.
+
+ if dst is provided, it should be of type numpy.complex64 !
+ """
+ n_y, n_x = np.int32(self.shape)
+ # numpy.ndarray gradients are expected to be (2, n_y, n_x)
+ if isinstance(gradient, np.ndarray):
+ gradient2 = np.zeros(self.shape, dtype=np.complex64)
+ gradient2.real = np.copy(gradient[0])
+ gradient2.imag = np.copy(gradient[1])
+ gradient = gradient2
+ elif self.do_checks:
+ self.check_array(gradient, np.complex64, self.shape, "gradient")
+ if dst is not None:
+ self.check_array(dst, np.float32, self.shape, "dst")
+ grad_ref, img_ref = self.get_data_references(gradient, dst, self.d_gradient.data, self.d_image.data)
+
+ # Prepare the kernel call
+ kernel_args = [
+ grad_ref,
+ img_ref,
+ n_x,
+ n_y
+ ]
+ # Call the gradient kernel
+ evt = self.kernels.kern_divergence2D(
+ self.queue,
+ self.ndrange2D,
+ self.wg2D,
+ *kernel_args
+ )
+ self.events.append(EventDescription("divergence2D", evt))
+ # TODO: should the wait be done in any case ?
+ # In the case where dst=None, the wait() is mandatory since a user will be doing arithmetic on dst afterwards
+ if dst is None:
+ evt.wait()
+
+ if return_to_host:
+ if dst is not None:
+ res = self.d_image.get()
+ else:
+ res = np.zeros(self.shape, dtype=np.float32)
+ cl.enqueue_copy(self.queue, res, img_ref)
+ return res
+ else:
+ return dst
diff --git a/silx/opencl/medfilt.py b/silx/opencl/medfilt.py
index 90cd49a..d4e425b 100644
--- a/silx/opencl/medfilt.py
+++ b/silx/opencl/medfilt.py
@@ -36,7 +36,7 @@ from __future__ import absolute_import, print_function, with_statement, division
__author__ = "Jerome Kieffer"
__license__ = "MIT"
-__date__ = "15/03/2017"
+__date__ = "12/09/2017"
__copyright__ = "2012-2017, ESRF, Grenoble"
__contact__ = "jerome.kieffer@esrf.fr"
@@ -51,7 +51,7 @@ if pyopencl:
mf = pyopencl.mem_flags
else:
raise ImportError("pyopencl is not installed")
-logger = logging.getLogger("silx.opencl.medfilt")
+logger = logging.getLogger(__name__)
class MedianFilter2D(OpenclProcessing):
@@ -202,7 +202,7 @@ class MedianFilter2D(OpenclProcessing):
kwargs["width"] = numpy.int32(image.shape[1])
# for k, v in kwargs.items():
# print("%s: %s (%s)" % (k, v, type(v)))
- mf2d = self.program.medfilt2d(self.queue,
+ mf2d = self.kernels.medfilt2d(self.queue,
(wg, image.shape[1]),
(wg, 1), *list(kwargs.values()))
events.append(EventDescription("median filter 2d", mf2d))
@@ -264,6 +264,6 @@ class _MedFilt2d(object):
new_shape = numpy.maximum(numpy.array(cls.median_filter.shape), shape)
ctx = cls.median_filter.ctx
cls.median_filter = MedianFilter2D(new_shape, kernel_size, ctx=ctx)
- return cls.median_filter.medfilt2d(image)
+ return cls.median_filter.medfilt2d(image, kernel_size=kernel_size)
medfilt2d = _MedFilt2d.medfilt2d
diff --git a/silx/opencl/processing.py b/silx/opencl/processing.py
index ca46701..1997a55 100644
--- a/silx/opencl/processing.py
+++ b/silx/opencl/processing.py
@@ -4,7 +4,7 @@
# Project: S I L X project
# https://github.com/silx-kit/silx
#
-# Copyright (C) European Synchrotron Radiation Facility, Grenoble, France
+# Copyright (C) 2012-2017 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
@@ -41,7 +41,7 @@ __author__ = "Jerome Kieffer"
__contact__ = "Jerome.Kieffer@ESRF.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-__date__ = "03/02/2017"
+__date__ = "03/10/2017"
__status__ = "stable"
@@ -51,14 +51,34 @@ import gc
from collections import namedtuple
import numpy
import threading
-from .common import ocl, pyopencl, release_cl_buffers
+from .common import ocl, pyopencl, release_cl_buffers, kernel_workgroup_size
from .utils import concatenate_cl_kernel
BufferDescription = namedtuple("BufferDescription", ["name", "size", "dtype", "flags"])
EventDescription = namedtuple("EventDescription", ["name", "event"])
-logger = logging.getLogger("pyFAI.opencl.processing")
+logger = logging.getLogger(__name__)
+
+
+class KernelContainer(object):
+ """Those object holds a copy of all kernels accessible as attributes"""
+
+ def __init__(self, program):
+ """Constructor of the class
+
+ :param program: the OpenCL program as generated by PyOpenCL
+ """
+ for kernel in program.all_kernels():
+ self.__setattr__(kernel.function_name, kernel)
+
+ def get_kernels(self):
+ "return the dictionary with all kernels"
+ return self.__dict__.copy()
+
+ def get_kernel(self, name):
+ "get a kernel from its name"
+ return self.__dict__.get(name)
class OpenclProcessing(object):
@@ -85,9 +105,10 @@ class OpenclProcessing(object):
:param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
:param platformid: integer with the platform_identifier, as given by clinfo
:param deviceid: Integer with the device identifier, as given by clinfo
- :param block_size: preferred workgroup size, may vary depending on the outpcome of the compilation
- :param profile: switch on profiling to be able to profile at the kernel level,
- store profiling elements (makes code slightly slower)
+ :param block_size: preferred workgroup size, may vary depending on the
+ out come of the compilation
+ :param profile: switch on profiling to be able to profile at the kernel
+ level, store profiling elements (makes code slightly slower)
"""
self.sem = threading.Semaphore()
self.profile = None
@@ -108,6 +129,7 @@ class OpenclProcessing(object):
self.set_profiling(profile)
self.block_size = block_size
self.program = None
+ self.kernels = None
def __del__(self):
"""Destructor: release all buffers and programs
@@ -145,8 +167,8 @@ class OpenclProcessing(object):
ualloc = 0
for buf in buffers:
ualloc += numpy.dtype(buf.dtype).itemsize * buf.size
- logger.info("%.3fMB are needed on device which has %.3fMB",
- ualloc / 1.0e6, self.device.memory / 1.0e6)
+ logger.info("%.3fMB are needed on device: %s, which has %.3fMB",
+ ualloc / 1.0e6, self.device, self.device.memory / 1.0e6)
if ualloc >= self.device.memory:
raise MemoryError("Fatal error in allocate_buffers. Not enough "
@@ -157,13 +179,29 @@ class OpenclProcessing(object):
try:
for buf in buffers:
size = numpy.dtype(buf.dtype).itemsize * buf.size
- mem[buf.name] = pyopencl.Buffer(self.ctx, buf.flags, size)
+ mem[buf.name] = pyopencl.Buffer(self.ctx, buf.flags, int(size))
except pyopencl.MemoryError as error:
release_cl_buffers(mem)
raise MemoryError(error)
self.cl_mem.update(mem)
+ def add_to_cl_mem(self, parrays):
+ """
+ Add pyopencl.array, which are allocated by pyopencl, to self.cl_mem.
+ This should be used before calling allocate_buffers().
+
+ :param parrays: a dictionary of `pyopencl.array.Array` or `pyopencl.Buffer`
+ """
+ mem = self.cl_mem
+ for name, parr in parrays.items():
+ mem[name] = parr
+ self.cl_mem.update(mem)
+
+ def check_workgroup_size(self, kernel_name):
+ kernel = self.kernels.get_kernel(kernel_name)
+ self.compiletime_workgroup_size = kernel_workgroup_size(self.program, kernel)
+
def free_buffers(self):
"""free all device.memory allocated on the device
"""
@@ -199,12 +237,15 @@ class OpenclProcessing(object):
self.program = pyopencl.Program(self.ctx, kernel_src).build(options=compile_options)
except (pyopencl.MemoryError, pyopencl.LogicError) as error:
raise MemoryError(error)
+ else:
+ self.kernels = KernelContainer(self.program)
def free_kernels(self):
"""Free all kernels
"""
for kernel in self.cl_kernel_args:
self.cl_kernel_args[kernel] = []
+ self.kernels = None
self.program = None
def set_profiling(self, value=True):
diff --git a/silx/opencl/projection.py b/silx/opencl/projection.py
new file mode 100644
index 0000000..0ebe9bc
--- /dev/null
+++ b/silx/opencl/projection.py
@@ -0,0 +1,419 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Module for tomographic projector on the GPU"""
+
+from __future__ import absolute_import, print_function, with_statement, division
+
+__authors__ = ["A. Mirone, P. Paleo"]
+__license__ = "MIT"
+__date__ = "26/06/2017"
+
+import logging
+import numpy as np
+
+from .common import pyopencl
+from .processing import EventDescription, OpenclProcessing, BufferDescription
+from .backprojection import _sizeof, _idivup
+
+if pyopencl:
+ mf = pyopencl.mem_flags
+ import pyopencl.array as parray
+else:
+ raise ImportError("pyopencl is not installed")
+logger = logging.getLogger(__name__)
+
+
+class Projection(OpenclProcessing):
+ """
+ A class for performing a tomographic projection (Radon Transform) using
+ OpenCL
+ """
+ kernel_files = ["proj.cl", "array_utils.cl"]
+
+ def __init__(self, slice_shape, angles, axis_position=None,
+ detector_width=None, normalize=False, ctx=None,
+ devicetype="all", platformid=None, deviceid=None,
+ profile=False
+ ):
+ """Constructor of the OpenCL projector.
+
+ :param slice_shape: shape of the slice: (num_rows, num_columns).
+ :param angles: Either an integer number of angles, or a list of custom
+ angles values in radian.
+ :param axis_position: Optional, axis position. Default is
+ `(shape[1]-1)/2.0`.
+ :param detector_width: Optional, detector width in pixels.
+ If detector_width > slice_shape[1], the
+ projection data will be surrounded with zeros.
+ Using detector_width < slice_shape[1] might
+ result in a local tomography setup.
+ :param normalize: Optional, normalization. If set, the sinograms are
+ multiplied by the factor pi/(2*nprojs).
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by
+ clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel
+ level, store profiling elements (makes code slightly
+ slower)
+ """
+ # OS X enforces a workgroup size of 1 when the kernel has synchronization barriers
+ # if sys.platform.startswith('darwin'): # assuming no discrete GPU
+ # raise NotImplementedError("Backprojection is not implemented on CPU for OS X yet")
+
+ OpenclProcessing.__init__(self, ctx=ctx, devicetype=devicetype,
+ platformid=platformid, deviceid=deviceid,
+ profile=profile)
+ self.shape = slice_shape
+ self.axis_pos = axis_position
+ self.angles = angles
+ self.dwidth = detector_width
+ self.normalize = normalize
+
+ # Default values
+ if self.axis_pos is None:
+ self.axis_pos = (self.shape[1] - 1) / 2.
+ if self.dwidth is None:
+ self.dwidth = self.shape[1]
+ if not(np.iterable(self.angles)):
+ if self.angles is None:
+ self.nprojs = self.shape[0]
+ else:
+ self.nprojs = self.angles
+ self.angles = np.linspace(start=0,
+ stop=np.pi,
+ num=self.nprojs,
+ endpoint=False).astype(dtype=np.float32)
+ else:
+ self.nprojs = len(self.angles)
+ self.offset_x = -np.float32((self.shape[1]-1)/2. - self.axis_pos) # TODO: custom
+ self.offset_y = -np.float32((self.shape[0]-1)/2. - self.axis_pos) # TODO: custom
+ # Reset axis_pos once offset are computed
+ self.axis_pos0 = np.float((self.shape[1]-1)/2.)
+
+ # Workgroup, ndrange and shared size
+ self.dimgrid_x = _idivup(self.dwidth, 16)
+ self.dimgrid_y = _idivup(self.nprojs, 16)
+ self._dimrecx = np.int32(self.dimgrid_x * 16)
+ self._dimrecy = np.int32(self.dimgrid_y * 16)
+ self.local_mem = 16 * 7 * _sizeof(np.float32)
+ self.wg = (16, 16)
+ self.ndrange = (
+ int(self.dimgrid_x) * self.wg[0], # int(): pyopencl <= 2015.1
+ int(self.dimgrid_y) * self.wg[1] # int(): pyopencl <= 2015.1
+ )
+
+ self.is_cpu = False
+ if self.device.type == "CPU":
+ self.is_cpu = True
+
+ # Allocate memory
+ self.buffers = [
+ BufferDescription("_d_sino", self._dimrecx * self._dimrecy, np.float32, mf.READ_WRITE),
+ BufferDescription("d_angles", self._dimrecy, np.float32, mf.READ_ONLY),
+ BufferDescription("d_beginPos", self._dimrecy * 2, np.int32, mf.READ_ONLY),
+ BufferDescription("d_strideJoseph", self._dimrecy * 2, np.int32, mf.READ_ONLY),
+ BufferDescription("d_strideLine", self._dimrecy * 2, np.int32, mf.READ_ONLY),
+ ]
+ self.add_to_cl_mem(
+ {
+ "d_axis_corrections": parray.zeros(self.queue,
+ self.nprojs, np.float32)
+ }
+ )
+ self._tmp_extended_img = np.zeros((self.shape[0]+2, self.shape[1]+2),
+ dtype=np.float32)
+ if self.is_cpu:
+ self.allocate_slice()
+ else:
+ self.allocate_textures()
+ self.allocate_buffers()
+ self._ex_sino = np.zeros((self._dimrecy, self._dimrecx),
+ dtype=np.float32)
+ if self.is_cpu:
+ self.cl_mem["d_slice"].fill(0.)
+ # enqueue_fill_buffer has issues if opencl 1.2 is not present
+ #~ pyopencl.enqueue_fill_buffer(
+ #~ self.queue,
+ #~ self.cl_mem["d_slice"],
+ #~ np.float32(0),
+ #~ 0,
+ #~ self._tmp_extended_img.size * _sizeof(np.float32)
+ #~ )
+ # Precomputations
+ self.compute_angles()
+ self.proj_precomputations()
+ self.cl_mem["d_axis_corrections"].fill(0.)
+ # enqueue_fill_buffer has issues if opencl 1.2 is not present
+ #~ pyopencl.enqueue_fill_buffer(
+ #~ self.queue,
+ #~ self.cl_mem["d_axis_corrections"],
+ #~ np.float32(0),
+ #~ 0,
+ #~ self.nprojs*_sizeof(np.float32)
+ #~ )
+ # Shorthands
+ self._d_sino = self.cl_mem["_d_sino"]
+
+ OpenclProcessing.compile_kernels(self, self.kernel_files)
+ # check that workgroup can actually be (16, 16)
+ self.check_workgroup_size("forward_kernel_cpu")
+
+ def compute_angles(self):
+ angles2 = np.zeros(self._dimrecy, dtype=np.float32) # dimrecy != num_projs
+ angles2[:self.nprojs] = np.copy(self.angles)
+ angles2[self.nprojs:] = angles2[self.nprojs-1]
+ self.angles2 = angles2
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_angles"], angles2)
+
+ def allocate_slice(self):
+ self.add_to_cl_mem({"d_slice": parray.zeros(self.queue, (self.shape[1]+2, self.shape[1]+2), np.float32)})
+
+ def allocate_textures(self):
+ self.d_image_tex = pyopencl.Image(
+ self.ctx,
+ mf.READ_ONLY | mf.USE_HOST_PTR,
+ pyopencl.ImageFormat(
+ pyopencl.channel_order.INTENSITY,
+ pyopencl.channel_type.FLOAT
+ ), hostbuf=np.ascontiguousarray(self._tmp_extended_img.T),
+ )
+
+ def transfer_to_texture(self, image):
+ image2 = image
+ if not(image.flags["C_CONTIGUOUS"] and image.dtype == np.float32):
+ image2 = np.ascontiguousarray(image)
+ if self.is_cpu:
+ # TODO: create NoneEvent
+ return self.transfer_to_slice(image2)
+ #~ return pyopencl.enqueue_copy(
+ #~ self.queue,
+ #~ self.cl_mem["d_slice"].data,
+ #~ image2,
+ #~ origin=(1, 1),
+ #~ region=image.shape[::-1]
+ #~ )
+ else:
+ return pyopencl.enqueue_copy(
+ self.queue,
+ self.d_image_tex,
+ image2,
+ origin=(1, 1),
+ region=image.shape[::-1]
+ )
+
+ def transfer_device_to_texture(self, d_image):
+ if self.is_cpu:
+ # TODO this copy should not be necessary
+ return self.cpy2d_to_slice(d_image)
+ else:
+ return pyopencl.enqueue_copy(
+ self.queue,
+ self.d_image_tex,
+ d_image,
+ offset=0,
+ origin=(1, 1),
+ region=(int(self.shape[1]), int(self.shape[0]))#self.shape[::-1] # pyopencl <= 2015.2
+ )
+
+ def transfer_to_slice(self, image):
+ image2 = np.zeros((image.shape[0]+2, image.shape[1]+2), dtype=np.float32)
+ image2[1:-1, 1:-1] = image.astype(np.float32)
+ self.cl_mem["d_slice"].set(image2)
+
+ def proj_precomputations(self):
+ beginPos = np.zeros((2, self._dimrecy), dtype=np.int32)
+ strideJoseph = np.zeros((2, self._dimrecy), dtype=np.int32)
+ strideLine = np.zeros((2, self._dimrecy), dtype=np.int32)
+ cos_angles = np.cos(self.angles2)
+ sin_angles = np.sin(self.angles2)
+ dimslice = self.shape[1]
+
+ M1 = np.abs(cos_angles) > 0.70710678
+ M1b = np.logical_not(M1)
+ M2 = cos_angles > 0
+ M2b = np.logical_not(M2)
+ M3 = sin_angles > 0
+ M3b = np.logical_not(M3)
+ case1 = M1 * M2
+ case2 = M1 * M2b
+ case3 = M1b * M3
+ case4 = M1b * M3b
+
+ beginPos[0][case1] = 0
+ beginPos[1][case1] = 0
+ strideJoseph[0][case1] = 1
+ strideJoseph[1][case1] = 0
+ strideLine[0][case1] = 0
+ strideLine[1][case1] = 1
+
+ beginPos[0][case2] = dimslice-1
+ beginPos[1][case2] = dimslice-1
+ strideJoseph[0][case2] = -1
+ strideJoseph[1][case2] = 0
+ strideLine[0][case2] = 0
+ strideLine[1][case2] = -1
+
+ beginPos[0][case3] = dimslice-1
+ beginPos[1][case3] = 0
+ strideJoseph[0][case3] = 0
+ strideJoseph[1][case3] = 1
+ strideLine[0][case3] = -1
+ strideLine[1][case3] = 0
+
+ beginPos[0][case4] = 0
+ beginPos[1][case4] = dimslice-1
+ strideJoseph[0][case4] = 0
+ strideJoseph[1][case4] = -1
+ strideLine[0][case4] = 1
+ strideLine[1][case4] = 0
+
+ # For debug purpose
+ #~ self.beginPos = beginPos
+ #~ self.strideJoseph = strideJoseph
+ #~ self.strideLine = strideLine
+ #
+
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_beginPos"], beginPos)
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_strideJoseph"], strideJoseph)
+ pyopencl.enqueue_copy(self.queue, self.cl_mem["d_strideLine"], strideLine)
+
+ def _get_local_mem(self):
+ return pyopencl.LocalMemory(self.local_mem) # constant for all image sizes
+
+ def cpy2d_to_sino(self, dst):
+ ndrange = (int(self.dwidth), int(self.nprojs)) # pyopencl < 2015.2
+ sino_shape_ocl = np.int32(ndrange)
+ wg = None
+ kernel_args = (
+ dst.data,
+ self._d_sino,
+ np.int32(self.dwidth),
+ np.int32(self._dimrecx),
+ np.int32((0, 0)),
+ np.int32((0, 0)),
+ sino_shape_ocl
+ )
+ return self.kernels.cpy2d(self.queue, ndrange, wg, *kernel_args)
+
+ def cpy2d_to_slice(self, src):
+ """
+ copy a Nx * Ny slice to self.d_slice which is (Nx+2)*(Ny+2)
+ """
+ ndrange = (int(self.shape[1]), int(self.shape[0])) #self.shape[::-1] # pyopencl < 2015.2
+ wg = None
+ slice_shape_ocl = np.int32(ndrange)
+ kernel_args = (
+ self.cl_mem["d_slice"].data,
+ src,
+ np.int32(self.shape[1]+2),
+ np.int32(self.shape[1]),
+ np.int32((1, 1)),
+ np.int32((0, 0)),
+ slice_shape_ocl
+ )
+ return self.kernels.cpy2d(self.queue, ndrange, wg, *kernel_args)
+
+ def projection(self, image=None, dst=None):
+ """Perform the projection on an input image
+
+ :param image: Image to project
+ :return: A sinogram
+ """
+ events = []
+ with self.sem:
+ if image is not None:
+ assert image.ndim == 2, "Treat only 2D images"
+ assert image.shape[0] == self.shape[0], "image shape is OK"
+ assert image.shape[1] == self.shape[1], "image shape is OK"
+ if not(self.is_cpu):
+ self.transfer_to_texture(image)
+ slice_ref = self.d_image_tex
+ else:
+ self.transfer_to_slice(image)
+ slice_ref = self.cl_mem["d_slice"].data
+ else:
+ if self.is_cpu:
+ slice_ref = self.cl_mem["d_slice"].data
+ else:
+ slice_ref = self.d_image_tex
+
+ kernel_args = (
+ self._d_sino,
+ slice_ref,
+ np.int32(self.shape[1]),
+ np.int32(self.dwidth),
+ self.cl_mem["d_angles"],
+ np.float32(self.axis_pos0),
+ self.cl_mem["d_axis_corrections"].data, # TODO custom
+ self.cl_mem["d_beginPos"],
+ self.cl_mem["d_strideJoseph"],
+ self.cl_mem["d_strideLine"],
+ np.int32(self.nprojs),
+ self._dimrecx,
+ self._dimrecy,
+ self.offset_x,
+ self.offset_y,
+ np.int32(1), # josephnoclip, 1 by default
+ np.int32(self.normalize)
+ )
+
+ # Call the kernel
+ if self.is_cpu:
+ event_pj = self.kernels.forward_kernel_cpu(
+ self.queue,
+ self.ndrange,
+ self.wg,
+ *kernel_args
+ )
+ else:
+ event_pj = self.kernels.forward_kernel(
+ self.queue,
+ self.ndrange,
+ self.wg,
+ *kernel_args
+ )
+ events.append(EventDescription("projection", event_pj))
+ if dst is None:
+ self._ex_sino[:] = 0
+ ev = pyopencl.enqueue_copy(self.queue, self._ex_sino, self._d_sino)
+ events.append(EventDescription("copy D->H result", ev))
+ ev.wait()
+ res = np.copy(self._ex_sino[:self.nprojs, :self.dwidth])
+ else:
+ ev = self.cpy2d_to_sino(dst)
+ events.append(EventDescription("copy D->D result", ev))
+ ev.wait()
+ res = dst
+ # /with self.sem
+ if self.profile:
+ self.events += events
+ #~ res = self._ex_sino
+ return res
+
+ __call__ = projection
diff --git a/silx/opencl/reconstruction.py b/silx/opencl/reconstruction.py
new file mode 100644
index 0000000..cb68680
--- /dev/null
+++ b/silx/opencl/reconstruction.py
@@ -0,0 +1,381 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Module for tomographic reconstruction algorithms"""
+
+from __future__ import absolute_import, print_function, with_statement, division
+
+__authors__ = ["P. Paleo"]
+__license__ = "MIT"
+__date__ = "19/09/2017"
+
+import logging
+import numpy as np
+
+from .common import pyopencl
+from .processing import OpenclProcessing
+from .backprojection import Backprojection
+from .projection import Projection
+from .linalg import LinAlg
+
+import pyopencl.array as parray
+from pyopencl.elementwise import ElementwiseKernel
+logger = logging.getLogger(__name__)
+
+cl = pyopencl
+
+
+class ReconstructionAlgorithm(OpenclProcessing):
+ """
+ A parent class for all iterative tomographic reconstruction algorithms
+
+ :param sino_shape: shape of the sinogram. The sinogram is in the format
+ (n_b, n_a) where n_b is the number of detector bins and
+ n_a is the number of angles.
+ :param slice_shape: Optional, shape of the reconstructed slice.
+ By default, it is a square slice where the dimension
+ is the "x dimension" of the sinogram (number of bins).
+ :param axis_position: Optional, axis position. Default is `(shape[1]-1)/2.0`.
+ :param angles: Optional, a list of custom angles in radian.
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel level,
+ store profiling elements (makes code slightly slower)
+ """
+
+ def __init__(self, sino_shape, slice_shape=None, axis_position=None, angles=None,
+ ctx=None, devicetype="all", platformid=None, deviceid=None,
+ profile=False
+ ):
+ OpenclProcessing.__init__(self, ctx=ctx, devicetype=devicetype,
+ platformid=platformid, deviceid=deviceid,
+ profile=profile)
+
+ # Create a backprojector
+ self.backprojector = Backprojection(
+ sino_shape,
+ slice_shape=slice_shape,
+ axis_position=axis_position,
+ angles=angles,
+ ctx=self.ctx,
+ profile=profile
+ )
+ # Create a projector
+ self.projector = Projection(
+ self.backprojector.slice_shape,
+ self.backprojector.angles,
+ axis_position=axis_position,
+ detector_width=self.backprojector.num_bins,
+ normalize=False,
+ ctx=self.ctx,
+ profile=profile
+ )
+ self.sino_shape = sino_shape
+ self.is_cpu = self.backprojector.is_cpu
+ # Arrays
+ self.d_data = parray.zeros(self.queue, sino_shape, dtype=np.float32)
+ self.d_sino = parray.zeros_like(self.d_data)
+ self.d_x = parray.zeros(self.queue,
+ self.backprojector.slice_shape,
+ dtype=np.float32)
+ self.d_x_old = parray.zeros_like(self.d_x)
+
+ self.add_to_cl_mem({
+ "d_data": self.d_data,
+ "d_sino": self.d_sino,
+ "d_x": self.d_x,
+ "d_x_old": self.d_x_old,
+ })
+
+ def proj(self, d_slice, d_sino):
+ """
+ Project d_slice to d_sino
+ """
+ self.projector.transfer_device_to_texture(d_slice.data) #.wait()
+ self.projector.projection(dst=d_sino)
+
+ def backproj(self, d_sino, d_slice):
+ """
+ Backproject d_sino to d_slice
+ """
+ self.backprojector.transfer_device_to_texture(d_sino.data) #.wait()
+ self.backprojector.backprojection(dst=d_slice)
+
+
+class SIRT(ReconstructionAlgorithm):
+ """
+ A class for the SIRT algorithm
+
+ :param sino_shape: shape of the sinogram. The sinogram is in the format
+ (n_b, n_a) where n_b is the number of detector bins and
+ n_a is the number of angles.
+ :param slice_shape: Optional, shape of the reconstructed slice.
+ By default, it is a square slice where the dimension is
+ the "x dimension" of the sinogram (number of bins).
+ :param axis_position: Optional, axis position. Default is `(shape[1]-1)/2.0`.
+ :param angles: Optional, a list of custom angles in radian.
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel level,
+ store profiling elements (makes code slightly slower)
+
+ .. warning:: This is a beta version of the SIRT algorithm. Reconstruction
+ fails for at least on CPU (Xeon E3-1245 v5) using the AMD opencl
+ implementation.
+ """
+
+ def __init__(self, sino_shape, slice_shape=None, axis_position=None, angles=None,
+ ctx=None, devicetype="all", platformid=None, deviceid=None,
+ profile=False
+ ):
+
+ ReconstructionAlgorithm.__init__(self, sino_shape, slice_shape=slice_shape,
+ axis_position=axis_position, angles=angles,
+ ctx=ctx, devicetype=devicetype, platformid=platformid,
+ deviceid=deviceid, profile=profile)
+ self.compute_preconditioners()
+
+ def compute_preconditioners(self):
+ """
+ Create a diagonal preconditioner for the projection and backprojection
+ operator.
+ Each term of the diagonal is the sum of the projector/backprojector
+ along rows [1], i.e the projection/backprojection of an array of ones.
+
+ [1] Jens Gregor and Thomas Benson,
+ Computational Analysis and Improvement of SIRT,
+ IEEE transactions on medical imaging, vol. 27, no. 7, 2008
+ """
+
+ # r_{i,i} = 1/(sum_j a_{i,j})
+ slice_ones = np.ones(self.backprojector.slice_shape, dtype=np.float32)
+ R = 1./self.projector.projection(slice_ones) # could be all done on GPU, but I want extra checks
+ R[np.logical_not(np.isfinite(R))] = 1. # In the case where the rotation axis is excentred
+ self.d_R = parray.to_device(self.queue, R)
+ # c_{j,j} = 1/(sum_i a_{i,j})
+ sino_ones = np.ones(self.sino_shape, dtype=np.float32)
+ C = 1./self.backprojector.backprojection(sino_ones)
+ C[np.logical_not(np.isfinite(C))] = 1. # In the case where the rotation axis is excentred
+ self.d_C = parray.to_device(self.queue, C)
+
+ self.add_to_cl_mem({
+ "d_R": self.d_R,
+ "d_C": self.d_C
+ })
+
+ # TODO: compute and possibly return the residual
+ def run(self, data, n_it):
+ """
+ Run n_it iterations of the SIRT algorithm.
+ """
+ cl.enqueue_copy(self.queue, self.d_data.data, np.ascontiguousarray(data.astype(np.float32)))
+
+ d_x_old = self.d_x_old
+ d_x = self.d_x
+ d_R = self.d_R
+ d_C = self.d_C
+ d_sino = self.d_sino
+ d_x *= 0
+
+ for k in range(n_it):
+ d_x_old[:] = d_x[:]
+ # x{k+1} = x{k} - C A^T R (A x{k} - b)
+ self.proj(d_x, d_sino)
+ d_sino -= self.d_data
+ d_sino *= d_R
+ if self.is_cpu:
+ # This sync is necessary when using CPU, while it is not for GPU
+ d_sino.finish()
+ self.backproj(d_sino, d_x)
+ d_x *= -d_C
+ d_x += d_x_old
+ if self.is_cpu:
+ # This sync is necessary when using CPU, while it is not for GPU
+ d_x.finish()
+
+ return d_x
+
+ __call__ = run
+
+
+class TV(ReconstructionAlgorithm):
+ """
+ A class for reconstruction with Total Variation regularization using the
+ Chambolle-Pock TV reconstruction algorithm.
+
+ :param sino_shape: shape of the sinogram. The sinogram is in the format
+ (n_b, n_a) where n_b is the number of detector bins and
+ n_a is the number of angles.
+ :param slice_shape: Optional, shape of the reconstructed slice. By default,
+ it is a square slice where the dimension is the
+ "x dimension" of the sinogram (number of bins).
+ :param axis_position: Optional, axis position. Default is
+ `(shape[1]-1)/2.0`.
+ :param angles: Optional, a list of custom angles in radian.
+ :param ctx: actual working context, left to None for automatic
+ initialization from device type or platformid/deviceid
+ :param devicetype: type of device, can be "CPU", "GPU", "ACC" or "ALL"
+ :param platformid: integer with the platform_identifier, as given by clinfo
+ :param deviceid: Integer with the device identifier, as given by clinfo
+ :param profile: switch on profiling to be able to profile at the kernel
+ level, store profiling elements (makes code slightly slower)
+
+ .. warning:: This is a beta version of the Chambolle-Pock TV algorithm.
+ Reconstruction fails for at least on CPU (Xeon E3-1245 v5) using
+ the AMD opencl implementation.
+ """
+
+ def __init__(self, sino_shape, slice_shape=None, axis_position=None, angles=None,
+ ctx=None, devicetype="all", platformid=None, deviceid=None,
+ profile=False
+ ):
+ ReconstructionAlgorithm.__init__(self, sino_shape, slice_shape=slice_shape,
+ axis_position=axis_position, angles=angles,
+ ctx=ctx, devicetype=devicetype, platformid=platformid,
+ deviceid=deviceid, profile=profile)
+ self.compute_preconditioners()
+
+ # Create a LinAlg instance
+ self.linalg = LinAlg(self.backprojector.slice_shape, ctx=self.ctx)
+ # Positivity constraint
+ self.elwise_clamp = ElementwiseKernel(self.ctx, "float *a", "a[i] = max(a[i], 0.0f);")
+ # Projection onto the L-infinity ball of radius Lambda
+ self.elwise_proj_linf = ElementwiseKernel(
+ self.ctx,
+ "float2* a, float Lambda",
+ "a[i].x = copysign(min(fabs(a[i].x), Lambda), a[i].x); a[i].y = copysign(min(fabs(a[i].y), Lambda), a[i].y);",
+ "elwise_proj_linf"
+ )
+ # Additional arrays
+ self.linalg.gradient(self.d_x)
+ self.d_p = parray.zeros_like(self.linalg.cl_mem["d_gradient"])
+ self.d_q = parray.zeros_like(self.d_data)
+ self.d_g = self.linalg.d_image
+ self.d_tmp = parray.zeros_like(self.d_x)
+ self.add_to_cl_mem({
+ "d_p": self.d_p,
+ "d_q": self.d_q,
+ "d_tmp": self.d_tmp,
+ })
+
+ self.theta = 1.0
+
+ def compute_preconditioners(self):
+ """
+ Create a diagonal preconditioner for the projection and backprojection
+ operator.
+ Each term of the diagonal is the sum of the projector/backprojector
+ along rows [2],
+ i.e the projection/backprojection of an array of ones.
+
+ [2] T. Pock, A. Chambolle,
+ Diagonal preconditioning for first order primal-dual algorithms in
+ convex optimization,
+ International Conference on Computer Vision, 2011
+ """
+
+ # Compute the diagonal preconditioner "Sigma"
+ slice_ones = np.ones(self.backprojector.slice_shape, dtype=np.float32)
+ Sigma_k = 1./self.projector.projection(slice_ones)
+ Sigma_k[np.logical_not(np.isfinite(Sigma_k))] = 1.
+ self.d_Sigma_k = parray.to_device(self.queue, Sigma_k)
+ self.d_Sigma_kp1 = self.d_Sigma_k + 1 # TODO: memory vs computation
+ self.Sigma_grad = 1/2.0 # For discrete gradient, sum|D_i,j| = 2 along lines or cols
+
+ # Compute the diagonal preconditioner "Tau"
+ sino_ones = np.ones(self.sino_shape, dtype=np.float32)
+ C = self.backprojector.backprojection(sino_ones)
+ Tau = 1./(C + 2.)
+ self.d_Tau = parray.to_device(self.queue, Tau)
+
+ self.add_to_cl_mem({
+ "d_Sigma_k": self.d_Sigma_k,
+ "d_Sigma_kp1": self.d_Sigma_kp1,
+ "d_Tau": self.d_Tau
+ })
+
+ def run(self, data, n_it, Lambda, pos_constraint=False):
+ """
+ Run n_it iterations of the TV-regularized reconstruction,
+ with the regularization parameter Lambda.
+ """
+ cl.enqueue_copy(self.queue, self.d_data.data, np.ascontiguousarray(data.astype(np.float32)))
+
+ d_x = self.d_x
+ d_x_old = self.d_x_old
+ d_tmp = self.d_tmp
+ d_sino = self.d_sino
+ d_p = self.d_p
+ d_q = self.d_q
+ d_g = self.d_g
+
+ d_x *= 0
+ d_p *= 0
+ d_q *= 0
+
+ for k in range(0, n_it):
+ # Update primal variables
+ d_x_old[:] = d_x[:]
+ #~ x = x + Tau*div(p) - Tau*Kadj(q)
+ self.backproj(d_q, d_tmp)
+ self.linalg.divergence(d_p)
+ # TODO: this in less than three ops (one kernel ?)
+ d_g -= d_tmp # d_g -> L.d_image
+ d_g *= self.d_Tau
+ d_x += d_g
+
+ if pos_constraint:
+ self.elwise_clamp(d_x)
+
+ # Update dual variables
+ #~ p = proj_linf(p + Sigma_grad*gradient(x + theta*(x - x_old)), Lambda)
+ d_tmp[:] = d_x[:]
+ # FIXME: mul_add is out of place, put an equivalent thing in linalg...
+ #~ d_tmp.mul_add(1 + theta, d_x_old, -theta)
+ d_tmp *= 1+self.theta
+ d_tmp -= self.theta*d_x_old
+ self.linalg.gradient(d_tmp)
+ # TODO: out of place mul_add
+ #~ d_p.mul_add(1, L.cl_mem["d_gradient"], Sigma_grad)
+ self.linalg.cl_mem["d_gradient"] *= self.Sigma_grad
+ d_p += self.linalg.cl_mem["d_gradient"]
+ self.elwise_proj_linf(d_p, Lambda)
+
+ #~ q = (q + Sigma_k*K(x + theta*(x - x_old)) - Sigma_k*data)/(1.0 + Sigma_k)
+ self.proj(d_tmp, d_sino)
+ # TODO: this in less instructions
+ d_sino -= self.d_data
+ d_sino *= self.d_Sigma_k
+ d_q += d_sino
+ d_q /= self.d_Sigma_kp1
+ return d_x
+
+ __call__ = run
diff --git a/silx/opencl/setup.py b/silx/opencl/setup.py
index d0181cd..a2ae244 100644
--- a/silx/opencl/setup.py
+++ b/silx/opencl/setup.py
@@ -1,6 +1,6 @@
# coding: utf-8
#
-# Copyright (C) 2016 European Synchrotron Radiation Facility
+# Copyright (C) 2016-2017 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
@@ -27,14 +27,17 @@ __contact__ = "jerome.kieffer@esrf.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__authors__ = ["J. Kieffer"]
-__date__ = "08/09/2016"
+__date__ = "16/08/2017"
+import os.path
from numpy.distutils.misc_util import Configuration
def configuration(parent_package='', top_path=None):
config = Configuration('opencl', parent_package, top_path)
- config.add_subpackage('sift')
+ path = os.path.dirname(os.path.abspath(__file__))
+ if os.path.exists(os.path.join(path, 'sift')):
+ config.add_subpackage('sift')
config.add_subpackage('test')
return config
diff --git a/silx/opencl/test/__init__.py b/silx/opencl/test/__init__.py
index 24aa06e..f6aadcd 100644
--- a/silx/opencl/test/__init__.py
+++ b/silx/opencl/test/__init__.py
@@ -24,18 +24,31 @@
__authors__ = ["J. Kieffer"]
__license__ = "MIT"
-__date__ = "15/03/2017"
+__date__ = "01/09/2017"
+import os
import unittest
from . import test_addition
from . import test_medfilt
-from ..sift import test as test_sift
-
+from . import test_backprojection
+from . import test_projection
+from . import test_linalg
+from . import test_array_utils
def suite():
test_suite = unittest.TestSuite()
test_suite.addTests(test_addition.suite())
test_suite.addTests(test_medfilt.suite())
- test_suite.addTests(test_sift.suite())
+ test_suite.addTests(test_backprojection.suite())
+ test_suite.addTests(test_projection.suite())
+ test_suite.addTests(test_linalg.suite())
+ test_suite.addTests(test_array_utils.suite())
+
+ # Allow to remove sift from the project
+ test_base_dir = os.path.dirname(__file__)
+ sift_dir = os.path.join(test_base_dir, "..", "sift")
+ if os.path.exists(sift_dir):
+ from ..sift import test as test_sift
+ test_suite.addTests(test_sift.suite())
return test_suite
diff --git a/silx/opencl/test/test_array_utils.py b/silx/opencl/test/test_array_utils.py
new file mode 100644
index 0000000..833d828
--- /dev/null
+++ b/silx/opencl/test/test_array_utils.py
@@ -0,0 +1,161 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Test of the OpenCL array_utils"""
+
+from __future__ import division, print_function
+
+__authors__ = ["Pierre paleo"]
+__license__ = "MIT"
+__copyright__ = "2013-2017 European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "14/06/2017"
+
+
+import time
+import logging
+import numpy as np
+import unittest
+try:
+ import mako
+except ImportError:
+ mako = None
+from ..common import ocl
+if ocl:
+ import pyopencl as cl
+ import pyopencl.array as parray
+ from .. import linalg
+from ..utils import get_opencl_code
+from silx.test.utils import utilstest
+
+logger = logging.getLogger(__name__)
+try:
+ from scipy.ndimage.filters import laplace
+ _has_scipy = True
+except ImportError:
+ _has_scipy = False
+
+
+
+@unittest.skipUnless(ocl and mako, "PyOpenCl is missing")
+class TestCpy2d(unittest.TestCase):
+
+ def setUp(self):
+ if ocl is None:
+ return
+ self.ctx = ocl.create_context()
+ if logger.getEffectiveLevel() <= logging.INFO:
+ self.PROFILE = True
+ self.queue = cl.CommandQueue(
+ self.ctx,
+ properties=cl.command_queue_properties.PROFILING_ENABLE)
+ else:
+ self.PROFILE = False
+ self.queue = cl.CommandQueue(self.ctx)
+ self.allocate_arrays()
+ self.program = cl.Program(self.ctx, get_opencl_code("array_utils")).build()
+
+ def allocate_arrays(self):
+ """
+ Allocate various types of arrays for the tests
+ """
+ self.prng_state = np.random.get_state()
+ # Generate arrays of random shape
+ self.shape1 = np.random.randint(20, high=512, size=(2,))
+ self.shape2 = np.random.randint(20, high=512, size=(2,))
+ self.array1 = np.random.rand(*self.shape1).astype(np.float32)
+ self.array2 = np.random.rand(*self.shape2).astype(np.float32)
+ self.d_array1 = parray.to_device(self.queue, self.array1)
+ self.d_array2 = parray.to_device(self.queue, self.array2)
+ # Generate random offsets
+ offset1_y = np.random.randint(2, high=min(self.shape1[0], self.shape2[0]) - 10)
+ offset1_x = np.random.randint(2, high=min(self.shape1[1], self.shape2[1]) - 10)
+ offset2_y = np.random.randint(2, high=min(self.shape1[0], self.shape2[0]) - 10)
+ offset2_x = np.random.randint(2, high=min(self.shape1[1], self.shape2[1]) - 10)
+ self.offset1 = (offset1_y, offset1_x)
+ self.offset2 = (offset2_y, offset2_x)
+ # Compute the size of the rectangle to transfer
+ size_y = np.random.randint(2, high=min(self.shape1[0], self.shape2[0]) - max(offset1_y, offset2_y) + 1)
+ size_x = np.random.randint(2, high=min(self.shape1[1], self.shape2[1]) - max(offset1_x, offset2_x) + 1)
+ self.transfer_shape = (size_y, size_x)
+
+ def tearDown(self):
+ self.array1 = None
+ self.array2 = None
+ self.d_array1.data.release()
+ self.d_array2.data.release()
+ self.d_array1 = None
+ self.d_array2 = None
+ self.ctx = None
+ self.queue = None
+
+ def compare(self, result, reference):
+ errmax = np.max(np.abs(result - reference))
+ logger.info("Max error = %e" % (errmax))
+ self.assertTrue(errmax == 0, str("Max error is too high"))#. PRNG state was %s" % str(self.prng_state)))
+
+ @unittest.skipUnless(ocl and mako, "pyopencl is missing")
+ def test_cpy2d(self):
+ """
+ Test rectangular transfer of self.d_array1 to self.d_array2
+ """
+ # Reference
+ o1 = self.offset1
+ o2 = self.offset2
+ T = self.transfer_shape
+ logger.info("""Testing D->D rectangular copy with (N1_y, N1_x) = %s,
+ (N2_y, N2_x) = %s:
+ array2[%d:%d, %d:%d] = array1[%d:%d, %d:%d]""" %
+ (
+ str(self.shape1), str(self.shape2),
+ o2[0], o2[0] + T[0],
+ o2[1], o2[1] + T[1],
+ o1[0], o1[0] + T[0],
+ o1[1], o1[1] + T[1]
+ )
+ )
+ self.array2[o2[0]:o2[0] + T[0], o2[1]:o2[1] + T[1]] = self.array1[o1[0]:o1[0] + T[0], o1[1]:o1[1] + T[1]]
+ kernel_args = (
+ self.d_array2.data,
+ self.d_array1.data,
+ np.int32(self.shape2[1]),
+ np.int32(self.shape1[1]),
+ np.int32(self.offset2[::-1]),
+ np.int32(self.offset1[::-1]),
+ np.int32(self.transfer_shape[::-1])
+ )
+ wg = None
+ ndrange = self.transfer_shape[::-1]
+ self.program.cpy2d(self.queue, ndrange, wg, *kernel_args)
+ res = self.d_array2.get()
+ self.compare(res, self.array2)
+
+
+def suite():
+ testSuite = unittest.TestSuite()
+ testSuite.addTest(TestCpy2d("test_cpy2d"))
+ return testSuite
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="suite")
diff --git a/silx/opencl/test/test_backprojection.py b/silx/opencl/test/test_backprojection.py
new file mode 100644
index 0000000..342bd2f
--- /dev/null
+++ b/silx/opencl/test/test_backprojection.py
@@ -0,0 +1,165 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Test of the filtered backprojection module"""
+
+from __future__ import division, print_function
+
+__authors__ = ["Pierre paleo"]
+__license__ = "MIT"
+__copyright__ = "2013-2017 European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "05/10/2017"
+
+
+import time
+import logging
+import numpy
+import unittest
+try:
+ import mako
+except ImportError:
+ mako = None
+from ..common import ocl
+if ocl:
+ from .. import backprojection
+from silx.test.utils import utilstest
+
+logger = logging.getLogger(__name__)
+
+
+def generate_coords(img_shp, center=None):
+ """
+ Return two 2D arrays containing the indexes of an image.
+ The zero is at the center of the image.
+ """
+ l_r, l_c = float(img_shp[0]), float(img_shp[1])
+ R, C = numpy.mgrid[:l_r, :l_c]
+ if center is None:
+ center0, center1 = l_r / 2., l_c / 2.
+ else:
+ center0, center1 = center
+ R = R + 0.5 - center0
+ C = C + 0.5 - center1
+ return R, C
+
+
+def clip_circle(img, center=None, radius=None):
+ """
+ Puts zeros outside the inscribed circle of the image support.
+ """
+ R, C = generate_coords(img.shape, center)
+ M = R * R + C * C
+ res = numpy.zeros_like(img)
+ if radius is None:
+ radius = img.shape[0] / 2. - 1
+ mask = M < radius * radius
+ res[mask] = img[mask]
+ return res
+
+
+@unittest.skipUnless(ocl and mako, "PyOpenCl is missing")
+class TestFBP(unittest.TestCase):
+
+ def setUp(self):
+ if ocl is None:
+ return
+ # ~ if sys.platform.startswith('darwin'):
+ # ~ self.skipTest("Backprojection is not implemented on CPU for OS X yet")
+ self.getfiles()
+ self.fbp = backprojection.Backprojection(self.sino.shape, profile=True)
+ if self.fbp.compiletime_workgroup_size < 16:
+ self.skipTest("Current implementation of OpenCL backprojection is not supported on this platform yet")
+
+ def tearDown(self):
+ self.sino = None
+# self.fbp.log_profile()
+ self.fbp = None
+
+ def getfiles(self):
+ # load sinogram of 512x512 MRI phantom
+ self.sino = numpy.load(utilstest.getfile("sino500.npz"))["data"]
+ # load reconstruction made with ASTRA FBP (with filter designed in spatial domain)
+ self.reference_rec = numpy.load(utilstest.getfile("rec_astra_500.npz"))["data"]
+
+ def measure(self):
+ "Common measurement of timings"
+ t1 = time.time()
+ try:
+ result = self.fbp.filtered_backprojection(self.sino)
+ except RuntimeError as msg:
+ logger.error(msg)
+ return
+ t2 = time.time()
+ return t2 - t1, result
+
+ def compare(self, res):
+ """
+ Compare a result with the reference reconstruction.
+ Only the valid reconstruction zone (inscribed circle) is taken into
+ account
+ """
+ res_clipped = clip_circle(res)
+ ref_clipped = clip_circle(self.reference_rec)
+ delta = abs(res_clipped - ref_clipped)
+ bad = delta > 1
+# numpy.save("/tmp/bad.npy", bad.astype(int))
+ logger.debug("Absolute difference: %s with %s outlier pixels out of %s", delta.max(), bad.sum(), numpy.prod(bad.shape))
+ return delta.max()
+
+ @unittest.skipUnless(ocl and mako, "pyopencl is missing")
+ def test_fbp(self):
+ """
+ tests FBP
+ """
+ # Test single reconstruction
+ # --------------------------
+ t, res = self.measure()
+ if t is None:
+ logger.info("test_fp: skipped")
+ else:
+ logger.info("test_backproj: time = %.3fs" % t)
+ err = self.compare(res)
+ msg = str("Max error = %e" % err)
+ logger.info(msg)
+ # TODO: cannot do better than 1e0 ?
+ # The plain backprojection was much better, so it must be an issue in the filtering process
+ self.assertTrue(err < 1., "Max error is too high")
+ # Test multiple reconstructions
+ # -----------------------------
+ res0 = numpy.copy(res)
+ for i in range(10):
+ res = self.fbp.filtered_backprojection(self.sino)
+ errmax = numpy.max(numpy.abs(res - res0))
+ self.assertTrue(errmax < 1.e-6, "Max error is too high")
+
+
+def suite():
+ testSuite = unittest.TestSuite()
+ testSuite.addTest(TestFBP("test_fbp"))
+ return testSuite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="suite")
diff --git a/silx/opencl/test/test_linalg.py b/silx/opencl/test/test_linalg.py
new file mode 100644
index 0000000..7d03983
--- /dev/null
+++ b/silx/opencl/test/test_linalg.py
@@ -0,0 +1,215 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Test of the linalg module"""
+
+from __future__ import division, print_function
+
+__authors__ = ["Pierre paleo"]
+__license__ = "MIT"
+__copyright__ = "2013-2017 European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "14/06/2017"
+
+
+import time
+import logging
+import numpy as np
+import unittest
+try:
+ import mako
+except ImportError:
+ mako = None
+from ..common import ocl
+if ocl:
+ import pyopencl as cl
+ import pyopencl.array as parray
+ from .. import linalg
+from silx.test.utils import utilstest
+
+logger = logging.getLogger(__name__)
+try:
+ from scipy.ndimage.filters import laplace
+ _has_scipy = True
+except ImportError:
+ _has_scipy = False
+
+
+# TODO move this function in math or image ?
+def gradient(img):
+ '''
+ Compute the gradient of an image as a numpy array
+ Code from https://github.com/emmanuelle/tomo-tv/
+ '''
+ shape = [img.ndim, ] + list(img.shape)
+ gradient = np.zeros(shape, dtype=img.dtype)
+ slice_all = [0, slice(None, -1),]
+ for d in range(img.ndim):
+ gradient[slice_all] = np.diff(img, axis=d)
+ slice_all[0] = d + 1
+ slice_all.insert(1, slice(None))
+ return gradient
+
+
+# TODO move this function in math or image ?
+def divergence(grad):
+ '''
+ Compute the divergence of a gradient
+ Code from https://github.com/emmanuelle/tomo-tv/
+ '''
+ res = np.zeros(grad.shape[1:])
+ for d in range(grad.shape[0]):
+ this_grad = np.rollaxis(grad[d], d)
+ this_res = np.rollaxis(res, d)
+ this_res[:-1] += this_grad[:-1]
+ this_res[1:-1] -= this_grad[:-2]
+ this_res[-1] -= this_grad[-2]
+ return res
+
+
+@unittest.skipUnless(ocl and mako, "PyOpenCl is missing")
+class TestLinAlg(unittest.TestCase):
+
+ def setUp(self):
+ if ocl is None:
+ return
+ self.getfiles()
+ self.la = linalg.LinAlg(self.image.shape)
+ self.allocate_arrays()
+
+ def allocate_arrays(self):
+ """
+ Allocate various types of arrays for the tests
+ """
+ # numpy images
+ self.grad = np.zeros(self.image.shape, dtype=np.complex64)
+ self.grad2 = np.zeros((2,) + self.image.shape, dtype=np.float32)
+ self.grad_ref = gradient(self.image)
+ self.div_ref = divergence(self.grad_ref)
+ self.image2 = np.zeros_like(self.image)
+ # Device images
+ self.gradient_parray = parray.zeros(self.la.queue, self.image.shape, np.complex64)
+ # we should be using cl.Buffer(self.la.ctx, cl.mem_flags.READ_WRITE, size=self.image.nbytes*2),
+ # but platforms not suporting openCL 1.2 have a problem with enqueue_fill_buffer,
+ # so we use the parray "fill" utility
+ self.gradient_buffer = self.gradient_parray.data
+ # Do the same for image
+ self.image_parray = parray.to_device(self.la.queue, self.image)
+ self.image_buffer = self.image_parray.data
+ # Refs
+ tmp = np.zeros(self.image.shape, dtype=np.complex64)
+ tmp.real = np.copy(self.grad_ref[0])
+ tmp.imag = np.copy(self.grad_ref[1])
+ self.grad_ref_parray = parray.to_device(self.la.queue, tmp)
+ self.grad_ref_buffer = self.grad_ref_parray.data
+
+ def tearDown(self):
+ self.image = None
+ self.image2 = None
+ self.grad = None
+ self.grad2 = None
+ self.grad_ref = None
+ self.div_ref = None
+ self.gradient_parray.data.release()
+ self.gradient_parray = None
+ self.gradient_buffer = None
+ self.image_parray.data.release()
+ self.image_parray = None
+ self.image_buffer = None
+ self.grad_ref_parray.data.release()
+ self.grad_ref_parray = None
+ self.grad_ref_buffer = None
+
+ def getfiles(self):
+ # load 512x512 MRI phantom - TODO include Lena or ascent once a .npz is available
+ self.image = np.load(utilstest.getfile("Brain512.npz"))["data"]
+
+ def compare(self, result, reference, abstol, name):
+ errmax = np.max(np.abs(result - reference))
+ logger.info("%s: Max error = %e" % (name, errmax))
+ self.assertTrue(errmax < abstol, str("%s: Max error is too high" % name))
+
+ @unittest.skipUnless(ocl and mako, "pyopencl is missing")
+ def test_gradient(self):
+ arrays = {
+ "numpy.ndarray": self.image,
+ "buffer": self.image_buffer,
+ "parray": self.image_parray
+ }
+ for desc, image in arrays.items():
+ # Test with dst on host (numpy.ndarray)
+ res = self.la.gradient(image, return_to_host=True)
+ self.compare(res, self.grad_ref, 1e-6, str("gradient[src=%s, dst=numpy.ndarray]" % desc))
+ # Test with dst on device (pyopencl.Buffer)
+ self.la.gradient(image, dst=self.gradient_buffer)
+ cl.enqueue_copy(self.la.queue, self.grad, self.gradient_buffer)
+ self.grad2[0] = self.grad.real
+ self.grad2[1] = self.grad.imag
+ self.compare(self.grad2, self.grad_ref, 1e-6, str("gradient[src=%s, dst=buffer]" % desc))
+ # Test with dst on device (pyopencl.Array)
+ self.la.gradient(image, dst=self.gradient_parray)
+ self.grad = self.gradient_parray.get()
+ self.grad2[0] = self.grad.real
+ self.grad2[1] = self.grad.imag
+ self.compare(self.grad2, self.grad_ref, 1e-6, str("gradient[src=%s, dst=parray]" % desc))
+
+ @unittest.skipUnless(ocl and mako, "pyopencl is missing")
+ def test_divergence(self):
+ arrays = {
+ "numpy.ndarray": self.grad_ref,
+ "buffer": self.grad_ref_buffer,
+ "parray": self.grad_ref_parray
+ }
+ for desc, grad in arrays.items():
+ # Test with dst on host (numpy.ndarray)
+ res = self.la.divergence(grad, return_to_host=True)
+ self.compare(res, self.div_ref, 1e-6, str("divergence[src=%s, dst=numpy.ndarray]" % desc))
+ # Test with dst on device (pyopencl.Buffer)
+ self.la.divergence(grad, dst=self.image_buffer)
+ cl.enqueue_copy(self.la.queue, self.image2, self.image_buffer)
+ self.compare(self.image2, self.div_ref, 1e-6, str("divergence[src=%s, dst=buffer]" % desc))
+ # Test with dst on device (pyopencl.Array)
+ self.la.divergence(grad, dst=self.image_parray)
+ self.image2 = self.image_parray.get()
+ self.compare(self.image2, self.div_ref, 1e-6, str("divergence[src=%s, dst=parray]" % desc))
+
+ @unittest.skipUnless(ocl and mako and _has_scipy, "pyopencl and/or scipy is missing")
+ def test_laplacian(self):
+ laplacian_ref = laplace(self.image)
+ # Laplacian = div(grad)
+ self.la.gradient(self.image)
+ laplacian_ocl = self.la.divergence(self.la.d_gradient, return_to_host=True)
+ self.compare(laplacian_ocl, laplacian_ref, 1e-6, "laplacian")
+
+
+def suite():
+ testSuite = unittest.TestSuite()
+ testSuite.addTest(TestLinAlg("test_gradient"))
+ testSuite.addTest(TestLinAlg("test_divergence"))
+ testSuite.addTest(TestLinAlg("test_laplacian"))
+ return testSuite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="suite")
diff --git a/silx/opencl/test/test_projection.py b/silx/opencl/test/test_projection.py
new file mode 100644
index 0000000..c9a3a1c
--- /dev/null
+++ b/silx/opencl/test/test_projection.py
@@ -0,0 +1,139 @@
+#!/usr/bin/env python
+# 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.
+#
+# ###########################################################################*/
+"""Test of the forward projection module"""
+
+from __future__ import division, print_function
+
+__authors__ = ["Pierre paleo"]
+__license__ = "MIT"
+__copyright__ = "2013-2017 European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "14/06/2017"
+
+
+import time
+import logging
+import numpy as np
+import unittest
+try:
+ import mako
+except ImportError:
+ mako = None
+from ..common import ocl
+if ocl:
+ from .. import projection
+from silx.test.utils import utilstest
+
+logger = logging.getLogger(__name__)
+
+
+
+@unittest.skipUnless(ocl and mako, "PyOpenCl is missing")
+class TestProj(unittest.TestCase):
+
+ def setUp(self):
+ if ocl is None:
+ return
+ #~ if sys.platform.startswith('darwin'):
+ #~ self.skipTest("Projection is not implemented on CPU for OS X yet")
+ self.getfiles()
+ n_angles = self.sino.shape[0]
+ self.proj = projection.Projection(self.phantom.shape, n_angles)
+ if self.proj.compiletime_workgroup_size < 16:
+ self.skipTest("Current implementation of OpenCL projection is not supported on this platform yet")
+
+
+ def tearDown(self):
+ self.phantom = None
+ self.sino = None
+ self.proj = None
+
+
+ def getfiles(self):
+ # load 512x512 MRI phantom
+ self.phantom = np.load(utilstest.getfile("Brain512.npz"))["data"]
+ # load sinogram computed with PyHST
+ self.sino = np.load(utilstest.getfile("sino500_pyhst.npz"))["data"]
+
+
+ def measure(self):
+ "Common measurement of timings"
+ t1 = time.time()
+ try:
+ result = self.proj.projection(self.phantom)
+ except RuntimeError as msg:
+ logger.error(msg)
+ return
+ t2 = time.time()
+ return t2 - t1, result
+
+
+ def compare(self, res):
+ """
+ Compare a result with the reference reconstruction.
+ Only the valid reconstruction zone (inscribed circle) is taken into account
+ """
+ # Compare with the original phantom.
+ # TODO: compare a standard projection
+ ref = self.sino
+ return np.max(np.abs(res - ref))
+
+
+ @unittest.skipUnless(ocl and mako, "pyopencl is missing")
+ def test_proj(self):
+ """
+ tests Projection
+ """
+ # Test single reconstruction
+ # --------------------------
+ t, res = self.measure()
+ if t is None:
+ logger.info("test_proj: skipped")
+ else:
+ logger.info("test_proj: time = %.3fs" % t)
+ err = self.compare(res)
+ msg = str("Max error = %e" % err)
+ logger.info(msg)
+ # Interpolation differs at some lines, giving relative error of 10/50000
+ self.assertTrue(err < 20., "Max error is too high")
+ # Test multiple reconstructions
+ # -----------------------------
+ res0 = np.copy(res)
+ for i in range(10):
+ res = self.proj.projection(self.phantom)
+ errmax = np.max(np.abs(res - res0))
+ self.assertTrue(errmax < 1.e-6, "Max error is too high")
+
+
+
+def suite():
+ testSuite = unittest.TestSuite()
+ testSuite.addTest(TestProj("test_proj"))
+ return testSuite
+
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest="suite")
diff --git a/silx/opencl/utils.py b/silx/opencl/utils.py
index 58becb0..f558c1b 100644
--- a/silx/opencl/utils.py
+++ b/silx/opencl/utils.py
@@ -1,30 +1,30 @@
-#!/usr/bin/env python
# -*- coding: utf-8 -*-
+# /*##########################################################################
+# Copyright (C) 2017 European Synchrotron Radiation Facility
#
-# Project: Sift implementation in Python + OpenCL
-# https://github.com/silx-kit/silx
+# 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:
#
-# 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 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.
#
-# 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.
-
+# ############################################################################*/
+"""
+Project: Sift implementation in Python + OpenCL
+ https://github.com/silx-kit/silx
+"""
from __future__ import division
@@ -32,12 +32,12 @@ __authors__ = ["Jérôme Kieffer", "Pierre Paleo"]
__contact__ = "jerome.kieffer@esrf.eu"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-__date__ = "15/03/2017"
-__status__ = "Production"
+__date__ = "06/09/2017"
+__status__ = "Production"
import os
import numpy
-from ..resources import resource_filename
+from .. import resources
from math import log, ceil
@@ -77,14 +77,22 @@ def sizeof(shape, dtype="uint8"):
return cnt * itemsize
-def get_cl_file(filename):
- """get the full path of a openCL file
+def get_cl_file(resource):
+ """get the full path of a openCL resource file
+
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx".
+ See also :func:`silx.resources.register_resource_directory`.
+ :param str resource: Resource name. File name contained if the `opencl`
+ directory of the resources.
:return: the full path of the openCL source file
"""
- if not filename.endswith(".cl"):
- filename += ".cl"
- return resource_filename(os.path.join("opencl", filename))
+ if not resource.endswith(".cl"):
+ resource += ".cl"
+ return resources._resource_filename(resource,
+ default_directory="opencl")
def read_cl_file(filename):
@@ -97,6 +105,7 @@ def read_cl_file(filename):
lines = [i for i in f.readlines() if not i.startswith("#include ")]
return "".join(lines)
+
get_opencl_code = read_cl_file
@@ -109,4 +118,4 @@ def concatenate_cl_kernel(filenames):
this method concatenates all the kernel from the list
"""
- return os.linesep.join(read_cl_file(fn) for fn in filenames)
+ return os.linesep.join(read_cl_file(fn) for fn in filenames)
diff --git a/silx/resources/__init__.py b/silx/resources/__init__.py
index f5b06cb..250aed1 100644
--- a/silx/resources/__init__.py
+++ b/silx/resources/__init__.py
@@ -56,7 +56,7 @@ of this modules to ensure access across different distribution schemes:
__authors__ = ["V.A. Sole", "Thomas Vincent", "J. Kieffer"]
__license__ = "MIT"
-__date__ = "02/05/2017"
+__date__ = "06/09/2017"
import os
@@ -67,6 +67,7 @@ import getpass
import logging
import tempfile
import unittest
+import importlib
from silx.third_party import six
logger = logging.getLogger(__name__)
@@ -100,31 +101,179 @@ if getattr(sys, 'frozen', False):
_RESOURCES_DIR = _dir
+class _ResourceDirectory(object):
+ """Store a source of resources"""
+
+ def __init__(self, package_name, package_path=None, forced_path=None):
+ if forced_path is None:
+ if package_path is None:
+ if pkg_resources is None:
+ # In this case we have to compute the package path
+ # Else it will not be used
+ module = importlib.import_module(package_name)
+ package_path = os.path.abspath(os.path.dirname(module.__file__))
+ self.package_name = package_name
+ self.package_path = package_path
+ self.forced_path = forced_path
+
+
+_SILX_DIRECTORY = _ResourceDirectory(
+ package_name=__name__,
+ package_path=os.path.abspath(os.path.dirname(__file__)),
+ forced_path=_RESOURCES_DIR)
+
+_RESOURCE_DIRECTORIES = {}
+_RESOURCE_DIRECTORIES["silx"] = _SILX_DIRECTORY
+
+
+def register_resource_directory(name, package_name, forced_path=None):
+ """Register another resource directory to the available list.
+
+ By default only the directory "silx" is available.
+
+ .. versionadded:: 0.6
+
+ :param str name: Name of the resource directory. It is used on the resource
+ name to specify the resource directory to use. The resource
+ "silx:foo.png" will use the "silx" resource directory.
+ :param str package_name: Python name of the package containing resources.
+ For example "silx.resources".
+ :param str forced_path: Path containing the resources. If specified
+ `pkg_resources` nor `package_name` will be used
+ For example "silx.resources".
+ :raises ValueError: If the resource directory name already exists.
+ """
+ if name in _RESOURCE_DIRECTORIES:
+ raise ValueError("Resource directory name %s already exists" % name)
+ resource_directory = _ResourceDirectory(
+ package_name=package_name,
+ forced_path=forced_path)
+ _RESOURCE_DIRECTORIES[name] = resource_directory
+
+
+def list_dir(resource):
+ """List the content of a resource directory.
+
+ Result are not prefixed by the resource name.
+
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx". See also :func:`register_resource_directory`.
+
+ :param str resource: Name of the resource directory to list
+ :return: list of name contained in the directory
+ :rtype: list
+ """
+ resource_directory, resource_name = _get_package_and_resource(resource)
+
+ if resource_directory.forced_path is not None:
+ # if set, use this directory
+ path = resource_filename(resource)
+ return os.listdir(path)
+ elif pkg_resources is None:
+ # Fallback if pkg_resources is not available
+ path = resource_filename(resource)
+ return os.listdir(path)
+ else:
+ # Preferred way to get resources as it supports zipfile package
+ package_name = resource_directory.package_name
+ return pkg_resources.resource_listdir(package_name, resource_name)
+
+
+def is_dir(resource):
+ """True is the resource is a resource directory.
+
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx". See also :func:`register_resource_directory`.
+
+ :param str resource: Name of the resource
+ :rtype: bool
+ """
+ path = resource_filename(resource)
+ return os.path.isdir(path)
+
+
+def _get_package_and_resource(resource, default_directory=None):
+ """
+ Return the resource directory class and a cleaned resource name without
+ prefix.
+
+ :param str: resource: Name of the resource with resource prefix.
+ :param str default_directory: If the resource is not prefixed, the resource
+ will be searched on this default directory of the silx resource
+ directory.
+ :rtype: tuple(_ResourceDirectory, str)
+ :raises ValueError: If the resource name uses an unregistred resource
+ directory name
+ """
+ if ":" in resource:
+ prefix, resource = resource.split(":", 1)
+ else:
+ prefix = "silx"
+ if default_directory is not None:
+ resource = os.path.join(default_directory, resource)
+ if prefix not in _RESOURCE_DIRECTORIES:
+ raise ValueError("Resource '%s' uses an unregistred prefix", resource)
+ resource_directory = _RESOURCE_DIRECTORIES[prefix]
+ return resource_directory, resource
+
+
def resource_filename(resource):
"""Return filename corresponding to resource.
- resource can be the name of either a file or a directory.
The existence of the resource is not checked.
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx". See also :func:`register_resource_directory`.
+
+ :param str resource: Resource path relative to resource directory
+ using '/' path separator. It can be either a file or
+ a directory.
+ :raises ValueError: If the resource name uses an unregistred resource
+ directory name
+ :return: Absolute resource path in the file system
+ :rtype: str
+ """
+ return _resource_filename(resource, default_directory=None)
+
+
+def _resource_filename(resource, default_directory=None):
+ """Return filename corresponding to resource.
+
+ The existence of the resource is not checked.
+
+ The resource name can be prefixed by the name of a resource directory. For
+ example "silx:foo.png" identify the resource "foo.png" from the resource
+ directory "silx". See also :func:`register_resource_directory`.
+
:param str resource: Resource path relative to resource directory
- using '/' path separator.
+ using '/' path separator. It can be either a file or
+ a directory.
+ :param str default_directory: If the resource is not prefixed, the resource
+ will be searched on this default directory of the silx resource
+ directory. It should only be used internally by silx.
:return: Absolute resource path in the file system
+ :rtype: str
"""
- # Not in use, uncomment when functionality is needed
- # If _RESOURCES_DOC_DIR is set, use it to get resources in doc/ subfoldler
- # from an alternative directory.
- # if _RESOURCES_DOC_DIR is not None and (resource is 'doc' or
- # resource.startswith('doc/')):
- # # Remove doc folder from resource relative path
- # return os.path.join(_RESOURCES_DOC_DIR, *resource.split('/')[1:])
-
- if _RESOURCES_DIR is not None: # if set, use this directory
- return os.path.join(_RESOURCES_DIR, *resource.split('/'))
- elif pkg_resources is None: # Fallback if pkg_resources is not available
- return os.path.join(os.path.abspath(os.path.dirname(__file__)),
- *resource.split('/'))
- else: # Preferred way to get resources as it supports zipfile package
- return pkg_resources.resource_filename(__name__, resource)
+ resource_directory, resource_name = _get_package_and_resource(resource,
+ default_directory=default_directory)
+
+ if resource_directory.forced_path is not None:
+ # if set, use this directory
+ base_dir = resource_directory.forced_path
+ resource_path = os.path.join(base_dir, *resource_name.split('/'))
+ return resource_path
+ elif pkg_resources is None:
+ # Fallback if pkg_resources is not available
+ base_dir = resource_directory.package_path
+ resource_path = os.path.join(base_dir, *resource_name.split('/'))
+ return resource_path
+ else:
+ # Preferred way to get resources as it supports zipfile package
+ package_name = resource_directory.package_name
+ return pkg_resources.resource_filename(package_name, resource_name)
class ExternalResources(object):
@@ -139,20 +288,26 @@ class ExternalResources(object):
timeout=60):
"""Constructor of the class
- :param project: name of the project, like "silx"
- :param url_base: base URL for the data, like "http://www.silx.org/pub"
- :param env_key: name of the environment variable which contains the
- test_data directory like "SILX_DATA"
+ :param str project: name of the project, like "silx"
+ :param str url_base: base URL for the data, like "http://www.silx.org/pub"
+ :param str env_key: name of the environment variable which contains the
+ test_data directory, like "SILX_DATA".
+ If None (default), then the name of the
+ environment variable is built from the project argument:
+ "<PROJECT>_DATA".
+ The environment variable is optional: in case it is not set,
+ a directory in the temporary folder is used.
:param timeout: time in seconds before it breaks
"""
self.project = project
self._initialized = False
self._tempdir = None
self.sem = threading.Semaphore()
- self.env_key = env_key
+ self.env_key = env_key or (self.project.upper() + "_DATA")
self.url_base = url_base
self.all_data = set()
self.timeout = timeout
+ self.data_home = None
def _initialize_tmpdir(self):
"""Initialize the temporary directory"""
@@ -202,7 +357,7 @@ class ExternalResources(object):
self._tempdir = None
def getfile(self, filename):
- """Downloads the requested file from web-server available
+ """Downloads the requested file from web-server available
at https://www.silx.org/pub/silx/
:param: relative name of the image.
@@ -249,12 +404,13 @@ class ExternalResources(object):
data to disk at %s" % self.data_home)
if not os.path.isfile(fullfilename):
- raise RuntimeError("Could not automatically \
- download test images %s!\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"\
- % (filename, self.url_base, filename))
+ raise RuntimeError(
+ "Could not automatically \
+ download test images %s!\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"
+ % (filename, self.url_base, filename))
if filename not in self.all_data:
self.all_data.add(filename)
@@ -269,19 +425,19 @@ class ExternalResources(object):
return fullfilename
def getdir(self, dirname):
- """Downloads the requested tarball from the server
+ """Downloads the requested tarball from the server
https://www.silx.org/pub/silx/
and unzips it into the data directory
:param: relative name of the image.
- :return: full path of the locally saved file.
+ :return: list of files with their full path.
"""
lodn = dirname.lower()
if (lodn.endswith("tar") or lodn.endswith("tgz") or
lodn.endswith("tbz2") or lodn.endswith("tar.gz") or
lodn.endswith("tar.bz2")):
import tarfile
- engine = tarfile.TarFile
+ engine = tarfile.TarFile.open
elif lodn.endswith("zip"):
import zipfile
engine = zipfile.ZipFile
@@ -289,9 +445,14 @@ class ExternalResources(object):
raise RuntimeError("Unsupported archive format. Only tar and zip "
"are currently supported")
full_path = self.getfile(dirname)
- with engine.open(full_path) as fd:
+ root = os.path.dirname(full_path)
+ with engine(full_path, mode="r") as fd:
fd.extractall(self.data_home)
- return full_path
+ if lodn.endswith("zip"):
+ result = [os.path.join(root, i) for i in fd.namelist()]
+ else:
+ result = [os.path.join(root, i) for i in fd.getnames()]
+ return result
def download_all(self, imgs=None):
"""Download all data needed for the test/benchmarks
diff --git a/silx/resources/gui/colormaps/inferno.npy b/silx/resources/gui/colormaps/inferno.npy
new file mode 100644
index 0000000..3b00d2e
--- /dev/null
+++ b/silx/resources/gui/colormaps/inferno.npy
Binary files differ
diff --git a/silx/resources/gui/colormaps/magma.npy b/silx/resources/gui/colormaps/magma.npy
new file mode 100644
index 0000000..3f8f4dc
--- /dev/null
+++ b/silx/resources/gui/colormaps/magma.npy
Binary files differ
diff --git a/silx/resources/gui/colormaps/plasma.npy b/silx/resources/gui/colormaps/plasma.npy
new file mode 100644
index 0000000..6af2fd0
--- /dev/null
+++ b/silx/resources/gui/colormaps/plasma.npy
Binary files differ
diff --git a/silx/resources/gui/colormaps/viridis.npy b/silx/resources/gui/colormaps/viridis.npy
new file mode 100644
index 0000000..141877e
--- /dev/null
+++ b/silx/resources/gui/colormaps/viridis.npy
Binary files differ
diff --git a/silx/resources/gui/icons/3d-plane-normal-x.svg b/silx/resources/gui/icons/3d-plane-normal-x.svg
index 6bd2986..b1addae 100644
--- a/silx/resources/gui/icons/3d-plane-normal-x.svg
+++ b/silx/resources/gui/icons/3d-plane-normal-x.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
- <rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1062.6" y="-31.854" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
+<rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1062.6" y="-31.854" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/3d-plane-normal-y.svg b/silx/resources/gui/icons/3d-plane-normal-y.svg
index b2977e0..7016992 100644
--- a/silx/resources/gui/icons/3d-plane-normal-y.svg
+++ b/silx/resources/gui/icons/3d-plane-normal-y.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1041.7" y="1457.5" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1041.7" y="1457.5" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/3d-plane-normal-z.svg b/silx/resources/gui/icons/3d-plane-normal-z.svg
index ce540fb..6ee06dd 100644
--- a/silx/resources/gui/icons/3d-plane-normal-z.svg
+++ b/silx/resources/gui/icons/3d-plane-normal-z.svg
@@ -1,20 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)">
- <path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
- <g transform="translate(-24.646 -1.4219)" stroke="#000">
- <rect x="31.61" y="1029.2" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
- </g>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)">
+<path d="m12.5 1039.9v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path d="m30.5 1039.9h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path transform="matrix(1 0 -.69517 .71885 0 0)" d="m1018.3 1461.8v-15.133" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2.3589"/>
+<g transform="translate(-24.646 -1.4219)" stroke="#000">
+<rect x="31.61" y="1029.2" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
+</g>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/3d-plane-pan.png b/silx/resources/gui/icons/3d-plane-pan.png
new file mode 100644
index 0000000..79b8ace
--- /dev/null
+++ b/silx/resources/gui/icons/3d-plane-pan.png
Binary files differ
diff --git a/silx/resources/gui/icons/3d-plane-pan.svg b/silx/resources/gui/icons/3d-plane-pan.svg
new file mode 100644
index 0000000..2867c3e
--- /dev/null
+++ b/silx/resources/gui/icons/3d-plane-pan.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="31.513" y="27.211" width="18" height="15.133" fill="none" stroke="#808080" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1.5" width="18" height="18" ry="0" fill="none" stroke="#808080" stroke-miterlimit="2"/>
+<g transform="translate(.085189 -2e-7)">
+<rect transform="rotate(90)" x="9.6949" y="-16.915" width="16.61" height="1.8305" ry=".020888" color="#000000"/>
+<path d="m19.47 24.598c-1.2305 2.0808-2.3818 3.924-3.5398 5.7873l-3.3995-5.7593z"/>
+<path d="m19.47 7.4021c-1.2305-2.0808-2.3818-3.924-3.5398-5.7873l-3.3995 5.7593z"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="23.765" y="16.176" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect transform="rotate(90)" x="5.6949" y="-16.915" width="10.225" height="1.8305" ry=".020888" color="#000000"/>
+</g>
+<rect x="1.5" y="12.5" width="18" height="18" ry="0" fill="none" stroke="#808080" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="13.765" y="2.0757" width="18" height="15.365" fill="none" stroke="#808080" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+</svg>
diff --git a/silx/resources/gui/icons/3d-plane.svg b/silx/resources/gui/icons/3d-plane.svg
index a473593..4ba88bc 100644
--- a/silx/resources/gui/icons/3d-plane.svg
+++ b/silx/resources/gui/icons/3d-plane.svg
@@ -1,16 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path d="m12.5 19.538v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path d="m30.5 19.538h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
- <path d="m2.1003 30.446 10.52-10.879" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2"/>
- <path d="m12.881 4.6102-7.7285 22.78 21.694-7.729z" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-width="1px"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<path d="m12.5 19.538v-18" fill="none" stroke="#008000" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path d="m30.5 19.538h-18" fill="none" stroke="#F00" stroke-linecap="round" stroke-miterlimit="2" stroke-width="2"/>
+<path d="m2.1003 30.446 10.52-10.879" fill="none" stroke="#00F" stroke-linecap="round" stroke-miterlimit="0" stroke-width="2"/>
+<path d="m12.881 4.6102-7.7285 22.78 21.694-7.729z" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-width="1px"/>
</svg>
diff --git a/silx/resources/gui/icons/arrow-keys.svg b/silx/resources/gui/icons/arrow-keys.svg
index 5b573c3..64aade5 100644
--- a/silx/resources/gui/icons/arrow-keys.svg
+++ b/silx/resources/gui/icons/arrow-keys.svg
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(0 -2.4249)"><g transform="translate(-12.499 4.4866)"><rect x="12.999" y="15.013" width="9" height="9" fill="none" stroke="#f7941e"/><g transform="translate(-20.022 -1.5293)"><path transform="translate(20.1 1.5293)" d="m17.469 16.375-3.2188 3.2188 3.2188 3.2188v-2.125h3.0625l0.0625-1.0938-0.0625-1.0938h-3.0625v-2.125z"/></g></g><g transform="matrix(0 -1 1 0 -3.5134 41.499)"><rect x="12.999" y="15.013" width="9" height="9" fill="none" stroke="#f7941e"/><g transform="translate(-20.022 -1.5293)"><path transform="translate(20.1 1.5293)" d="m17.469 16.375-3.2188 3.2188 3.2188 3.2188v-2.125h3.0625l0.0625-1.0938-0.0625-1.0938h-3.0625v-2.125z"/></g></g><g transform="matrix(-1 0 0 -1 44.499 43.513)"><rect x="12.999" y="15.013" width="9" height="9" fill="none" stroke="#f7941e"/><g transform="translate(-20.022 -1.5293)"><path transform="translate(20.1 1.5293)" d="m17.469 16.375-3.2188 3.2188 3.2188 3.2188v-2.125h3.0625l0.0625-1.0938-0.0625-1.0938h-3.0625v-2.125z"/></g></g><g transform="matrix(0 1 -1 0 35.513 -4.6495)"><rect x="12.999" y="15.013" width="9" height="9" fill="none" stroke="#f7941e"/><g transform="translate(-20.022 -1.5293)"><path transform="translate(20.1 1.5293)" d="m17.469 16.375-3.2188 3.2188 3.2188 3.2188v-2.125h3.0625l0.0625-1.0938-0.0625-1.0938h-3.0625v-2.125z"/></g></g></g></svg>
diff --git a/silx/resources/gui/icons/axis.png b/silx/resources/gui/icons/axis.png
new file mode 100644
index 0000000..aa29525
--- /dev/null
+++ b/silx/resources/gui/icons/axis.png
Binary files differ
diff --git a/silx/resources/gui/icons/axis.svg b/silx/resources/gui/icons/axis.svg
new file mode 100644
index 0000000..fc07e30
--- /dev/null
+++ b/silx/resources/gui/icons/axis.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"><g><path d="m10.041 23.61c-0.24903 0.58659-0.65577 0.87988-1.2202 0.87988-0.79688 0-1.2119-0.48421-1.2451-1.4526-0.69174 0.99056-1.6546 1.4858-2.8887 1.4858-0.74707 0-1.3696-0.19645-1.8677-0.58936-0.53125-0.43164-0.79688-1.0099-0.79688-1.7349-9e-7 -1.7874 1.5246-2.7752 4.5737-2.9634l0.86328-0.0498v-0.30713c-6.4e-6 -1.7044-0.6696-2.5566-2.0088-2.5566-0.89095 8e-6 -1.4969 0.29607-1.8179 0.88818 0.32096 0.04981 0.48144 0.25456 0.48145 0.61426-3e-6 0.48698-0.24903 0.73047-0.74707 0.73047-0.54785 6e-6 -0.82178-0.27669-0.82178-0.83008-1.5e-6 -0.46484 0.26009-0.89094 0.78027-1.2783 0.61979-0.46484 1.3586-0.69726 2.2163-0.69727 1.9922 9e-6 2.9883 0.99334 2.9883 2.98v3.4531c-7.4e-6 1.1344 0.19368 1.7017 0.58105 1.7017 0.23795 0 0.43993-0.17155 0.60596-0.51465l0.32373 0.24072m-2.5815-1.4941v-2.3325l-0.71387 0.0332c-2.3574 0.11622-3.5361 0.87712-3.5361 2.2827-2.2e-6 0.52018 0.16325 0.94629 0.48975 1.2783 0.32096 0.31543 0.72493 0.47314 1.2119 0.47314 0.66406 0 1.2589-0.20475 1.7847-0.61426 0.35416-0.28776 0.60872-0.66129 0.76367-1.1206"/><path d="m19.222 24.241h-3.6523v-0.47314c0.68066 1e-6 1.021-0.11344 1.021-0.34033-6e-6 -0.10514-0.13558-0.34586-0.40674-0.72217l-1.5854-2.1416-1.9009 2.3159c-0.19369 0.24349-0.29053 0.42611-0.29053 0.54785-2e-6 0.22689 0.3846 0.34033 1.1538 0.34033v0.47314h-3.2456v-0.47314c0.61426 1e-6 1.2202-0.37077 1.8179-1.1123l2.0752-2.5483-1.8677-2.4321c-0.30436-0.40396-0.56445-0.69449-0.78027-0.87158-0.23242-0.16047-0.57276-0.24902-1.021-0.26562v-0.49805h3.6025v0.49805c-0.6696 0.01661-1.0044 0.13559-1.0044 0.35693-3e-6 0.11622 0.13558 0.35417 0.40674 0.71387l1.3945 1.8511 1.6851-2.0752c0.19368-0.24348 0.29052-0.42056 0.29053-0.53125-7e-6 -0.19368-0.40398-0.29882-1.2119-0.31543v-0.49805h3.2622v0.49805c-0.32097 7e-6 -0.57553 0.04981-0.76367 0.14941-0.2435 0.11622-0.58383 0.43441-1.021 0.95459l-1.8677 2.2412 2.0586 2.7227c0.55338 0.7526 1.1704 1.14 1.8511 1.1621v0.47314"/><path d="m21.828 12.205c0.24349 1.2e-5 0.44824 0.08579 0.61426 0.25732 0.17155 0.17156 0.25732 0.37631 0.25732 0.61426-3e-6 0.56446-0.29053 0.84669-0.87158 0.84668-0.56446 1.1e-5 -0.84668-0.28222-0.84668-0.84668-1e-6 -0.58104 0.28222-0.87157 0.84668-0.87158m2.0088 12.036h-4.0425v-0.47314c0.37077 1e-6 0.67513-0.03597 0.91309-0.10791 0.3763-0.09961 0.56445-0.42334 0.56445-0.97119v-5.0801c-2e-6 -0.53678-0.13558-0.85497-0.40674-0.95459-0.17155-0.0664-0.52848-0.0996-1.0708-0.09961v-0.51465c0.92415-0.01659 1.7902-0.1079 2.5981-0.27393v6.9229c-3e-6 0.50912 0.13004 0.81624 0.39014 0.92139 0.25455 0.10514 0.60595 0.15772 1.0542 0.15772v0.47314"/><path d="m30.602 18.555c-0.08855-0.64192-0.31544-1.1483-0.68066-1.519-0.47592-0.4759-1.0487-0.71386-1.7183-0.71387-0.55339 8e-6 -1.0127 0.18262-1.3779 0.54785-0.26009 0.2767-0.39014 0.60596-0.39014 0.98779-2e-6 0.66407 0.57275 1.1759 1.7183 1.5356l0.43994 0.13281c0.94628 0.30437 1.6159 0.60596 2.0088 0.90478 0.56445 0.42611 0.84667 0.99333 0.84668 1.7017-8e-6 0.84115-0.3182 1.4748-0.95459 1.9009-0.49252 0.33756-1.0985 0.50635-1.8179 0.50635-0.6364 0-1.3143-0.19645-2.0337-0.58936-0.24349-0.14388-0.43164-0.21582-0.56445-0.21582-0.18262 1e-6 -0.27393 0.19645-0.27393 0.58936h-0.48975v-3.1128h0.52295c0.05534 0.80241 0.29883 1.4194 0.73047 1.8511 0.55338 0.56999 1.2451 0.85498 2.0752 0.85498 1.1787 1e-6 1.7681-0.52295 1.7681-1.5688-6e-6 -0.45931-0.17432-0.83284-0.52295-1.1206-0.23796-0.18815-0.78858-0.43164-1.6519-0.73047l-0.50635-0.17432c-0.78028-0.25455-1.3032-0.49251-1.5688-0.71387-0.49805-0.3929-0.74707-0.90755-0.74707-1.5439-2e-6 -0.61978 0.23242-1.1538 0.69726-1.6021 0.50911-0.4759 1.1732-0.71386 1.9922-0.71387 0.70833 9e-6 1.342 0.16879 1.9009 0.50635 0.16048 0.09408 0.29606 0.14112 0.40674 0.14111 0.12727 8e-6 0.20751-0.16324 0.24072-0.48975h0.42334v2.6479h-0.47314"/></g><path d="m1.9688 2.1562-1 0.03125 0.125 25.625v0.46875h0.5 28.625v-1h-28.125l-0.125-25.125z" color="#000000" style="block-progression:tb;text-indent:0;text-transform:none"/><path d="m24.972 25.376 6.5555 2.4106-6.5555 2.4106c1.0473-1.4232 1.0413-3.3705 0-4.8213z" fill-rule="evenodd" stroke-linejoin="round" stroke-width=".625"/><path d="m-0.9349 7.4134 2.3759-6.5682 2.4453 6.5427c-1.4288-1.0398-3.3759-1.0234-4.8212 0.025509z" fill-rule="evenodd" stroke-linejoin="round" stroke-width=".625"/></svg>
diff --git a/silx/resources/gui/icons/camera.svg b/silx/resources/gui/icons/camera.svg
index d0335fa..ac9ed92 100644
--- a/silx/resources/gui/icons/camera.svg
+++ b/silx/resources/gui/icons/camera.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)">
- <g transform="translate(-.25 -.037824)">
- <rect x="3.5" y="1030.4" width="16" height="12" rx="2"/>
- <path d="m22 1033.1 6-2c0.52557-0.1752 1 0.446 1 1v8c0 0.554-0.47443 1.1752-1 1l-6-2c-0.52557-0.1752-1-0.446-1-1v-4c0-0.554 0.47443-0.8248 1-1z"/>
- </g>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)">
+<g transform="translate(-.25 -.037824)">
+<rect x="3.5" y="1030.4" width="16" height="12" rx="2"/>
+<path d="m22 1033.1 6-2c0.52557-0.1752 1 0.446 1 1v8c0 0.554-0.47443 1.1752-1 1l-6-2c-0.52557-0.1752-1-0.446-1-1v-4c0-0.554 0.47443-0.8248 1-1z"/>
+</g>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/close.svg b/silx/resources/gui/icons/close.svg
index f98ec95..3b96e8f 100644
--- a/silx/resources/gui/icons/close.svg
+++ b/silx/resources/gui/icons/close.svg
@@ -1,68 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3086"
- xml:space="preserve"><metadata
- id="metadata3115"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3113"><filter
- x="-0.14179821"
- y="-0.14627124"
- width="1.2835964"
- height="1.2925425"
- color-interpolation-filters="sRGB"
- id="filter7174"><feGaussianBlur
- id="feGaussianBlur7176"
- stdDeviation="0.9522046" /></filter></defs><radialGradient
- cx="13.553"
- cy="18.115999"
- r="9.3607998"
- fx="17.403"
- fy="10.383"
- id="a"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.3706,0,0,1.3276,-2.5752,-8.0518)"><stop
- id="stop3089"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0.0279" /><stop
- id="stop3091"
- style="stop-color:#ffeddb;stop-opacity:1"
- offset="0.3066" /><stop
- id="stop3093"
- style="stop-color:#fed09e;stop-opacity:1"
- offset="0.5122" /><stop
- id="stop3095"
- style="stop-color:#fdc587;stop-opacity:1"
- offset="0.58660001" /><stop
- id="stop3097"
- style="stop-color:#f9a13c;stop-opacity:1"
- offset="0.83029997" /><stop
- id="stop3099"
- style="stop-color:#f7941e;stop-opacity:1"
- offset="0.94080001" /></radialGradient><ellipse
- cx="16"
- cy="16"
- rx="12.83"
- ry="12.427"
- id="ellipse3101"
- style="fill:url(#a)" /><path
- d="m 22.89734,9.1277334 c -0.39375,0.002 -0.79775,0.17675 -1.09375,0.46875 l -5.375,5.2500006 -5.4375,-5.2187506 c -0.602,-0.58 -1.5592499,-0.583 -2.1562499,0 -0.598,0.5840006 -0.602,1.5470006 0,2.1250006 l 5.4374999,5.21875 -5.3749999,5.25 c -0.599,0.583 -0.605,1.51675 0,2.09375 0.601,0.577 1.5904999,0.586 2.1874999,0 l 5.375,-5.25 5.4375,5.1875 c 0.605,0.578 1.55825,0.584 2.15625,0 0.596,-0.58 0.598,-1.51475 0,-2.09375 l -5.4375,-5.21875 5.375,-5.25 c 0.594,-0.584 0.602,-1.547999 0,-2.1250006 -0.301,-0.29 -0.7,-0.4395 -1.09375,-0.4375 z"
- id="path3107-3"
- style="filter:url(#filter7174)" /><g
- id="g3105"
- style="fill:#414042;stroke:#414042;stroke-width:0.30000001;stroke-miterlimit:10"><path
- d="M 10.627,23.362 C 10.03,23.948 9.058,23.95 8.457,23.373 7.852,22.796 7.847,21.852 8.446,21.269 L 21.373,8.637 c 0.592,-0.584 1.57,-0.59 2.172,-0.01 0.602,0.577 0.604,1.519 0.01,2.103 L 10.627,23.362 z"
- id="path3107" /><path
- d="m 21.439,23.315 c 0.605,0.578 1.578,0.575 2.176,-0.009 0.596,-0.58 0.588,-1.526 -0.01,-2.105 L 10.558,8.685 C 9.956,8.105 8.984,8.109 8.387,8.692 7.789,9.276 7.794,10.219 8.396,10.797 l 13.043,12.518 z"
- id="path3109" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="b" x="-.1418" y="-.14627" width="1.2836" height="1.2925" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.9522046"/></filter></defs><radialGradient id="c" cx="13.553" cy="18.116" r="9.3608" fx="17.403" fy="10.383" gradientTransform="matrix(1.3706,0,0,1.3276,-2.5752,-8.0518)" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset=".0279"/><stop stop-color="#ffeddb" offset=".3066"/><stop stop-color="#fed09e" offset=".5122"/><stop stop-color="#fdc587" offset=".5866"/><stop stop-color="#f9a13c" offset=".8303"/><stop stop-color="#f7941e" offset=".9408"/></radialGradient><ellipse cx="16" cy="16" rx="12.83" ry="12.427" fill="url(#c)"/><path d="m22.897 9.1277c-0.39375 2e-3 -0.79775 0.17675-1.0938 0.46875l-5.375 5.25-5.4375-5.2188c-0.602-0.58-1.5592-0.583-2.1562 0-0.598 0.584-0.602 1.547 0 2.125l5.4375 5.2188-5.375 5.25c-0.599 0.583-0.605 1.5168 0 2.0938 0.601 0.577 1.5905 0.586 2.1875 0l5.375-5.25 5.4375 5.1875c0.605 0.578 1.5582 0.584 2.1562 0 0.596-0.58 0.598-1.5148 0-2.0938l-5.4375-5.2188 5.375-5.25c0.594-0.584 0.602-1.548 0-2.125-0.301-0.29-0.7-0.4395-1.0938-0.4375z" filter="url(#b)"/><g fill="#414042" stroke="#414042" stroke-miterlimit="10" stroke-width=".3"><path d="m10.627 23.362c-0.597 0.586-1.569 0.588-2.17 0.011-0.605-0.577-0.61-1.521-0.011-2.104l12.927-12.632c0.592-0.584 1.57-0.59 2.172-0.01 0.602 0.577 0.604 1.519 0.01 2.103l-12.928 12.632z"/><path d="m21.439 23.315c0.605 0.578 1.578 0.575 2.176-9e-3 0.596-0.58 0.588-1.526-0.01-2.105l-13.047-12.516c-0.602-0.58-1.574-0.576-2.171 7e-3 -0.598 0.584-0.593 1.527 9e-3 2.105l13.043 12.518z"/></g></svg>
diff --git a/silx/resources/gui/icons/colorbar.png b/silx/resources/gui/icons/colorbar.png
new file mode 100644
index 0000000..1b0e416
--- /dev/null
+++ b/silx/resources/gui/icons/colorbar.png
Binary files differ
diff --git a/silx/resources/gui/icons/colorbar.svg b/silx/resources/gui/icons/colorbar.svg
new file mode 100644
index 0000000..035e619
--- /dev/null
+++ b/silx/resources/gui/icons/colorbar.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="a" x1="-24.805" x2="4.1949" y1="24.441" y2="24.441" gradientTransform="translate(-5.6949 -5.0763)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop stop-color="#FFF" offset="1"/></linearGradient></defs>
+<g transform="translate(-1.4915 -1)" stroke="#f7941e"><rect transform="rotate(-90)" x="-30" y="11.365" width="26" height="10" rx="2" fill="url(#a)"/><path d="m22.365 6h1.2542" fill="none" stroke-linecap="square" stroke-width="1px"/><path d="m22.365 28h1.2542" fill="none" stroke-linecap="square" stroke-width="1px"/><path d="m22.365 13.333h1.2542" fill="none" stroke-linecap="square" stroke-width="1px"/><path d="m22.365 20.667h1.2542" fill="none" stroke-linecap="square" stroke-width="1px"/></g></svg>
diff --git a/silx/resources/gui/icons/crosshair.svg b/silx/resources/gui/icons/crosshair.svg
index d8bd07e..d61f301 100644
--- a/silx/resources/gui/icons/crosshair.svg
+++ b/silx/resources/gui/icons/crosshair.svg
@@ -1,40 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3208"
- xml:space="preserve"><defs
- id="defs3220"><filter
- x="-0.18998802"
- y="-0.11593667"
- width="1.379976"
- height="1.2318733"
- color-interpolation-filters="sRGB"
- id="filter4582"><feGaussianBlur
- id="feGaussianBlur4584"
- stdDeviation="1.239375" /></filter></defs><metadata
- id="metadata3210"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><path
- d="m 0.13559,5.2881 h 31.864"
- id="path3212"
- style="fill:none;stroke:#f7941e;stroke-width:3" /><path
- d="m 6.8475,0.067797 v 31.864"
- id="path3214"
- style="fill:none;stroke:#f7941e;stroke-width:3" /><path
- d="m 6.9515363,5.88374 c 0,7.668296 0,14.727377 0,21.468749 1.562499,-1.562499 3.1249987,-3.124999 4.6874987,-4.687499 1.286105,2.960737 2.595999,5.911189 3.875001,8.874999 1.679854,-0.586234 3.057686,-1.123669 4.5625,-1.687499 -1.355248,-2.924576 -2.785698,-5.815806 -4.1875,-8.71875 2.239583,0 4.479167,0 6.71875,0 C 17.237387,15.822506 11.545303,10.466868 6.9515363,5.88374 z"
- transform="matrix(0.83268173,0,0,0.83268173,1.0722105,0.21558257)"
- id="path3222-6"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter4582);enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /><path
- d="m 7.5738363,5.8489159 0,15.8905341 3.6382357,-3.638237 3.317217,7.597496 2.996195,-1.123574 -3.584734,-7.436982 5.243342,0 z"
- id="path3222"
- style="fill:#000000;stroke:#ffffff;stroke-width:0.83268172;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.18999" y="-.11594" width="1.38" height="1.2319" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.239375"/></filter></defs><path d="m0.13559 5.2881h31.864" fill="none" stroke="#f7941e" stroke-width="3"/><path d="m6.8475 0.067797v31.864" fill="none" stroke="#f7941e" stroke-width="3"/><path transform="matrix(.83268 0 0 .83268 1.0722 .21558)" d="m6.9515 5.8837v21.469c1.5625-1.5625 3.125-3.125 4.6875-4.6875 1.2861 2.9607 2.596 5.9112 3.875 8.875 1.6799-0.58623 3.0577-1.1237 4.5625-1.6875-1.3552-2.9246-2.7857-5.8158-4.1875-8.7188h6.7188c-5.3704-5.3112-11.062-10.667-15.656-15.25z" color="#000000" filter="url(#a)" style="block-progression:tb;text-indent:0;text-transform:none"/><path d="m7.5738 5.8489v15.891l3.6382-3.6382 3.3172 7.5975 2.9962-1.1236-3.5847-7.437h5.2433z" stroke="#fff" stroke-width=".83268"/></svg>
diff --git a/silx/resources/gui/icons/cube-back.svg b/silx/resources/gui/icons/cube-back.svg
index 1157ca1..8e9c690 100644
--- a/silx/resources/gui/icons/cube-back.svg
+++ b/silx/resources/gui/icons/cube-back.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube-bottom.svg b/silx/resources/gui/icons/cube-bottom.svg
index aa9dfcf..ac2ae4b 100644
--- a/silx/resources/gui/icons/cube-bottom.svg
+++ b/silx/resources/gui/icons/cube-bottom.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube-front.svg b/silx/resources/gui/icons/cube-front.svg
index c17ba31..9ea8aef 100644
--- a/silx/resources/gui/icons/cube-front.svg
+++ b/silx/resources/gui/icons/cube-front.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube-left.svg b/silx/resources/gui/icons/cube-left.svg
index a7626fe..f5c3753 100644
--- a/silx/resources/gui/icons/cube-left.svg
+++ b/silx/resources/gui/icons/cube-left.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1052.2" y="-17.566" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
- <rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1070.6" y="-43.173" width="18" height="15.399" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1052.2" y="-17.566" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
+<rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1070.6" y="-43.173" width="18" height="15.399" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube-right.svg b/silx/resources/gui/icons/cube-right.svg
index f9230f6..f74ff51 100644
--- a/silx/resources/gui/icons/cube-right.svg
+++ b/silx/resources/gui/icons/cube-right.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1052.2" y="-17.566" width="18" height="15.399" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1070.6" y="-43.173" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1052.2" y="-17.566" width="18" height="15.399" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect transform="matrix(0 -1 -.70641 .70781 0 0)" x="-1070.6" y="-43.173" width="18" height="15.399" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1898"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube-top.svg b/silx/resources/gui/icons/cube-top.svg
index 0b872ee..75ec3a4 100644
--- a/silx/resources/gui/icons/cube-top.svg
+++ b/silx/resources/gui/icons/cube-top.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/cube.svg b/silx/resources/gui/icons/cube.svg
index 1ea0435..08e84a3 100644
--- a/silx/resources/gui/icons/cube.svg
+++ b/silx/resources/gui/icons/cube.svg
@@ -1,19 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1020.4)" stroke="#000">
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
- <rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
- <rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
- <path transform="matrix(0 -1 -.70641 .70781 0 0)" d="m-1070.3-42.826 17.725-0.01751 0.026 14.9-18.077 0.01751z" fill="#f7941e" fill-opacity=".81569" stroke-linejoin="bevel" stroke-miterlimit="0" stroke-width=".5949"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)" stroke="#000">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="1018.3" y="1446.7" width="18" height="15.133" fill="none" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1795"/>
+<rect x="12.5" y="1021.9" width="18" height="18" ry="0" fill="none" stroke-miterlimit="2"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="1031.7" y="1443.4" width="18" height="15.365" fill="#f7941e" fill-opacity=".81569" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1885"/>
+<rect x="1.5" y="1032.9" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke-miterlimit="2"/>
+<path transform="matrix(0 -1 -.70641 .70781 0 0)" d="m-1070.3-42.826 17.725-0.01751 0.026 14.9-18.077 0.01751z" fill="#f7941e" fill-opacity=".81569" stroke-linejoin="bevel" stroke-miterlimit="0" stroke-width=".5949"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/document-open.svg b/silx/resources/gui/icons/document-open.svg
index 26c7466..0046cfd 100644
--- a/silx/resources/gui/icons/document-open.svg
+++ b/silx/resources/gui/icons/document-open.svg
@@ -1,126 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata54"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs52"><linearGradient
- x1="7.8379002"
- y1="15.27"
- x2="18.125"
- y2="23.115"
- id="b-2"
- gradientUnits="userSpaceOnUse"><stop
- id="stop9-9"
- style="stop-color:#dedfe3;stop-opacity:1"
- offset="0" /><stop
- id="stop11-1"
- style="stop-color:#97989c;stop-opacity:1"
- offset="0.31040001" /><stop
- id="stop13-2"
- style="stop-color:#626365;stop-opacity:1"
- offset="0.55800003" /><stop
- id="stop15-7"
- style="stop-color:#343435;stop-opacity:1"
- offset="0.73269999" /><stop
- id="stop17-0"
- style="stop-color:#000000;stop-opacity:1"
- offset="0.81879997" /></linearGradient><filter
- x="-0.32558218"
- y="-0.40255472"
- width="1.6511643"
- height="1.8051095"
- color-interpolation-filters="sRGB"
- id="filter4474"><feGaussianBlur
- id="feGaussianBlur4476"
- stdDeviation="3.0979788" /></filter></defs><path
- d="m 26.494328,25.327094 c 0.161,0.526 -0.149,1.033 -0.691,1.128 l -16.5839999,2.9 c -0.542,0.095 -1.117,-0.258 -1.279,-0.784 l -4.1969996,-13.629 c -0.162,-0.525 0.149,-1.033 0.69,-1.128 l 16.5829995,-2.898 c 0.542,-0.095 1.118,0.258 1.279,0.783 l 4.199,13.628 z"
- id="path19-9"
- style="opacity:0.5;fill:#000000;filter:url(#filter4474)" /><path
- d="M 18.462,31.115"
- id="path4"
- style="stroke:#ffffff;stroke-width:0.50999999;stroke-miterlimit:10" /><linearGradient
- x1="7.8379002"
- y1="15.27"
- x2="18.125"
- y2="23.115"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop9"
- style="stop-color:#dedfe3;stop-opacity:1"
- offset="0" /><stop
- id="stop11"
- style="stop-color:#97989c;stop-opacity:1"
- offset="0.31040001" /><stop
- id="stop13"
- style="stop-color:#626365;stop-opacity:1"
- offset="0.55800003" /><stop
- id="stop15"
- style="stop-color:#343435;stop-opacity:1"
- offset="0.73269999" /><stop
- id="stop17"
- style="stop-color:#000000;stop-opacity:1"
- offset="0.81879997" /></linearGradient><path
- d="m 24.989,24.866 c 0.161,0.526 -0.149,1.033 -0.691,1.128 l -16.584,2.9 C 7.172,28.989 6.597,28.636 6.435,28.11 L 2.238,14.481 c -0.162,-0.525 0.149,-1.033 0.69,-1.128 l 16.583,-2.898 c 0.542,-0.095 1.118,0.258 1.279,0.783 l 4.199,13.628 z"
- id="path19"
- style="fill:url(#b)" /><path
- d="m 24.989,24.866 c 0.161,0.526 -0.149,1.033 -0.691,1.128 l -16.584,2.9 C 7.172,28.989 6.597,28.636 6.435,28.11 L 2.238,14.481 c -0.162,-0.525 0.149,-1.033 0.69,-1.128 l 16.583,-2.898 c 0.542,-0.095 1.118,0.258 1.279,0.783 l 4.199,13.628 z"
- id="path21"
- style="fill:none;stroke:#414042;stroke-width:0.1;stroke-miterlimit:10" /><linearGradient
- x1="7.0897999"
- y1="20.499001"
- x2="29.940001"
- y2="20.499001"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop24"
- style="stop-color:#f1f2f2;stop-opacity:1"
- offset="0" /><stop
- id="stop26"
- style="stop-color:#f2e7db;stop-opacity:1"
- offset="0.0395" /><stop
- id="stop28"
- style="stop-color:#f4d3ae;stop-opacity:1"
- offset="0.1471" /><stop
- id="stop30"
- style="stop-color:#f5c188;stop-opacity:1"
- offset="0.2586" /><stop
- id="stop32"
- style="stop-color:#f5b36a;stop-opacity:1"
- offset="0.37180001" /><stop
- id="stop34"
- style="stop-color:#f6a74f;stop-opacity:1"
- offset="0.48710001" /><stop
- id="stop36"
- style="stop-color:#f79e39;stop-opacity:1"
- offset="0.60509998" /><stop
- id="stop38"
- style="stop-color:#f79829;stop-opacity:1"
- offset="0.727" /><stop
- id="stop40"
- style="stop-color:#f79520;stop-opacity:1"
- offset="0.85519999" /><stop
- id="stop42"
- style="stop-color:#f7941e;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 25.415,24.895 c -0.191,0.516 -0.791,1.016 -1.332,1.112 L 7.786,28.892 C 7.244,28.989 6.958,28.645 7.149,28.129 l 4.463,-12.022 c 0.191,-0.516 0.791,-1.016 1.333,-1.112 l 16.299,-2.888 c 0.541,-0.096 0.828,0.248 0.637,0.763 l -4.466,12.025 z"
- id="path44"
- style="fill:url(#a)" /><path
- d="m 25.415,24.895 c -0.191,0.516 -0.791,1.016 -1.332,1.112 L 7.786,28.892 C 7.244,28.989 6.958,28.645 7.149,28.129 l 4.463,-12.022 c 0.191,-0.516 0.791,-1.016 1.333,-1.112 l 16.299,-2.888 c 0.541,-0.096 0.828,0.248 0.637,0.763 l -4.466,12.025 z"
- id="path46"
- style="fill:none;stroke:#f7941e;stroke-width:0.1;stroke-miterlimit:10" /><path
- d="M 26.084,6.26 C 22.891,1.053 17.66,3.32 17.66,3.32 L 9.84,6.835 c 0,0 10.569,-4.773 14.794,0.259 -1.424,0.883 -2.508,1.723 -2.508,1.723 l 4.616,1.042 0.19,-0.024 c -0.027,-0.222 2.092,-4.694 2.092,-4.694 -0.89,0.143 -1.935,0.588 -2.94,1.119 z"
- id="path48"
- style="fill:#00a651;stroke:#000000;stroke-width:0.1;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="c" x="-.32558" y="-.40255" width="1.6512" height="1.8051" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="3.0979788"/></filter></defs><path d="m26.494 25.327c0.161 0.526-0.149 1.033-0.691 1.128l-16.584 2.9c-0.542 0.095-1.117-0.258-1.279-0.784l-4.197-13.629c-0.162-0.525 0.149-1.033 0.69-1.128l16.583-2.898c0.542-0.095 1.118 0.258 1.279 0.783l4.199 13.628z" filter="url(#c)" opacity=".5"/><path d="m18.462 31.115" stroke="#fff" stroke-miterlimit="10" stroke-width=".51"/><linearGradient id="d" x1="7.8379" x2="18.125" y1="15.27" y2="23.115" gradientUnits="userSpaceOnUse"><stop stop-color="#dedfe3" offset="0"/><stop stop-color="#97989c" offset=".3104"/><stop stop-color="#626365" offset=".558"/><stop stop-color="#343435" offset=".7327"/><stop offset=".8188"/></linearGradient><path d="m24.989 24.866c0.161 0.526-0.149 1.033-0.691 1.128l-16.584 2.9c-0.542 0.095-1.117-0.258-1.279-0.784l-4.197-13.629c-0.162-0.525 0.149-1.033 0.69-1.128l16.583-2.898c0.542-0.095 1.118 0.258 1.279 0.783l4.199 13.628z" fill="url(#d)"/><path d="m24.989 24.866c0.161 0.526-0.149 1.033-0.691 1.128l-16.584 2.9c-0.542 0.095-1.117-0.258-1.279-0.784l-4.197-13.629c-0.162-0.525 0.149-1.033 0.69-1.128l16.583-2.898c0.542-0.095 1.118 0.258 1.279 0.783l4.199 13.628z" fill="none" stroke="#414042" stroke-miterlimit="10" stroke-width=".1"/><linearGradient id="e" x1="7.0898" x2="29.94" y1="20.499" y2="20.499" gradientUnits="userSpaceOnUse"><stop stop-color="#f1f2f2" offset="0"/><stop stop-color="#f2e7db" offset=".0395"/><stop stop-color="#f4d3ae" offset=".1471"/><stop stop-color="#f5c188" offset=".2586"/><stop stop-color="#f5b36a" offset=".3718"/><stop stop-color="#f6a74f" offset=".4871"/><stop stop-color="#f79e39" offset=".6051"/><stop stop-color="#f79829" offset=".727"/><stop stop-color="#f79520" offset=".8552"/><stop stop-color="#f7941e" offset="1"/></linearGradient><path d="m25.415 24.895c-0.191 0.516-0.791 1.016-1.332 1.112l-16.297 2.885c-0.542 0.097-0.828-0.247-0.637-0.763l4.463-12.022c0.191-0.516 0.791-1.016 1.333-1.112l16.299-2.888c0.541-0.096 0.828 0.248 0.637 0.763l-4.466 12.025z" fill="url(#e)"/><path d="m25.415 24.895c-0.191 0.516-0.791 1.016-1.332 1.112l-16.297 2.885c-0.542 0.097-0.828-0.247-0.637-0.763l4.463-12.022c0.191-0.516 0.791-1.016 1.333-1.112l16.299-2.888c0.541-0.096 0.828 0.248 0.637 0.763l-4.466 12.025z" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width=".1"/><path d="m26.084 6.26c-3.193-5.207-8.424-2.94-8.424-2.94l-7.82 3.515s10.569-4.773 14.794 0.259c-1.424 0.883-2.508 1.723-2.508 1.723l4.616 1.042 0.19-0.024c-0.027-0.222 2.092-4.694 2.092-4.694-0.89 0.143-1.935 0.588-2.94 1.119z" fill="#00a651" stroke="#000" stroke-miterlimit="10" stroke-width=".1"/></svg>
diff --git a/silx/resources/gui/icons/document-print.svg b/silx/resources/gui/icons/document-print.svg
index 49cc20e..eff3b3f 100644
--- a/silx/resources/gui/icons/document-print.svg
+++ b/silx/resources/gui/icons/document-print.svg
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
- <linearGradient id="c" x1="3.1421" x2="28.861" y1="14.73" y2="14.73" gradientUnits="userSpaceOnUse">
+ <linearGradient id="d" x1="3.1421" x2="28.861" y1="14.73" y2="14.73" gradientUnits="userSpaceOnUse">
<stop stop-color="#414042" offset="0"/>
<stop stop-color="#464547" offset=".0326"/>
<stop stop-color="#49494B" offset=".0976"/>
@@ -14,12 +14,12 @@
<stop stop-color="#DBDCDD" offset=".8467"/>
<stop stop-color="#fff" offset="1"/>
</linearGradient>
- <path d="m28.861 20.263c0 0.275-0.225 0.5-0.5 0.499l-24.719-0.037c-0.275-1e-3 -0.5-0.226-0.5-0.501v-11.027c0-0.275 0.225-0.5 0.5-0.499l24.719 0.037c0.275 0 0.5 0.226 0.5 0.501v11.027z" fill="url(#c)"/>
+ <path d="m28.861 20.263c0 0.275-0.225 0.5-0.5 0.499l-24.719-0.037c-0.275-1e-3 -0.5-0.226-0.5-0.501v-11.027c0-0.275 0.225-0.5 0.5-0.499l24.719 0.037c0.275 0 0.5 0.226 0.5 0.501v11.027z" fill="url(#d)"/>
<path d="m28.861 20.263c0 0.275-0.225 0.5-0.5 0.499l-24.719-0.037c-0.275-1e-3 -0.5-0.226-0.5-0.501v-11.027c0-0.275 0.225-0.5 0.5-0.499l24.719 0.037c0.275 0 0.5 0.226 0.5 0.501v11.027z" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".1"/>
<ellipse cx="26.886" cy="11.038" rx=".62" ry=".652" stroke="#fff" stroke-miterlimit="10" stroke-width=".45"/>
<path d="m2.83 9.676m0 5.901m5.598-5.193m-5.598 0.012" fill="none" stroke="#fff" stroke-miterlimit="10"/>
<path d="m26.886 15.388c0 0.537-0.728 0.972-1.625 0.972h-18.006c-0.897 0-1.626-0.435-1.626-0.972 0-0.538 0.729-0.973 1.626-0.973h18.006c0.897 1e-3 1.625 0.436 1.625 0.973z" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".7"/>
-<linearGradient id="b" x1="23.558" x2="25.852" y1="24.5" y2="24.5" gradientUnits="userSpaceOnUse">
+<linearGradient id="e" x1="23.558" x2="25.852" y1="24.5" y2="24.5" gradientUnits="userSpaceOnUse">
<stop offset="0"/>
<stop stop-color="#141515" offset=".0088"/>
<stop stop-color="#656668" offset=".0453"/>
@@ -32,8 +32,8 @@
<stop stop-color="#FAFAFA" offset=".8616"/>
<stop stop-color="#fff" offset="1"/>
</linearGradient>
-<line x1="23.558" x2="25.852" y1="25.428" y2="23.571" fill="url(#b)" stroke="#414042" stroke-miterlimit="10" stroke-width=".1"/>
- <linearGradient id="a" x1="6.8477" x2="25.852" y1="20.151" y2="20.151" gradientUnits="userSpaceOnUse">
+<line x1="23.558" x2="25.852" y1="25.428" y2="23.571" fill="url(#e)" stroke="#414042" stroke-miterlimit="10" stroke-width=".1"/>
+ <linearGradient id="f" x1="6.8477" x2="25.852" y1="20.151" y2="20.151" gradientUnits="userSpaceOnUse">
<stop offset="0"/>
<stop stop-color="#141515" offset=".0088"/>
<stop stop-color="#656668" offset=".0453"/>
@@ -46,9 +46,9 @@
<stop stop-color="#FAFAFA" offset=".8329"/>
<stop stop-color="#fff" offset="1"/>
</linearGradient>
- <path d="m25.852 14.875v8.699c0 5e-3 -5e-3 0.01-0.01 0.01h-2.233c-5e-3 0-0.01 5e-3 -0.01 0.01l-0.041 1.824c0 5e-3 -5e-3 0.01-0.01 0.01h-16.691c-5e-3 0-0.01-5e-3 -0.01-0.01v-10.543" fill="url(#a)"/>
+ <path d="m25.852 14.875v8.699c0 5e-3 -5e-3 0.01-0.01 0.01h-2.233c-5e-3 0-0.01 5e-3 -0.01 0.01l-0.041 1.824c0 5e-3 -5e-3 0.01-0.01 0.01h-16.691c-5e-3 0-0.01-5e-3 -0.01-0.01v-10.543" fill="url(#f)"/>
<path d="m25.852 14.875v8.699c0 5e-3 -5e-3 0.01-0.01 0.01h-2.233c-5e-3 0-0.01 5e-3 -0.01 0.01l-0.041 1.824c0 5e-3 -5e-3 0.01-0.01 0.01h-16.691c-5e-3 0-0.01-5e-3 -0.01-0.01v-10.543" fill="none" stroke="#414042" stroke-miterlimit="10" stroke-width=".1"/>
<path d="m12.146 17.77c0.568 1.652 1.558 3.131 2.264 4.729 0.375 0.851 0.797 1.645 1.315 2.416-0.207-0.309 1.19-2.995 1.358-3.425 0.462-1.182 0.426-1.742 1.26-0.426 0.222-0.223 0.382-0.483 0.48-0.781 0 0 0.638 1.393 0.679 1.515 0.389 1.16 1.012-0.942 1.249-1.424 0.576-1.167 1.432-2.186 2.137-3.274 0.309-0.477-0.3-1.538 0-2-1.111 1.717-2.107 3.454-3.17 5.194 0.146-0.241-0.742-1.771-0.895-2.01-0.099 0.298-0.259 0.559-0.48 0.781-0.253 0.322-0.336-2.152-1.003-0.26-0.325 0.922-0.707 1.826-1.072 2.733-0.185 0.457-0.366 0.916-0.543 1.377 0.035-0.089-0.945-1.617-1.032-1.794-0.861-1.736-1.918-3.522-2.547-5.352 0.203 0.592-0.207 1.4 0 2.001z" fill="#ED1C24"/>
-<path d="m8.077 9.676l-3.91 5e-3c-9e-3 0-0.017-5e-3 -0.025-5e-3 -0.194 0-0.35 0.161-0.35 0.359v4.023c0 0.197 0.156 0.357 0.35 0.357s0.351-0.16 0.351-0.357v-3.66l3.586-6e-3c0.193 0 0.35-0.16 0.349-0.358 0-0.198-0.158-0.359-0.351-0.358z" fill="#fff" stroke="#fff" stroke-miterlimit="10" stroke-width=".3"/>
+<path d="m8.077 9.676-3.91 5e-3c-9e-3 0-0.017-5e-3 -0.025-5e-3 -0.194 0-0.35 0.161-0.35 0.359v4.023c0 0.197 0.156 0.357 0.35 0.357s0.351-0.16 0.351-0.357v-3.66l3.586-6e-3c0.193 0 0.35-0.16 0.349-0.358 0-0.198-0.158-0.359-0.351-0.358z" fill="#fff" stroke="#fff" stroke-miterlimit="10" stroke-width=".3"/>
<path d="m18.462 31.115" stroke="#fff" stroke-miterlimit="10" stroke-width=".51"/>
</svg>
diff --git a/silx/resources/gui/icons/document-save.svg b/silx/resources/gui/icons/document-save.svg
index 1e156bc..5134a42 100644
--- a/silx/resources/gui/icons/document-save.svg
+++ b/silx/resources/gui/icons/document-save.svg
@@ -1,36 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><path
- d="m 27.458,27.45 c 0,0.275 -0.225,0.5 -0.5,0.5 H 5.942 c -0.275,0 -0.5,-0.225 -0.5,-0.5 V 6.437 c 0,-0.275 0.225,-0.5 0.5,-0.5 h 16.271 c 0.275,0 0.656,0.162 0.847,0.36 l 4.051,4.201 c 0.19,0.198 0.347,0.585 0.347,0.86 V 27.45 z"
- inkscape:connector-curvature="0"
- id="path4" /><path
- d="m 25.169,24.58 c 0,0.165 -0.135,0.3 -0.3,0.3 H 8.365 c -0.165,0 -0.3,-0.135 -0.3,-0.3 v -7.015 c 0,-0.165 0.135,-0.3 0.3,-0.3 h 16.504 c 0.165,0 0.3,0.135 0.3,0.3 v 7.015 z"
- inkscape:connector-curvature="0"
- id="path6"
- style="fill:#ffffff" /><path
- d="m 20.925,11.322 c 0,0.165 -0.135,0.3 -0.3,0.3 H 8.365 c -0.165,0 -0.3,-0.135 -0.3,-0.3 v -5.41 c 0,-0.165 0.135,-0.3 0.3,-0.3 h 12.26 c 0.165,0 0.3,0.135 0.3,0.3 v 5.41 z"
- inkscape:connector-curvature="0"
- id="path8"
- style="fill:#ffffff" /><rect
- width="2.1359999"
- height="4.277"
- x="15.422"
- y="5.9369998"
- id="rect10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m27.458 27.45c0 0.275-0.225 0.5-0.5 0.5h-21.016c-0.275 0-0.5-0.225-0.5-0.5v-21.013c0-0.275 0.225-0.5 0.5-0.5h16.271c0.275 0 0.656 0.162 0.847 0.36l4.051 4.201c0.19 0.198 0.347 0.585 0.347 0.86v16.092z"/><path d="m25.169 24.58c0 0.165-0.135 0.3-0.3 0.3h-16.504c-0.165 0-0.3-0.135-0.3-0.3v-7.015c0-0.165 0.135-0.3 0.3-0.3h16.504c0.165 0 0.3 0.135 0.3 0.3v7.015z" fill="#fff"/><path d="m20.925 11.322c0 0.165-0.135 0.3-0.3 0.3h-12.26c-0.165 0-0.3-0.135-0.3-0.3v-5.41c0-0.165 0.135-0.3 0.3-0.3h12.26c0.165 0 0.3 0.135 0.3 0.3v5.41z" fill="#fff"/><rect x="15.422" y="5.937" width="2.136" height="4.277"/></svg>
diff --git a/silx/resources/gui/icons/draw-brush.svg b/silx/resources/gui/icons/draw-brush.svg
index 60895e8..b371236 100644
--- a/silx/resources/gui/icons/draw-brush.svg
+++ b/silx/resources/gui/icons/draw-brush.svg
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
- <linearGradient id="b" x1="9.7979" x2="22.185" y1="7.9565" y2="7.9565" gradientTransform="matrix(-.9657 .2596 -.2596 -.9657 34.576 28.902)" gradientUnits="userSpaceOnUse">
+ <linearGradient id="c" x1="9.7979" x2="22.185" y1="7.9565" y2="7.9565" gradientTransform="matrix(-.9657 .2596 -.2596 -.9657 34.576 28.902)" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFF33B" offset="0"/>
<stop stop-color="#FFE029" offset=".0595"/>
<stop stop-color="#FFD218" offset=".1303"/>
@@ -11,15 +11,15 @@
<stop stop-color="#ED683C" offset=".8876"/>
<stop stop-color="#E93E3A" offset="1"/>
</linearGradient>
- <path d="m21.632 20.113c1.117 1.159 2.026 6.063 1.582 7.539-0.228-0.428-0.642-0.679-0.759-1.139l-0.111 0.031c-0.101 0.521-0.45 0.988-0.583 1.394-0.059-0.23-0.255-0.542-0.313-0.771-0.05 0.258-0.291 0.694-0.344 0.954-0.166-0.198-0.583-0.449-0.751-0.648-0.022 0.373-0.182 0.666-0.093 1.011-0.168-0.199-0.478-0.482-0.564-0.826-0.021 0.375-0.289 0.696-0.311 1.073-0.118-0.463-0.455-0.857-0.465-1.346-0.021 0.375-0.262 0.811-0.391 1.217-0.088-0.345-0.426-0.743-0.565-0.825-0.048 0.261-0.29 0.695-0.421 1.103-0.119-0.458-0.481-0.971-0.601-1.429-0.291 0.695-0.304 1.56-0.564 2.369-0.256-0.54-0.543-1.197-0.579-1.801 0.036 0.604-0.176 1.152-0.387 1.703-0.227-0.427-0.703-0.907-0.82-1.363-0.098 0.518-0.391 1.214-0.352 1.818-0.335-0.399-0.625-1.057-0.659-1.658 6e-3 0.489-0.313 1.071-0.307 1.562-0.225-0.429-0.622-1.054-0.74-1.514-0.022 0.375-0.233 0.926-0.222 1.416-1.139-2.139-1.923-4.742-1.605-7.166" fill="url(#b)"/>
+ <path d="m21.632 20.113c1.117 1.159 2.026 6.063 1.582 7.539-0.228-0.428-0.642-0.679-0.759-1.139l-0.111 0.031c-0.101 0.521-0.45 0.988-0.583 1.394-0.059-0.23-0.255-0.542-0.313-0.771-0.05 0.258-0.291 0.694-0.344 0.954-0.166-0.198-0.583-0.449-0.751-0.648-0.022 0.373-0.182 0.666-0.093 1.011-0.168-0.199-0.478-0.482-0.564-0.826-0.021 0.375-0.289 0.696-0.311 1.073-0.118-0.463-0.455-0.857-0.465-1.346-0.021 0.375-0.262 0.811-0.391 1.217-0.088-0.345-0.426-0.743-0.565-0.825-0.048 0.261-0.29 0.695-0.421 1.103-0.119-0.458-0.481-0.971-0.601-1.429-0.291 0.695-0.304 1.56-0.564 2.369-0.256-0.54-0.543-1.197-0.579-1.801 0.036 0.604-0.176 1.152-0.387 1.703-0.227-0.427-0.703-0.907-0.82-1.363-0.098 0.518-0.391 1.214-0.352 1.818-0.335-0.399-0.625-1.057-0.659-1.658 6e-3 0.489-0.313 1.071-0.307 1.562-0.225-0.429-0.622-1.054-0.74-1.514-0.022 0.375-0.233 0.926-0.222 1.416-1.139-2.139-1.923-4.742-1.605-7.166" fill="url(#c)"/>
<path d="m21.5 20.179c0.81 1.016 1.094 2.381 1.363 3.624 0.193 0.892 0.286 1.804 0.318 2.715 0.039 1.111-0.137 0.718-0.595-0.069-0.028-0.05-0.111-0.053-0.16-0.039-0.574 0.161-0.45 1.663-0.835 0.72-0.045-0.11-0.245-0.088-0.284 0.02-0.231 0.646-0.32 0.691-0.844 0.239-0.08-0.069-0.241-4e-3 -0.259 0.096-0.115 0.677-0.033 0.748-0.378 0.109-0.049-0.091-0.245-0.043-0.271 0.046-0.263 0.912-0.304 0.376-0.491-0.292-0.04-0.143-0.264-0.06-0.292 0.049-0.154 0.722-0.38 0.827-0.677 0.316-0.068-0.071-0.233-0.058-0.271 0.046-0.32 0.89-0.46 0.313-0.737-0.346-0.044-0.105-0.25-0.093-0.284 0.02-0.319 1.092-0.488 2.647-0.859 0.549-0.024-0.136-0.279-0.067-0.292 0.049-0.163 1.479-0.468 1.576-0.915 0.291-0.06-0.127-0.261-0.073-0.292 0.049-0.277 1.096-0.458 1.536-0.719 0.111-0.026-0.142-0.271-0.061-0.292 0.049-0.205 1.037-0.176 1.495-0.755-1e-3 -0.05-0.129-0.27-0.073-0.292 0.049-0.319 1.716-1.017-1.203-1.172-1.703-0.411-1.315-0.471-2.702-0.361-4.066 0.013-0.155-0.283-0.118-0.294 0.02-0.209 2.581 0.469 4.924 1.62 7.222 0.055 0.108 0.266 0.026 0.279-0.075 0.186-1.423 0.218-0.668 0.682 0.173 0.061 0.11 0.26 0.024 0.279-0.075 0.289-1.469 0.199-0.569 0.687 0.172 0.063 0.096 0.27 0.037 0.279-0.075 0.12-1.443 0.129-1.553 0.893-0.38 0.057 0.087 0.24 0.046 0.271-0.046 0.485-1.41 0.177-1.013 0.682 0.117 0.058 0.128 0.263 0.073 0.292-0.049 0.168-0.698 0.236-2.408 0.874-0.892 0.047 0.112 0.241 0.086 0.284-0.02 0.283-0.713 0.313-1.012 0.715-0.231 0.05 0.097 0.239 0.036 0.271-0.046 0.347-0.911 0.211-0.727 0.571 0.148 0.043 0.106 0.251 0.093 0.284-0.02 0.195-0.675 0.152-0.719 0.604-0.201 0.067 0.078 0.277 0.05 0.279-0.075 6e-3 -0.675 0.073-0.709 0.585-0.267 0.068 0.059 0.221 0.017 0.251-0.066 0.204-0.566 0.142-0.734 0.373-0.164 0.047 0.117 0.237 0.081 0.284-0.02 0.399-0.861 0.569-1.051 1.182-0.24 0.073 0.098 0.256 0.034 0.279-0.075 0.484-2.255-0.154-5.783-1.598-7.595-0.084-0.11-0.359 8e-3 -0.262 0.129z" fill="#808285"/>
<path d="m20.565 20.018c0.842 0.827 1.445 2.232 1.27 3.42 0.097-0.021 0.192-0.041 0.288-0.063-0.257-1.372-1.012-2.411-2.133-3.22-0.047-0.034-0.303 0.011-0.28 0.09 0.179 0.64 0.448 1.235 0.73 1.835 0.036 0.078 0.316-0.021 0.289-0.078-0.282-0.6-0.552-1.195-0.73-1.835-0.094 0.03-0.187 0.061-0.28 0.09 1.11 0.802 1.86 1.839 2.115 3.196 0.013 0.069 0.278 1e-3 0.288-0.063 0.18-1.217-0.418-2.624-1.285-3.475-0.058-0.056-0.324 0.051-0.272 0.103z" fill="#808285"/>
<path d="m14.377 28.327c6e-3 0.021 0.012 0.04 0.026 0.057 0.061 0.077 0.242 0.055 0.271-0.046 0.197-0.668-0.347-1.911-0.505-2.535-0.036-0.141-0.267-0.061-0.292 0.049-0.246 1.07-0.334 2.126-0.219 3.219 0.097-0.026 0.193-0.052 0.29-0.078-0.402-1.116-0.693-2.25-0.878-3.423-0.021-0.129-0.249-0.067-0.284 0.021-0.469 1.151-0.442 2.305-0.16 3.501 0.093-0.035 0.185-0.069 0.277-0.104-0.994-1.354-1.377-3.172-1.5-4.821-0.012-0.157-0.304-0.115-0.294 0.02 0.126 1.693 0.507 3.54 1.529 4.933 0.072 0.098 0.309 0.028 0.277-0.104-0.274-1.16-0.308-2.267 0.148-3.386-0.095 7e-3 -0.189 0.014-0.284 0.021 0.186 1.172 0.477 2.306 0.878 3.423 0.05 0.14 0.305 0.063 0.29-0.078-0.114-1.076-0.019-2.109 0.223-3.16-0.097 0.017-0.194 0.032-0.292 0.049 0.139 0.547 0.271 1.095 0.386 1.647 0.038 0.182 0.185 0.585 0.13 0.771 0.09-0.016 0.181-0.03 0.271-0.046v-5e-3c-0.041-0.142-0.331-0.063-0.288 0.075z" fill="#808285"/>
- <linearGradient id="a" x1="7.7773" x2="19.356" y1="25.019" y2="17.299" gradientTransform="matrix(-.9657 .2596 -.2596 -.9657 34.911 28.453)" gradientUnits="userSpaceOnUse">
+ <linearGradient id="d" x1="7.7773" x2="19.356" y1="25.019" y2="17.299" gradientTransform="matrix(-.9657 .2596 -.2596 -.9657 34.911 28.453)" gradientUnits="userSpaceOnUse">
<stop stop-color="#fff" offset="0"/>
<stop offset="1"/>
</linearGradient>
- <path d="m22.109 20.613c-3.689-0.191-8.254 1.217-11.383 3.2-0.383-1.49-0.873-2.946-1.119-4.353 7.214-2.025 5.45-2.454 11.464-3.347 0.137 1.436 0.628 2.896 1.011 4.384m-1.011-4.383c-0.745-0.16-2.115-0.265-2.889-0.537-2.82-0.928-1.906-3.763-2.474-6.429-0.363-1.863-1.203-6.045-3.088-6.989-3.026-1.732-2.68 3.723-2.239 5.442 0.353 1.373 0.645 2.616 1.297 3.781 0.405 0.723 1.864 3.042 1.93 3.76 0.145 1.926-3.541 2.469-4.002 4.319m3.045-15.103c-0.108-3.162-1.982 1.418 0.08-0.146" fill="url(#a)"/>
+ <path d="m22.109 20.613c-3.689-0.191-8.254 1.217-11.383 3.2-0.383-1.49-0.873-2.946-1.119-4.353 7.214-2.025 5.45-2.454 11.464-3.347 0.137 1.436 0.628 2.896 1.011 4.384m-1.011-4.383c-0.745-0.16-2.115-0.265-2.889-0.537-2.82-0.928-1.906-3.763-2.474-6.429-0.363-1.863-1.203-6.045-3.088-6.989-3.026-1.732-2.68 3.723-2.239 5.442 0.353 1.373 0.645 2.616 1.297 3.781 0.405 0.723 1.864 3.042 1.93 3.76 0.145 1.926-3.541 2.469-4.002 4.319m3.045-15.103c-0.108-3.162-1.982 1.418 0.08-0.146" fill="url(#d)"/>
<g fill="#414042">
<path d="m22.161 20.515c-2.445-0.057-4.9 0.336-7.201 1.183-1.263 0.464-2.527 0.97-3.684 1.668-0.642 0.387-1.081-2.038-1.134-2.232-0.333-1.205 0-1.722 1.179-2.073 1.801-0.538 3.515-1.273 5.284-1.896 0.811-0.285 1.656-0.461 2.498-0.628 1.464-0.29 1.824-0.089 2.129 1.352 0.188 0.891 0.47 1.771 0.706 2.649 0.033 0.125 0.323 0.047 0.289-0.078-0.391-1.457-0.801-2.887-1.011-4.384-7e-3 -0.052-0.09-0.066-0.13-0.06-4.03 0.619-7.601 2.235-11.503 3.354-0.056 0.015-0.135 0.06-0.121 0.13 0.302 1.471 0.729 2.903 1.119 4.353 0.027 0.1 0.182 0.056 0.239 0.021 3.381-2.04 7.27-3.252 11.237-3.161 0.131 2e-3 0.3-0.194 0.104-0.198z"/>
<path d="m21.123 16.016c-1.26-0.217-2.426-0.331-3.637-0.896-1.429-0.667-1.342-2.966-1.416-4.231-0.128-2.19-0.717-4.402-1.508-6.438-0.55-1.415-2.238-3.579-3.88-2.332-1.795 1.364-0.366 5.897 0.091 7.489 0.622 2.165 4.057 5.336 1.528 7.294-1.077 0.833-2.26 1.245-2.832 2.546-0.064 0.146 0.228 0.134 0.275 0.025 0.812-1.845 4.568-2.431 3.872-4.848-0.516-1.793-1.916-3.325-2.553-5.095-0.62-1.72-0.878-3.53-0.792-5.351 0.066-1.388 0.819-3.761 3.227-1.048 0.703 0.792 1.044 2.066 1.365 3.063 0.587 1.823 0.857 3.735 0.968 5.639 0.205 3.487 2.176 3.862 5.188 4.38 0.134 0.023 0.298-0.164 0.104-0.197z"/>
diff --git a/silx/resources/gui/icons/draw-pencil.svg b/silx/resources/gui/icons/draw-pencil.svg
index 2e376ac..255bdc5 100644
--- a/silx/resources/gui/icons/draw-pencil.svg
+++ b/silx/resources/gui/icons/draw-pencil.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3269"
- xml:space="preserve"><defs
- id="defs14" /><metadata
- id="metadata3307"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><path
- d="m 25,4.21875 c -0.67775,0.05775 -1.15625,0.375 -1.15625,0.375 l -16.625,14.5 3.75,4.46875 16.625,-14.5 c 0,0 1.4995,-1.6845 -0.1875,-3.6875 C 26.56425,4.373 25.67775,4.161 25,4.21875 z"
- id="polyline3271"
- style="color:#000000;fill:#00a651;fill-opacity:1;fill-rule:nonzero;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /><path
- d="m 10.643414,23.625677 0.03636,-0.01996 0.09119,-0.07157 -0.04187,-0.103214 -3.4430644,-4.090587 -0.1148987,-0.06232 -0.1275569,0.09737 -1.8938804,4.360306 -0.021422,0.115872 c 0,0.07303 0.022396,0.150927 0.069134,0.207402 l 0.5579401,0.662128 c 0.058423,0.06816 0.1548211,0.107109 0.2453768,0.107109 z"
- id="path3275"
- style="fill:#ffffff;stroke:#000000;stroke-width:0.14605762;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /><path
- d="m 26.004375,10.457844 -4.667906,4.063094 -3.75136,-4.467439 4.630952,-4.0364839 z"
- id="polygon3277"
- style="fill:#f7941e" /><path
- d="m 5.325,23.114 c 0.079,-0.153 0.238,-0.172 0.352,-0.04 l 1.146,1.298 c 0.115,0.126 0.079,0.284 -0.079,0.344 L 4.247,25.661 C 4.09,25.722 4.025,25.642 4.104,25.491 l 1.221,-2.377 z"
- id="path3301" /><path
- d="m 8.697,18.552 c 1.172,-1.087 2.338,-2.179 3.532,-3.238 1.182,-1.073 2.384,-2.124 3.587,-3.174 1.199,-1.057 2.408,-2.098 3.627,-3.129 1.211,-1.04 2.431,-2.07 3.665,-3.083 L 23.09,5.945 c 0.269,-0.296 0.573,-0.527 0.916,-0.711 0.172,-0.089 0.353,-0.163 0.542,-0.209 0.188,-0.044 0.383,-0.075 0.575,-0.065 0.098,-0.004 0.193,0.007 0.289,0.028 0.094,0.02 0.191,0.026 0.279,0.066 0.185,0.056 0.355,0.135 0.517,0.239 0.326,0.193 0.592,0.462 0.841,0.738 C 26.78,5.773 26.498,5.525 26.17,5.361 26.008,5.273 25.838,5.208 25.659,5.168 25.574,5.136 25.482,5.137 25.393,5.125 25.305,5.111 25.214,5.107 25.124,5.118 24.945,5.121 24.77,5.162 24.601,5.215 24.431,5.272 24.269,5.345 24.114,5.433 23.807,5.612 23.52,5.851 23.301,6.117 l -0.008,0.009 -0.011,0.008 c -1.182,1.073 -2.378,2.13 -3.584,3.177 -1.196,1.056 -2.403,2.102 -3.625,3.132 -1.213,1.038 -2.427,2.074 -3.661,3.087 -1.221,1.026 -2.471,2.02 -3.715,3.022 z"
- id="path3303"
- style="fill:#ffffff" /><path
- d="m 22.216292,6.0087433 3.802575,4.4385707"
- id="path3766"
- style="fill:none;stroke:#ffffff;stroke-width:0.15000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /><path
- d="m 17.567985,10.061979 3.783044,4.458102"
- id="path3766-3"
- style="fill:none;stroke:#ffffff;stroke-width:0.15000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m25 4.2188c-0.67775 0.05775-1.1562 0.375-1.1562 0.375l-16.625 14.5 3.75 4.4688 16.625-14.5s1.4995-1.6845-0.1875-3.6875c-0.842-1.002-1.7285-1.214-2.4062-1.1562z" color="#000000" fill="#00a651"/><path d="m10.643 23.626 0.03636-0.01996 0.09119-0.07157-0.04187-0.10321-3.4431-4.0906-0.1149-0.06232-0.12756 0.09737-1.8939 4.3603-0.021422 0.11587c0 0.07303 0.022396 0.15093 0.069134 0.2074l0.55794 0.66213c0.058423 0.06816 0.15482 0.10711 0.24538 0.10711z" fill="#fff" stroke="#000" stroke-width=".14606"/><path d="m26.004 10.458-4.6679 4.0631-3.7514-4.4674 4.631-4.0365z" fill="#f7941e"/><path d="m5.325 23.114c0.079-0.153 0.238-0.172 0.352-0.04l1.146 1.298c0.115 0.126 0.079 0.284-0.079 0.344l-2.497 0.945c-0.157 0.061-0.222-0.019-0.143-0.17l1.221-2.377z"/><path d="m8.697 18.552c1.172-1.087 2.338-2.179 3.532-3.238 1.182-1.073 2.384-2.124 3.587-3.174 1.199-1.057 2.408-2.098 3.627-3.129 1.211-1.04 2.431-2.07 3.665-3.083l-0.018 0.017c0.269-0.296 0.573-0.527 0.916-0.711 0.172-0.089 0.353-0.163 0.542-0.209 0.188-0.044 0.383-0.075 0.575-0.065 0.098-4e-3 0.193 7e-3 0.289 0.028 0.094 0.02 0.191 0.026 0.279 0.066 0.185 0.056 0.355 0.135 0.517 0.239 0.326 0.193 0.592 0.462 0.841 0.738-0.269-0.258-0.551-0.506-0.879-0.67-0.162-0.088-0.332-0.153-0.511-0.193-0.085-0.032-0.177-0.031-0.266-0.043-0.088-0.014-0.179-0.018-0.269-7e-3 -0.179 3e-3 -0.354 0.044-0.523 0.097-0.17 0.057-0.332 0.13-0.487 0.218-0.307 0.179-0.594 0.418-0.813 0.684l-8e-3 9e-3 -0.011 8e-3c-1.182 1.073-2.378 2.13-3.584 3.177-1.196 1.056-2.403 2.102-3.625 3.132-1.213 1.038-2.427 2.074-3.661 3.087-1.221 1.026-2.471 2.02-3.715 3.022z" fill="#fff"/><path d="m22.216 6.0087 3.8026 4.4386" fill="none" stroke="#fff" stroke-width=".15"/><path d="m17.568 10.062 3.783 4.4581" fill="none" stroke="#fff" stroke-width=".15"/></svg>
diff --git a/silx/resources/gui/icons/draw-rubber.svg b/silx/resources/gui/icons/draw-rubber.svg
index a234415..29a98b5 100644
--- a/silx/resources/gui/icons/draw-rubber.svg
+++ b/silx/resources/gui/icons/draw-rubber.svg
@@ -1,43 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata19"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs17" /><linearGradient
- x1="15.354"
- y1="11.431"
- x2="21.164"
- y2="16.003"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><polygon
- points="20.579,5.13 26.72,10.594 16.148,22.471 10.009,17.007 "
- id="polygon9"
- style="fill:url(#a);stroke:#000000;stroke-width:0.80000001;stroke-miterlimit:10" /><path
- d="m 15.574,22.779 c 0.073,-0.082 0.065,-0.209 -0.017,-0.282 L 9.948,17.505 C 9.866,17.432 9.739,17.44 9.666,17.522 l -2.879,3.233 c -0.073,0.082 -0.065,0.209 0.017,0.282 l 3.292,2.93 c 0.082,0.073 0.239,0.133 0.35,0.133 h 3.752 c 0.11,0 0.26,-0.067 0.333,-0.149 l 1.043,-1.172 z"
- inkscape:connector-curvature="0"
- id="path11"
- style="fill:#ffffff" /><path
- d="m 15.574,22.779 c 0.073,-0.082 0.065,-0.209 -0.017,-0.282 L 9.948,17.505 C 9.866,17.432 9.739,17.44 9.666,17.522 l -2.879,3.233 c -0.073,0.082 -0.065,0.209 0.017,0.282 l 3.292,2.93 c 0.082,0.073 0.239,0.133 0.35,0.133 h 3.752 c 0.11,0 0.26,-0.067 0.333,-0.149 l 1.043,-1.172 z"
- inkscape:connector-curvature="0"
- id="path13"
- style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="a" x1="15.354" x2="21.164" y1="11.431" y2="16.003" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><polygon points="20.579 5.13 26.72 10.594 16.148 22.471 10.009 17.007" fill="url(#a)" stroke="#000" stroke-miterlimit="10" stroke-width=".8"/><path d="m15.574 22.779c0.073-0.082 0.065-0.209-0.017-0.282l-5.609-4.992c-0.082-0.073-0.209-0.065-0.282 0.017l-2.879 3.233c-0.073 0.082-0.065 0.209 0.017 0.282l3.292 2.93c0.082 0.073 0.239 0.133 0.35 0.133h3.752c0.11 0 0.26-0.067 0.333-0.149l1.043-1.172z" fill="#fff"/><path d="m15.574 22.779c0.073-0.082 0.065-0.209-0.017-0.282l-5.609-4.992c-0.082-0.073-0.209-0.065-0.282 0.017l-2.879 3.233c-0.073 0.082-0.065 0.209 0.017 0.282l3.292 2.93c0.082 0.073 0.239 0.133 0.35 0.133h3.752c0.11 0 0.26-0.067 0.333-0.149l1.043-1.172z" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/></svg>
diff --git a/silx/resources/gui/icons/edit-copy.svg b/silx/resources/gui/icons/edit-copy.svg
index 44796b7..6100075 100644
--- a/silx/resources/gui/icons/edit-copy.svg
+++ b/silx/resources/gui/icons/edit-copy.svg
@@ -1,75 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3453"
- xml:space="preserve"><metadata
- id="metadata3491"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3489"><filter
- x="-0.15908387"
- y="-0.13152882"
- width="1.3181677"
- height="1.2630576"
- color-interpolation-filters="sRGB"
- id="filter6624"><feGaussianBlur
- id="feGaussianBlur6626"
- stdDeviation="1.1601338" /></filter></defs><path
- d="M 18.462,31.115"
- id="path3455"
- style="stroke:#ffffff;stroke-width:0.50999999;stroke-miterlimit:10" /><path
- d="m 19.959,22.647 c 0,0.28 -0.229,0.51 -0.51,0.51 H 3.895 c -0.28,0 -0.51,-0.229 -0.51,-0.51 V 3.55 c 0,-0.28 0.229,-0.51 0.51,-0.51 H 19.45 c 0.28,0 0.51,0.229 0.51,0.51 v 19.097 z"
- id="path3457"
- style="fill:#f1f2f2" /><path
- d="m 19.959,22.647 c 0,0.28 -0.229,0.51 -0.51,0.51 H 3.895 c -0.28,0 -0.51,-0.229 -0.51,-0.51 V 3.55 c 0,-0.28 0.229,-0.51 0.51,-0.51 H 19.45 c 0.28,0 0.51,0.229 0.51,0.51 v 19.097 z"
- id="path3459"
- style="fill:none;stroke:#f7941e;stroke-width:2;stroke-miterlimit:10" /><path
- d="M 16.858,5.889 C 13.71,6.354 10.576,6.416 7.409,6.09 6.997,6.048 6.212,7.409 6.517,7.44 c 3.167,0.326 6.3,0.265 9.451,-0.201 0.456,-0.067 1.086,-1.379 0.89,-1.35 z"
- id="path3461"
- style="fill:#58595b" /><path
- d="M 16.257,9.307 C 13.284,9.266 10.322,9.33 7.359,9.559 c -0.449,0.035 -1.12,1.367 -0.892,1.35 2.964,-0.23 5.926,-0.293 8.897,-0.25 0.435,0.006 1.163,-1.348 0.893,-1.352 z"
- id="path3463"
- style="fill:#414042" /><path
- d="M 9.973,12.374 C 9.138,12.468 8.298,12.433 7.46,12.476 7.156,12.49 6.838,12.962 6.694,13.183 6.653,13.244 6.287,13.839 6.568,13.826 7.406,13.785 8.246,13.816 9.081,13.724 9.394,13.689 9.694,13.251 9.847,13.019 9.881,12.965 10.253,12.344 9.973,12.374 z"
- id="path3465"
- style="fill:#6d6e71" /><path
- d="m 16.76,15.44 c -3.111,-0.518 -6.223,0.045 -9.351,-0.051 -0.43,-0.014 -1.168,1.344 -0.892,1.35 3.127,0.096 6.24,-0.467 9.35,0.051 0.393,0.068 1.22,-1.295 0.893,-1.35 z"
- id="path3467"
- style="fill:#414042" /><path
- d="m 28.65,27.848 c 0,0.28 -0.229,0.51 -0.51,0.51 H 12.586 c -0.28,0 -0.51,-0.229 -0.51,-0.51 V 8.75 c 0,-0.28 0.229,-0.51 0.51,-0.51 h 15.555 c 0.28,0 0.51,0.229 0.51,0.51 v 19.098 z"
- id="path3469"
- style="fill:#d1d3d4" /><path
- d="m 28.65,27.848 c 0,0.28 -0.229,0.51 -0.51,0.51 H 12.586 c -0.28,0 -0.51,-0.229 -0.51,-0.51 V 8.75 c 0,-0.28 0.229,-0.51 0.51,-0.51 h 15.555 c 0.28,0 0.51,0.229 0.51,0.51 v 19.098 z"
- id="path3471"
- style="fill:none;stroke:#f7941e;stroke-width:1.60000002;stroke-miterlimit:10" /><path
- d="m 25.146,11.089 c -3.148,0.465 -6.282,0.526 -9.449,0.201 -0.412,-0.042 -1.196,1.319 -0.892,1.35 3.166,0.326 6.3,0.265 9.45,-0.201 0.456,-0.067 1.086,-1.379 0.891,-1.35 z"
- id="path3473"
- style="fill:#58595b" /><path
- d="m 24.544,14.986 c -2.973,-0.041 -5.935,0.023 -8.898,0.252 -0.449,0.035 -1.12,1.367 -0.892,1.35 2.964,-0.23 5.926,-0.293 8.897,-0.25 0.435,0.005 1.163,-1.348 0.893,-1.352 z"
- id="path3475"
- style="fill:#414042" /><path
- d="m 18.26,18.053 c -0.835,0.094 -1.676,0.059 -2.514,0.102 -0.304,0.014 -0.621,0.486 -0.766,0.707 -0.041,0.061 -0.406,0.656 -0.126,0.643 0.838,-0.041 1.679,-0.01 2.513,-0.102 0.313,-0.035 0.613,-0.473 0.767,-0.705 0.034,-0.053 0.407,-0.675 0.126,-0.645 z"
- id="path3477"
- style="fill:#6d6e71" /><path
- d="m 25.047,21.117 c -3.111,-0.518 -6.223,0.045 -9.351,-0.051 -0.431,-0.014 -1.168,1.344 -0.892,1.35 3.127,0.096 6.239,-0.467 9.35,0.051 0.393,0.068 1.22,-1.295 0.893,-1.35 z"
- id="path3479"
- style="fill:#414042" /><path
- d="m 4.0143008,8.8697034 -0.71875,0.0625 -0.71875,0.03125 c 2.84e-4,0.020548 -3.11e-4,0.041942 0,0.0625 0.00108,0.010632 -0.00109,0.020622 0,0.03125 0.02814,1.7823956 0.134739,3.5889086 0.4375,5.3750006 0.146,0.911 0.34875,1.82375 0.59375,2.71875 l 0.4375,1.34375 0.5,1.3125 c 0.177,0.432 0.417,0.831 0.625,1.25 0.197,0.424 0.503,0.7895 0.75,1.1875 0.238,0.405 0.57,0.73375 0.875,1.09375 0.291,0.374 0.66325,0.698 1.03125,1 l 0.5625,0.4375 0.59375,0.375 c 0.407,0.243 0.82325,0.496 1.2812502,0.625 0.451,0.134 0.872751,0.36825 1.343751,0.40625 l 1.125,0.1875 0.125,3.0625 c 0.014,0.132 -0.0305,0.26475 0.0625,0.46875 0.051,0.154 0.313,0.16875 0.375,0.09375 0.098,-0.06 0.09425,-0.10725 0.15625,-0.15625 l 0.625,-0.53125 1.25,-1.09375 c 0.83,-0.724 1.656,-1.44925 2.5,-2.15625 l 0.9375,-0.8125 0.3125,-0.25 0.625,-0.53125 0.28125,-0.21875 c 0.132,-0.111 0.123,-0.3055 0,-0.4375 -1.556,-1.678 -3.13125,-3.3555 -4.65625,-5.0625 l -1.125,-1.28125 -0.59375,-0.625 -0.28125,-0.34375 -0.03125,-0.03125 c -0.035,-0.023 -0.079,-0.0525 -0.125,-0.0625 -0.094,-0.034 -0.211,0.02375 -0.25,0.09375 -0.077,0.126 -0.08775,0.2375 -0.09375,0.3125 l -0.09375,3.09375 -0.6875,-0.09375 c -0.332,-0.025 -0.65375,-0.0905 -0.96875,-0.1875 -0.312001,-0.103 -0.647501,-0.1545 -0.937501,-0.3125 -0.2960002,-0.139 -0.5860002,-0.25925 -0.8750002,-0.40625 l -0.8125,-0.53125 c -0.263,-0.188 -0.502,-0.42 -0.75,-0.625 -0.255,-0.198 -0.43225,-0.48875 -0.65625,-0.71875 -0.228,-0.228 -0.40375,-0.489 -0.59375,-0.75 -0.198,-0.257 -0.37425,-0.55875 -0.53125,-0.84375 -0.169,-0.276 -0.3045,-0.577 -0.4375,-0.875 -0.147,-0.291 -0.265,-0.565 -0.375,-0.875 -0.124,-0.303 -0.2215,-0.6215 -0.3125,-0.9375 -0.205,-0.623 -0.33975,-1.26125 -0.46875,-1.90625 -0.104577,-0.531118 -0.222699,-1.0886966 -0.28125,-1.6250006 -0.00389,-0.094527 0.00365,-0.186536 0,-0.28125 l -0.03125,0 c -0.00182,-0.020634 0.00171,-0.041876 0,-0.0625 z"
- id="path3483-3"
- style="fill:#000000;filter:url(#filter6624)" /><path
- d="m 19.92,22.149 -6.764,-7.176 c -0.124,-0.132 -0.225,-0.063 -0.225,0.148 l 0.023,3.469 C 4.777,18.356 3.435,9.55 3.226,7.296 c 0.097,3.02 0.339,16.219 9.705,17.19 v 3.541 c 0,0.213 0.109,0.296 0.243,0.185 l 6.728,-5.62 c 0.132,-0.111 0.141,-0.311 0.018,-0.443 z"
- id="path3483"
- style="fill:#ffffff" /><path
- d="m 19.92,22.149 c -1.584,-1.652 -3.153,-3.318 -4.767,-4.942 l -1.203,-1.226 -0.608,-0.606 -0.294,-0.291 -0.04,-0.032 c 0.002,0.009 0.005,0.007 0.017,0.012 0.021,0.009 0.082,-0.012 0.08,-0.027 0,0 -0.009,0.053 -0.003,0.118 l 0.14,3.433 0.012,0.308 -0.308,-0.019 -1.055,-0.066 C 11.536,18.807 11.188,18.735 10.841,18.656 10.497,18.569 10.133,18.541 9.805,18.393 9.471,18.265 9.129,18.149 8.798,18.007 L 7.85,17.483 C 7.543,17.294 7.267,17.057 6.974,16.844 6.673,16.637 6.445,16.353 6.177,16.109 5.904,15.866 5.695,15.572 5.463,15.295 5.224,15.021 5.029,14.719 4.834,14.417 4.627,14.12 4.447,13.809 4.286,13.488 4.112,13.173 3.958,12.849 3.825,12.518 3.676,12.191 3.546,11.859 3.433,11.521 2.949,10.177 2.64,8.788 2.496,7.364 L 3.958,7.273 c 0.069,1.793 0.18,3.552 0.439,5.299 0.129,0.872 0.308,1.731 0.494,2.588 l 0.338,1.268 0.427,1.233 c 0.153,0.406 0.34,0.795 0.508,1.195 0.155,0.409 0.411,0.755 0.611,1.139 0.193,0.393 0.478,0.711 0.731,1.059 0.24,0.362 0.548,0.656 0.861,0.949 l 0.461,0.449 0.531,0.36 c 0.352,0.245 0.702,0.501 1.112,0.643 l 0.594,0.261 c 0.194,0.099 0.399,0.17 0.615,0.205 l 1.277,0.296 0.251,0.058 -0.007,0.213 -0.113,3.305 c -0.005,0.137 -0.016,0.295 0.01,0.337 -0.004,-0.005 -0.063,-0.015 -0.024,-0.02 0.024,-0.003 0.1,-0.073 0.148,-0.107 l 0.648,-0.513 1.29,-1.032 c 0.86,-0.688 1.722,-1.375 2.568,-2.08 l 1.275,-1.05 0.638,-0.525 c 0.101,-0.093 0.225,-0.164 0.306,-0.273 0.081,-0.115 0.064,-0.275 -0.027,-0.381 z m 0,0 c 0.093,0.104 0.112,0.267 0.033,0.381 -0.082,0.113 -0.204,0.185 -0.304,0.279 l -0.63,0.534 -1.261,1.068 c -0.844,0.707 -1.673,1.433 -2.503,2.157 l -1.246,1.085 -0.62,0.547 c -0.062,0.049 -0.08,0.085 -0.178,0.145 -0.062,0.075 -0.317,0.071 -0.368,-0.083 -0.093,-0.204 -0.058,-0.34 -0.072,-0.472 l -0.113,-3.305 0.244,0.271 -1.378,-0.219 C 11.053,24.499 10.634,24.258 10.183,24.124 9.725,23.995 9.323,23.747 8.916,23.504 L 8.302,23.143 7.759,22.687 C 7.391,22.385 7.027,22.079 6.736,21.705 6.431,21.345 6.091,21.004 5.853,20.599 5.606,20.201 5.299,19.828 5.102,19.404 4.894,18.985 4.65,18.577 4.473,18.145 L 3.96,16.84 3.545,15.508 C 3.3,14.613 3.103,13.708 2.957,12.797 2.649,10.98 2.518,9.131 2.493,7.319 L 3.955,7.228 c 0.054,0.65 0.159,1.305 0.286,1.95 0.129,0.645 0.272,1.291 0.477,1.914 0.091,0.316 0.198,0.626 0.322,0.929 0.11,0.31 0.237,0.61 0.384,0.901 0.133,0.298 0.271,0.594 0.44,0.87 0.157,0.285 0.313,0.571 0.511,0.828 0.19,0.261 0.359,0.543 0.587,0.771 0.224,0.23 0.41,0.506 0.665,0.704 0.248,0.205 0.479,0.436 0.742,0.624 l 0.816,0.527 c 0.289,0.147 0.591,0.271 0.887,0.41 0.29,0.158 0.621,0.202 0.933,0.305 0.315,0.097 0.634,0.187 0.966,0.212 l 0.99,0.131 -0.295,0.289 0.095,-3.434 c 0.006,-0.075 -0.005,-0.173 0.072,-0.299 0.039,-0.07 0.169,-0.138 0.263,-0.104 0.046,0.01 0.079,0.034 0.114,0.057 l 0.042,0.038 0.295,0.333 0.569,0.643 1.152,1.273 c 1.525,1.707 3.096,3.371 4.652,5.049 z"
- id="path3485"
- style="fill:#f7941e" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.15908" y="-.13153" width="1.3182" height="1.2631" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.1601338"/></filter></defs><path d="m18.462 31.115" stroke="#fff" stroke-miterlimit="10" stroke-width=".51"/><path d="m19.959 22.647c0 0.28-0.229 0.51-0.51 0.51h-15.554c-0.28 0-0.51-0.229-0.51-0.51v-19.097c0-0.28 0.229-0.51 0.51-0.51h15.555c0.28 0 0.51 0.229 0.51 0.51v19.097z" fill="#f1f2f2"/><path d="m19.959 22.647c0 0.28-0.229 0.51-0.51 0.51h-15.554c-0.28 0-0.51-0.229-0.51-0.51v-19.097c0-0.28 0.229-0.51 0.51-0.51h15.555c0.28 0 0.51 0.229 0.51 0.51v19.097z" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2"/><path d="m16.858 5.889c-3.148 0.465-6.282 0.527-9.449 0.201-0.412-0.042-1.197 1.319-0.892 1.35 3.167 0.326 6.3 0.265 9.451-0.201 0.456-0.067 1.086-1.379 0.89-1.35z" fill="#58595b"/><path d="m16.257 9.307c-2.973-0.041-5.935 0.023-8.898 0.252-0.449 0.035-1.12 1.367-0.892 1.35 2.964-0.23 5.926-0.293 8.897-0.25 0.435 6e-3 1.163-1.348 0.893-1.352z" fill="#414042"/><path d="m9.973 12.374c-0.835 0.094-1.675 0.059-2.513 0.102-0.304 0.014-0.622 0.486-0.766 0.707-0.041 0.061-0.407 0.656-0.126 0.643 0.838-0.041 1.678-0.01 2.513-0.102 0.313-0.035 0.613-0.473 0.766-0.705 0.034-0.054 0.406-0.675 0.126-0.645z" fill="#6d6e71"/><path d="m16.76 15.44c-3.111-0.518-6.223 0.045-9.351-0.051-0.43-0.014-1.168 1.344-0.892 1.35 3.127 0.096 6.24-0.467 9.35 0.051 0.393 0.068 1.22-1.295 0.893-1.35z" fill="#414042"/><path d="m28.65 27.848c0 0.28-0.229 0.51-0.51 0.51h-15.554c-0.28 0-0.51-0.229-0.51-0.51v-19.098c0-0.28 0.229-0.51 0.51-0.51h15.555c0.28 0 0.51 0.229 0.51 0.51v19.098z" fill="#d1d3d4"/><path d="m28.65 27.848c0 0.28-0.229 0.51-0.51 0.51h-15.554c-0.28 0-0.51-0.229-0.51-0.51v-19.098c0-0.28 0.229-0.51 0.51-0.51h15.555c0.28 0 0.51 0.229 0.51 0.51v19.098z" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="1.6"/><path d="m25.146 11.089c-3.148 0.465-6.282 0.526-9.449 0.201-0.412-0.042-1.196 1.319-0.892 1.35 3.166 0.326 6.3 0.265 9.45-0.201 0.456-0.067 1.086-1.379 0.891-1.35z" fill="#58595b"/><path d="m24.544 14.986c-2.973-0.041-5.935 0.023-8.898 0.252-0.449 0.035-1.12 1.367-0.892 1.35 2.964-0.23 5.926-0.293 8.897-0.25 0.435 5e-3 1.163-1.348 0.893-1.352z" fill="#414042"/><path d="m18.26 18.053c-0.835 0.094-1.676 0.059-2.514 0.102-0.304 0.014-0.621 0.486-0.766 0.707-0.041 0.061-0.406 0.656-0.126 0.643 0.838-0.041 1.679-0.01 2.513-0.102 0.313-0.035 0.613-0.473 0.767-0.705 0.034-0.053 0.407-0.675 0.126-0.645z" fill="#6d6e71"/><path d="m25.047 21.117c-3.111-0.518-6.223 0.045-9.351-0.051-0.431-0.014-1.168 1.344-0.892 1.35 3.127 0.096 6.239-0.467 9.35 0.051 0.393 0.068 1.22-1.295 0.893-1.35z" fill="#414042"/><path d="m4.0143 8.8697-0.71875 0.0625-0.71875 0.03125c2.84e-4 0.020548-3.11e-4 0.041942 0 0.0625 0.00108 0.010632-0.00109 0.020622 0 0.03125 0.02814 1.7824 0.13474 3.5889 0.4375 5.375 0.146 0.911 0.34875 1.8238 0.59375 2.7188l0.4375 1.3438 0.5 1.3125c0.177 0.432 0.417 0.831 0.625 1.25 0.197 0.424 0.503 0.7895 0.75 1.1875 0.238 0.405 0.57 0.73375 0.875 1.0938 0.291 0.374 0.66325 0.698 1.0312 1l0.5625 0.4375 0.59375 0.375c0.407 0.243 0.82325 0.496 1.2813 0.625 0.451 0.134 0.87275 0.36825 1.3438 0.40625l1.125 0.1875 0.125 3.0625c0.014 0.132-0.0305 0.26475 0.0625 0.46875 0.051 0.154 0.313 0.16875 0.375 0.09375 0.098-0.06 0.09425-0.10725 0.15625-0.15625l0.625-0.53125 1.25-1.0938c0.83-0.724 1.656-1.4492 2.5-2.1562l0.9375-0.8125 0.3125-0.25 0.625-0.53125 0.28125-0.21875c0.132-0.111 0.123-0.3055 0-0.4375-1.556-1.678-3.1312-3.3555-4.6562-5.0625l-1.125-1.2812-0.59375-0.625-0.28125-0.34375-0.03125-0.03125c-0.035-0.023-0.079-0.0525-0.125-0.0625-0.094-0.034-0.211 0.02375-0.25 0.09375-0.077 0.126-0.08775 0.2375-0.09375 0.3125l-0.09375 3.0938-0.6875-0.09375c-0.332-0.025-0.65375-0.0905-0.96875-0.1875-0.312-0.103-0.6475-0.1545-0.9375-0.3125-0.296-0.139-0.586-0.25925-0.875-0.40625l-0.8125-0.53125c-0.263-0.188-0.502-0.42-0.75-0.625-0.255-0.198-0.43225-0.48875-0.65625-0.71875-0.228-0.228-0.40375-0.489-0.59375-0.75-0.198-0.257-0.37425-0.55875-0.53125-0.84375-0.169-0.276-0.3045-0.577-0.4375-0.875-0.147-0.291-0.265-0.565-0.375-0.875-0.124-0.303-0.2215-0.6215-0.3125-0.9375-0.205-0.623-0.33975-1.2612-0.46875-1.9062-0.10458-0.53112-0.2227-1.0887-0.28125-1.625-0.00389-0.094527 0.00365-0.18654 0-0.28125h-0.03125c-0.00182-0.020634 0.00171-0.041876 0-0.0625z" filter="url(#a)"/><path d="m19.92 22.149-6.764-7.176c-0.124-0.132-0.225-0.063-0.225 0.148l0.023 3.469c-8.177-0.234-9.519-9.04-9.728-11.294 0.097 3.02 0.339 16.219 9.705 17.19v3.541c0 0.213 0.109 0.296 0.243 0.185l6.728-5.62c0.132-0.111 0.141-0.311 0.018-0.443z" fill="#fff"/><path d="m19.92 22.149c-1.584-1.652-3.153-3.318-4.767-4.942l-1.203-1.226-0.608-0.606-0.294-0.291-0.04-0.032c2e-3 9e-3 5e-3 7e-3 0.017 0.012 0.021 9e-3 0.082-0.012 0.08-0.027 0 0-9e-3 0.053-3e-3 0.118l0.14 3.433 0.012 0.308-0.308-0.019-1.055-0.066c-0.355-4e-3 -0.703-0.076-1.05-0.155-0.344-0.087-0.708-0.115-1.036-0.263-0.334-0.128-0.676-0.244-1.007-0.386l-0.948-0.524c-0.307-0.189-0.583-0.426-0.876-0.639-0.301-0.207-0.529-0.491-0.797-0.735-0.273-0.243-0.482-0.537-0.714-0.814-0.239-0.274-0.434-0.576-0.629-0.878-0.207-0.297-0.387-0.608-0.548-0.929-0.174-0.315-0.328-0.639-0.461-0.97-0.149-0.327-0.279-0.659-0.392-0.997-0.484-1.344-0.793-2.733-0.937-4.157l1.462-0.091c0.069 1.793 0.18 3.552 0.439 5.299 0.129 0.872 0.308 1.731 0.494 2.588l0.338 1.268 0.427 1.233c0.153 0.406 0.34 0.795 0.508 1.195 0.155 0.409 0.411 0.755 0.611 1.139 0.193 0.393 0.478 0.711 0.731 1.059 0.24 0.362 0.548 0.656 0.861 0.949l0.461 0.449 0.531 0.36c0.352 0.245 0.702 0.501 1.112 0.643l0.594 0.261c0.194 0.099 0.399 0.17 0.615 0.205l1.277 0.296 0.251 0.058-7e-3 0.213-0.113 3.305c-5e-3 0.137-0.016 0.295 0.01 0.337-4e-3 -5e-3 -0.063-0.015-0.024-0.02 0.024-3e-3 0.1-0.073 0.148-0.107l0.648-0.513 1.29-1.032c0.86-0.688 1.722-1.375 2.568-2.08l1.275-1.05 0.638-0.525c0.101-0.093 0.225-0.164 0.306-0.273 0.081-0.115 0.064-0.275-0.027-0.381zc0.093 0.104 0.112 0.267 0.033 0.381-0.082 0.113-0.204 0.185-0.304 0.279l-0.63 0.534-1.261 1.068c-0.844 0.707-1.673 1.433-2.503 2.157l-1.246 1.085-0.62 0.547c-0.062 0.049-0.08 0.085-0.178 0.145-0.062 0.075-0.317 0.071-0.368-0.083-0.093-0.204-0.058-0.34-0.072-0.472l-0.113-3.305 0.244 0.271-1.378-0.219c-0.471-0.038-0.89-0.279-1.341-0.413-0.458-0.129-0.86-0.377-1.267-0.62l-0.614-0.361-0.543-0.456c-0.368-0.302-0.732-0.608-1.023-0.982-0.305-0.36-0.645-0.701-0.883-1.106-0.247-0.398-0.554-0.771-0.751-1.195-0.208-0.419-0.452-0.827-0.629-1.259l-0.513-1.305-0.415-1.332c-0.245-0.895-0.442-1.8-0.588-2.711-0.308-1.817-0.439-3.666-0.464-5.478l1.462-0.091c0.054 0.65 0.159 1.305 0.286 1.95 0.129 0.645 0.272 1.291 0.477 1.914 0.091 0.316 0.198 0.626 0.322 0.929 0.11 0.31 0.237 0.61 0.384 0.901 0.133 0.298 0.271 0.594 0.44 0.87 0.157 0.285 0.313 0.571 0.511 0.828 0.19 0.261 0.359 0.543 0.587 0.771 0.224 0.23 0.41 0.506 0.665 0.704 0.248 0.205 0.479 0.436 0.742 0.624l0.816 0.527c0.289 0.147 0.591 0.271 0.887 0.41 0.29 0.158 0.621 0.202 0.933 0.305 0.315 0.097 0.634 0.187 0.966 0.212l0.99 0.131-0.295 0.289 0.095-3.434c6e-3 -0.075-5e-3 -0.173 0.072-0.299 0.039-0.07 0.169-0.138 0.263-0.104 0.046 0.01 0.079 0.034 0.114 0.057l0.042 0.038 0.295 0.333 0.569 0.643 1.152 1.273c1.525 1.707 3.096 3.371 4.652 5.049z" fill="#f7941e"/></svg>
diff --git a/silx/resources/gui/icons/first.svg b/silx/resources/gui/icons/first.svg
index 8704281..8af1df7 100644
--- a/silx/resources/gui/icons/first.svg
+++ b/silx/resources/gui/icons/first.svg
@@ -1,26 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <linearGradient id="b" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
- <stop stop-color="#002839" offset="0"/>
- <stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
- </linearGradient>
- <linearGradient id="a" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
- <stop offset="0"/>
- <stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
- </linearGradient>
- </defs>
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g>
- <path d="m25.451 4.9951c-6.6141 3.9114-12.473 7.571-18.396 11.252l18.307 10.806z" fill="url(#b)" stroke="url(#a)" stroke-linejoin="round" stroke-width=".4"/>
- <path d="m6.5357 6.2992-1e-7 9.9456v9.9456" fill="none" stroke="#00006a"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<linearGradient id="c" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
+<stop stop-color="#002839" offset="0"/>
+<stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
+</linearGradient>
+<linearGradient id="d" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
+<stop offset="0"/>
+<stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
+</linearGradient>
+</defs>
+<path d="m25.451 4.9951c-6.6141 3.9114-12.473 7.571-18.396 11.252l18.307 10.806z" fill="url(#c)" stroke="url(#d)" stroke-linejoin="round" stroke-width=".4"/>
+<path d="m6.5357 6.2992-1e-7 9.9456v9.9456" fill="none" stroke="#00006a"/>
</svg>
diff --git a/silx/resources/gui/icons/folder.svg b/silx/resources/gui/icons/folder.svg
index 7ee9be1..5c3b194 100644
--- a/silx/resources/gui/icons/folder.svg
+++ b/silx/resources/gui/icons/folder.svg
@@ -1,120 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3031"
- xml:space="preserve"><metadata
- id="metadata3081"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3079"><linearGradient
- x1="7.2104001"
- y1="11.63"
- x2="18.261"
- y2="20.056999"
- id="b-3"
- gradientUnits="userSpaceOnUse"><stop
- id="stop3038-6"
- style="stop-color:#dedfe3;stop-opacity:1"
- offset="0" /><stop
- id="stop3040-7"
- style="stop-color:#97989c;stop-opacity:1"
- offset="0.31040001" /><stop
- id="stop3042-5"
- style="stop-color:#626365;stop-opacity:1"
- offset="0.55800003" /><stop
- id="stop3044-3"
- style="stop-color:#343435;stop-opacity:1"
- offset="0.73269999" /><stop
- id="stop3046-5"
- style="stop-color:#000000;stop-opacity:1"
- offset="0.81879997" /></linearGradient><filter
- x="-0.32505301"
- y="-0.4033666"
- width="1.650106"
- height="1.8067333"
- color-interpolation-filters="sRGB"
- id="filter3903"><feGaussianBlur
- id="feGaussianBlur3905"
- stdDeviation="3.2938311" /></filter></defs><path
- d="m 26.653703,23.838789 c 0.048,0.158 -0.045,0.311 -0.208,0.339 l -18.8620008,3.298 c -0.163,0.028 -0.335,-0.077 -0.384,-0.235 l -4.84,-15.719 c -0.049,-0.158 0.044,-0.31 0.207,-0.338 L 21.427703,7.8867879 c 0.163,-0.028 0.336,0.077 0.384,0.235 l 4.842,15.7170011 z"
- id="path3048-6"
- style="opacity:0.5;fill:#000000;filter:url(#filter3903)" /><linearGradient
- x1="7.2104001"
- y1="11.63"
- x2="18.261"
- y2="20.056999"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop3038"
- style="stop-color:#dedfe3;stop-opacity:1"
- offset="0" /><stop
- id="stop3040"
- style="stop-color:#97989c;stop-opacity:1"
- offset="0.31040001" /><stop
- id="stop3042"
- style="stop-color:#626365;stop-opacity:1"
- offset="0.55800003" /><stop
- id="stop3044"
- style="stop-color:#343435;stop-opacity:1"
- offset="0.73269999" /><stop
- id="stop3046"
- style="stop-color:#000000;stop-opacity:1"
- offset="0.81879997" /></linearGradient><path
- d="m 25.561,22.518 c 0.048,0.158 -0.045,0.311 -0.208,0.339 L 6.491,26.155 C 6.328,26.183 6.156,26.078 6.107,25.92 L 1.267,10.201 C 1.218,10.043 1.311,9.891 1.474,9.863 L 20.335,6.566 c 0.163,-0.028 0.336,0.077 0.384,0.235 l 4.842,15.717 z"
- id="path3048"
- style="fill:url(#b)" /><path
- d="m 25.561,22.518 c 0.048,0.158 -0.045,0.311 -0.208,0.339 L 6.491,26.155 C 6.328,26.183 6.156,26.078 6.107,25.92 L 1.267,10.201 C 1.218,10.043 1.311,9.891 1.474,9.863 L 20.335,6.566 c 0.163,-0.028 0.336,0.077 0.384,0.235 l 4.842,15.717 z"
- id="path3050"
- style="fill:none;stroke:#414042;stroke-width:0.1;stroke-miterlimit:10" /><linearGradient
- x1="6.2392998"
- y1="17.226"
- x2="30.867001"
- y2="17.226"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop3053"
- style="stop-color:#f1f2f2;stop-opacity:1"
- offset="0" /><stop
- id="stop3055"
- style="stop-color:#f2e7db;stop-opacity:1"
- offset="0.0395" /><stop
- id="stop3057"
- style="stop-color:#f4d3ae;stop-opacity:1"
- offset="0.1471" /><stop
- id="stop3059"
- style="stop-color:#f5c188;stop-opacity:1"
- offset="0.2586" /><stop
- id="stop3061"
- style="stop-color:#f5b36a;stop-opacity:1"
- offset="0.37180001" /><stop
- id="stop3063"
- style="stop-color:#f6a74f;stop-opacity:1"
- offset="0.48710001" /><stop
- id="stop3065"
- style="stop-color:#f79e39;stop-opacity:1"
- offset="0.60509998" /><stop
- id="stop3067"
- style="stop-color:#f79829;stop-opacity:1"
- offset="0.727" /><stop
- id="stop3069"
- style="stop-color:#f79520;stop-opacity:1"
- offset="0.85519999" /><stop
- id="stop3071"
- style="stop-color:#f7941e;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 25.951,22.025 c -0.191,0.516 -0.791,1.016 -1.332,1.112 L 6.935,26.267 C 6.393,26.364 6.107,26.02 6.298,25.504 l 4.854,-13.077 c 0.191,-0.516 0.791,-1.016 1.333,-1.112 L 30.17,8.181 c 0.541,-0.096 0.828,0.248 0.637,0.763 l -4.856,13.081 z"
- id="path3073"
- style="fill:url(#a)" /><path
- d="m 25.951,22.025 c -0.191,0.516 -0.791,1.016 -1.332,1.112 L 6.935,26.267 C 6.393,26.364 6.107,26.02 6.298,25.504 l 4.854,-13.077 c 0.191,-0.516 0.791,-1.016 1.333,-1.112 L 30.17,8.181 c 0.541,-0.096 0.828,0.248 0.637,0.763 l -4.856,13.081 z"
- id="path3075"
- style="fill:none;stroke:#f7941e;stroke-width:0.1;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="c" x="-.32505" y="-.40337" width="1.6501" height="1.8067" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="3.2938311"/></filter></defs><path d="m26.654 23.839c0.048 0.158-0.045 0.311-0.208 0.339l-18.862 3.298c-0.163 0.028-0.335-0.077-0.384-0.235l-4.84-15.719c-0.049-0.158 0.044-0.31 0.207-0.338l18.861-3.297c0.163-0.028 0.336 0.077 0.384 0.235l4.842 15.717z" filter="url(#c)" opacity=".5"/><linearGradient id="d" x1="7.2104" x2="18.261" y1="11.63" y2="20.057" gradientUnits="userSpaceOnUse"><stop stop-color="#dedfe3" offset="0"/><stop stop-color="#97989c" offset=".3104"/><stop stop-color="#626365" offset=".558"/><stop stop-color="#343435" offset=".7327"/><stop offset=".8188"/></linearGradient><path d="m25.561 22.518c0.048 0.158-0.045 0.311-0.208 0.339l-18.862 3.298c-0.163 0.028-0.335-0.077-0.384-0.235l-4.84-15.719c-0.049-0.158 0.044-0.31 0.207-0.338l18.861-3.297c0.163-0.028 0.336 0.077 0.384 0.235l4.842 15.717z" fill="url(#d)"/><path d="m25.561 22.518c0.048 0.158-0.045 0.311-0.208 0.339l-18.862 3.298c-0.163 0.028-0.335-0.077-0.384-0.235l-4.84-15.719c-0.049-0.158 0.044-0.31 0.207-0.338l18.861-3.297c0.163-0.028 0.336 0.077 0.384 0.235l4.842 15.717z" fill="none" stroke="#414042" stroke-miterlimit="10" stroke-width=".1"/><linearGradient id="e" x1="6.2393" x2="30.867" y1="17.226" y2="17.226" gradientUnits="userSpaceOnUse"><stop stop-color="#f1f2f2" offset="0"/><stop stop-color="#f2e7db" offset=".0395"/><stop stop-color="#f4d3ae" offset=".1471"/><stop stop-color="#f5c188" offset=".2586"/><stop stop-color="#f5b36a" offset=".3718"/><stop stop-color="#f6a74f" offset=".4871"/><stop stop-color="#f79e39" offset=".6051"/><stop stop-color="#f79829" offset=".727"/><stop stop-color="#f79520" offset=".8552"/><stop stop-color="#f7941e" offset="1"/></linearGradient><path d="m25.951 22.025c-0.191 0.516-0.791 1.016-1.332 1.112l-17.684 3.13c-0.542 0.097-0.828-0.247-0.637-0.763l4.854-13.077c0.191-0.516 0.791-1.016 1.333-1.112l17.685-3.134c0.541-0.096 0.828 0.248 0.637 0.763l-4.856 13.081z" fill="url(#e)"/><path d="m25.951 22.025c-0.191 0.516-0.791 1.016-1.332 1.112l-17.684 3.13c-0.542 0.097-0.828-0.247-0.637-0.763l4.854-13.077c0.191-0.516 0.791-1.016 1.333-1.112l17.685-3.134c0.541-0.096 0.828 0.248 0.637 0.763l-4.856 13.081z" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width=".1"/></svg>
diff --git a/silx/resources/gui/icons/image-mask.svg b/silx/resources/gui/icons/image-mask.svg
index 698efb2..b439b13 100644
--- a/silx/resources/gui/icons/image-mask.svg
+++ b/silx/resources/gui/icons/image-mask.svg
@@ -1,20 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(-.4361 -.1802)">
- <path d="m7.9557 1.6942c-2.4733 3.0522-4.0586 7.3933-4.0586 12.242 0 9.2281 5.6201 16.73 12.539 16.73s12.539-7.5015 12.539-16.73c0-4.5475-1.354-8.6683-3.5637-11.681-6.001 1.9433-11.808 1.5682-17.455-0.5608z"/>
- <path transform="matrix(1.0559 0 0 1.0559 -2.567 -1.5541)" d="m16.644 11.458a3.8814 2.9492 0 1 1 -7.7627 0 3.8814 2.9492 0 1 1 7.7627 0z" fill="#FFF"/>
- <path transform="matrix(1.0559 0 0 1.0559 8.869 -1.5541)" d="m16.644 11.458a3.8814 2.9492 0 1 1 -7.7627 0 3.8814 2.9492 0 1 1 7.7627 0z" fill="#FFF"/>
- <path d="m16.563 13.059-2.0993 5.8501c1.2282 0.78863 2.6176 1.0247 4.3666 0.02799z" color="#000000" fill="#FFF"/>
- <path d="m13.111 21.648h7.0723c1.1245 0 2.0297 0.90526 2.0297 2.0297h-11.132c0-1.1245 0.90526-2.0297 2.0297-2.0297z" fill="#FFF" stroke-linecap="round" stroke-linejoin="round"/>
- <path d="m13.111 27.422h7.0723c1.1245 0 2.0297-0.90526 2.0297-2.0297h-11.132c0 1.1245 0.90526 2.0297 2.0297 2.0297z" fill="#FFF" stroke-linecap="round" stroke-linejoin="round"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(-.4361 -.1802)">
+<path d="m7.9557 1.6942c-2.4733 3.0522-4.0586 7.3933-4.0586 12.242 0 9.2281 5.6201 16.73 12.539 16.73s12.539-7.5015 12.539-16.73c0-4.5475-1.354-8.6683-3.5637-11.681-6.001 1.9433-11.808 1.5682-17.455-0.5608z"/>
+<path transform="matrix(1.0559 0 0 1.0559 -2.567 -1.5541)" d="m16.644 11.458a3.8814 2.9492 0 1 1-7.7627 0 3.8814 2.9492 0 1 1 7.7627 0z" fill="#FFF"/>
+<path transform="matrix(1.0559 0 0 1.0559 8.869 -1.5541)" d="m16.644 11.458a3.8814 2.9492 0 1 1-7.7627 0 3.8814 2.9492 0 1 1 7.7627 0z" fill="#FFF"/>
+<path d="m16.563 13.059-2.0993 5.8501c1.2282 0.78863 2.6176 1.0247 4.3666 0.02799z" color="#000000" fill="#FFF"/>
+<path d="m13.111 21.648h7.0723c1.1245 0 2.0297 0.90526 2.0297 2.0297h-11.132c0-1.1245 0.90526-2.0297 2.0297-2.0297z" fill="#FFF" stroke-linecap="round" stroke-linejoin="round"/>
+<path d="m13.111 27.422h7.0723c1.1245 0 2.0297-0.90526 2.0297-2.0297h-11.132c0 1.1245 0.90526 2.0297 2.0297 2.0297z" fill="#FFF" stroke-linecap="round" stroke-linejoin="round"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/image-select-box.svg b/silx/resources/gui/icons/image-select-box.svg
index 2db5392..421cee9 100644
--- a/silx/resources/gui/icons/image-select-box.svg
+++ b/silx/resources/gui/icons/image-select-box.svg
@@ -1,121 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata52"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><g
- id="g4"
- style="opacity:0.5"><defs
- id="defs6"><rect
- width="31.155001"
- height="32.41"
- x="0.47"
- y="-0.015"
- id="h" /></defs><clipPath
- id="g"><use
- id="use10"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#h" /></clipPath><g
- clip-path="url(#g)"
- id="g12"><defs
- id="defs14"><rect
- width="31.156"
- height="32.41"
- x="0.46900001"
- y="-0.016000001"
- id="f" /></defs><clipPath
- id="e"><use
- id="use18"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#f" /></clipPath><g
- clip-path="url(#e)"
- id="g20"><defs
- id="defs22"><rect
- width="31.155001"
- height="32.41"
- x="0.47"
- y="-0.015"
- id="d" /></defs><clipPath
- id="c"><use
- id="use26"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#d" /></clipPath><g
- clip-path="url(#c)"
- id="g28"><image
- xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEVQRVAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABmrAAA1lwAAW1j/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAgwB7QMBIgACEQEDEQH/ xADRAAACAwEBAQAAAAAAAAAAAAAABAIDBQEHBgEBAAMBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQIEBgIDAQACAwAAAQIAAxEEEiEFMRM1BhAgMCIVF0AUQTIjUGAzQyQWEQABAwIDBQUHAwMEAQIH AAABABECITFBEgMQUWEyBHEispN0IECBkdITNDChQrFSI1DBMwUUYNHwYnKCFSU1EgACAQIGAQIF AwMFAQAAAAAAAREhAhAgMUFREmEwcUCBkbEioTJCUGADwdFSchNi/9oADAMBAAIRAxEAAAD0AiqO CYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOC YOCYOCYOCYOCjYn4d7j4cADgAAAAAAAAAAAAAAAHTg7swr+bl9nbXn+E59pgTtygLLwAAAAAAAAA AAAAAAAAAAAAABz3Hw73F1Pw73Hw4AHAAAAAAAAAAAAAALdXkUN1pzPjmWxzVwlZXxGu3k6/iVPs Pk9voVgTuAAAAAAAAAAAAAAAAAAAAABz3Hw73F1Pw73Hw4AHAAAAAAAAAAALCttzTrzsO1Sy47pw nVb3nex73kpc7VVdGddOPrr30/Fx+jV1ehjGmh22sDsgAAAAAAAAAAAAAAAAABz3Hw73F1Pw73Hw 4AHAAAAAAAAAAJa6GvCibtdlOK+2qdVltpKmzlkGa7OV2EVdMM2+LSMKdHFqXOWX1s1bdcviIfTl vfmXdThjr/W9i+Vs+kV1w+fhqZ05wO2VdqLYEQOAAAAAAAc9x8O9xdT8O9x8OABwAAAAAAAAADQ1 s3UqwzurtqrYupYounOFtVt0SNUpKxzruwjKWidEZ97KrtseWRnCvljLqehVYxxyeOC2jVjcqeye 920oZX1a+qjHuan6uDOp1c/Rdkq7WPj9CIGfoAAAADnuPh3uLqfh3uPhwAOAAAAAAAAAAa+im1Tg YvWuq4xfRfTexyjlVt6ldVk+0WxnKyBHk+1nO2cOdXVx7CVj+th62bTaq7kRxytojdTbelxx6vl3 K0rnEtXmwWZv9jDhZv0uH308wDz9QA4AAAOe4+He4up+He4+HAA4AAAAAAAAF1LDmk2ozTivZVur XFU4X2x7yFoc5yzlU49nPlUVnOdh22XK6ZXTqhVPrmhjaUdOip2iquca6p1M2KP8NMrSz1tdJRw5 SWzn+h5Co/PbTjofUcsn8MOpU+sAR6ADnuPh3uLqfh3uPhwAOAAAAAAAdkxPkGuXdom2oxlqnbVO JiUOV32TrZrvgR7GcOQj22uFCts26V7JXR46w1ossRjr5CXUoUdhLHE7Z2Nra86rmdTMvz4H5qTh hkgS0+ZydM9fnz5XDZFD5z635yz1EzvMmwAHPcfDvcXU/DvcfDgAcAAAAAJjU48ZsunlrosqpSbW aqlZOE4cY7HtWi6dC8LrqqXO2i1/OX5tU2rr+XUzj6NhTBK+uifarl5q9hd3txCfauWdZ7dXCN1s 6cwxFirDQhsKW+eh2EN3kucXu11XSpYvgj8v9jky2fMHeYvXc9x8O9xdT8O9x8OABwAAAJSdsjBu DMsva714VdVsKL7r6bI8slUzXcRbnVehNiPLr1WKYXEI2Suz7Jluiq3vF60LKJ0VtVWddo0eRvqu 5ON0bq+xsYsT7CjQisxXjuZrZqwzTbz5YaY2VbPJ7XfZ2tGbXNPFlNNTZL5KNtWb23PcfDvcedT8 O9x8OABwAALOmm4N6MddxyqiFEY03cYqlC6ydT1c5zYXqsZnOuuVVkbOXURYgvK5cXQz5pXHGs1n uyammokrFuqdPbY3R0Ll1fYcsr7yDFq9tdTDajVNDjCt+fNatbVLJmRnD0PHmxRKMbec7Ls6rY7K sP5v7z5SzfV7j4d7jV6Kfh3uPhwAOAAM0aFsG7oEsFitkc/aOcsr1ExqFk/q7GfIvycnexdEbYdv nKpuMK7uUXU9s7lM9tsSlC629ScbJ2X0X9hpV5HlmeOjnPx0SOSr1BKXI139uhnOMWU46ry3mBSd 2bd53apQ0+WAx2Nd1k5d5y6ekjmbmVph817j4f7hl95Pw73Hw50AcAC3QRdvpYIV0551zlTbGwuj Nt7NjTP62fxc8tmrXyu7l8a5Jzsz3o2c5GhfOVce3IM8stuStqnOV9lFsNK4wpKqI5FOvvJuXFMo dn2xqFNF906s021ractiFtV2FeXOavIhBnjkL6e2HJ0c08swtr5jTJD3Hw73HL7ifh3uPhwAOE4W yWurMSzWWX1U5q6u1w0cL5JUjyvOd0FrISdSrI2uOsZlF8G6IdspdR0eaaUNHJkbspa7ryr4WTiW XU81TWv6gq+g2l2pwrtUGK5YuX1swz2vJSpo0eQ7VSnCS+zzDsbLfPsOShZCF3XE52Va6rPk9n5n Vua9x8O9xp9FPw73Hw4AHC6lyXGHlyWJ/inOU9hZXVZV2UoXSOx4nKjShdS0zGm69SVldl6zSMbV NJJ2d2eo+tM5xuiv0FF7q7qX67Sr0F42VWZquMnaeMUxhY/ZnX18YO3wzdvLasaF9S2jHbRKq/zu sVHc9slredulTZCyVd3JvnvnPt/itutr3Hw73FsT8O9x8OABwlEGmEGruPzXmwzsojm6W1WRsJmj Ca13GKrnVdHOz2R5yyyduW6snqqaqOfWhBd7Tx2uzuffkK7SOjL1lC1pupZnG1eVgzrtxhzO3Ct2 uNTEpwpLqqo5+ptqacFczt3nVyKuxs5ZbGdc7pV2qxbq0V1/IfU/PbJqe4+He4x9ZPw73Hw4AHAA L6LZd0+9vjgott7TyvktCNizUHqboWVzqtmnen2bc9NOi3F0ENC+T9Fxj1/Od1cjbTqX5b9WyVDt EZ5knU7sy7jC6xyec1XPt9pXnEdMZeXZWlyvmbpZt2a2hRrRhsl2Uc/K2OcklecnXZfTzljUKpaO LfI7nzGrS37j4d7jX6Cfh3uPhwAOABLeR1YY421kMrC7S0et9jKF1blHYabrIlVvO08Wb9VvcF+D SxR6ENNnI18mqrG+gQkyLuS1RevyNLPq5ToUxjj6XUrqNGHLqu1PQojW8VW11Z6enmbcbi1fbcdU 6Urc+5JNmrl3YWV3VVs19hTIhfTKNKfo2Z2Rp5lXvue4+He4xpT8O9x8OABwaV1eQduqvq82MJcc ZUZo51iVNsLr65Rhc52LFN6fJ1dnst4uvhuTyvosG5U4K2y3a1NHFowo7GJrpvWbZ7Kp3PtqsY5f KurBevytNOxavKjme8uhpz6lE15ZOSlOeVel1OcFrGeylZdm3w68L21W9pvqnDJovU9v2MpWUcfX PcfDvcUU/DvcfDgAcs3FHoY+srsQyLzhN2+m3kY1XUXtF0LKa7GNjC2M+inP2srkzTz+LPoU77/O t+ccVPQhxy6iubyo5T35rQYytcNSdN1PaH1l0dHPagqzHFatVDmRpLWZKm83TnVddXPPYLNVuZ7H bbaZWUW1XV1tw7ymVPb6c/N0Mv1focoDJS57j4d7i6n4d7j4cddvallv52dWHltNkOR5avyV1ld3 K07Kpd0tRruh3jKN0dH0C9LmOWVauxfZ3awyiza+f+hUqKOYmpctl1CvumkWdjj6C9GmvWyXF+Qb MPTnTfyubJ2uyLmK3xbRPdsQbzct5yddtHLarKiq2uVdluffaFKKvQ19yNX5/vuwAz4XPcfDvcXU /DvcfDjacw9+3zqmUr6qK74wq62pdCMe2K3d7X25VO+yg46zWRtv0Uq6Z6eRqpxdtzHpW26WKzV1 ajWy7YaFmQ7ElqZNlkdHNalzOtJmuUM2LClstFmhmqmyMuVWIq6SuitZ2FTujbnN1dZjGVVsKrVd NKFKt3s+j26teHs1Zco5MYBypz3Hw73F1Pw73Hw4NnGvlV9BVZZZ5saOW19gwp2nvZ9W5JrlVnIw sps7Kwqs5G+aTcUnMTQj1JySHZa2W8nyOmIs8rUk73pdHRV6sYQYQbsrup6vk7WTbJtnJ1UbwKJw ruhOtNitezjSzdse0sJ9HM13H13U2Fvp/QJY7KmGkArpABz3Hw73F1Pw73Hw4AHNdrJ3dGGuh63u bMr0OwsQnbTXKu21aHb4w7BxtKXDBfKNKZep23XipowzKWOSh3DuhO6zQtpaz1KobOXKxR5B+3jN sLM8YovwkxXa6rp612a5TBiEiq2hRyu6hJ7Npvs289anRazRVdp9axPmTDRzgZsgA4ADnuPh3uLq fh3uPhwAOd3sCydf1F2A/o85u7Pb5X2lpePLF3148QbW0arE1NNCMr9BZ+ioy9rHjKD+doyNy5LL ZkQuQ1c2GlGqISRfW5PJnJXU2GMrRorshZGElkNTLuixAb7yV+avGevTTTZBZftvs+xTdPnNyyS1 eKrvArpAHAAABz3Hw73F1Pw73Hw4AHAAO8Om7EJXNJ/59xn+nrrsl5aD6065s5ushGJq4+jR1vM1 U65Y+pmty7pzquySTyt5C+NWhkPI6NM457aMnbztFajicrJ7fUHs0YqsUWV57ai+2/WyZUX6NLMY S7qcmlR3ZrZNFNHACvMAAAAAADnuPh3uLqfh3uPhwAOAAAAAFtR1vP8Azend57PUeufSpNIsK7iV 1V+7CF1XMlPTzJnNXI0M/blWq+MS6nlvdNzH08/JUMLTjjUv5WrW/rfNvQhsJcyrOcuzm9frs1Tz uXt5POZs4BCAAAAAAAAAADnuPh3uLqfh3uPhwAOAAAAAAATgdSlWH1EMJmzC5fiy5L6nQ+d2Hnyw t75+U7m/mGKtX2fPnNnuRTGuyO7trSyJTl9Iv8+tHPOead9PXVS4npoVkeAEId4AAAAAAAAAAAAA AOe4+He4up+He4+HAA4AAAAAAAAAAAAAXaGSSr1suJzoByfZ1gAAAAAAAAAAAAAAAAAAAAAAAAAA DnuPh3uLqfh3uPhwAOAAAAAAAAAAAAAAAAAAAABZMoLagAAAAAAAAAAAAAAAAAAAAAAAc9x8O9xd T8O9x8OABwAAAAAAAAAAAAAAAAAAA1xjfy+utZ1zAYWrw+WNDPcAAAAAAAAAAAAAAAAAAAAc9x8O 9xdr+c+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g +nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+ nD5v6QD/2gAIAQIAAQUA/wDLaxVhvEW1WP8AKZgI9vUMJnMBlb8h/IZ+jZLE9MzMBxKzghxgEH+M 5jGMRGMZjBK6yYoAnKPbxPnrg29P7KiVXary2oLApMKkfXbxbwcw8s46V1CZxMzM8ZY2FN1wYJZc a1CCnZINdikKARsVcT9UxhGnCKmIJ1+OJeplIBbHUjpkLNbaCslgYXAtX9QjoYwhHyY+AWASxeip iBTG6AjMyM0WkBLSYEVoylT9FUzHICQwxiPhiBMziBCwE5E/AATpG6yxSw4dawVlZlZwdgBl+gq/ B2hhhnEmHAg6EHAOZxnHEAhM8YzCFxGYSmzrWwUq6mKY1YZfmRCYTHboYYxhYRmbivKdAciZzBDO UJEOTCkKqIzLKQsHhzIldplVsPj8gGSegYxjkmMwABDTOYTOUHiixliscgw4z0hjCOIwErBBXwYE xDK2li/LUOrGM0JjNgbO2XbXcNWTgH7iuYv2zr8AcGP8MmM5nMwtK+LgDpFAiQLkfIDhXaEwxkYw 9vTKooXGI6qoAyuOufgRAczl1OJhYzKIXWMMmpSpgaIeqLOXFfigySYwJmPi3WYAGS5YBlfoK/A9 IT9oOYMiP4B8TkDGMZQ0CsGQZB8IGwabZawK/FfEiERsQ/BjgF8t4Imc2dYDhVbIH+oOCJyh4GMk JcQt1Ccogh6kqYRKm65yPkQ5jdI/jGbEc9EOWPgv2it8uwwgOCjghlBnLA5Q4MPJYWzOORVnGTAM wsROZJrAMC4X5FODZZk5jNiOxyc5UDktvK23/UHDIwZbExEeBiRyVoyEQvmK+C6EGkQIFhMDQkEB cylDl+g+Rj8TG6qfAj7QcOvVblKmizqSJZWREsmQ8OVjYeYYSrBVUweIIZcE9IGlZBNVcb/b4seh +Jn+CcQf67CcTrPyU4YOprapw45FS6KTzIIPmKVOeHNUWFojZBYRkEKkSk/cOlHyMYfh/k/C9TKm yLE5qC1dhAZSwada2DCxWBEKcxWGU8A0rGI4wGiHBZgYwMVjK0+5ulXx49GHUweBhEIxGXI4lGYd LqRYuu7Kba4q8oqMhK81rQBjVg4IgzkjIdSJ4QHIUZi09aaQJe3yL1DLGEHiR8CIR0ZOUr6FkIll WYhLBqsFkyFHGArB1DmDxVocGMhmMTXXLV1Ists4kkk/FTglcgrmMhEx8hWMnXHIKOpXE5iKRgiN mVno4+AMxyHIiFQZo15dj1tbk/yoAwKAwpCkKTEImZ0IbInmGHwc4lTZjRvFGwTgh0g6FDPILivT bFaiuW2/Oj8SHUz/ACRCIRCI8rjwk5XqlglZw3QixcQGVnIJIJqJNNRLKoVS2I9hJ+it0Nimf4Ih EdYo6usYdaycWLmDoazCMxlIatSSmuzRdeGsVg3gB7S31UbIPiRGWcepHS2uIsKyyvrWhgpJD0NK qMBLRxe0CWWFz9fMDjBYZC5jLgHBCoIeOWpTigQQWkFrmMaxm/jBiIWJ/wDmP//aAAgBAwABBQD/ AMt70WHc617Kuf5T2Kssud4VM44BE17vMX+P4SzYAGSYB149CIwyORR12VZUcMP4t74GclVgECwi FC0GuuVTE8nlMkTJMGY1oUg5mROn19k/cogEAmJjMCwLAkCQVZjVqIcCNWGjhq1a5s0WFmU5H1bT l0EUQCAQCARVipFSKoxfXiCuFI9WZs6QnNqzrXiwfUb/AFs/3URYBAIBFEVYMCZlf3CyvqUEWrMt UCWDpeCrecwiblilWDL9FmAjPmWDosURRAIogiI7SvSdoutVXCoZWByEJLKEW7xsmwIwgUzSs+36 DMBHs6oOtnggiCCKsVMyirJRkEN+Cbi0tsioTDhY1TGWUkSxcTZryGXEKuIeQmne6t8zuFDucL1K DAIzEXEURAuTiIpxX0VegY/dX4nXJFaOB/zUWXKJbaxlmZf4W9WAJhJErZeQII+Twlj5JOSiTGYq TEEQRRA3TzCZU4xdUoVq8GvzODLZDyjkiMxjsZcRi0YdSBDgxwBNDY5D5LWwp6lR1AwFWKmAR1UR TgAwDlKlWVgR1yvLM1CBOkZQY9Sy2oSxZsAiOcn/ADxhRSKSUs/x8bus45igCCKTPMIAbMETJijq OgqXC1GBsxhxJp6CywQ7LR3do+Y5MvIIbxwZnq1mJqqHv+S09Q5JWc8BLSwyTEEAi9DSI56pkrQB 5zLxLhWGu+C9YMtQiMSI1hjtNhyCepGDOHRlmhTxPxc4V8tPL6r1gOIvUKvQCL4kyroAM2MOJUjz mAYOOvg3nOsbYUywoZZLHxL2z8AYrAx1Bmi+U+RqlZWXqEJGBFAEUfBfEDJYYWk5s8Q6ENVfP9ja JzKwurRzGebB6McmKMwVLixSJpE+d8nLjGIyXzFwAsHwxhavHOR1RqrchxmH7SrukNysLI5hfMtf EtszAOpTp4EOVj2Aro1ED5Nq05PUVGJEOQsXx/wDg1tmWDojYldoYWCBykLgwviM2ZY+DbbmKoaZ IK9YyQ5E1tR77L1VD8bW4o5+6V9IvQ1mLAYpjeKtghgwY8SGgtOHIM5YJeNZLbJgsSCDyzFbEFim WgY7UAKrG5P8dizkzxvFT9wPRDAYDFMzkAwMRC2RyweULyx41vR7erkxBiWLkAGIyx6xC5xqpw0v jbf1B/6MIOqE9RAcFWmYGivGaBpzjPPM6NaM2WYhbJOMA8wrYPQxlILQWnGpoPa2wQlXx2EKPYvQ /cqdGdcFDyURH+0PmCzB54nPIFvVrMQ2ZVriC9hMUllHUnwDEEtyisVOQRZ1NWmglICJdZ5j/G6s OueLYKlkDAfcMFSwGSOJYlTZ0C2c1rt+52ORYSEYiOMFAJWcO68X/wAMsAzB1gJU0J5l1VYIuclv l2BwItInmgTKmBladBHUMvMYUq1ZBQnLRsmtBkgAPdjKDocgkhgpKk4IPQqjEJqWvNTUWoWWhB81 1QsWzWsUsjBVJiMQ1xxKWJjHkyj7rR96gYAJSs9bMgAKyL0JEUDOSImTCpL0UhFWnEe4n6WBLqVI Iw75ZKXjdHJwbeoQ5BZlh6FuqoeLOuZnoT1FNlq06bAa+kEYGtZbeGX6ZGRfR95q/wCdY6uOmcrW TEbrYRjGURsRzKFZ0upZRr6j2FK1Abgodyx+vgYbUIZtditoattU8nfUbNyWIdag+XdokrXouWTi g5xnJ/jPTW8SpE+GBn/5d//aAAgBAQABBQD/AN5mVF/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5j tM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/L9pn5jtM/M dpn5jtM/L9pn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5 jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/ Mdpi917W7TvHpP8AJVHaGm0Qgj/wOz+rTvHpP8ZVLHX7Vt3tq+3aki6dFANQaXdrouPc+zWap/nd n9WnePSf4un2+/abT7ZRqOxprUlVCK1kZlgVJbV5tfcNNtS/+b2f1ad49J/h1a11x0+y4lFCqDTr 0lUVlNfmwhq1XnHNbzj9vdO3rt03U2Uv/M7P6tO8ek/wQMzU0ntfR1Era5sta6VqKlZQpuHWsqtx LWMCSELqjF14ju2imwroyN/L7P6tO8ek/wACmlrWp0qqxpUoLKnB2LHBstWusLW11dfFAlNiuz2k 4dV5cyxrKsDi4ALt6OvaatTQofd1dayWU2V/yez+rTvHpP10Us2tUEUJhWArpYpXSqIirT56BnZa qfJZ67bWA4AOzO9qpHOZZsoG2dpgbbrbCaLideqtDs6guotqep4EZpR21rFu7fs0nBymvYw/pW4e p0P1+z+rTvHpP19FMvShJoRXlah6qqhaldJ2Ig5itBrmyvYtYNxVTaxawgbey9Z2N3ac5IDZMNbY KPhK3LV69P8AX2tKuwV9l1K9a2vVWutWaVUvZV//ADNbtf7fNC2dutRbhXi1ArBGMGtcYda4Qoy/ T7P6tO8ek/X0B9tSsHQHjQhtWsM8rzWuujUsa7rbHfjVrllR7mJ2t1ll9zFhWVjKxgQzgc8CYAAR exawZbTqrvVezi+P2FKJR29Enl1UpvbdHl9WG72z+wPxdivVoooGsIactdVVNrXCfS7P6tO8ek/X 0RgIxR1LVvQbEXVBQUVsl1jPbfdshZWTXU1gebG0OLuZV9zscwgkhXaHAhJMJwOvJEyuoh46zzzA 73bKVrsbtuxY+Wg6RaiRsapYVrgjVdjagQXKA1lYdbFKP9Ds/q07x6T9fUUipWDMjBtnWKnYrcNt WM19ltqIgby0JOL9hnjORHJZlpCIyEg/aGLCYxM4jtFBB1fLMrINYe5V2txqhRtXXmw1oCwAoAVW 3EYl9gy4uJXthqmBMt1meOr1tvqBb9Ds/q07x6T9fRYLV/8AjbBsf/7bQvJrAsDNzfYVJbezghxC AApCqbAWZbXPHDZAAIwYzdQ2TRcEOvcvBLMHuRL7AYIguRYbgAoa1ksGK0YnyMjY0+LJegJCMuzS jJu0ZX6HZ/Vp3j0n62sqtZq/cQCFXpFGD5hSBmYknJJMUDNhy1uFH2lFKIGswA5MYQdS7x3xDYc1 2TTsIj7DAM3XLsMish8mrLtUigKVAQlpYea7VAeeXYp4WGHt6uG7HQw2+z3UJ83Z/Vp3j0n62rWw s1VIIyCj9fMDNjJU4niVIADMXwVhVnCqSUP2spYlwsZgIbwoa4mNaBDZk18ydZyJYxllhMOwEDWk FGLmhVAVwAhNhqUQjEvqDggizgAVXEwI6oU7lqmm/wCXs/q07x6T9RVJldMoA86tilhUsi9YuBAc zICl8RUEBCMw5AjKVnEVirPb1suAj7HRrYBY5r0XaV6lagIixiFa21cMwyXxMljRkRGxAxc6daCt eKsxUSzBGzXyleHr44nHMbw7nrC6tlKt8nZ/Vp3j0n6aIWKV4gQzyRWbcZoYlF8VP3HpWWBZK82C rAc/e1nFS5AZeC7VoSx73Y/c0r1bHiaSCJSiQ4hYCA8iQstRMkDHDMrryRhRWTYw6Cq9lC3Ph3fi 15RmcMADWRZHtM8wibKKy9wqItx8nZ/Vp3j0n6SIWKVyugwoqy64vZlrJV0VPBYoDmoAvWCGW37b bQq+azBeNK3ede23SwapMstCCAATMLQuojupn+qvcSRkzjFrzGK1qmXKHgA7mI7St2xUel2ulgsq ehrGPHXZbHaok/1wZXTWpbVoM2u06Vidx0G07Ph2f1ad49J+jXWWNdeTVTiHCwqbXuCg0qcKOgwI DhVIK1no+wimzYzK0e98eUoM4kC0tbsPUtKi9SF5NLLVUBmIezLhjHswHYeYi5i1kx3FarW9hqpA C0DKVDiKhKlWIgMKTZrBDA1FqSZVtX1Qb1ZC7AYhwwdundKxbSRgzs/q07x6T9BFLFKyBVWAAs2D gZRKl+5kAArOIvQJlg9gKszZeuxRq9vs2TZrjXUV2B+ak2ElK1FWztWGwhFEYnjsZUO7lVssWJgq yMR5ZD1OqjmWC1CKoEWBwoS+sB9rJrcharhystQxrQ8vUSsYVqgY1QEGuIP7CjzbRNp+S2f7zs/q 07x6T89NLWslCIcHCLgDADf9LNizk1SdFHRCvAciFosVUpoVAiAMQ519l9aC5rn2rRxqqPF6nxdS 3Jfunl9PuxcwiuIHAlFiKFVWDUgwUqIMCcxPOUQ3mAu0WpjKqOtWsTE11EevK3VvS7nkCVRUYMAm Y1eIFUxqgZtagsTYpem2dn9WnePSfn1vtRazxKgL0xcwAeziqLkgAQnMBGdM0Vi682mggVsgAsrP IlePHC+VyFfCtbQ4Z2PG64I2vY5hKspoJNyf9mr6quGoZ64+1if2WM8xjMtFTMVEWKy4R0lVqAVW CIwMbEvUOCvFsDNakRfDMwIVyHrxO89uFtRGJ2f1ad49J+alctRWIU6ooLXsEVmayHrKxxGeoyx0 dG3as2dUUFWQu4VEaw45NYiUsUVeRcFWXzDLmxXbsswfLEXFVpcEqwm1xLsgxZXka7C1fLWGoRqT PKIirAzKEZzKyJXZriIus4WsoBYTLT0vHXqwDgDzAYG6L4kwsCHVWHeNL+tf2f1ad49J+bXSVJwU nqCEWzle9rqIoyYiHGnpW7NmroJp1bfQ0otuxY3V1DCqosbGqBsqAllIUuRmx7GtbWJIqrxavLYV eLITjZqYHmWQeNDFNiATjOAhqBn9fMqqAApXC1srIqmIrAPdYlnmqRYQShwC4xzJI81pXXYZ5LYb XcBkZZ3igX6vaPVp3j0n5UGTqV5bOS1gEw1ktvRFCknEVJra7329v0k19fjl+51AV0VsowM1JWrs 9ZeyoFuQIsJ5O9l7MnlILuTccTlz2h1fGJaOVakg5ZCcLcrAjMByBBF8VxE4iDi7eWAUUibFS2Iy mokdeLApx5VY5+BDRepaWgFd0jh2r1md49J+WodNY4RrCIFSuWXM0C5gwJWrOdbSAla1pZr9zr47 Hc9XWr7j3Tb2zTcpVQC1rOwTfYm7aHJxdZGZCqny22j/AMa1ySGEH2bOcOGyFPSwcLDxYWUWgI7r EvMXZRWW6sg7FYH9omLZc0qULEdElDWuVOC4mwoYKmJ/h6g8Ftqstuxmos0BCgODLAQO62+WvaPV 53j0n5B1KCVkgAitQWcitjOBMKIkqurn9/7fyIj92smvZtbFjVXVqlqJbfaGaum7g5dn0aVaruFw or1vMddjlwvsH9VKeNT/AOuxnlnMQ5gIlyBkyBKSHWyiKCCERoaSsrNRldVWaqkwNdWiaixaih80 qP7EY5ZzgpOM4Lnqsp2EUixGBY58zI9xXf8AftHq07x6T8lYyaULvlaxXSXCoFUE4dsDkwgYwvZn ixlNXJqGemWbAcM6vbr691tjr/USwkW6FuZtZu36EKTdV2lr4DOCtijhsAgaqebTxatlIM6kXa5z S5rcAENTmFChDYgGCvIxXauU28pWYq85bWOLDoWGCeRQQQrMR6gZxKlLjHcKO83C3d7P6tO8ek/J X/rSMCmsueaMrqFhtcTJENlTrSqiy16mHHJrKAhgBbbk1UO5XjXr7Gwdqy6gqlBYDV/++sdLnBl7 cra1w/Esm4Djt7DiywrhvMKgMrjZGG1bOdQE4Bo1ECMpTJlZEOnXYtVrViq7o7HF7SxiznksUYGY IBCsdIy9N/Z/r12OXftHq07x6T8lS5FNWYlaQBCCicSiK9jIJgNOPRcCKDY74C6y37DLqMt2URdh inbtGoBHUM2wopWkFWqGF2y011537GvmVXTbUY0Oj4yLEikQ1CWJYwrfywmxiJehiuhi1qwbTMrq ZDUmThSoc67m0OjEQDqA5frj/AgMHWFY1YI7/QTrzs/q07x6T8mioMyQPMieZZGS0yyrinEA1hQK 1Lm3oKwVlubGoc61GjTxG1SK7tqwmnSAKggNv3AyihnAsPC9ec7evLaYZj0q8fKtqlarlEK5lleI rPCpitVZDp1tP6lyny71NT3EJt7CSq9bmSsQqvG0ZVbjWXcRizSpGEIZT/ZUMtimeYIhDTwnSdx1 hdrupV+z+rTvHpPyK7Katm0mu0NKHMyxNqFCGID4d+YWPkFf+p16ATUc7WrWRVt2M9tqKV0HK1+B 23LPp0eXq7X/ACaywCrtKEvgZZcHcrIZG+6q+L9wsBMTNbIfus10tldjVMlqNOAaGhgUyp/xXaBC Ay2ooDopi0AEgcVc1y1iB5VbBdRMrrmBLEjNbObicw695p8rd7R6tO8ek/LW3FgRzqHmMjMJazMh uLBazLAglVBdaaq6qPPXGhUOZZQNkeXbzJIqNdWxbinSpOztKAF30DI5InbyEr8Yy8o9amWUCt3r ao1X9EdbAKxHpMUFTevmBqvLWi5bZW2YFRoilTbxK0XEm8rhjkzxjpyHLLAryGIhGMQrmWVgjqp9 xEHZ7P6tO8ek/NVZ9usFStmYwGxzXQimwoqqh2HUNn+sUWjQ1jU9QWumzkm85azt2sb33k4yx2sT tpC1oft2U5jbqsVtW7JpsDQS1DGrW1WVtd7NMMqGyo17GDUyOGpDTy2Bp4qH0da9EL6ttfh0aWdB dca2a8WK7HIGFVZxj1gguUdW5BHIKuPg3SXsobut/n7faPVp3j0n5tdS1qUO0VCINdsPaoVaTa2s iqasJcwV60DcqSC1JxbsBrtyilKae41ZV67Km1HUxPGwEzb1fMVq2V6LCTVbygHIPXxN1C3LVY+v YUquFmhYpHm1ynZticLVNErBEv1q9hKHv0mW0EOwE20DStrqzShYkZiwDqwjorRFCHCMCeMS4R3B Xuu55VZJJ7P6tO8ek/LWhsfU066F5YZWzCTwStbbERFFXSyzNe3r5MP2moCOOF2utQ31GRsV8ltw HpL0PQ+QVyHTE3KWrtNZsFNplNgYMgYcCh2NVLkqZ6LUs6fY4bVSA21HXPmqyYgX7e4V5XU2iha4 EX28owUGraVopyPCCERlhGCCVgYNDgSywJX3Js1zs/q07x6T8va9fqp4m5cRIoBRDxcGVH79tS01 LMy8ESjIF1jedoqbL6jkWDM7lUVttBuq1NjIpcEWV5G7QXrUlDbrlhTcUmtsBo1YYEFDfqLsIDdq NW3JUWIpIsru1DRcLV5CXkFb9XDV2vGZidhCVK3UNq7K2KDFOIOoKxkzHQiNkS2/jLdg3zubDjOz +rTvHpPyaVAsesABv9SOVdcQ4X/KHJr8b8SkcbXOUXpNpxyA8q3Vt6YzO408q6j5dmyvBtTYzEYM tlYm7qOrU2ODbqJcCl1B1ds44hxwcNdQt1TV3aL0WpcqHI6FLM6mxXeliWHJuPE8SWx0tTIYKxs1 nqNO9xiWcgrQEGERhHXpvlgV6Lv2c7Z2f1ad49J+Tt9eNesdCua6ySFHVM8KxyFJJAODec1u4WIQ yLX9u3UGFf8A2o07cyh+QtQMNumyu2pFuqZLKJqXlZ9rpZUHXa17aLNa4MrAOP6DoaWszUwsHAib tHmV02f1ba7Ayl2m5V5w1dhte0uuGIawgxEzLE6EMHRlVjr1WBabqiLbVi3AxLAYescdN7rZe/Cp 25NOz+rTvHpPxpqa2zXrC1oMMnVKyVZhxsSFfKtQ8XBySA9aDzadWyKqmvZqGNRgHYNU2lsDBQMm 5SWSvZFeyK1sW+izWmntFRyRxtawurYNRZS62BGYRkFy0XvTarh4SJv6S7A09jymZxHIZb1/6V7F vClQAgJi4AYS9OgqJlNjGIqmcVw2upLKyxLMRiCN3rf3Q8df4dn9WnePSfj2fWyR0fH3VeLjjc55 So5G0MRsckMrIwv/ADtDCu3UuDLYgebNXA8ua0WNS+ptKwsXI7ppFLNHZ5LVYhmxoGs6tqhcB13t QXJrudewEEVWCbaLauttlrOfVrVxvaYslGyywuBGBN7O1d1L8gsHwcTywp4KRyKlHBhMYZln2Mjy 5+d/dz9vw7P6tO8ekwAk6uiXOuAgvUrcACtZm4oDV9VqJBtUvWMMKnnOX4h+9NPYKsjhhtVyshZ5 fJadjyn1tgW17FK3Ltadmvbq3ealNvGXV11trXDnYwDbunXsihrNWwWPyS1cbjtqbVWwLq3cE8ur 1o88tVOzkVOjOO23ZC5yJiMIwxEPVwWnPjK78zkCNjBFl4QAEHutoe74dn9WnePSZ2zUTGPLsTpN sckqYEV+N9RsSlsMP9+YC8vvIIldx5EAhGKFjNTZBVgCu3RatiXB6bES+vQ221bRYli7ahkN6VWr YrJU9bLtVV6tlG0tyhgD3XWF009nnAzA76G+nXst1iL1ISwGczAWjkkKa6WZij6+0lqrZA0GCHWc cE5EtRMBuBFoUbG/yZCWNzhEtYu/w7P6tO7+kzt9oavZryqsCEIZFBrsU4KPLuK3cvtVsrsKAa2w W6hXVltJV6WIn/Sg62yl63oLK1L61y2gSylbq9DasqLkMO4dtcjR3WoK7CKCRcnmnU2fOTHmAja1 GV69piotl65eksWqHEpyijo/hdSTY1TMxpspbX2PNCvFaA5hHVhHbEt261e3bssCACAgL3HYwvx7 P6tO8ekzRv8ALsrfmhBretzjYrLpTYGVTL1BSp8xGwcqRni3LlB9hdea0swWq3KH/wDVvqvS1N6q at+ZQ/E7aOh0+4C5Ddyncqlzp3goljCdzUsdC/lSHzEbJNdZjV1k30FGRwt1a9K5mEZFinFnhThh bqurU7WQtgAVwYTkMZstxTwdQMYwu1uLWLLGsf49n9WnePSYDg6G1yWxBbWpIiWkS5CjJZmK4ly+ W4fIVpcAQrRj9qP9pPVbKWN5LJpbQUsRYuwr031XB1D+YgsOrsiwGNixb9YoybBMdVurpDJcbX5I wIX7px6bFYatwJrWrZVXkQQiEYjICD9jq6MLdauwA267V3dFfkD0HcbcVLWHCVhZvbHkI7s7fJ2f 1ad49J+Gtd5b9t2ELbVAzzxFsDC1DUyWiZV1DNW4fqGBH+rAZWtiDiIQr12AraSllVwddivza62N NtbDG9TzaixkCOSVUEtr1ObkqqSzXbyKWZpXkSpkwD0sHTbB5at/B63gMOYV6EYl9eSlpraq4NCq vHqNDpcUZ7FZNl/NtUGKRO43eZf8vZ/Vp3j0n46ZF1KC8RqGYPXdTBZ5islqSu7rYBYA2RVZkW/c qWgi2zjKWV0vrxKrptrymleFlf3C3SWyJq7FUet3R0PKjmxTwTJm5UXWzYsqp17C1oFgNZ5AdI03 a+pUCamwpCuQQczAMcQ+F9XVLGQ0bCMLipRLFLbG7wSsdBNzdWlWJY/L2f1ad49J+Pb7/LsqTlKw xKr0soVLODIL9QMtNbAtrCyPU9RrYk2UMxNVnGmw1Su2u2Ppo0t1LVUV4sR7FepyQCWhQY2+j6X+ lS5iAAMAZ3GssVr8tq8GVzEYR0DC6riQnOUXB1qbEBhxLATAmF2yEcbqILO4W3IpsxapUV4Cbm+t Yd2dvm7P6tO8ek/EEg9v2fNrVwXBAlrDmqh1aotPLNVwUGbFOJUQbEQkNWxFoJatADWrR1PC7gh1 GUmoZiIBGGRv0lrtPjzpbBXqOk3wDLCwXUtzKbA3wMOJsJ9gbg7aqWBjs0zXu5Aw+NlgA2rVsZ6V ISpkFa8ps2hW2N9nBJJ+fs/q07x6T8lV1lLU92IKdx17RZehmrepXkDGZjfWBw2VJFRU369ambCc A78TWAVpXpgEb4AOn/vQcRYfDugmq4SxWUys5GJemW2tc1sOStTaCanDLCJYOQ2qmRtbYwLB51bN bQtm5s41N7zk27xWijohgUSwpRXda1tn0ez+rTvHpPzKxU13KVVgIu1cjDYW0azcqrELF6wl2njN 9Qc3VqLNVya6MFSJ3OvrXYyWVkAr4Hw3aPNrOn9upZxFLiCWD7rKw63KyMhwaL+BrIZTiGbSc1Ct W9dRaNrcajs1htdqVr3b3turIKgiFgJ3Da81/pdn9WnePSfoB2E81ppXEjRs6W5liAJp2fdcuRcg Mqbi2o5IIyN+vNJXprWBkofkuDggS1Aj5KNTaHVGyHBzxM3aSp6LEbidPZKMxzGYCM2RuMMUbGwh 2tjatWutGVKwBtMPPO/XUrdycy3aus+p2f1ad49J+lRcam0NjIe4EWWZmm48xkDVOq4P+utZh0OV sRWD0IhFZc6dj12rGWbdRK2NixHwdW7DEZHXOygI28I3mnFVoYa2ylqWL02L661W87DqMRhyrpHX d21pVnZm+t2f1ad49J+nqbBqYbIK2XAjR2FNtVgNLt93LjYpImu/JD1m6ArFuFzgWV6totqMsDza Ty2ptEWw517edbKTLLBy7jZUFXIP/RRq7Cot3cRx3bs169qq53KBF2aFqu7gzRmLH6/Z/Vp3j0n6 gtcA2OZTaa7NbdHlPYxNrkGqwGaNuIHBG7WXr2GmrsKJr7AptUo6uQF7kAAuyA42VYa9uAtmU2rq UTe2jdfXcgQbVKhraza29Si23Pa3wyf4XZ/Vp3j0n69G29U/JrL917ZRvsk0twOtVoYO2R3myug1 7diN+UbHau62va21Uo7t3VLYtjBtbc1cbO/Xrkd+umx3K26EknJmT/I7P6tO8ek/w9bZfXavvZSX d/vdbLHsb4KSpsvts/8AB7P6tO8ek/8At9n9WnePSf8A2+z+rTvHpP8ALpouvddLcY/1djyP5vZ/ Vp3j0n+X7Uvs17dVWp2tqxD2rsPadbc7f/U7LSPcFWql38rs/q07x6T/ACuza/t26pdT2KhGr7GE /qexuKN7MTS/qexodL2IZ3irtFWx/J7P6tL6U2KP157bn689tz9ee25+vPbc/Xntufrz23P157bn 689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPb c/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P15 7bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+ vPbc/Xntufrz23P157bn689tz9ee25+vPbc/XntuUewvb+vf/wC//9oACAECAgY/AP6XVmhHxdSO dkVnyTtsT9zz8TQl8CcxXUfGyKpeEb/Ewexrpqef4oTo7vsbN+5OKYpKUPzcC/J/Mm1yiiKp+uyg /wBFyJpKWvoNbTqS0Rk1g/d+K2glvratSEJOq4E7TRCa0fr+6E1xQjXcl4VeSSGlyUUeDg0+pD0Y na5Q1uq+q/UpjXCjNSNBp+lL0GlnkrjXGSFQWFCor1qqP0ZeEYvCNWTuJMrll6Y6EbE7FMHChpZ5 2zaD66kPXfBPPUnCNyMNcHlgjI23CR2VSUVw9ypJGFVk0ZuvfN2WWcrtVLLf1ZK9sFNDU8vD5Yp5 uGR63Z0W6OtiSS4Jf6naCdFsJ+csM0OTQqUKk5G36nFqwS4RHAicVcVKYU+maolzXNpkpqyB+XJB QfhEMawlGhwUuKpNcrCd8I4yJ+k2xt/Ih7juew53Y43wglENEpnDx7KmM4Q88lMUNzO434k8aIpo TjG5K1RF1GTayHQ63ObX+hSq2ZXJ5xSyxgxkkjbf8YwXFxJ7kMlFNSmvBRkUV2xDOt2edh++d4wL 6MlHVnV6o8M6vVEOqO1jOGif5I4E/wCSyfkijxT8ehGDJQ7Rp6kPmgr7PmdL1D2ezKc6kr9y2JWp 2ShrUlHZfNDKY1JIdRMjxknPDwTW42l+SOr04NKMdl0zsUo0dvqeLtSmhQW41kg0E7vodckehD12 Haymx3tXudLymvIrvrhplh4pGktD9iXln0JWDXOFT3xjLDqiUS9q4N+rXCUVxh+hoVhDtRFufwa5 4xXsSThOEEOqJQkK08Dj0qqSij0IxjJMEOjJmpqR8HOM4URVEuiRwJyS/ga5K49lcmS/oNrc0K/D UKv+8f/aAAgBAwIGPwD+l1cvhFLP1Iadj8/F1Y0vxtNq6EbvWUU24If7lr/v8RI4K7mn+x92Ub8s 2+YrraQTF08JE6eHr8NBXnGuhxhUhJIndFUUoVRDpPPwUe/paGmFVJFug5Zq/XrzqfL0pRXCpK2q boh0fqsj0IwqipQnBjjQo+vsKX2XkVy39OORXrVZ4SPycI0n3Pxi0ehBG+DxkdjfpUFNWRl8Du/j a6n4IhVGhJPDrbW77ZGNOhRyOZkSubdr5z+cPYl75KlMHZMS5GuR11Id312E1UhtWr9SkFKkYTjD qKaCarnSFmrhQ6zImuST8LotKts0NMjxlan/AJ3arTPSt32IWfhIlDf/ANDXGgmy618kFVkbwgqx sUbNPLBTQoTmhDXgr7jXDnCNmK+xsUPTkiEmVeFRjwrgo01eWuiIdMG4gquuVspuM6vRo8Ebj/xv 5FKPGuDyQx37RCyNmp+6CZkfgnLUt8s7W/Qtu0rhDRMwyqkhoo64RkjB2PWx/fK2qNDEJakZEkKN hN7YdloRcdkypysjwjCVqTLPF1uVsbmWyLPnBy884TsQ9NmUfZH5FCVhJTJrKJP/AEuWqhZelr01 JHGvo0IeEPTDxix/lD2IeqwoQW2pUn8nwi2y1QrLEsn6YNDeaScJJRDyNDIIIuU+dzkjC25rkd3L yOxfx+5InyiORPNDJWSMNSUJ84+xEEqg0y17u375HZbqtz/tQaPNomiHvp6lKjkk6x/1ZDpjJDqJ 3rrZr7i/xrf/AEydloxNHb6nvQgj/iQRwRjJDw7ErBrhYRhFzqtGQ8EluJtS1ydrqJE7KiyQOy75 Er5koh/utExPCUK5bkfytIbo8IdYGtmQVIOE9Mn+hGxalpbUqdU/xtzPjVFYaKLXY7LYgi75EW6o 63qPI7GyZ+hIngk/2tidukYSVIeKutUyS6SUq3qzrbrnjfY0lCcDW0YL2xXnFqdCBe40Q8GuSLqk L7nSKitROxFtPPp9koa4Ge1MJ5ExNbYUep2WHuSeSh2tH3dXsh33Ps3p4Ks62KFu/UhkrQY1xi4x TR1fyIJjQ7QztcutvLFEJITb+RwuPgIG7VMnkdPchLXQlbnVqXGx+dJJsacbCf8Aku62rjU6pUWh HVEaLx8NN1sn4WpYTH93/wD/2gAIAQEBBj8A/wBeM5kRjEEykSwAFySvzun82H1L87p/Nh9S/O6f zYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fz YfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzY fUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYf Uvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfU vzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUv zun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvz un82H1L87p/Nh9SEIdZoSlIgRiNWBJJsAM2zrvT6vgl713QSnMD8iqj/AEDofUaXjjs670+r4Je7 sA5QAgw3lCWucx3IfbgD8AgDADtRE4xruCOpph9PHh7/AND6jS8cdnXen1fBL3YCIaOJKi/fkd4Q hG5wVLoE8o4LLIV3LK5BwKnpz7wIY9hRheJrE8Pfuh9RpeOOzrvT6vgl7o0Ikoamu7bgEIacSBvZ kJO8sHWdqtdUkyaIcIynFhgqYLNE1xRdhqRrA/7I6eoGkN/vvQ+o0vHHZ13p9XwS9zjmFEBlaIDH tQhEN/7ICKE5irUTA5QKFCEKkYLNNhwWTKX3rvUdOCwO5ZR3olZohpxxRjIMR750PqNLxx2dd6fV 8EvcWjbEoUeRxKeVhZGMS8AK9qjGJclZmeQxKBlIgcF9vTvxqjqakgSbAWWWEX4qoc4o0cbiFlNO CIc8F3i6fUGWR/kE+q+oNzrP0gMTjEld8N7z0PqNLxx2dd6fV8EvcBEYqgTm6jJ++WonDCX+6Gp/ IhyShqEkA4I6eiKihWbUk8z8kAKQFyqCyoDlxOC7wL4MHT5R8VludwRGUHcRVliXXKarvnNLcLIi IrgEYyDNsoCV3zlJsEXhmiP5CoTYpwNjSHuHQ+o0vHHZ13p9XwS9wMyHAQiO0qRlaNkdWVxy/BDU lXcFmJIhG4GK+zp0yqpeRuUCRlg90MofsRMo5QsuVZYEZrssrgE7kz1xKu6oKnFd+RKGUIDM02rI nFFwM4vxQ1taGaT0DsF/i0mruTgUF00QHNCTghqE5yd1E8SYjHFZtM/dG7FGMxXEG6LWVA65SuUq ob9PofUaXjjs670+r4Je4DiXQiLyU9MPRfbdhG4R0tM5RGhR0dM967nFEyrIp5tGAr2qgfciZBns EwHxKaB+S3yOKMpF5G5Oyzn9k5qnKDCyAsEJuexH7kXGAJRhHUEdL+1g/wA1FtVwf4shpxs9VYRA RgQ4NmXdAgMGus0ZNqCxa/asuoqCqqiwomIBWeFj+l0PqNLxx2dd6fV8EvcI9iE2qbIvXUnVkRGu oS5UoCurKpPFfc1iHwGCAiGjG5WWETKRoE+qWJqyuwxKyw+ae5RmWaNB2qjdqe4TPTcEybBcVS6A PeRJ+CBQ1CXESxjiyzQ7ox3qUYkjTjcn+ieRtZACr4rcsFkkO9hxTk0WUfEqlkRgUYnD9HofUaXj js670+r4Je4RPCi0/wC0I6h5Yhgp6loYI6oDQiG7ShGAo9ZIacA8ju3oZqyaqz6hpdl3aRwVk1kC cVmlQYBYPYBCINcVxK4bBI0CGZyu6OxGMYuEDGh/kpAnum5KAjhijxWaZbFZdMGcuFlygPxXfizW kE38hdE3dUossqFOMR+j0PqNLxx2dd6fV8EvcIiWEf6rTiN7lRjG2KjGNrFacdO71ZZQa8EGLA3K Ld471e9gq/NZpFzgpajVwQbvSTmg3JyXZErMU5qdwTgIZrKyDG64HFCES4uWWWAA3lEkZ5bzgs0i 5wCz6xaOEFkgBEcFVMQ4WaAY7sCsmoMp4p4yB+KILHcUd8f0eh9RpeOOzrvT6vgl+vXAOoxNkZbi w7EJfugDjcp3rZ1eqZ+0ogV4qoqLIAKgqUXJJBoMFaqMpFtwRYOSnkgDQCrBMA2yqqsrrKKcUSBU 3JVE8i5wiMVnlfAblWysnKzYYJpRHwRdqWKIBIbcmJI4qsiUSKI6kDmiLjEe30PqNLxx2dd6fV8E v1weCffZEYIA8oLp96FboP8ABHs2URkTVObDejEHKF3fmq2TRFVWp/ZMKnE+w7JjdVKZ2CyR7x3r NKpQQTnBUsEw+WwtQoCVCKFcFRVRpwZSlENCRp7XQ+o0vHHZ13p9XwS/VonKiLBNusswxQ/fYMHC Cu3FMC7psUwWUfFHKK7ypAVYnZU/BMKJgqBPMsrVTAJ07urqmx06fDBPw/dUTlOE45ghvConTYFS AvcIg3Hs9D6jS8cdnXen1fBL9TgqbIyBqgQa4ojABME25ZsQf6oRwTyFrRRlEfBZhYXKossayKyz kYC74lMAQCHA3phQLeVWgW870wG18F3l3a7bbGwxQYVGKYgyPBf8V8SV39OhxBdMTTB1Sqzg903C fBNFd4p4FynANb+z0PqNLxx2dd6fV8Ev0+CYKtAnNgnsIp2siBiKp9yf5lEEtEB0dRmB5RwRkUXR DsEIxqTZOe9qFOaDB0JSk53piLoKm2pVLlOmevscU5+SYX2WTYJiKHBNKIK3wOKaNRdASkKCsUWV QmZV04l94R/xgHeKJrwNjt6H1Gl447Ou9Pq+CX6XBMEN67E/8AhGI7dkuxMm+JRMqABCRsAyO5E2 GAQLPEIAAROAF1mAeTVKD4LL/EFghIVOKxdPYKl08qBCIDhbmsqoEIHZSpWYpk+2uyqINQmvFZ43 uml3o7lUZSnBTvskDcBwm2dD6jS8cdnXen1fBL9IU25eCEsrEiicplLsK4sqBgLlDTiKYlAD4BOb nBVLQFzihDTCMtS27gmTCiBlymoKaI7qDphZA4Aru4prbygxdb1VVCaIVanbUq6aNAnNCUHiSMcE 8bbiiv6og1a3YqKocJ4limEnC7wdE71Jt+zofUaXjjs670+r4JfoMLYphVkw+OxyhIjuYIRFhSid OVIm5HdCDc0kBKgu3+5WeJzlAj4ncjEVOClQmveG5fcPLvdERrI4oMHkU3zUSzxjdEMwTxTSFkQV lRhIXsUBL5pwXGyuy+1wHVSAqVQdcUxvv3JzyyxTYpzY0TjY63FVCLUKlCYYg7Oh9RpeOOzrvT6v gl+hQVKrcoAXcOggBimHwVUAmwK/2R1JnNIcoQAUYkIsKYoTgWITkVI7xTRpEYIhAHm3rPEuCu9b cmFynlZOFmZ1UdiqjA/Arvcu5d2JK3ban4BWrsqqM6qVRFGMqhkQcLJpdqcWNtnD2DqwHfj+4TFd D6jS8cdnXen1fBL23KDJtyAwC4rgFVPtEYhhidwQhpQpG8mqUO6xJUZAJzSKs0VmNhZUCMYh3uu+ aiwVKHcjElmRliLICT1Q3bBvUeIVD3hUKvMFZUG25CcTNME5b4hHNAFAGGXiu7JingcyaVNjjC6p 8SgqexXBMQs0R3J1C6H1Gl447Ou9Pq+CXt8UCblU+af91ljbErJCwx2uUIacb4lDTjWR5jxUiQ4U ps0RSIQiKkfsmO5RiaRsENGO5CMe62KzgnNi6ieFVL7YzB74LNOhTkVUYnBEDAplnuv6J96IwJ9q iYlUKL1CFGK7km7U2rQHEJ3cI7ipRT/sFSJVAyqndO/wVQpf3QqPguh9RpeOOzrvT6vgl7dU266Z VpELJp/EpymVVGAHwQoM9yU+4KUjQb0XletFlCbUKEJRbduQEV9uR7wqCnJpEVWQUhiUwFkQU6B3 I9qBRAWVd7lKEsCgnT7RsBTvaipsIITGxsVREi6rfcmIvbaNswdxXR+p0vHHZ13p9XwS9p1xKEYV JTzLlMCwTlVqqCpQnOvAr7gpIbkIz+a+4ZO/LHEoQjDLp3yipKIygFmZEuQRuWbSJ7t3qVEal94C i1ZYgLOTkG5ZBU4pjbBGYuAicUNzMq4o9roDY7UTb1QuNyysQQmkmehT5gndUVHTz7xO9AwgH7WT 5f3TSFVSxRBTHDZuIshHH+5VYqorimTFPcLUc4LovUaXjjs670+r4Je0AhGKL1kcVwW4JhYUQzF0 0RUJt1nXeYJtJ+3BRlM5msDZCQk0rF6r/IKvVkBoGhpxRiaG5WSIEctSUZmszcrKD3zYIz/k6qGk DdNiaLOcSGQQliFGXDa7JsUxuE4TEOrMU8QCExjVOzex3S3YjnubSwTF1XY2yyJqRwujmcE71Qrg mQ0xucrofUaXjjs670+r4Jey+5BMLrPK2ARj+6Y4Lumqc1ThViSnkGBwW4IGIDhd6krkIVYb0+iW hH+Z/wBlnnLOZXX3bwlYhEBNcA/0VEGFMVGG6604iydE4FF7iyqPinCbBZgg9AdjhFcFmus0Sw4o GVAnBcKiZGJxTYi6fEbAU/sUTSTk3UiK5aLofUaXjjs670+r4Jez2p1mlyj90zMiQVIixoUJYIDK yALMaogJzZDMKBExsqVJUJTsDZCUQwAUYRFAzqTct2Umo4RmauCfmgQi9gqJtwVU2G5EbKUTkON6 cV2B77aI0VasmkKJ9AtK7IR1RlO/eu6XVVmGF0GNGQAxQ9rsRMvgpTN5F10PqNLxx2dd6fV8EvZA CDhohXtgmp2Ji1VVgCpAVCYUCBP8UDgcEwsKlGRLNYIw0w4xWUHMYiu4FZG76JF2QN5zP7BMKhE2 JT/3JjgEd25DiVnhSQWTUpJFlIbHTIyjTsVs39UImnbRMSqq42OKJpCioWIsiNSL8UXHcNk4x2F9 1FQuOKbd7RWYfxNdnQ+o0vHHZ13p9XwS9kk4W2XTxNkA5eSj3qFu8Ue6Zg2IsiTQDBOeR6KgZd0l zc8EIRLgXKjp6Q/y6uKJlWRNSoyI7sseKlDhQKLGkQiyiAcUZi0U+66JGCpYOdh371knVGMqZrHa 4RIss8BXEJpgOngWPBd0uE+X5EIZSYkb00oZuK70cqcIvuTEPuWSVBgVdOKNinlbBPEu93WSdCqF 9lNupBriiMTQgsuh9RpeOOzrvT6vgl7LxLKpdMS0sQUYBhEVJ7VGOnXMWCIJeOZ0RDlKy2GJQiCo yNcTwCYDuqzB6lHUNBAd0ccE8r3KjHAKT3ITHFEpuLAKMTchynFsUZBSmRTAojZmGKzSuLJlTYQe UrMzBZo92YWTUod+GyhZOKpjRA1O4hASDI9i4Igh9yrZNgiJGiiYm6/yRBJTxDcFQsqAFMQ3FMiD dTaglULofUaXjjs670+r4Je06hPDFSJsA/aswOWMbb1EMbV4oRhRroEnui6JCedjaIRlJox/coiN AbBDX1A8SWiE4xsFGRxTkOcPiovSUaoSGKEyP8cLphZFHT3rLI1wT7tjSDhd4PCSzQrp/uFvXHY4 VVHNy/y3rPoEED+OKp3ZC4KqrbOV96ySruRcewQUISDMhE/A+z/uiP3UGvlquh9RpeOOzrvT6vgl 7eU3R1JlndhxQDAsKMnkWejYsuX5p2shki43r7UA87JpnNLjgiZEHUJ+SaH8bfBAm4wQH9q+6R/j hicSnFl9oVRgzSF0xumIVBayymkhgmeuxwmKadYFfc0iz4JtQNxTSsnBdUXesnYcUTGOXUOIojoa 9v4yKErjAph80ak70JAG90DGx2B7nbx3oZ6cU4L7K7QpkcsaD4LofUaXjjs670+r4Je2Az8F3h8E 0YuVnIqLBMQxKryRrJOA3DcFOIFQXT4qhy0qpwd4g0UtP5KOjEMaA9ijCAYRDKiztTEJ443QGwkX C7tJxwT2mLhVumTpiKsvtTtgmkAXT6R+CqDH4UTAZt6BxxComRE4vLejp6gzaT04ISwKp8U0hRu6 OKIq2AWad8H9moW8JwmTEqillPeZh8USbldD6jS8cdnXen1fBL2hEXKBAeTVOKdcUU87RoAmiKIx WY8sw3xRq74IhUoiR2ozPNOII2yjIXsjpyseUqL7tpk1DYoT06TF+Kc3FwqFcdhLd7eFk1CQDaSe 4TEU4rNpnKdwsnlUbwgQAUydGQFQsky4wW9CjEYpwaprEUTv7VExumZGRLAKUiXMjs6H1Gl447Ou 9Pq+CXtHWkLUiqoEII72XbsPyQ3tT4KPG6pdkHujmsLIa0jQFojFOLJ0Dhgoz0+aFwg9JOxBTFOE wuLJsMVnhSWBWWbxmEx+acJmdEHuk4rJrPLTFBLcqViag7CC1V9zRk+mecFZhfEPsIKzaaykMQrJ gKlPeOLICKf2aJwn+aYcgQA2dD6jS8cdnXen1fBL2TKVooABggdpGKEt0q/FSIsECoHipQwuPinF 7IBRDVBug3JOvxWU7CQKhZTaSGtEUHMP90CTQ22mcA8TWi+3qM7U4p3Y4FNqcuEx/uhE14ob1WyM WD4FWeBuN3YhKBfsVbhEGoxWaNIFCUTe+wB1mDJk+IqnEaG6+5o0fBZdUEHenjUeyVGILCV9jYDZ 0PqNLxx2dd6fV8EvZJasimR4BMiEeClFN80AgdxChq2bunZUJ7EJjcWPEKpaUboHBEGoKLReNws0 bihCJjXTev8A8qAkaLejAUdXdrbiEDjiFlIBBwWbSlS+U2WTUOUj90QTyrtQ4ItR7xOPEISBumem 5ZY3wR0NWVCb7irugBVkGVdmSDgy+TL7TvIYoiUQm0yW3FD7kC28LulV2MojcjIoy37Oh9RpeOOz rvT6vgl7AhG5UYDCiZEJtxXaiN6I3h1IDGoQO+pRjwosliQ3xQgcKFWoj/aVPSkWLuF9wVhLm4IR unCzC8atvRiItGXyddt0/Np78QhGVYn+SeJfsRiea8Sszf8A1RAWaBdU+RRB7sxaS+3qhpf3CxTu 6qnjQhHptWQJHLIqnzW5SiQ1UItmAxCzDmN1XaZChGKzA95NK4VUycUKb900vmgm3IDedvQ+o0vH HZ13p9XwS9g60uwIx4oHei6kOLhA4jZGe6h+KjIdmxjcKcDicw+KEhad+1M/BGJHEL7kQ0oFzxCr yyCEDUfxPBZSqBwV9wUEv2X2yWIosmoHiUdXQrA3gE4tiE4uiYBtSNX3ogho/wAnoxWYFAoT0/8A kjZkdMhv/dMfmiB2IShSYDr7WrEiQW9ZjHMSGG5Vs6BozewU4Ti/s3vZHNgpcFCO3ofUaXjjs670 +r4JbGCEtS25CMQw3J94QQUZi1kybcpBN/8ADpjcUTqOqP437CsoxqCgDQi6EkZDG6OibisexMfg cQUIz7shY4FAgoxnYrPChB7vFd498XG5NKy+9Edw8wGHFNGYMWsqEIyj/wAgF19rVLxJ7pOBWZ+3 cuKGrAsJXQmD2q9sBsBI2SyjvXX3SXGIR05UIVFX2XGCoUx2XtgibywHFObm6ER/Ebeh9RpeOOzr vT6vgls+5MOTbgjHA2QUZj+KZNuVKMmOyt1IWcuFmFd4QjKLPZEGvBGJvFDViK/yHBCvwXas4wLx UZi4oRxTSocCy+1ql44GzhZhUIvfBCcRlwnW/FCQLjet4NF9yBIifkFlcZhdUX3IfxGC+xq0lHHe mDMjSsbIGcSIWO5Ag0Nld1QJ0YkXUhqC9mWeAIDuHQIPexHtNvTtXgqGqMpGiOStVmkidwRkcTt6 H1Gl447Ou9Pq+CWyI3BkNQXF1Ei4uiJWKMD8E6qaImNjVCWwSFxddq4xqOxAg1xQnhKhW8WKzQDw NexOC5FxiEYjmwRB5DzLgnDOLFfbmXi7NuVcUZabEH9kNDWrgCng7bkRPFZTQA/shIG+5NRjclfd 0bgvRZZRMZYumkaIh+7ghB6K9Ct+3NEOSgZW3LPpn4BBy0hcJj7J3IgGo3LLFwDc7ckTU/09jofU aXjjs670+r4JbBE2NkxqGRibYbBOPNFMbplQVFXWUpjZFNZrKqzRPaEdxRiOcXWWRzDFDU0zmBuO CzxxR1MMUdGV427E2HFfd0v/ALk0ueN9g1IxvdZTzRsroTFzRZJc8LpnTlPIBWRnaJQYu6BBb2KX Re+JRhKyz6VFl1KSCfBU2yJwDoyONU42ZXruRkcfY6H1Gl447Ou9Pq+CWxwg97FZo80a/DZwX3YU ib9qBW9Zhyy/qnx2ZhgnT76FB/ihONxZCen3T/KOCEo3ijpmjlwjEm6zxqQf2QmMbjijGVigYmjs UCMVllUFZ9IuY4KtJDBNKhTQkIl2cppBpDEWTm4T7CECBlMf3QahVfZfY4DS3rvB4LNDlTjYYi8q JiqWQA5ijKRcn2eh9RpeOOzrvT6vglt4FGM6FsUZ6VRiAnHxTGo3LMOQ7CDVGMsNuXA1CZGJsUUR gbdqMZJ44FRnG5uFmF0xLRN+1XWYGhxQ0pmosd6s7JyE5ix3pyvvAd134ogkk4OhTZRMmLBtyAwN D2qttlNpLJjZWVRROK6Z/ZPePBGQKYFxH+uwogWjT2uh9RpeOOzrvT6vgl7Ak7TjQnFMZ0T4rMzx 4LLLFUrHApjQpxzBMaSGzMLioW7enjbFA71T5obxdOKI6crqhT4reMERKKBkWAQyyeO9MSuGw6J5 TvRNuCeJcblUMcdokyZuxZJ0kLJjbDbRVTxTFMT3kXqFKINBZHTiXkdye5NSU6MYl5lEm59rofUa Xjjs670+r4JexklaX9Uz1UovZMzxNwgAKHBFg43LPLuk7kwNRQp7SRMS+8ILNCm8JpBwUBK2CYrN ChW8b1UEEXITA5ohV2F0QqYUTmu0CzoEUa53oEYqu2qNFZiLFZJlpiyYnb3aIuu7hdZnDhCMOXer s92QYPvKBRhCskZSLk+30PqNLxx2dd6fV8EvYcXCBfvRoVZOFElUN0xRF3AKeyzgqZ3KivawUXGN UGorhHsTyFN4UsRgmwVNgy3Klp43WXaCBUISpVZTcJsdrJ0xsUJQLSTTGaIQBsbbSEdONge8UwCY VXZdMSwFSskKRTn9DofUaXjjs670+r4JezmgWKH3AqFih3g6YkOnTyDUYKoTxwwRagOHYmdFVDuF Et2KyZGLUdGDM4cJjtEhQrM9Y1+CExY7WOKe8TZUwQkDXEewRsaV1Q1QjIVFmRIJDbllkO810STU 0HauJ2VUtQlGRN/0uh9RpeOOzrvT6vgl7bhNK6cEj4oSjMlrgqGoD29qe6IFFEirGpRX9VIM4ZAG 4ohsExZRletTwQOBQ2FrhZybL7ZqDZZdjog2RG5Z8MVc5UCDfa2KYllmzngApak3Aa5KyiVDgvuz YNbigbAcoQOxzQLJA9yP7/p9D6jS8cdnXen1fBL9G+wjcQUQqFFrocU9kTim/uFO1McE6cCyfchC RaUbOuIVFVSh/GVQiBcFwhMFjiECNlFm33TGyy3BsvtztgVRVTpzfBldxhVNKZED/ELLIBxigLgY IhxRk0e8U4DKsqbh+p0PqNLxx2dd6fV8Ev03wNCgxQV2R4FP80adicXiVHcUyIOKnBnOCYUIxX2t Q9h37cwuE5TjllQ9qyS+GxsExHxTu3BCrIf3RumeoT3RJLCN0ZH4DgqohDfiskKzP7IyJcn9fofU aXjjs670+r4JfqMTQq6NVlJqj2JyiDYoNhZAqqExjQqh4oSiWnGoKBxx7UyIsCiDcFZVlJqLFAk1 Tgpjdf5Reg3o914mzrPAEbxwUSJfBNGsjuROoanlCzEsMVzOjqTk9KBH7YyvinJc+4dD6jS8cdnX en1fBL9VgVUoTGBqgAanYJFCqMSqlFl2YpiaoknuTr8U93xV3WcdhWXEWKAerp4yd7Jye1HMz/ui 57o5QhmlVVks8S0Xs6aAeSzSPuvQ+o0vHHZ13p9XwS9wY1iuVMKBATq2KExIEi4QIKY2TQLmWCe6 bKvtSkBHAEo55CIG9fa0K75LNdDMADin0ZCYNcowTEU7U1uKc+9dD6jS8cdnXen1fBL3R41BuFyI xgMr4ozmXkcdoILEYrvyMm3/AOg9D6jS8cdnXen1fBL/AFzofUaXjjs670+r4Jf650PqNLxx2dd6 fV8EvfMmjCWpNnyxDlvgtQR0Zk6X/I0T3e1f+R9qX2Xb7jHK/b790PqNLxx2dd6fV8EvfOr1dHRl r6v2hADT1TpagjKQzGJjXDBZOn6mWrp6fXTl1s56maR0jpj/AJZE94CoWpKEv/1x6CMIwEu5/wCR 9z+1+a60NbU0BqS/8+OnqzJI/wAOSMiDUUUNM9Jo6mbpuo1pSlKT59KZyCkqWXTavS6cNIa/T6er PT0+UTkO8zkt730PqNLxx2dd6fV8Eve9Q/8AcdXqdNqiTacYQlMGLX7oOKzQ/wC16iJ3jS1AfCi3 /a9QM3M2lqV7e6sn/wCV6jI75ftajP2ZUehh/wBrrx0DqfdLaOoJZmEb5eC//q9Ru/4tT6VX/tNc tQPpan0qMf8AqNefUaBi8pziYESezSA966H1Gl447NTp9R/t6sJQm1DlkMpXJq+YVyavmFcmr5hX Jq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcm r5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyav mFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+Y VyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFafUacN X7mlOM4PqEjNE5h/6A//2Q=="
- width="480"
- height="456"
- transform="matrix(0.0649,0,0,0.0711,0.4697,-0.0151)"
- id="image30"
- style="overflow:visible" /></g></g></g></g><path
- d="M 9.085,25.873"
- inkscape:connector-curvature="0"
- id="path32"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><rect
- width="6.915"
- height="1"
- x="9.085"
- y="203"
- id="rect34"
- style="fill:none;stroke:#ffffff;stroke-miterlimit:10" /><image
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACnCAYAAAB9/eyWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABW9JREFUeNrs2olu2zgQgGHJZ5vN Hu//mNsj8RFrY4DcTGjKdtMWoaPvBwaS3QYmRr9mSEpdBwAAAAAAAAAAAAAAAAAA8L70xvlhGcj4 +8ZEyJ8XcSDjj4+lPzNGUl4v4XDFORnPiNdfOMd1Ug4XzpuTsm/k9/uRmBWfVcbrKuMQ4lB8HiqC NsGiMRFnZ4KUPy7hWMS/61sRcvHOv1+TcJ7GNS9iVqmcOJUwi/hUxD4d+0LKyVfGviJjlvAYy+IY 5cz/X3V8LVNux1G+Y+zScRa+K6tpE9Xxvdt0rIpZvlWKdThfVYRUHU+rYhRxG2ITOktXVNBJt+lz VfEo3acUn1Osg5g1IclYF3GT4iFMc7rKoqZvpTq20KbLqngU8Y8Qd0HKZRBSdTytirktZwm/p3zN QiuvLWa06UplXCfxjhL+9Rx/Psd9IeQiJHjKK+uhqHR5PhhFXKXcdmFRsw9zyN5q+nVVzDLmyphl PIr4d5DyrmjXs4kvZIai2sX2fBTxSxCxnEfuQv4OVtOvhYxzxnUS7z6J+E863idRV1r1aIvepqq4 LkQ8fv9Y5K7sLJNr0/2FNr0KrfouVcQs5H2ojksynsiY54rrcF2fQttej8hYXpNhKjLWVtOXhLwP VfIuLXCWZxI6NRkPQcbHcE3z/PHzBRGbqY6LBpKaEzIPQi7Dlk6WMotJxnEZSxHXlV2IZrfFWnkC UxMyV8lcKT+FWJHxRMZ5IWJ8WDD2wGDSc8ZLK+uakLlSLsOKeznx7Z3atk6eIy67149Ra49Sm8xV S226No+cdacvTERRZ51N70PY4qm9XDI2P9Smr5By7H3Gc6+WTVnGrht/3W42ktcmWTQ6rv6CpF4l uy4/3S1NYRY3nuSbSvZvqopvyVeTzG64GuCD5WPmOoKMABlBRoCMICNARpARICPICJARZATICDIC ZAQZATICZAQZATKCjAAZQUaAjCAjQEaQESAjyAiQEWQEyAgyAmQEyAgyAmQEGQEygowAGUFGgIwg I0BGkBEgI8gIkBEgI8gIkBFk/A0MLt3Hy8ei8QSPBTl/Ll9kfOOdPnyERL+DgMOt3ayLxhN7KM7L ONJPXMZaXmr5a/4GXjQkYVcR8RhPldiHOW8/QSmHQsb9SJ4OFSG7VqVcNHaHD4VwOXYh5ulvDkHG KVbHeNMe87Ut8hTzl3Ma86wyVu7sGKWI2xSb53gM431KUpLxRcZdytFjylfOXU3IWqVUGUdE3KWE HuPhOdZhrMd/X5JxVMbvKR5CDncjQk6+Mg5JnqGS0H2ohA8pqaWImyBjT8b/b+R8Ax9z9jVFlHIb hDy0WB0X7yRid6WIX8IcMYu4SuMm42sZc/4ekoj/pvxdI2QTW0AtzBlrMn5P0s3DHHGTqmSWcda9 PEGaqoxdWDGX+fuShMwVckxGc8bK9s0u3NmLioifQ8teTHhb59z2zr7oLF+TlN/Sd3nFXW77dGQ8 rYybsDDpwpZFXsQsteiLrXpXCPktyLi50KYnu7XTF3f1rGi9+fvHoj3PCxmnTm03YlvsRjykPG7D ylqbrqymY2Xsg4i5Kq7OiEjG8X3abfd6n3Z7YQEzTFHGWpvuu5dHfEMxIV9URJzywuXcQqb24GBX HPfd6WNCbbpIZLmoyQmcd6cb3KrieHWM3aZ8nv80IqInMJW7OiZzVkQpIRnrK+tzbzmNvTjRBH0j v9+PBAl/jZTn3nccyFgfQ18RtNOW39y2z503JWJrVaa/4lxlvK4y1j43/+Z3f0NjIuHbpWxawlu7 wET8dUICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwJv4 T4ABAGzCmEeBhCMDAAAAAElFTkSuQmCC"
- width="159"
- height="166"
- transform="matrix(0.24,0,0,0.24,-2,-2)"
- id="image36"
- style="opacity:0.75;overflow:visible" /><defs
- id="defs38"><rect
- width="18.552999"
- height="17.054001"
- x="6.783"
- y="4.3000002"
- id="a" /></defs><clipPath
- id="b"><use
- id="use42"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#a" /></clipPath><g
- clip-path="url(#b)"
- id="g44"><image
- xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEOAQ4AAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABhhAAAxyQAAVQf/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAf4B4AMBIgACEQEDEQH/ xADOAAACAwEBAQAAAAAAAAAAAAAAAwIEBQEGBwEAAwEBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AgIABQMFAAICAwAAAQIAAxEEIRITBRAgMSInMEAUUEEyIwZgByQVcEIzEQABAwIEAwYEBQIEBQUB AAABABECITFBURIDEGEicYEyE0OjIJFCBDBAobHBUFJiktI00eFyIwVw8PEUFTMSAAIBAgUDAwMD BQEBAAAAAAABESECECAxQVFhcRIwgSJAkTKhsQNg8MHRUkIT/9oADAMBAAIRAxEAAADwQBwAAAAA AAAAAAAAAAAAAAABwJ7uac4eRj7eus/IGnmV1AHegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAASCLLu2kaXoIvyZYcZKaRh3pxPjfbZ128eThr9IAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAJX+cp+jXrQxzapuaXZ86lOSi3nYRbAVUHJpHG817bH11wDUjXZmnedoAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4Lt+FyOBlhDZSa1VqVpRl2VJslGTRJ1m5yumnpm7N ai71Wvj27MD2mYvfOG3KvcqG1bXnlZb/AGncJe7V1Llk4QcOgcA4AAAAAAAAAAAAAAAAAAAAAAAA FynocXUsKdHzZWq9mVWsg6FS3DkKE4oGnkiNJCNlNXSN6OmU+co7lWytLTDWzdyLOpOMoprZ7Tjm 6Td8PIWt1HoZqPNE2wyM/YR3djEo+fcA4AAAAAAAAAAAAAAAAAAAAGnmbKzu2Kz44LDq1iVrT63c 9myWjlJ1Icsy58Z14R7AfkZRKEJqLRu0rJbZml+F0oQvRgsQhF+WLGe3itq2+vkWmM/X8qjV3Kmy 3namlm4vTAI9AAAAAAAAAAAAAAAAAAAAnq5mmkrrUtnjsOSSs6aGJYj05Tq5LKQnDnXdXI8rznYt aaOJakmU5M21dyLWe/F8i2YEjJatVr0meytYll7l61avnZPHz9TzM2l6Kd6eOr+28omyoBLUAAAA AAAAAAAAAAB0OMnYonLiHyjaIylBzkOnZnVE7tmcSvYMSU4mdZqNTWS9LSEuaqy7ZNlB9iK6IMig TqiD5pOVa49l1V8OaFio7P51hJWbCjrEbPJcHNmbuRpo218hy3Ux+4AKAAAAAAAAAAAdAf21ScHu X3Nzi+wpbatspysIsJXjVvlobXXV5Sx2Myys/RovWrYm993Grkm2fER6NEs7MSpvY8lNo8OQdwnZ VYjHthbpY3ItTTHkduZ+zx5zrWNuTknmhKVD0K6U8Kn0/mIeuASsAAAAAAB0Cx21WRbg/uVUOwiJ eizK7+xFVj0WJaIqtdWtC6x89NKc6vXbmaNR7trOG1Sr2E9aCJxeDgetc+6APhJia42F9Ttl+f2e bQ7StJgu2KT5YlUGx1+YmM2W8+mXOVFSnDYlTzHp/MP6SwM20AAAAAAt1r1UcxkmxyO1pIIkR0MZ DqsyxWvzq1la7F+JsrWi4s6XrzZE0cW6oVUU2Xa9VbYXXlRuLfPWtJd1rMFRTQ3ihpNYpqzc+s6U LtyjazwtyS2Oarn6mbs8xUuT0ee7sepTkuM0zr+f9PX188KWqsvcAOdAAAAdp0tTRln2MUyxr2Kk LDIyTR1vfQwpyzrUvNr569Wdt5GL3pTtd3JXqynXo9ehdXZ66r1aluXK7ua0lil1ZLktp6Idl6Ue MlxUFmRFVib45a1vvUxPhNfMUqXIafMh2PLYmTg8Itmyva0b6NcsPy/tfG89OAEtoABODmLtym6u KclKz870lO/XmjNj1XmJY7erzcRUWtCG6uNnTRx9euhyW5WB6tyNTNer6l2m9mvrs7odTtQ4JQ57 Il9c49ptGavd7V6nLTE2EyusU7MslzvIyy0a9yvt8mKXlMa3o6xZfWfbrlRlqTK8j6PzPfRAIbQA OvW+i2pRu8x1pNXnIxgwtGa7PBEZWB26mf2Idqba2jUuUkpcq9r8tYk3nNVCSJ1H0dGgW5MsteE1 N49Jlio0byHslspscpsq3rZzNZtU5xlpMq3M8YVL9KmNaur1+V1ym9hyLYq1eT01Rna3PRli4tup P3QBKAAMtI0aRnaTPmKdOypeqg1c7dsIaveTXLjtW+3KytbPtQrQ0K17lqFPTzXbQRapJpz7tTao 9eq9Jato5+kXRCzXGiqxBs67tTnG0ZZ1mdHLfanCld7NcUSxUMlqpyFMio95p8x/YSVZyh1HZCU+ PVyd7P2z8Yd5T2QAAAHXsubrpuoW6Z7EYznAS1GejJROPLrrSVXpUdjPaoiZx4WqVrlKT6W9y1BN vM7RexnafNSM/VqHczSoSsugsnPbUZMeKmsWuZ/FXE5WdY6kuXFSnB9SwszZy7Mdvlr7NbZZJmwE sexXSycFfnIQ1w8jT28S3rgHKgAAAWrmZqVnM72GZT7CZkXyclZrvshWveWudVolf6yKmnij2NnO 0I6kYPpMlxGjiaFKX1Mln2Z9bRraM1NzYsWG5tyeifLQkkrtWuZM+9WkRuRZGU6LqadeN/Fur552 UlSpN9ZlsMqtV7XUNK8qW6HoZsHGsV++wALQAABoP1W8n5/Wrekaj4XOW5GfJ2tcgyV+86LSvv4e 7CtfG9DiDK08m7Sl5FqOXT55elT3QfdyrSabarPI1ypaGfbNahC2vad2fFWx1F2MoZurWfNWfj29 OaWfbRfA5+Rpk2zXOTdW6PGRIhSM+RNM24Wlh6/RxgI7gA4AB3XqaiZnd7xMMLdSxwRZqv5VrUPn ZV6lcnfi3JWq93EvyrpZeqrJTz/Jt9Bb1vD1cemON6Oi3KFft/QtXVoJnXUjJsTNVr0LZnOzdJTt W9nEtBNR7QRVtQ04IKtcbPmctlGc7LsJzQkhsbEG852tT0cr0o1s+/jafpawGfEAAA4NG5GcvOsJ fX5GTlt5yvOair3IsTquzVml9avchlrlNTYu+tYx9vzrZCtjzujliFmTNbllaMKZ9TfxrzsspXDs XyqoaMFskmLauYuuGqtR2OZeqI05dBybCQkTJWoru1L53w5YXqS5xK12wU03Zelm77UcHaxLe0AR zgMCGyu+Y+SkSysWziqtqW9GVrdRWc+m/lu9ILXU0PP7OW1etqZHWZoVVcp6PO5fw08vrLqbl1q8 mwZ0aF1TGdfxtM9R2c9SroZcay1ExiZarnjwq5uzk15bvYuuvH9jLPaKbC2SMSTTG0+dLtZqLcjn zV6fp0Mi7ShtAEgbGPpNLQmxHfPtVrCYo51Zs1rPWdpZpWI85Dq3FHp4cZ9ipZnbWpKv52zLFOVX nsZyJPtee3ayKq35/Qq12lYyxNpVZhPM0lV6ytZV6s83OzNDqWZwdFV0NKs3Mx0+WbQbk6EeWhU4 2hxkWRdO1i756eYqW/0mc7mT9qjEM3mgBwnAD0Zl7VfNU+tJJxdBMmuVXQTk2VZnOdkgo9qOissV Jq1qzUrJ3Wx9TP4XGZ10ZOjh3zrM7SR2LUpf3lTQzLDdutqWJw7XurVsPUots+ixLoKLZHnakLdW 0mV3v51T6fed0IrZOlbA1aPta4znTr66M/hhgAckAAABLbwtJ47VKTq4Ekko3HrTJpyFq1mCXIs4 pBriuu5Ltfkjr7eLrKlK1aXziEX6HS1ZzdBUeppPtGrOreujaq2Ug+PST5dXUz9D6NrH0JzskWxo lVlTTznyqX5qqRZQqWM+vpeQtvpe/LDs5mZgCGUAAAAAAao6emdja2ry7C2J7CS7Ihm2GMnTNho0 kpOFyM50LtW0lLkW2YwwWORW2i9FyETH280rU0c3RoluUZ5qZtHVy9K2bmRoCXeHYPCleW88ya7l mbZzWy5fV3k2Xn3cn0BIzm/1eDKprsUKqcvO8CUAA4AAAAAAAAWK53ms7DfWO5b872s925jaq4eZ 2pRTts5YnLFurEvquTYzJlU9PIpTWuUL0JsoaCEr57XqmldZtW1l6iloqdMN4nRTXsZGnCbITghn o0M7SX6/Xuma6hbtpbRS7VvYxfH9GeA+rkgATgAAAAAAAAAAAAAAAAd4Bb3fM6lcu7X4imBunjbi Jn17tJXv6ONsZ+IxvQ5/e0tLKendiPZZ6Z9DZxbyt38m0hfgyEXpZu3j6uRsZb2r6GFW1DOjPfjb 9Dp9Zt9au9SUqtdPmSblxFQA4oAAAAAAAAAAAAAAAAAAAAxZ01o5g8tH03iN7uW9V7X7K5qYeikt anYhyeJZpQNG5bxNaKSyNfNpOhYx7PdnoLOPoSyxz7nl9Fnyrtt61m3iTnGxQTFb6LsgGsVwRADi gAAAAAAAAAAAAAAAAAAAAAAAAAAAE4AW1JOq3WxJC+0f48r5+nhR5P0LNjOOd9hiZfGj3Qzg16tW oC2K4L0A4ABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAejXBSvTsO+HPQbYeENjHOAAAAAAAAAAA AAAAAAAAAAAAAAAB9GA+cn0YD5yfRgPnJ9GA+cn0YD5yfRgPnJ9GA+cn0YD5yfRgPnJ9GA+cn0YD 5yfRgPnJ9GA8brbgdwzcAyFbgGHk+yA+cn0YOfOT6MB85PowHzk+jAfOT6MB85PowHzk+jAfOT6M B85PowHzk+jAfOT6MB85PowHzk+jAf/aAAgBAgABBQD9PMNyiC9YCCP3LWASyztOwx9JS/U/tyQJ Y5hPBMMBimVvx2H7UwmNGOJnnJwozEQxcCFpXcM+VYbcFLqSRVW6kEHB/Wb6GPGPLcr17NXWFAM7 TMwBLbXSfyrStVNhKXMhouRypBllKsCMH9N/oY31InUmKoEJnPwEYcN9VROvMI5SwKda9XAYzYXF n6bwwiED4CGAfALOsesFgOMGOcQiUOVNew0Ldw9WB+iqS45YxoRM5ggHIQzqBC4E7EzAMxDjDCMG 7VqYh4rYysqQ69W+dVxGMc5JjRjAkMT6locwLMTAEJh4jkRiIHwa2DCplwpnVWltfQ/Kq4GZYYYY xE7CO7dhyE4g4A+vEJxCQRnEbJhrJhUAEDNY6zODXcREtJl7Bk+SocscxjCYY7RsAAmZhJIWdeMl YDwcEACYEOY0cAwgg0Hg/QfWtoPuBGPkUYVjCcwmXXLWqbBexvqXAg7QZMXAgJy3MXkfDsYXjWQu DF6dq0wcTAMRZXLVx8UGSzR2hMZjNihrhTolWI58YnUCAESvgLCIDg5xCAYVzCojBIwWAHNZOASJ kRJWCJeR8VGA5hmJgT6RlyXIUJmBcWZ+7HCHktgmA5HYqewMMZQYwINJJijEaAyuwg1MCHOW+A+m IwEPwMZwDZ90sY9kOQvLO2Cv1sPKnIBhCtGQiF2WM4YKe0RCCPoQYRAcGh/kVp1j/T4FsS5sBeFc fda3RE+4Wn7q2GWAYfQlgZnMPYQ2RuZXkFTx9ZkgFxBhjUvJGD8Q/wBrvmZjNC5w33RmCV1Hst5y 1DiWJmA4KtCwjIRA8LsIwDKv1FeRjAJgYGMoiIQaV4Y5PxLEwxiZ/cjn++znGs2ZauQrYKtlbEyF bEVg0PdYzdg3ZTU2GNQzWMB1IhgMHMqQGFeqfFj8GjQ/V/qP8r1LCp+jky+oiUW4hJWOi2DJErsD SxSDUMwVlWQkANz2jJCpgJE0/ubYPPxP1EP0+saMMgMQzYmwpRqH8ilwI9RU02BgykH/ADgVlKf7 FVMHoGDcTJyrAgkieQzAaaQIa/8Az+DDgz+5gjCYl1eDWSyuocBWpsOLFx1hrKsh7hq4a+yqmJ2l ZzLF5MUz6E15lNRlNfQWNlov1cQiH4CGYjATqa2Kgh6xYKT0L0gyusYFZBwGiDEKgRjiVmHBDpiE YIM16e4SgILbML8R9wKxkx8MfAiFYUyqDEK4LVgxeB1AhUEssVuW5DfURTmZIhUEBcHUTFVjYQnP yJ9SpMKmGuFZj44jCdwYpBjiAgMI/wBB9VOQ6Q5EUz/ILWwZNckrhVusz8oiEMrDgiFYywrGELEH +znEpb7nh+tZ+11+CNgt9GQEAETVp7kVIpscBWtJHzAkRLMzAx/dhCI68FeVH22CVnDMMhxgo2J9 RYmIIgJCUnJoMoArj2ASyzsf0kaGARhw6xBLK8wLgoOLEyFBlYJBXgVnNFYEwgHkCqbGJJJ/V8kR uTCMxUhWNVyqYHjJnhPZawqg1GAVAtYSfK8JJ/Y9jAcQWARmycwucI7KWcsSxP8A5R//2gAIAQMA AQUA/TJAj7VawbixHVx+5svVYzO56QjMot8b/t2YLLryxAgEAjCOMTW2OsF9Zb9oTgXWHIECwCYE IMNJMTXUQJkKjJOwmTC2Atit+wsP2k5IEUQCAQLAsCwJAmYaBgoBGAMNIDXX2LBsNmlyV/UuOEA5 URRAIBAIFirAkRJYnDKe3SFJdqhxZSamo2QpUgj9O76ARIIogEAirFWcRG5ZftNXPQQ1cWACbKZB Kgrt2LNba8p/RZwIT2I4KxRAIBAIDER2lekzRdepJapWMJXVk3YlmJd9LR9xHNDMjqcj53cAdySi gA8soiiARVnTiihQEKKG2FwHBJsZilZMLR0YyysyxJsoQzAiFmi7VynXu8qfLZZLH5UZB4CrkqsC xEUBRyF5P3NYcqSxiqzKlbKwQsCEUWXKJdYWL5mxP75MwmdHGPksbCl4o7FBidcxVggiCJgTvKnJ boHDVYNXZWa22G14zExmjvHabXImRgqJTcabFYMvxvbnBMqAMAirCMARRARAYEJhQAVcR8q5Y5wC Cix6Vj0S2vEtBxe3wAM6nFleJoOSnwP0cZITMAAA4iNiNZAYGi8xYeWs4iNLBkBO8WyxIuyBH2I9 thju0sM2wMzOIDHYMNBcV/BjgO4WBiZlRGtRT3gOYogEHI6jpUfuuBxUhNYM5rZlVw6EQkiNaRGf MuOBe+YsKxlxDXk0J0q+FrYj9zE7iKTGCmAGKsEQcD/JieusnZXIK6h/12LiNnCXFF86GWBGli4j nEtsjnLQGYBCYSz4tUrG2srMcoDAuSsUfBTxQuWY4OrxXapIotKzsGVlwpYrO6mNxGaWkYucgk8/ 3FZM6uodmmu/er47ByoxkOWKxQIIoyTwaeBaJRbCchxiK7CLsKwsAjzyGO0sslrZIWFSIrtO4Ms5 ehOlfwJwLLmdmZp2wKzyIJXGlbQ8j6NVbH5hJU91MLkRnBlhj2cWuckMpUxlzDlSxOfWavkb47Fh xHg+ginMBiGHkAyt8iwRWzFtIjkGMSD5Mx2xLLOLXhzBZkfSKwMZQRXWGuwtWt8CQBY/Zl5hPCHM BiGAxTFOYeCDA+QxwQ8L4jMDC+Dbbw1uR/keo6sOpUAw1DHZkOmO+3sEgwkCbN2Vz9q/5tKj8EaA wNA2ISCA2JmduO+CbIbOLbIzExcKxAVhHWfULaRLGBnqdVg+ywNs2ATWPuVDGEbkVkK2SpQ4YPid sQPmB4bMTyceXl7IbwQLTm36oMxuD3UrkqVbIZREra19TSVWJWqsnJhGZahrdlzMBgnBZIPuXBwC SFbsK7AC1hUu/wBq34LWEGxszJyVxLPuRCcMOICZkidsj19eQqhBba1h+OwgZB1SDqSQrQTHVghz no6jq96FWL9lrbMcYbGVVcp/c/StuCChGDHXEHMJGK6LHbW1wibFgx8hGRfWyMv1DEF7CYj5UWsD YVKqTOzMirk46tb/AJj6KeXXq31B4jHgHrGORr1l7E1UlaBRZfx8xAMOtXl9JCbq2UVEQ8O5yifS vBWvhnlhVxUchhhuGVcgtEII5Beqzpq6vjSpMS+zs36W1V2VEM2AQycheGJ6k4zwQo+4HqzASsjs 9fDnE1NcuUoXIUKDa0LMf1CMjwLnc18itDLVKwuDDWWTJARv9j67GMSs1ddrCKa4dKgt2Ai3MCWL H9f6wIoltSuD65i1VK1o1SEVaddbBiIyqx/8o//aAAgBAQABBQD9yATOjf1mrVvuOp/zjvK/Uamu P4muy3+m17T7L09uof6pTr23vp+mWlk19emrgAZshNYUJLa/IvsdJ9S/+oqjMdT1N1x1dWnXX+Io i1V2Bqy4VTSnbuzhGnVgPaevG7TbW9T/ANPpoe1vX+uqra1Kak8ddVYqW9FyVANQD2OWtRYErDOu C6lV9v69L0ZSjf0xVZmp9eANLUXyKQl95CyylSlfksqqXxQJa9r39ICerFXPSvo3aWqSNz1tN5r9 TWtm766mtWVl/pOJp66oFr7LWhWipQK66g6kWXqj+Kuqu02XNY0RAge0d8VKX8bGy2tZs7NYmxuO 0drGNFLZ2NKuyixGrb4Uadt8t17aWgRjBr2GMjL/AEDVr8ltSyqryFUNqojXqq2WCoeKqmt67L7X siYRBaHbNSTZuWtb/Z4VrXY2FmhrE/2EYPbW1GfX3fWrYaPQeWpvW6VVdYAiVrZXZ/zWxY7ei2qF fT2altqrdba+jQKxhRhMH93oCUjq1RZDrlzXTmpNcGka/fzXO9rgqleu/ePcijY2a612tou2Gdmz Os6nJXMCBYNphLmcnWVr0/8ApmYD0O3SNb17VCnTSuvb8Aryom966y2HTvZqfWgBdQRtde1unVjY 1jV+60F4QjupHl1n6Nqk96lezY2LAHe1Kk1z5Ky4AuvCLbaXOBbY5XDMQQTjAAJE4ALcoGZNJSDq 2GXWGwsaqxue1ftbY9gGFCpkbOt2lSDJqdi1IrW9CGtqDJYhR/3Giv8ArGCjgNsVgHbbqNvZtWdU rrUI6Gx3F2wtYezMsYZqpYKVJgUAduoJJg4jtBknWUtKERUr2BWLd7xKPaNcxr6DtKFNge2quNtK 0tdS1N1bV2Esb6S0yynfQCz9x60KaQAtLDpD/pLp4qwFSPZ2d3Alu0Svc4IZoqqWNn2vaxDGwn6n PaHmMVyHyNdkRtawdVZO3tm6HXVKF7hyXUwbFtjIlSxcsW1xYLdWyo1tWwNP27WqrjdpZl/b0p5L NUgAAiA5gHY9uWuLnyMI7EkL2lnUB1woDGuutMdhk2AsckfUOyiM08gzXbk6d7CHZVVufyWGzgdm JKuUfJpqErRYGGbEpddvXyy7GwkbZuYWat9kf0t8v0digftdcHy6v+YciKw6lhlizRYeWX6llDEl nsYuAv3Bjh2YwBUhbI7oA1wJawRrBFt51XBNlmY9gAFior3ByLMzXrMr4HkJNKkAiX1ZBALeFQVr AgQSzXR6/Y6o1tj9mlRaUoFsrISw8hDwvABg/wAfJiKrRVAZ/oOErwGDAWPYAXsEsuXDWw2mKltp r0WMTURRjo1lhwzkxmGWftNcDNZxPJk6VBYKvVmUGWLibVcr/wBlYBEIMIGPbapsrIIP7AAk11RV wFqdTaOdewlF4gPK8IW+3qWYIQbT92VA8gARnl9jV2WbQjXM0HdyupY0q0lWBFUfSFsl6w8uWxZj gqYleTWgWK/KL0XX2eii6vJuUg7DKXIYITW/cZawKPLmbKN19hUEs/XAJNdeIlbE+EgX2gR7Ow18 LE5g5PJArzao/wBiusdgoNw6V19xtXgzc8jRUDMmpmV0IkAEzM5jnAXID34BctOYqRUCjyFjSAkF imKUMrNeE62C7TVgO9TO+ErbvHqwTUxiazGX+i1bjsf8ygXZ1bdWz9QAk11YlVOYECi2w5trKSkS sYKcBcBauTUeOyqWvCmy93NdKYYh51WbtxLrrlAGGO/JPUebtLLesyDC462th1GYFgUKHsNhppOB SxNeuMLT1lVIMSrEKHG1UGXJU/7Knq3a2IsqYCxc9sq75Ht9dL6SMH9IDJqrAFNWYigCw9VqT7bG 8j1IAKgCycgMMZFdfk6K1jNB5LDTpnXVrS79VEc9UK9trbZURKzgYRdhiFNgRPMrMpJDMSG7FqAC v2qCrWSupVCARcSvEaxElV2ZW/Ng6i0qxvQGVj7XqniIgN6RNtlH8lGm04IvXrd+iASatZgQiqtS 8Ks2Pue5hXXUuSkqBLK/21ZATUsefxVMsqTHr7a6rNi9LXv6otbWNG/wvQ56Kx8ZAyCt4DKpGFrr c64yvjBj64ytBiVBfgGAnlUA3kxbHiVuxqrYivXMKMFZmS237lXIiw1hp4us8eY9OZsa7hL8+b9H TrXKguRX9ir9rnouVAYm1q16jPULkTV12ua41Iuv2aroyiwMjfx6nFY8S2KbJr0fZcwRnWplYipq rwxNa4sq7NbWEsZCSuc6+wSWdFh2EhvnlMBZotbmJWoCCUosq6wYMZczZqWxT3DNllqBUr9DgwLg lMhk49364j9FV7HXq4CdV6khh1W27KuSwrHPbknlFLH+Ldr1moEpSERnWMy9V7MvSEdCHV4+PHZe gS+xnal0Va7WwoWbdQBNeVdCJWFsU64aHWxCpWAtFd4LIrJKwGNVLkJVcsrLrPIrSzGNjKsTKsBA cQEEAz+zYK3UrYnsdNtTY+ehcnXXg4ifXau46itQSYOAuSUr59P6vqN2hHdqSNhyBWV+2lMIuuK6 vGa5cHLGtVmxsBHdWZhqlpdUENYZCj8bTMT2Br7ZND+O/ExmFBPEDPCROjymo4WlhFH3VvcoTYsx /ITuzki4ZKTJx3xPKAEszMsYewmZ7zV82t8wGTrpkgBV4jW8CpUljGx1XECkxEnp/TK4ZcnfpwNf AtbLGuprGGuEl7W9i5dbbJdsKi+AOS6ZBM2MG9v/AOg4Fqhq0wIGGXGLlOV+A+AURFxEUxqV7Coq awZta4YLdYI7EwEqwBaJQpZaKwVRBBjBAxZUvXYA62r1s+WtcnUAnYCAvYS6VSyx7CqTqCaaHc06 Qrt1Hp8X0PtvZalVVDZmWLW7LVTzU2y6xQbb0WwlitaL3vACfW3v9rcbLY8uR0GCLEC2PWGFh4q2 D1W1WiPyIDPKgg21Eq2rWld1oK2o5VQY4xNqoEAFp4xHrZYtqiDYpJVwYmZkMHPG6/Q2t2s+WvgU fag/2F7jDmAYAVjKqAJXZVXWNpIPZLULvf2Xp0qYVKFexv47V2h1chBULdoOEpqS/wApuOFZ861V ZIKjpsgBiexUmD6X1dlDHColqPrhSiAsabDFa1IEtcLrWZq1BBrsAKLDKUFZQq0NymWnsxADK2Z1 ja4Zgq5p69yZ5OpLBl99d4lPygZKjmtD1JLyqmKqYJAjbAaLcyMb4bWyEd206qkNrV+O9yLGuYtT 0zcqDa9e6rPb7DF9SsJNtURGtPgHVNVlPTYPFINlSHBGZkFbVZG1rcMUDB6SCuQQVIVcOtvSU3iV 2KTXiFAYyN1ORC2ZYclPr/YrCoIKWJFvtWLarztif9JZ2v8AlqAlAHZnLGrXFdZyD2QMz5h1j0Sn Js0VClQsprwRwXu6w2sW09QBfYbCrRYD49N+ljN/I3qwJsKrDaIVkLMpGa9pVCeullSmYKFcGOgY WoKzQ/krwDHpBhqZYozEURagyhb6F17ldamGXdTLj0axwkUiLzAcCAcsvDpCCssvwnsr/PtfLX9K lOKaekWtgDWzA1N3NOJ9yhbWEN1jFvtnKhbhMs7U64CVP/8ACoU7FllQwlHianAvoyV2bfGXY2W2 VGqUlGTaq40CRaRkOuD0DANYhvK2DTcoiWqQpBnQNDrAnxMpqGTU7gfxVJpsYOxHWwlgcl2dTAB1 /sDOJgRkzGrnuS9et9fm1l7mtFSLcRBtYh2+GsLAmyx0VuxAyVKLWwL229U9Zq1vKa12r9itkd7A ulojFROW3mC1qOauoG2soTOy6gg1NW1r+UaiEbIjrmEFYHUxq1ydY4K3pFvZSm0wle0gCPr2A69f atGVhXL07Cm/Ku0Zgpr6u3lAYMCARMwGYhWe01vLrEYPy614pZdqpp3zNcLCK8PYDWEDEjxSpQFt IIKdYKHsc1nOrWoPsOnWwMR65hguS+/YSPXawtqYeIsBNFO26UhXB2x0s7/7a3DCWAYrQFgvL1W0 mm1XhoreHUqwlQQiitjVQazXgwggWIcWVN27u0FRxT1jgYaq1mV9hSGeVNDYogtBlgDp7TX/AI+5 81R+5WZCj9bO6tNhkZO46FwWcPkt3GrqO4SoVmgM+1RQKV2x2tLc66mtXYKuwTbdq0iqjfr+3zHx +qrHYnl1mxr+UeB0dGZGqtBDKCDQWPQoUaX0LXEssQrZiBEcfxzlFyDU6Cq4OLiwVzzxkmOpEZy9 SghAvCVrDUhja6ZeoiK+D/0lYFvzA4lbd01CWs69Q3jwlVjN4Sq2h1GvSFSm0ipKNmya9JoqFhdf YYVVDO9tQoS2wHX9XrB7F5G4uU2F6Pp2BAjBoAJYMHYq7qet0IspNGzmVurTxho1BUkBglBtUaW3 rTWvWyV5M6DDkEeTxWWv9rNyOYOZiPUQfJ9weI8Bz8GGZcvV/wDorM2fPWxDUsaUFPaCrqRUALXP XW02ZvD2vapRXRseNRYLDQep32Ct6nVKp7BftPNulX4zXxLVBm9qiV5pem7DKwaMgYdSrbetka9i WpbodT3es07WAllVgbXEVSkpchd3SYWaW0t4AlnI3UbFOyGUt3bHVVExCktpOaizQoylbCIrhoxw Nq0Cb2wdjZ+fS0rLnTXrQigErVWEs7g0axJq+1rDjcpfIGAa+3lP27N+ub/YIoCbdfeu7WQzTtOa 27BlyHrDDZpCXD/RKbIjAyyvIAm1quja+0GJqptB9cABQ1Z17OoFauBUVKjje1krbW3BYrPkbI4a pQ1KKi8GCCERhDEtMbmBnENrEe22GZfn1qTdbSqoHBUoxirlavttVjF5t3KwDrOCbRg0t2mwy+Rb yNqvBlqjG8PDZcq1zWuXCEMLFnsNcFa1BGDRNbZ4rZXD1CBcjZ02qbX2FtCOcBiw/jK01dhEcsrE YA2kDoRZr2LcWWwZlrsq1bhD0v2XtFMxmFcxlMaBisdgJdsCuv2DEU/Mqlm0NXwAjAs+6tDxUeGI Dq0U/ffjrr5RrcMlQ6jZrKtqr4rtZw6sMj2dBZaV7hQ+q2vcDOGW6rst9ZqsRUtremyg6+1iU2pa ttJiqBNv181tkOykCKol9C7Fevs+KzuMWtxcisPF0fxZl1X2XaQY0XPQ9diuARFMxCsdMhl42bPG iszn2dn2/N62vs1fM/8A0QgqvBrPGO0qcErxLuKSOt3+SKhxu9urEPXqbAMQhhtVd0tQ12W1G6rW sZDq7AcOuRtai2r2Smypg4u0FMpsat69hOhrUzrx7HSr6aWwzMg6wOAPYoTNLc8iswMvfMKiBSYy /bjlqa76/wCLsVGjaDRbBFcTIMIjDj2GOoPUbtne75vW1daK+Ci5FR5IxZUImRbXw/8Ad8tRy+vq 2d666j49hDjUbmhvFbqW9lcZHsNNWOrlDdqhpRd45rXrajJz7HTQjXuNZBBnipsH8bwNrXAuVEtq 8ibuvZrnS2RdUXEtZWFzeHYTbWxO5tfAMrSOuZdV9zX4srZWjaq2H+EQP9qlbSItgYN9PYf5bL+O hiWPy6lJvvrUJDw1ZjDrdZE5GwoV2OLFBIryZSer0kpdrsGS+slSr0bNlYddPYMpYWJdR2Tb8uvs 6tq21X6S7CVvZRZRe1oes43tFqhp7BeDAlU2KG1rKbw0LyxVtW42aV6Xi5S+RsVE7AAV6AQiCAwy xAQteClTIUYCA5hXMeoTsVPfsN/m72ZC6vygEn1WqapaOt2MrWZtKVsH3LS02B2pY9krfIVuhuPS 2wnro7AMIBbbozKSxrKsG09sqcrYvs9PyJTc2tbXbzYtW0iC2l6bVcWorDa1H1bNbervVLOpLeRB b/H3DYI9pl3jtH8a2hsuY9JzslRbpWixVMHwYQrFbiwYKWYgYEEZmxxFcK1z97/bsBV8lNL3Pq6i VNXxNtQJWcqk3OaqmijDgdl/wZW6upJFgL11v2FZamzWuDpevdLLBRcoAWzvRPWby2q+BPYaaE6l vgZG6x83Im50va0OGZbBvU/wrKrUtqrtbHtkJr0N9XQuTA3IPHBlqdkWntNV217lZTFImRCMxlxB 9Tho5INdpBFgM2LVEsvmAo9nf5Lvk9XWq13oUcfR0NtNLEReG6q4warM8hjizK2KA4AsSBo2EtT/ AGV6l7LA4ZdzVR5q7AK1uYyvr26e8uylwPXcd620ttdmmnYM3u1i6m7h+/Oyi7CV2Np390aOUsR6 hSat0MlV/Yg9gEjoZb3quvDE6u2yRbBA2YrZDAGFPuYRuVdup/kLWtuxbe1SkC+wIljdn+T1t+A6 i2lHPWl8C9fHYp7BGxNrsWRuyIxxbW1ioSCSMVXGXqStB7BqRculuMtjfcNujxXVXd1pdLFVv416 Wh029Sm8NXfo31bj3JTaJ7EGq6jbN1PczYorvC0bFUIsU7H3WoR5VxlFBijAb6XVqxekAtQliUXm ko4IVswGGNHOJsbjm4s7xRiduq+w2e3zU2mt9W4Ot6FWraYW1K2alw4yw7qpNdgbBFksBVlaNyqs rIrKjVWdDtEFdPZd12VFiV2NTso5DbFa3VaG69dnl53UN1dFza7rYoG8vkq0LvE/fBRsHuBDkzZq Xq5cNSQa62EzCY4Bj1kSo9Ht10tCi3WNWwrxLMzIhl7BUZWMrywPC7e7iEkn5vX7BU04vVkatleW 1+VUcgpbxsL2FdmQGjfeqkztlK2JBORXssQf9tdWw1FouBm9r5bWvyKnm/8A67qNgW1K02KEtni2 KojEK6gWZBaqwYryYAMWLxcprmjaxWsQCcRgIRLlKtTfkYDi7TZTXazSq3MPA9jdiutYq8+zuNdZ JP6COUbQ2jUbraNhWyJXcJeqsqWnCWS1TW4eK0tHVlxgfawGYT0apyDt/wCWpf5Kziyu6tqnpvRh uVCxEsSg13ISmDPqNlvHWlSW6tORYikStnUAkx5u14ZGdGpfKq2QRmdeCssTtHDVtTcxi/dNijMD kkX5rus8tqrFbB9hd5dj9H1tgKLRXlaUYPpdlRLlJ1C8PkpZbFsBDVmqzBLKyixklrl11LgUuq7B e9RuxYlFrU2U21sPFVYDoVAjWIF9YRtcLYayBK1zL6g67VdlC0OfKFRpSGAxGE2qiysjKaL3oK2A hHDARxCMSxBYCTU1G2ymy5RWNkG7Y2mK04K8Abu8RCc/pa9ppt1yjBUAsVedhB2NOY9KBK6fv8Il 9CAojhmoFgOsEGDRKNh8+OuxX0FKtSUdV7vSSAmWhXA9gvWzSlIBijEIzPY1ZVqgBS4YV8TEYQjj YpiJk1W/x2rtTCOGBMcAwKFG8YduxVXYsvRUEuT7EcV1bfsC0JJP6frNtVC2ZYuJc4IpIdTWO1tS pciEjYqUogbz1L2DVAS6okIp61ICOn27PauajlrKeSgGCOPZIpbWsUbKZV0OR9JugstmAutYUem4 Aggww5ly5SwlHrFd1d2maxrWsFNtYme0tsIOxebbCnYCkCVDJ3dlEe7Zst/WHEq3L65V7gmNvVsu t7GlIu3S5tyLaOVvAYBiNjWKltkKssLA6x7U0D7cz2IIbWyt9R6sh4/t7NS1Vbqj0Wi6qo5X6y5c nb1wQV5qt517gwGIY3M3KMDXuKFbq3VwqBuzzR2Lkm9silUHC5EGBL766KrLDY/7GrYKwXKQbEMo 2/LVpOGW0Am9FLajDyXKpmwD5dUkLrsCpE9igavDCVWdkrOV/tdWLE/ipjXs8bVOFZSJYOeuTt1d bElVpzr2rYh4hMuHYW1ipqG13DCimuzZLNq7daV7ztZZQSU7BY99SDd2v5D/ALTJmk7d9C7m3BD9 QuqxDWKGSxexU9DqtgqMrtVl6vGTKLxWNW1WAGQQRNpetlg62UWErTYHV1zOuRu05ViEKuAaLjTY G7qzYjMTNu1QK1dTdWzpSBFUCbt9ZubfKq21c0Z2b9ujsjev2cxriVstGNaweVOr0uQCRmUORKmy rAS5BXaVBer/AOLYjAhgDL6g9d/DI5aU2mthhlI5vAI36mWCzIovUzS2+wfBXa2lrWvYNtwGIOVR Sp3t5VUkk/uqbTU9e4Cr7KTV21GxqXA12nDWN1sDCaVoavmbw+y5gLK3S2vQuypIEdZvVhHquwRY FmncChAYWsyn2G2lKKGY+GxxRtJUG9g7pt3hErvVWPsUlXsqEru3brTkn97kiZMBKnR3s1NZmXth abgRp2dXWwEbKCyvZyDrbIUrsdLNfYS6tmHX2OPEdnrat7ONa1cV2AJtbldab+15b6tmtEG/Uos2 ksdvY4V3Zz/RK7XrP/2Fst2rbZVsWVT1+6LJRsK6s4x7vbpULa6kb14Hr/YMmzZ7PXqHs/cHYmTn W9l412/ZIQPZbWbdy60f06ux62T2u0ss9tuOCxY/Ekn/APGunp7O9sr/AM77h9qv0/srdT+s/wDN XPT7BU0Xut9jo7A9Bppteofc9XVv+62KtnR/qvpLPQI38j/19P5H/r6fyP8A19E9l/w1ev8AyP8A 19P5H/r6e7s9A7fuvxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxl PxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlP xlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlP//aAAgBAgIGPwD1I1K0JX1VKicuN4Op BG31MLgUt1/UfR0RRK5m/U7EP6eWVe5126IaUV1uISotxJJor++LTZCqdCLr4J/jv8iH9C/7qRvc q9BUi1P7kx7E5JG7I9xeSU3cHn/JdFZglM+X5EQOFDIfrd1AktFr1P7hYQsrlNiuir0KlfsjgVVK wb2ur9BTPpjQllGyGxeVTyWnpTce2Z40wWR8YLpg7XvQdvHodSpOWhRFM0sls1KMkjfD5IXD0zS8 Ixrh4pU5KUwjPqaihiw1wt5TyzxliasVcIZTGosNcmpQjJBHoO65ktxOiF0IJdZ1EU98e2b/AGQ1 E5k+ca5KCUtQK/8AkejokdzhkavgjkeSpJRlXhK/TCMtqxnnNImydJoO7hSSLvOEYQRhU64VROVv FZn03F1Z2G3uMSJTploVTeEPCcntkgnLAh9RJask7IrjqQ9eTU4KupBoRhoTmrtjA3apG3qiX7Ev uNkMlFSPsyLqE2kXUZSGuDyt03XGCuWNSMXn7ogjoWzokQiUQJ/clHizxu12ZRkXEVjk6MlaMgnL KyRkQnhO4jpcSiGTqmTbRoi48bvZkDsu0ehDxqSq4pMVvov7kM6XHlseM6HjfpyeVv4s8Ln2I0Hb c6xRnY8X+SwXY7YV2JtZWpTD29LyRG6PFkcHklXdEa2v9BNaM8bvy2ZO6Fcuzwqh5ZWEvcb9KHhK 3Ia+VujIuRK/Fng/ZnVE6PGhUrlbdWQtX6kcHiyeDyjU8XoSqk5oIdUSiCeR9ssYVzyVIwUjrM+j PAktEjxWZPPRk5VkroSnhUlJe+ELTPQi5lGvQkpgsJwrhEHjvh0XpxmeSMKkC8iiRXYb5K+roVz0 U4eTKpDYmqJaYV+h1xnCNCUSVc/1R//aAAgBAwIGPwD06lJu7FbLvapNrlfVQvlcfLgr+JNKexX8 btf8P6ip426DcC25Y6tIrHSh34PC/TZiSbrvFPv9LOHvhUl6mzKktSyIg3adcNMKOe30D9PQoUPO 2jI0NRNuZ9WT3YvRpQax1qOTxegmvUfRE+lKwgqiCdytqIUQO1qLl6VDuoHbw8/xRN78UaSxuKYS QsWUE95E+fRoSN5Kks+agotCUN6DTemHjZpzhVYTsStCBK29xwyXRrXNCwSW5CyTNcE+HJ5PTYhc UFDXZlDST5fFcI2RyUWDTw0JiC6Hx6E5pZUjRFKFy4KOvHKKWpIq2VnDTBtYRgnt/gVy0eSMIWi1 eamFfYXeBw9B1nyRbctriTQpTGg8KFWTqO3/AJqvfI2cLghYwsZJLfuJ8ND6k7oi2jIZFyfc+Npw VwnGR8nl/wBZE3vof6FPsJN65UuWQNdIPYtvRB5J0kT5woVwlZaFlvCxg0KqCrFKU7CWRYXPeSHR kPkkiaCtaoip8XkeS1vTyWSuo7eRTOo+BXZW3sQzuxxqV3KGnuU0OMkE4cEKGQyy58ftkSj5FWJL QjJBBKIeEr3Qna5RDJWEPB5JwSRba9lX3xl7FKLY1El9xZJIxhkolaElHkoRdvkoX/zfyKbf47X4 9bsjtXuTw8F0ELLXDqiGUJWE4yeN3yX6oo/JY22PS5njaon44tvRFz5qXLpOHdfsLLJKIZKyRhGE YQ6FGQ9D+NLqy23hThLHbbpyWv2F1oNHZzh29TUl7FNHVYSRuQyh/wDe5Qoi0ujamDgj/kdj9u52 Fd7Mro9SNiu5GWSMOGa0O9SWSeLXvwV05IGNW7E3/Jk8KhOEMb2PK0nfcdr0f74dbTsztqNLVEPf BXckPQTTkT5WEiuX/nGCP0JX2JLrn/6cfY8nsS9NlkcruRLaPK16bFHUh6onY1pcO16aCeqe5K0d UQ9VujxcwQTBc1pj4s5Txjcjc8bVrqW2rY8F75YY+MOwmdkRNBTVso2O7hRhayWta4QnudMJ4K1T KOmCjRakq1SS4R42ac54aklKOxKbRD2oNPcgTwdvcaE1tUlTKIG0VIeDtfsRD7EeMzoV/K7XCF+N vptrBMa2GmdyVrr3wjkn7k8niSQ9Tya+K/UnxU9iWOKFW/UhmonaQTwJia1RWgoJS1Ha0edyixPX krB5XNtcCVqSS0RNCW5+gqSkh7Pk1SR468tjUKp5fkyh5O22e39U/wD/2gAIAQEBBj8A/M0Vj/WQ IQJfkhLflpGQQlo1fqUI+UA9nCbyxF8lrgDLb/b+qiG3EklRn9y0v8KBAiC3JO4pgUAAGxITGhCb USbgqUNwCUWY9iMDWJrE8v6k0QSeSB3OiOLptpjLMCqE92btVkJM4Fl0s+KqHzZOY0FiV0mvJaol yL80QBp3Y1gc+SMJhpC4P9QAApmoR0uWeRQhCIfJAsHuUJGgWjao1FWpuh0ERxWk0lkrM66JMDcJ pdQOOK1wpuR/91RjKhF/6bpjUlCW4XOSEWYBiVHbFpCvcgebBCW4SaWwTbbRH8I9WqZzWucdMRbm tLEk2WqQqtJqEwp+6MSXyKJm3aEZjokccCh5+60MwvM+1nrGMTdVDf0oSNZYp0N7k7LzvrkMVHek XesY4ImBYChWiHVIYLzN1ojAIQ24uTjkq1OZQiMUXABWoA1yLKpZEEEDDmmDAWWJQO5LSMlIgOwo cUYyDEcXjQc1pnEgjhQKyqP6AAbCpTDGy8t6AVRi7Q26EZoCJ0wFCvL2aCNCTgF5UDqndGe6zysA tO3AnnghqviU0QSM8EaNJAyjqyCaG0Y9v8LVPx4DALqqiWL4MFYRH6p7nFCRkBOX0f8ANSkQ0x4g pbsp6IRORLomMjI87/JAQwR1QO5gyG4ANuEqsDqTgiQ5hlrlB4Zxr/zXVdNccKBVH5wnMgKJIvQB TFpFHbh4i7ryoVkMO1SEq7kqsFrmGGAWjbgeZVcApPWITR+QTkOVqkWa2TITkKN0hWTmn7rIcBmh AFCQNLFS2RMiDORzR29rbE9Q8ZNk5jEg3Log1Jr2ICVSpQkQCiIPKt8EdzaiBuXIGK0ziQcihqur MtLAldQZahWP5oHmoE2ijuSDRkKDNT3SL2HIKe7Ohl4Y5BRkRpiLviow2x1OyGo1ayJkOkmgK0wp kEavJEk0QBcgVl2YJkwoqRrmVzTD5pzdOq07EdNGxzQL3QH0QI1LWOo5vQLydovI5YBMTa5VcU7d ydq4FGJDSGCaIonPiTmroxwKMTh+ZByW3EXJqtuA8MRVaRWLOclCMDRiZckBAvI2AQ3NxvMa5Qnu C9nWkdMPktO3cXKcl+SaIdGRpqNUdGH1JyKXJzTteyeVeSsqJ0xIC6S5xKLgvgtYkerxBHbuMAEZ SPXK/Zki5onI6eaYkR/dFhI5UQPhmLEp/qxROC6Q6MZBihMfV+ZgJYkk9icX1U7FEv1SFVHTeVzz UdwHqk2rNamGrAlDUNXIrrLAYJoeEC6r/wDKc0AyUpE0iHUWLQuAtG2KYoA0AwTnCwV2CpQZnFVc hMKLqNk7u6qLrTEeJanOso+ZLSMGuVZohCGx0wFDJOSdyeckzJpDvWrbLjEIRetmN07BE2kLELnH 8wIZqMY5sjE2gf3UZHAISlX+1A7gfThgnyQoxR1VOSawFSgwTksMlIBojFCUj2AqgoESbKlAtMbn HBldzwpbNBaSexVqcFr3C5FhgODytiSmjTbFzmtEKBObp0wwumDg4lPHpmMc0zk8isE7AOiQRXBP OPTmK/lokZqlhUKQP1XXl/qhEWAC7U2IQ5hElBORQWCYD5IxYyJqyOqpBZgtIo+SJKcnTHMrVKmQ VFXi+SsyYCuaedCVlEfqmAonN12LTFNnUlVRMfkg4raSYjvTX4SBAMcQpRj4DWJ/KwHOq0titQxQ IVVFsP3VbuuxF6C4TyRa6IF7BPI2GCmCGBk/caqif9U5LnBPiqKgTyKqnFAndldPIueFVRaY43Qk cahHLhyWuN8QgcVVUR/xBSYObhMfyLBOUwDKMyGaqE2utJ4Mn/tqgBcrRGw8RTu8RmolElGRzoiY h5SqBgyckGch1E4NkqFyr0TAOnlRPK6oODDg2qiu/wAGmNynxRAIiHxRJmE2paJVyTpvoOKbLHhz C1YZLULS/IME+KGa5lRhAv8A3c0AO9OcQVW6daI4hCLvGIGrtyTANEURGCk9ZWCqvM3OmAsM0I7Q bmFA6WbHNMnKtX4HdalRVrxc0TR+a1SqVa6BIdeEdq0zAORZdJMZCxWjc7jgUQcVGMBWVyVmyyTT kSE8zLkyJ2twg5EIw3Q2RwP4rBWqnKstELlaiXJsrOuwFcyET3BR01LMgM3c5pnWmJ7Vpjc3KBkT NrgWQJLQy7E4izmnYvLF3+SG5IMFQqlU5XTVMSxKZ3zTIVohwcpo+FVouSqgw4U4EEVzWncrkVr2 zQWyTboY54J4kEKiomRp1RqCm/DZOn4VuVr1c6qlgnQByQJyVb2ARL9ZpFCIucUTVlpgHJwC17oe RwyQgA0Rds0yJFwmleRcLQKlBNinKsnnUiwTsz8GNlUp1Wgy+Fnc5IlRwfND90QFyRibxVAqEgq+ pNKJCrRFrKY5n8JggZYpzVrIPwjAGqEIntT8CxrEOgcAEZaeo45BapUjzyQJN1pAZrBT1AAWfJCM WZGQADD5rWSwFlzUDab0KY1KDmgsyZGJWk3wREqSTE2TMnF+FfgpRUJK6qLTG3JOwRES3LBEEUKK JONPgzVEdPyU3oXNPwtcsLIy+SMpIZIlEyu7lOeFL/ytIN/EUIWhGpPJCMBZHVJySiHoPChMVEvE vMqIz+l8U3iLsCckXqnlYYJtLRzWb4rktLJwrsMUBAnm6fFEfUFonXIqpVKqnCjlVICzPPgCSqcW tK4K04i6MeYqjG/BiqLmiDij9xti3jH8/gsuRsgEInHBPkgBd0y5JkAm/RA7kjEz+gXbtQAk4Qk9 E1ybJneSZq4ps11UcUXSDTxZJ7haRfJUsLpwGK04KyEhghLNawKx/ZPHvVSrqisqBVge5XI7kwm3 agRuAvgFRiAusMqXTrVnQoHKjc0Hvc/DRGJqDQqUCOk1ieX4Dp8E5stR7kw7ghKXiNk3Ci7UPud6 NDWET+6Oq6G3AvieQQiaZlNH5oC8pXVfFIfotRqSfDiyEzDo5oSFAbqW2aRCOixTgs91GETV6lMb jgMkwwXIowwPG3BwUytXNWTVHOyDTcLri4zCaIqVkUQcVLVUiyYFCvAMrFWPA7kfFt17vjZMEIhO brTGpXm7prgESU/ARAqUN/dqBhmoxA6cuSlIB3CnIxLvbsTypkEIjGyABGr/AIISNxktQDSFwoxA uhEdUhYI7m9WRq2SMYgBuG23eigi+SZaT3KJzQ+KlFeiDVe6bnw1xpK60yoyrinwxTfS90ytwZMU 6lE2IZTjkSPjJyC1y7uSpQZotWSqUy5IMGGaiW1RDO6AiQOSBNgjCMxLdNABVAmQshjQISbQ1gFG cZESx7VGVw6BgXNiAtbMcE8vE61Cox7FLTZRGJQUuDGybBc8ChqBEhig54aT3cbqi6QAMynkYt8l QgqiZFqSFiq3HB4d4QkaEYJnVDROeDFHkFKWZPx1x/hEypEfqtMaNYBVuuatQoGRfkmDPinEhVOZ shsbUjGMi0tzFuSEpxOkXN3Wnbl0HO4QlLHBTMg4yQkJMXsr6duOVyjLSGCLViGdHcjgiTZmRlyq gVGce9RlmK9ybDhqFwuxVFcU4CcEjkgRMlNKVMHCpuKp705qqKoVYCX6J4nSBgmuiBieB5cNWKYi yNGH88WKvWQYfEAmQMqALTAImVwnxxRkQgBTmruMVSV00ZV5LqkSUDuEM+KPlgGOBCBjQkiyiN16 tQ/wn8sxg1DIM/NUqKj5qUc6ofbwpqv3og4qn1YJraiyAbqnROj+i6amOCYoJlyKY2PBwrJpBULD mq24MycqgTxpIW5rU7Vr2oEd/DkeNU8CU0lz4bcRgCfiJyTlCI+SpWRujRlUtzTGyBBfktJ7kDiy YCoxQIDlF4gFdNBYqJjWTob+60pkY4LTHGzJp+OI6ZZhEmtHQkbA07AF+iANSEALXUIntTBHNSCe xTG2CumZOLoS+fCnBimueaAFDmnkNUc1qFsk5+SpgnNpXHNNgcE8k5z+JwsiLqUncCg7vjDXKdnk blO9Ua1CINyiDhZNfJRkBY1XUbrMlUuBVMS5QiXY/KiJAo7ujI0YH9FKcvDBz81pzFFWwxWQBLFO pYlMcbqEmeIDFdJdF0Y8a3zTHqGBxVKHJVxPwOLouHWRTS6o4g5Iy2TpOSO3uMJDgQbFAXIdCJpi UPiLIyhQ0B7D8bZJ8V/Cs4VIrzNOnEBcyOxVuFKI8RoyDm2K1SHSEW+vAqW/9wWhHCzlGQAjtQpA ckIikTgpbWOkqAP1F5DsXUqUJomGdSgXwR5lCJxP6JkZbfeExDHFEZJuHJNJNMPE2KfalTI1TmPy VXCFiEDJUkEDEuTkqpxcrUKTFymmahOE4xoUMSmIIjgVQ8Rx3IM5Ip2psviJId0wKoaI66l6BBww Bc9iMGrFtJORT7kmPKlEWq9lrl4zV02dH7UxOo4AZrVJqUZbX2sTcvLvUtA6RJh2Cig3jBotN6V5 uq/SG/VVWl3LqW7LsCMZWwKJJdE3ESUyqgQGUZ7ZY/Uq34yBvg60GoKePVD9lVVAK8Pyoi1RzWIP JCUZGTYJyqLvTwLSFwtJFU5vgEzNIYp5GhPctW1IAZJpx+RVUxIVCKJ+E4jwnqHf8dcUAC8ZUZW1 lv1dAbl3qBkjMBgXER/02QlPHBamN6BB6ALSA5FQB/K1zPYMVIyu7gIaPGbHJaP1QB8LoAdhUpiv UQex0Z/qhCN5myjt2IuiQpRNwFLc+pApwmsQjEFifktMumWSzVECCxCc15rTcHBeZtS0k/Tmh5o0 koUcJ2qV00TSLEYp4mqb6hcIsHLIfqnbhqje6iDfFAAMQq1dWVgnAZOK8lyyW1uD6gR8vwACWIxT s5IY96JHVIuxyAUYmT4nvTEdODokh6KhdxdDB7lEbUam8zgpGI1CPiJRmR/3Hd1Q3xUNN3QjHxTo Foa1zzUhiLI78y5HhRKLVT2rVDRjf4NUR1BaJBpixxTTBbCSu6omThCOP7Iw3GIOJujKI8zawRAD SjeKzThMXa47VqwzxTgs9kHT8HWsYVIUW+J1tbeMQSe/8BhjRGMKzP1d1Qg4Zgzpo15rW780QKvQ BDzTUAOpw8MIkAjFAQiNIC0EARKkGYtbkVLbysok4gr/AOzuDql4BkET3rSTQotSJsFThrbtQP0k 15IYxOPFsFrgOrMLy5jqF1q2jW7YLreJTSrzV08VVMahef8Ab0MbjNHbkNO7G8VU0yVaDBUcze3J aJ0ITQrmgB8GqF8lpkE4HwByzX7lPcwJYdg/AE/DAYoAd5KqackQMRU4oQ2y5OC1TFQOkc81p73T YTH6o7fJVFlKZaoYDsWqwxW3t+m2olaRYUCbJGAFRV+aMJGsaISCoiJC6lBunFPfaNuRQY0TlOFp Nl5u0LX5piG5JpC66JkZA1X/AHRTAxshHVqjg904T/oivNgNMv7gbFaT440KwLISHYTyKJY9qcG9 3+NpJwnBVbrchGwDE/gRgO9CIDAU4sicTYp/kgfmob0fFGqfNPgbpxUAoZtULaEQ8g8ZdirimzVK vcclH7iNHIEkGNk4xVl5gv8AwjCdQcEzEwwOSu8VSyojGS87auKsgHaeIWZCIITxOkjFHb33BwOB VAwR5qQ5IkUGKBe6vRWcBEEsMAgT8VVyur0RIrI2Ck95fGIi5RlKspISXYmRyT/4iPmgOSPy+Sic Hr3ow/sP6IHDFBkN16EsR2qWoPN3BzCf5LtWvK6ls7lRghtk6oyLxP8ACAHAxIoUYkWrFCtUTt1h khK4xAQKeNExqjvbR0yFV5e4NO4McCgU4ryRGI8JyKOxuhjYHBclRdVXTRNDgnemC5KlDgUNvetg cE4PxEJyaYDMoyl3BaM/jnP+0cSM0Qjky3AM3CMjiAAu9AjBiobn9wY9oRjgqYIHDJR3Yh5Q/bFR axZDmpRzFkMJRvzTZ1ByK0yPXGh5802KcLUaSGKjpDYEFMjubREdz90Yy6Tlmg/etYFUYmqE4Uq/ YV5O7Q4SzV6Igm9l5sfELowkax+adRDJ5B1SyLrTItpTN3onak4GC07nTIKlVXiVAf4k6OQ+Mk3n /CZFMc2XJEckXxUo4A0TYDFECpaiJj4h1R7QonNPiiPkFuR/tNuRRg/SaxQOOKdkN23YjsbtSPCe SJFJDwzCANJi47FzyVbI7kI/9QCG3O30l0Kd6acQe0LXACUMQjbSR2qlXutK1tqiatkqVlGks6J2 711B42I5LXsDQI4ZoTDB8FZopsOIJ8H1BDQG2xQ81qBuiWd0+3IxIwuusPzCfDjEc1KSJOPxR28C a9i04AqiIUh3/NRkE4UJixoUCcQ3yQ4T2z9JtyNUYCkbx7EADgnZ5BayOiZY8nVC0xWJCD0bxBX7 EYmo5oGRPTgMQtTstW1TcFihDcBhMfIppAROCORujKP/APN3EsQvL3PFEXz5rlmswbjBDd2yRtyP UMAq9tE4qiNwOF5sI/8AalgEJRtkmQEKmQtkyMDIxL4IB35/AQtJHev8PwOKJhfJNjigMgiMyPiY BycEZ7gaZoOS5FA5J/0QmRSQb5KlgmRAuKjuQPYfknGNlehUZgUmNJP7ITF4V7sUz0Nk4saFShhJ V8UOmS8yGHjAx5qJfpNindaoh5xr2oxmCIE9wQlAvmyaQaYtLF0dqcXN4yzCEJGpRhMPE0Zaw8oD wkc8CmHjHiCEXHJkYSZihtyk0R4Sck4LhFzewC0yDjmn2iTA3irMV5jtprIp4HsXMfExQ4U4OqVf BSkKiyjHEn4dEA5TSDzF+EJ93EHEVCZdqqjD+007EwsahczZafqw7Qg98UB9J8J/hDMq1Rir9MmE x+xQlnZeZth4fVH+QtL1VnRmBe7ryZg6T4ZkXTg3QFtwVjLmhDehpkL/APEISFlomOllHc2wXJcN iFHchUGrKlORUd2NxdDbnfBUpwqmCMc6FSgY9YNCiJViTXkgc1f4KourUzTWTYpitEL8NItD4RL6 pVJUZi0roHAoxxCY3FCFyKY1GSMcrdiEgiy1GxWnvBQnqcWITjHFEC0q960P1XByIRhKhBqhiUZg doUvtzKsfCeS0kv2rz9oNE+IBXaQuMUQMboxJkdJeKiX6sURJgRgtW22qPJeXOgxGRTWWk3iCxWm T+WSxGAK1CylHA0RMZETBcDmENXiF0wp2q/CiJ2vFLOyecnlkENrdtgVfhX4GF0xDFaibIkUBsqo klGRxPw6DgtPy7VoOH78BuDwzv2pwua8xqChTY8GCrQihVbG68uXcU48UahOC2IKE4y6xiF5G7f6 ZIxNQboShQioK1YihGRWmV8QqHTjE/whIF3RBDSzdDy6RNxmgQUxL5rXCxqozjexPNOUxDSWjVqh grFOQ0kAc04oQn4h7A1T3Y0KJiKheXuPpwKeJp8LqUI0AoSmkaDBOnJXlg9vxCQwuhXBwvMFjfgY HFHbnhjnw0g0K0yuE4XNasJcG7wUCcloPgljktBBiR4TmozbScSM0Yz8UUT9Qsmkemd+RVVzAdeR M0NnTFUPVGyMZ0jLHmru6pcH9EdqXglYmlVVmzT3dc+HmAOQoyIaLoEjjVMiBZVTlMzwTDxJjQ8T I4ArXiaq1UXovL2/mnN/j0E2stF9QRjKhC5rUPGLLSaEYHhriOoJuBBTG4uuYRAwqmK8uY1aKAnJ NdVNLHsQexWsUiVomeuNjmFUvyWqNGqFGYNxUrNEaWJxWmQJjhJNIE9yMtPQ6HlTeB+nJMqjgRgu usXOleXI9ipwqqcKJkxDrVtFjkmnSYTG/DQPqLIA2VAhCJYyVfwBIXCjuSrCWOSd2OBTHuKZa40k LjNOO/hqHhl+6fDgJYHxKqcWTixWvCxVDQpzRCLuY0daZVeyEgLfsqVJuhIiyjpPRK8cl4mTu65I yArgtyZP/cDnsWk/ULpn7kxHBlm9kJN4ShIVXP4XFCnJQN1rhSYWqJaQujqwVPDHh+6LF4xoPwpb UsKhOBdN81q2yRMYFaZBGUKHEJpWTGoRiaxNkYk2THFaZ4LpwQBuniFpkKYFDFafokhqTJ4kgptR KL1YrU2mtgmCdMiQWibgFAmoOJQdwUxLjDiGuOFawP6ITiaFU+Cl8SmdCMvCbLUSwUjaKMdqgN5I MnKO3tmpufwxMd/Yom8ZIg2wQqxCgcXunBYtdV6pHNaAOY700g4XTQixWk3C6u4p9XaEDmUBIU5p iOxdJYtZAA05p49JFwgSsuFrqQyqn4gkO6FKYAIPcUKoafA4F0QbIxlWBsUDEuCnHBiiyJsI3K8P ZVNIsMgsSrsgZURht2zTn8Tytws3hKFXCqgRgVa6bBbYj9QL9ychyi4aWCIIalO5VR1B0wctUIFq FlR+BkB4cFKTNanwRMiwxKERWJo/waVU9b2REvCUxxsqcGC5pwgCKrXtybkoyl2FVkAnjUZo5Ix+ iJrzITBUotJNkIk2wTO0cvxw0nAWnciqApiWTCYfBRmS4JIHeOBBuo6s2BRDIkIab1fsUZZivcn4 HIqINpUTJ+D5FdVjiM0JjxC4T8AFriKi4VbIRlcWKY/BqCYFwtMyzox2puL8gpdQpmhCb6Sv8RoB zXbwqjM3wRnK5/JMU6uxzQEi8tshyiMQmNk8PpLv2J811JxZkY9446v7UCKEF1HcHehwMSpAjqCc WNJJsDwdVRA7U5uLLULi6Bxx4OjFOU5Ynmjubk4ilIrXGBMXujI1OEUJTxsMkOSqnlJlSkI2/K3R i9x+y7U6IzQGVE5Ro6icHY96MXvZOpRF0Q1UYz8Mv0KYFxhxEwKSoUQLSWifijY5hU4uLhfwtYsb rUC8TdAixVnRJTXlgE4kQclqlIyPNacFZkzuwWnbDc1WRXUSfy4lG4QwIV1VHmxXYHX8KcDfBQke 9dqsiAGEkYGzqMgT5UrvgUDhwIF8FmQaoSF44ckJXiU4x4Nngn09iavYvLNMlokKCxThEmw+ZUjO 8rchlwZNINV3Xl7Rcm8k5/NuLYq6vZCJLg0VC9GRJzQOBVMa96Aeo4CQuEJYFaJVcI7M/HCnaMOD vREAUNQme+aqeg35FaSXItwsTEYpyRJ7RzR3IsHwCcECWBWmfTMXC07bknHBS1nVOQoMkJHBdMSj IuZ4RRqwOSr+dpwBFwgBjcp3Wp7IY5LlKxVUQ90Y5Jvko7samxGaE4l3umitRoRZEAvFadJL5BYx NAQV1FGtck9wKMMExKzK1mhFgtMB3rVIuf6K8SywXUaKhcZIxJImC6DmqqUI7RB3Ddk4NUzqPmzM YnEWQM5hjaqO3s0hic06EZCoxQns03MckOugwTE0P9P1QLEK4PciNTA5JyXJx+Cp/wDTWH2v2u2d 3f3H0QFzpBkf0C3fsx9tLz9kRluQNG1+D54Ld+8hsSOxsGQ3JZaPHT/C9f61uS2/KO9LY3YbQ330 ylMadIqKkOt/7P7Oe19tuje+x+53oQJG2JbcZf8A2BA5QlJ1L/yO3uQH2/28f/Jw3IEtKUvupzOy 0cdYmF/5J4w1w3vsyJzbpjq3TNieQqtmG0Pt/I3fvfvBvjy4EHZMBoiXj4XX/i994H7qWzuD7gwj GBeO7IQ1CAApH+rb3/7W1u7sSI+T5J0sa6nqOS/2n3f+c/6l/tPu/wDOf9S/2n3f+c/6lu/bQ+3+ 7GxvmB3YavEdt9H1YOV/tPu/85/1L/afd/5z/qWz/wDi7W7tRAl53nHU5ppap5/m/S99el769L31 6Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vf Xpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS9 9el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+v/2Q=="
- width="480"
- height="456"
- transform="scale(0.0667,0.0739)"
- id="image46"
- style="overflow:visible" /></g><use
- id="use48"
- style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:10;overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#a" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g opacity=".5"><defs><rect id="i" x=".47" y="-.015" width="31.155" height="32.41"/></defs><clipPath id="j"><use width="1" height="1" xlink:href="#i"/></clipPath><g clip-path="url(#j)"><defs><rect id="k" x=".469" y="-.016" width="31.156" height="32.41"/></defs><clipPath id="l"><use width="1" height="1" xlink:href="#k"/></clipPath><g clip-path="url(#l)"><defs><rect id="m" x=".47" y="-.015" width="31.155" height="32.41"/></defs><clipPath id="n"><use width="1" height="1" xlink:href="#m"/></clipPath><g clip-path="url(#n)"><image transform="matrix(.0649 0 0 .0711 .4697 -.0151)" width="480" height="456" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEVQRVAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABmrAAA1lwAAW1j/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAgwB7QMBIgACEQEDEQH/ xADRAAACAwEBAQAAAAAAAAAAAAAABAIDBQEHBgEBAAMBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQIEBgIDAQACAwAAAQIAAxEEEiEFMRM1BhAgMCIVF0AUQTIjUGAzQyQWEQABAwIDBQUHAwMEAQIH AAABABECITFBEgMQUWEyBHEispN0IECBkdITNDChQrFSI1DBMwUUYNHwYnKCFSU1EgACAQIGAQIF AwMFAQAAAAAAAREhAhAgMUFREmEwcUCBkbEioTJCUGADwdFSchNi/9oADAMBAAIRAxEAAAD0AiqO CYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOCYOC YOCYOCYOCYOCjYn4d7j4cADgAAAAAAAAAAAAAAAHTg7swr+bl9nbXn+E59pgTtygLLwAAAAAAAAA AAAAAAAAAAAAABz3Hw73F1Pw73Hw4AHAAAAAAAAAAAAAALdXkUN1pzPjmWxzVwlZXxGu3k6/iVPs Pk9voVgTuAAAAAAAAAAAAAAAAAAAAABz3Hw73F1Pw73Hw4AHAAAAAAAAAAALCttzTrzsO1Sy47pw nVb3nex73kpc7VVdGddOPrr30/Fx+jV1ehjGmh22sDsgAAAAAAAAAAAAAAAAABz3Hw73F1Pw73Hw 4AHAAAAAAAAAAJa6GvCibtdlOK+2qdVltpKmzlkGa7OV2EVdMM2+LSMKdHFqXOWX1s1bdcviIfTl vfmXdThjr/W9i+Vs+kV1w+fhqZ05wO2VdqLYEQOAAAAAAAc9x8O9xdT8O9x8OABwAAAAAAAAADQ1 s3UqwzurtqrYupYounOFtVt0SNUpKxzruwjKWidEZ97KrtseWRnCvljLqehVYxxyeOC2jVjcqeye 920oZX1a+qjHuan6uDOp1c/Rdkq7WPj9CIGfoAAAADnuPh3uLqfh3uPhwAOAAAAAAAAAAa+im1Tg YvWuq4xfRfTexyjlVt6ldVk+0WxnKyBHk+1nO2cOdXVx7CVj+th62bTaq7kRxytojdTbelxx6vl3 K0rnEtXmwWZv9jDhZv0uH308wDz9QA4AAAOe4+He4up+He4+HAA4AAAAAAAAF1LDmk2ozTivZVur XFU4X2x7yFoc5yzlU49nPlUVnOdh22XK6ZXTqhVPrmhjaUdOip2iquca6p1M2KP8NMrSz1tdJRw5 SWzn+h5Co/PbTjofUcsn8MOpU+sAR6ADnuPh3uLqfh3uPhwAOAAAAAAAdkxPkGuXdom2oxlqnbVO JiUOV32TrZrvgR7GcOQj22uFCts26V7JXR46w1ossRjr5CXUoUdhLHE7Z2Nra86rmdTMvz4H5qTh hkgS0+ZydM9fnz5XDZFD5z635yz1EzvMmwAHPcfDvcXU/DvcfDgAcAAAAAJjU48ZsunlrosqpSbW aqlZOE4cY7HtWi6dC8LrqqXO2i1/OX5tU2rr+XUzj6NhTBK+uifarl5q9hd3txCfauWdZ7dXCN1s 6cwxFirDQhsKW+eh2EN3kucXu11XSpYvgj8v9jky2fMHeYvXc9x8O9xdT8O9x8OABwAAAJSdsjBu DMsva714VdVsKL7r6bI8slUzXcRbnVehNiPLr1WKYXEI2Suz7Jluiq3vF60LKJ0VtVWddo0eRvqu 5ON0bq+xsYsT7CjQisxXjuZrZqwzTbz5YaY2VbPJ7XfZ2tGbXNPFlNNTZL5KNtWb23PcfDvcedT8 O9x8OABwAALOmm4N6MddxyqiFEY03cYqlC6ydT1c5zYXqsZnOuuVVkbOXURYgvK5cXQz5pXHGs1n uyammokrFuqdPbY3R0Ll1fYcsr7yDFq9tdTDajVNDjCt+fNatbVLJmRnD0PHmxRKMbec7Ls6rY7K sP5v7z5SzfV7j4d7jV6Kfh3uPhwAOAAM0aFsG7oEsFitkc/aOcsr1ExqFk/q7GfIvycnexdEbYdv nKpuMK7uUXU9s7lM9tsSlC629ScbJ2X0X9hpV5HlmeOjnPx0SOSr1BKXI139uhnOMWU46ry3mBSd 2bd53apQ0+WAx2Nd1k5d5y6ekjmbmVph817j4f7hl95Pw73Hw50AcAC3QRdvpYIV0551zlTbGwuj Nt7NjTP62fxc8tmrXyu7l8a5Jzsz3o2c5GhfOVce3IM8stuStqnOV9lFsNK4wpKqI5FOvvJuXFMo dn2xqFNF906s021ractiFtV2FeXOavIhBnjkL6e2HJ0c08swtr5jTJD3Hw73HL7ifh3uPhwAOE4W yWurMSzWWX1U5q6u1w0cL5JUjyvOd0FrISdSrI2uOsZlF8G6IdspdR0eaaUNHJkbspa7ryr4WTiW XU81TWv6gq+g2l2pwrtUGK5YuX1swz2vJSpo0eQ7VSnCS+zzDsbLfPsOShZCF3XE52Va6rPk9n5n Vua9x8O9xp9FPw73Hw4AHC6lyXGHlyWJ/inOU9hZXVZV2UoXSOx4nKjShdS0zGm69SVldl6zSMbV NJJ2d2eo+tM5xuiv0FF7q7qX67Sr0F42VWZquMnaeMUxhY/ZnX18YO3wzdvLasaF9S2jHbRKq/zu sVHc9slredulTZCyVd3JvnvnPt/itutr3Hw73FsT8O9x8OABwlEGmEGruPzXmwzsojm6W1WRsJmj Ca13GKrnVdHOz2R5yyyduW6snqqaqOfWhBd7Tx2uzuffkK7SOjL1lC1pupZnG1eVgzrtxhzO3Ct2 uNTEpwpLqqo5+ptqacFczt3nVyKuxs5ZbGdc7pV2qxbq0V1/IfU/PbJqe4+He4x9ZPw73Hw4AHAA L6LZd0+9vjgott7TyvktCNizUHqboWVzqtmnen2bc9NOi3F0ENC+T9Fxj1/Od1cjbTqX5b9WyVDt EZ5knU7sy7jC6xyec1XPt9pXnEdMZeXZWlyvmbpZt2a2hRrRhsl2Uc/K2OcklecnXZfTzljUKpaO LfI7nzGrS37j4d7jX6Cfh3uPhwAOABLeR1YY421kMrC7S0et9jKF1blHYabrIlVvO08Wb9VvcF+D SxR6ENNnI18mqrG+gQkyLuS1RevyNLPq5ToUxjj6XUrqNGHLqu1PQojW8VW11Z6enmbcbi1fbcdU 6Urc+5JNmrl3YWV3VVs19hTIhfTKNKfo2Z2Rp5lXvue4+He4xpT8O9x8OABwaV1eQduqvq82MJcc ZUZo51iVNsLr65Rhc52LFN6fJ1dnst4uvhuTyvosG5U4K2y3a1NHFowo7GJrpvWbZ7Kp3PtqsY5f KurBevytNOxavKjme8uhpz6lE15ZOSlOeVel1OcFrGeylZdm3w68L21W9pvqnDJovU9v2MpWUcfX PcfDvcUU/DvcfDgAcs3FHoY+srsQyLzhN2+m3kY1XUXtF0LKa7GNjC2M+inP2srkzTz+LPoU77/O t+ccVPQhxy6iubyo5T35rQYytcNSdN1PaH1l0dHPagqzHFatVDmRpLWZKm83TnVddXPPYLNVuZ7H bbaZWUW1XV1tw7ymVPb6c/N0Mv1focoDJS57j4d7i6n4d7j4cddvallv52dWHltNkOR5avyV1ld3 K07Kpd0tRruh3jKN0dH0C9LmOWVauxfZ3awyiza+f+hUqKOYmpctl1CvumkWdjj6C9GmvWyXF+Qb MPTnTfyubJ2uyLmK3xbRPdsQbzct5yddtHLarKiq2uVdluffaFKKvQ19yNX5/vuwAz4XPcfDvcXU /DvcfDjacw9+3zqmUr6qK74wq62pdCMe2K3d7X25VO+yg46zWRtv0Uq6Z6eRqpxdtzHpW26WKzV1 ajWy7YaFmQ7ElqZNlkdHNalzOtJmuUM2LClstFmhmqmyMuVWIq6SuitZ2FTujbnN1dZjGVVsKrVd NKFKt3s+j26teHs1Zco5MYBypz3Hw73F1Pw73Hw4NnGvlV9BVZZZ5saOW19gwp2nvZ9W5JrlVnIw sps7Kwqs5G+aTcUnMTQj1JySHZa2W8nyOmIs8rUk73pdHRV6sYQYQbsrup6vk7WTbJtnJ1UbwKJw ruhOtNitezjSzdse0sJ9HM13H13U2Fvp/QJY7KmGkArpABz3Hw73F1Pw73Hw4AHNdrJ3dGGuh63u bMr0OwsQnbTXKu21aHb4w7BxtKXDBfKNKZep23XipowzKWOSh3DuhO6zQtpaz1KobOXKxR5B+3jN sLM8YovwkxXa6rp612a5TBiEiq2hRyu6hJ7Npvs289anRazRVdp9axPmTDRzgZsgA4ADnuPh3uLq fh3uPhwAOd3sCydf1F2A/o85u7Pb5X2lpePLF3148QbW0arE1NNCMr9BZ+ioy9rHjKD+doyNy5LL ZkQuQ1c2GlGqISRfW5PJnJXU2GMrRorshZGElkNTLuixAb7yV+avGevTTTZBZftvs+xTdPnNyyS1 eKrvArpAHAAABz3Hw73F1Pw73Hw4AHAAO8Om7EJXNJ/59xn+nrrsl5aD6065s5ushGJq4+jR1vM1 U65Y+pmty7pzquySTyt5C+NWhkPI6NM457aMnbztFajicrJ7fUHs0YqsUWV57ai+2/WyZUX6NLMY S7qcmlR3ZrZNFNHACvMAAAAAADnuPh3uLqfh3uPhwAOAAAAAFtR1vP8Azend57PUeufSpNIsK7iV 1V+7CF1XMlPTzJnNXI0M/blWq+MS6nlvdNzH08/JUMLTjjUv5WrW/rfNvQhsJcyrOcuzm9frs1Tz uXt5POZs4BCAAAAAAAAAADnuPh3uLqfh3uPhwAOAAAAAAATgdSlWH1EMJmzC5fiy5L6nQ+d2Hnyw t75+U7m/mGKtX2fPnNnuRTGuyO7trSyJTl9Iv8+tHPOead9PXVS4npoVkeAEId4AAAAAAAAAAAAA AOe4+He4up+He4+HAA4AAAAAAAAAAAAAXaGSSr1suJzoByfZ1gAAAAAAAAAAAAAAAAAAAAAAAAAA DnuPh3uLqfh3uPhwAOAAAAAAAAAAAAAAAAAAAABZMoLagAAAAAAAAAAAAAAAAAAAAAAAc9x8O9xd T8O9x8OABwAAAAAAAAAAAAAAAAAAA1xjfy+utZ1zAYWrw+WNDPcAAAAAAAAAAAAAAAAAAAAc9x8O 9xdr+c+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g +nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+nD5g+ nD5v6QD/2gAIAQIAAQUA/wDLaxVhvEW1WP8AKZgI9vUMJnMBlb8h/IZ+jZLE9MzMBxKzghxgEH+M 5jGMRGMZjBK6yYoAnKPbxPnrg29P7KiVXary2oLApMKkfXbxbwcw8s46V1CZxMzM8ZY2FN1wYJZc a1CCnZINdikKARsVcT9UxhGnCKmIJ1+OJeplIBbHUjpkLNbaCslgYXAtX9QjoYwhHyY+AWASxeip iBTG6AjMyM0WkBLSYEVoylT9FUzHICQwxiPhiBMziBCwE5E/AATpG6yxSw4dawVlZlZwdgBl+gq/ B2hhhnEmHAg6EHAOZxnHEAhM8YzCFxGYSmzrWwUq6mKY1YZfmRCYTHboYYxhYRmbivKdAciZzBDO UJEOTCkKqIzLKQsHhzIldplVsPj8gGSegYxjkmMwABDTOYTOUHiixliscgw4z0hjCOIwErBBXwYE xDK2li/LUOrGM0JjNgbO2XbXcNWTgH7iuYv2zr8AcGP8MmM5nMwtK+LgDpFAiQLkfIDhXaEwxkYw 9vTKooXGI6qoAyuOufgRAczl1OJhYzKIXWMMmpSpgaIeqLOXFfigySYwJmPi3WYAGS5YBlfoK/A9 IT9oOYMiP4B8TkDGMZQ0CsGQZB8IGwabZawK/FfEiERsQ/BjgF8t4Imc2dYDhVbIH+oOCJyh4GMk JcQt1Ccogh6kqYRKm65yPkQ5jdI/jGbEc9EOWPgv2it8uwwgOCjghlBnLA5Q4MPJYWzOORVnGTAM wsROZJrAMC4X5FODZZk5jNiOxyc5UDktvK23/UHDIwZbExEeBiRyVoyEQvmK+C6EGkQIFhMDQkEB cylDl+g+Rj8TG6qfAj7QcOvVblKmizqSJZWREsmQ8OVjYeYYSrBVUweIIZcE9IGlZBNVcb/b4seh +Jn+CcQf67CcTrPyU4YOprapw45FS6KTzIIPmKVOeHNUWFojZBYRkEKkSk/cOlHyMYfh/k/C9TKm yLE5qC1dhAZSwada2DCxWBEKcxWGU8A0rGI4wGiHBZgYwMVjK0+5ulXx49GHUweBhEIxGXI4lGYd LqRYuu7Kba4q8oqMhK81rQBjVg4IgzkjIdSJ4QHIUZi09aaQJe3yL1DLGEHiR8CIR0ZOUr6FkIll WYhLBqsFkyFHGArB1DmDxVocGMhmMTXXLV1Ists4kkk/FTglcgrmMhEx8hWMnXHIKOpXE5iKRgiN mVno4+AMxyHIiFQZo15dj1tbk/yoAwKAwpCkKTEImZ0IbInmGHwc4lTZjRvFGwTgh0g6FDPILivT bFaiuW2/Oj8SHUz/ACRCIRCI8rjwk5XqlglZw3QixcQGVnIJIJqJNNRLKoVS2I9hJ+it0Nimf4Ih EdYo6usYdaycWLmDoazCMxlIatSSmuzRdeGsVg3gB7S31UbIPiRGWcepHS2uIsKyyvrWhgpJD0NK qMBLRxe0CWWFz9fMDjBYZC5jLgHBCoIeOWpTigQQWkFrmMaxm/jBiIWJ/wDmP//aAAgBAwABBQD/ AMt70WHc617Kuf5T2Kssud4VM44BE17vMX+P4SzYAGSYB149CIwyORR12VZUcMP4t74GclVgECwi FC0GuuVTE8nlMkTJMGY1oUg5mROn19k/cogEAmJjMCwLAkCQVZjVqIcCNWGjhq1a5s0WFmU5H1bT l0EUQCAQCARVipFSKoxfXiCuFI9WZs6QnNqzrXiwfUb/AFs/3URYBAIBFEVYMCZlf3CyvqUEWrMt UCWDpeCrecwiblilWDL9FmAjPmWDosURRAIogiI7SvSdoutVXCoZWByEJLKEW7xsmwIwgUzSs+36 DMBHs6oOtnggiCCKsVMyirJRkEN+Cbi0tsioTDhY1TGWUkSxcTZryGXEKuIeQmne6t8zuFDucL1K DAIzEXEURAuTiIpxX0VegY/dX4nXJFaOB/zUWXKJbaxlmZf4W9WAJhJErZeQII+Twlj5JOSiTGYq TEEQRRA3TzCZU4xdUoVq8GvzODLZDyjkiMxjsZcRi0YdSBDgxwBNDY5D5LWwp6lR1AwFWKmAR1UR TgAwDlKlWVgR1yvLM1CBOkZQY9Sy2oSxZsAiOcn/ADxhRSKSUs/x8bus45igCCKTPMIAbMETJijq OgqXC1GBsxhxJp6CywQ7LR3do+Y5MvIIbxwZnq1mJqqHv+S09Q5JWc8BLSwyTEEAi9DSI56pkrQB 5zLxLhWGu+C9YMtQiMSI1hjtNhyCepGDOHRlmhTxPxc4V8tPL6r1gOIvUKvQCL4kyroAM2MOJUjz mAYOOvg3nOsbYUywoZZLHxL2z8AYrAx1Bmi+U+RqlZWXqEJGBFAEUfBfEDJYYWk5s8Q6ENVfP9ja JzKwurRzGebB6McmKMwVLixSJpE+d8nLjGIyXzFwAsHwxhavHOR1RqrchxmH7SrukNysLI5hfMtf EtszAOpTp4EOVj2Aro1ED5Nq05PUVGJEOQsXx/wDg1tmWDojYldoYWCBykLgwviM2ZY+DbbmKoaZ IK9YyQ5E1tR77L1VD8bW4o5+6V9IvQ1mLAYpjeKtghgwY8SGgtOHIM5YJeNZLbJgsSCDyzFbEFim WgY7UAKrG5P8dizkzxvFT9wPRDAYDFMzkAwMRC2RyweULyx41vR7erkxBiWLkAGIyx6xC5xqpw0v jbf1B/6MIOqE9RAcFWmYGivGaBpzjPPM6NaM2WYhbJOMA8wrYPQxlILQWnGpoPa2wQlXx2EKPYvQ /cqdGdcFDyURH+0PmCzB54nPIFvVrMQ2ZVriC9hMUllHUnwDEEtyisVOQRZ1NWmglICJdZ5j/G6s OueLYKlkDAfcMFSwGSOJYlTZ0C2c1rt+52ORYSEYiOMFAJWcO68X/wAMsAzB1gJU0J5l1VYIuclv l2BwItInmgTKmBladBHUMvMYUq1ZBQnLRsmtBkgAPdjKDocgkhgpKk4IPQqjEJqWvNTUWoWWhB81 1QsWzWsUsjBVJiMQ1xxKWJjHkyj7rR96gYAJSs9bMgAKyL0JEUDOSImTCpL0UhFWnEe4n6WBLqVI Iw75ZKXjdHJwbeoQ5BZlh6FuqoeLOuZnoT1FNlq06bAa+kEYGtZbeGX6ZGRfR95q/wCdY6uOmcrW TEbrYRjGURsRzKFZ0upZRr6j2FK1Abgodyx+vgYbUIZtditoattU8nfUbNyWIdag+XdokrXouWTi g5xnJ/jPTW8SpE+GBn/5d//aAAgBAQABBQD/AN5mVF/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5j tM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/L9pn5jtM/M dpn5jtM/L9pn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5 jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/Mdpn5jtM/ Mdpi917W7TvHpP8AJVHaGm0Qgj/wOz+rTvHpP8ZVLHX7Vt3tq+3aki6dFANQaXdrouPc+zWap/nd n9WnePSf4un2+/abT7ZRqOxprUlVCK1kZlgVJbV5tfcNNtS/+b2f1ad49J/h1a11x0+y4lFCqDTr 0lUVlNfmwhq1XnHNbzj9vdO3rt03U2Uv/M7P6tO8ek/wQMzU0ntfR1Era5sta6VqKlZQpuHWsqtx LWMCSELqjF14ju2imwroyN/L7P6tO8ek/wACmlrWp0qqxpUoLKnB2LHBstWusLW11dfFAlNiuz2k 4dV5cyxrKsDi4ALt6OvaatTQofd1dayWU2V/yez+rTvHpP10Us2tUEUJhWArpYpXSqIirT56BnZa qfJZ67bWA4AOzO9qpHOZZsoG2dpgbbrbCaLideqtDs6guotqep4EZpR21rFu7fs0nBymvYw/pW4e p0P1+z+rTvHpP19FMvShJoRXlah6qqhaldJ2Ig5itBrmyvYtYNxVTaxawgbey9Z2N3ac5IDZMNbY KPhK3LV69P8AX2tKuwV9l1K9a2vVWutWaVUvZV//ADNbtf7fNC2dutRbhXi1ArBGMGtcYda4Qoy/ T7P6tO8ek/X0B9tSsHQHjQhtWsM8rzWuujUsa7rbHfjVrllR7mJ2t1ll9zFhWVjKxgQzgc8CYAAR exawZbTqrvVezi+P2FKJR29Enl1UpvbdHl9WG72z+wPxdivVoooGsIactdVVNrXCfS7P6tO8ek/X 0RgIxR1LVvQbEXVBQUVsl1jPbfdshZWTXU1gebG0OLuZV9zscwgkhXaHAhJMJwOvJEyuoh46zzzA 73bKVrsbtuxY+Wg6RaiRsapYVrgjVdjagQXKA1lYdbFKP9Ds/q07x6T9fUUipWDMjBtnWKnYrcNt WM19ltqIgby0JOL9hnjORHJZlpCIyEg/aGLCYxM4jtFBB1fLMrINYe5V2txqhRtXXmw1oCwAoAVW 3EYl9gy4uJXthqmBMt1meOr1tvqBb9Ds/q07x6T9fRYLV/8AjbBsf/7bQvJrAsDNzfYVJbezghxC AApCqbAWZbXPHDZAAIwYzdQ2TRcEOvcvBLMHuRL7AYIguRYbgAoa1ksGK0YnyMjY0+LJegJCMuzS jJu0ZX6HZ/Vp3j0n62sqtZq/cQCFXpFGD5hSBmYknJJMUDNhy1uFH2lFKIGswA5MYQdS7x3xDYc1 2TTsIj7DAM3XLsMish8mrLtUigKVAQlpYea7VAeeXYp4WGHt6uG7HQw2+z3UJ83Z/Vp3j0n62rWw s1VIIyCj9fMDNjJU4niVIADMXwVhVnCqSUP2spYlwsZgIbwoa4mNaBDZk18ydZyJYxllhMOwEDWk FGLmhVAVwAhNhqUQjEvqDggizgAVXEwI6oU7lqmm/wCXs/q07x6T9RVJldMoA86tilhUsi9YuBAc zICl8RUEBCMw5AjKVnEVirPb1suAj7HRrYBY5r0XaV6lagIixiFa21cMwyXxMljRkRGxAxc6daCt eKsxUSzBGzXyleHr44nHMbw7nrC6tlKt8nZ/Vp3j0n6aIWKV4gQzyRWbcZoYlF8VP3HpWWBZK82C rAc/e1nFS5AZeC7VoSx73Y/c0r1bHiaSCJSiQ4hYCA8iQstRMkDHDMrryRhRWTYw6Cq9lC3Ph3fi 15RmcMADWRZHtM8wibKKy9wqItx8nZ/Vp3j0n6SIWKVyugwoqy64vZlrJV0VPBYoDmoAvWCGW37b bQq+azBeNK3ede23SwapMstCCAATMLQuojupn+qvcSRkzjFrzGK1qmXKHgA7mI7St2xUel2ulgsq ehrGPHXZbHaok/1wZXTWpbVoM2u06Vidx0G07Ph2f1ad49J+jXWWNdeTVTiHCwqbXuCg0qcKOgwI DhVIK1no+wimzYzK0e98eUoM4kC0tbsPUtKi9SF5NLLVUBmIezLhjHswHYeYi5i1kx3FarW9hqpA C0DKVDiKhKlWIgMKTZrBDA1FqSZVtX1Qb1ZC7AYhwwdundKxbSRgzs/q07x6T9BFLFKyBVWAAs2D gZRKl+5kAArOIvQJlg9gKszZeuxRq9vs2TZrjXUV2B+ak2ElK1FWztWGwhFEYnjsZUO7lVssWJgq yMR5ZD1OqjmWC1CKoEWBwoS+sB9rJrcharhystQxrQ8vUSsYVqgY1QEGuIP7CjzbRNp+S2f7zs/q 07x6T89NLWslCIcHCLgDADf9LNizk1SdFHRCvAciFosVUpoVAiAMQ519l9aC5rn2rRxqqPF6nxdS 3Jfunl9PuxcwiuIHAlFiKFVWDUgwUqIMCcxPOUQ3mAu0WpjKqOtWsTE11EevK3VvS7nkCVRUYMAm Y1eIFUxqgZtagsTYpem2dn9WnePSfn1vtRazxKgL0xcwAeziqLkgAQnMBGdM0Vi682mggVsgAsrP IlePHC+VyFfCtbQ4Z2PG64I2vY5hKspoJNyf9mr6quGoZ64+1if2WM8xjMtFTMVEWKy4R0lVqAVW CIwMbEvUOCvFsDNakRfDMwIVyHrxO89uFtRGJ2f1ad49J+alctRWIU6ooLXsEVmayHrKxxGeoyx0 dG3as2dUUFWQu4VEaw45NYiUsUVeRcFWXzDLmxXbsswfLEXFVpcEqwm1xLsgxZXka7C1fLWGoRqT PKIirAzKEZzKyJXZriIus4WsoBYTLT0vHXqwDgDzAYG6L4kwsCHVWHeNL+tf2f1ad49J+bXSVJwU nqCEWzle9rqIoyYiHGnpW7NmroJp1bfQ0otuxY3V1DCqosbGqBsqAllIUuRmx7GtbWJIqrxavLYV eLITjZqYHmWQeNDFNiATjOAhqBn9fMqqAApXC1srIqmIrAPdYlnmqRYQShwC4xzJI81pXXYZ5LYb XcBkZZ3igX6vaPVp3j0n5UGTqV5bOS1gEw1ktvRFCknEVJra7329v0k19fjl+51AV0VsowM1JWrs 9ZeyoFuQIsJ5O9l7MnlILuTccTlz2h1fGJaOVakg5ZCcLcrAjMByBBF8VxE4iDi7eWAUUibFS2Iy mokdeLApx5VY5+BDRepaWgFd0jh2r1md49J+WodNY4RrCIFSuWXM0C5gwJWrOdbSAla1pZr9zr47 Hc9XWr7j3Tb2zTcpVQC1rOwTfYm7aHJxdZGZCqny22j/AMa1ySGEH2bOcOGyFPSwcLDxYWUWgI7r EvMXZRWW6sg7FYH9omLZc0qULEdElDWuVOC4mwoYKmJ/h6g8Ftqstuxmos0BCgODLAQO62+WvaPV 53j0n5B1KCVkgAitQWcitjOBMKIkqurn9/7fyIj92smvZtbFjVXVqlqJbfaGaum7g5dn0aVaruFw or1vMddjlwvsH9VKeNT/AOuxnlnMQ5gIlyBkyBKSHWyiKCCERoaSsrNRldVWaqkwNdWiaixaih80 qP7EY5ZzgpOM4Lnqsp2EUixGBY58zI9xXf8AftHq07x6T8lYyaULvlaxXSXCoFUE4dsDkwgYwvZn ixlNXJqGemWbAcM6vbr691tjr/USwkW6FuZtZu36EKTdV2lr4DOCtijhsAgaqebTxatlIM6kXa5z S5rcAENTmFChDYgGCvIxXauU28pWYq85bWOLDoWGCeRQQQrMR6gZxKlLjHcKO83C3d7P6tO8ek/J X/rSMCmsueaMrqFhtcTJENlTrSqiy16mHHJrKAhgBbbk1UO5XjXr7Gwdqy6gqlBYDV/++sdLnBl7 cra1w/Esm4Djt7DiywrhvMKgMrjZGG1bOdQE4Bo1ECMpTJlZEOnXYtVrViq7o7HF7SxiznksUYGY IBCsdIy9N/Z/r12OXftHq07x6T8lS5FNWYlaQBCCicSiK9jIJgNOPRcCKDY74C6y37DLqMt2URdh inbtGoBHUM2wopWkFWqGF2y011537GvmVXTbUY0Oj4yLEikQ1CWJYwrfywmxiJehiuhi1qwbTMrq ZDUmThSoc67m0OjEQDqA5frj/AgMHWFY1YI7/QTrzs/q07x6T8mioMyQPMieZZGS0yyrinEA1hQK 1Lm3oKwVlubGoc61GjTxG1SK7tqwmnSAKggNv3AyihnAsPC9ec7evLaYZj0q8fKtqlarlEK5lleI rPCpitVZDp1tP6lyny71NT3EJt7CSq9bmSsQqvG0ZVbjWXcRizSpGEIZT/ZUMtimeYIhDTwnSdx1 hdrupV+z+rTvHpPyK7Katm0mu0NKHMyxNqFCGID4d+YWPkFf+p16ATUc7WrWRVt2M9tqKV0HK1+B 23LPp0eXq7X/ACaywCrtKEvgZZcHcrIZG+6q+L9wsBMTNbIfus10tldjVMlqNOAaGhgUyp/xXaBC Ay2ooDopi0AEgcVc1y1iB5VbBdRMrrmBLEjNbObicw695p8rd7R6tO8ek/LW3FgRzqHmMjMJazMh uLBazLAglVBdaaq6qPPXGhUOZZQNkeXbzJIqNdWxbinSpOztKAF30DI5InbyEr8Yy8o9amWUCt3r ao1X9EdbAKxHpMUFTevmBqvLWi5bZW2YFRoilTbxK0XEm8rhjkzxjpyHLLAryGIhGMQrmWVgjqp9 xEHZ7P6tO8ek/NVZ9usFStmYwGxzXQimwoqqh2HUNn+sUWjQ1jU9QWumzkm85azt2sb33k4yx2sT tpC1oft2U5jbqsVtW7JpsDQS1DGrW1WVtd7NMMqGyo17GDUyOGpDTy2Bp4qH0da9EL6ttfh0aWdB dca2a8WK7HIGFVZxj1gguUdW5BHIKuPg3SXsobut/n7faPVp3j0n5tdS1qUO0VCINdsPaoVaTa2s iqasJcwV60DcqSC1JxbsBrtyilKae41ZV67Km1HUxPGwEzb1fMVq2V6LCTVbygHIPXxN1C3LVY+v YUquFmhYpHm1ynZticLVNErBEv1q9hKHv0mW0EOwE20DStrqzShYkZiwDqwjorRFCHCMCeMS4R3B Xuu55VZJJ7P6tO8ek/LWhsfU066F5YZWzCTwStbbERFFXSyzNe3r5MP2moCOOF2utQ31GRsV8ltw HpL0PQ+QVyHTE3KWrtNZsFNplNgYMgYcCh2NVLkqZ6LUs6fY4bVSA21HXPmqyYgX7e4V5XU2iha4 EX28owUGraVopyPCCERlhGCCVgYNDgSywJX3Js1zs/q07x6T8va9fqp4m5cRIoBRDxcGVH79tS01 LMy8ESjIF1jedoqbL6jkWDM7lUVttBuq1NjIpcEWV5G7QXrUlDbrlhTcUmtsBo1YYEFDfqLsIDdq NW3JUWIpIsru1DRcLV5CXkFb9XDV2vGZidhCVK3UNq7K2KDFOIOoKxkzHQiNkS2/jLdg3zubDjOz +rTvHpPyaVAsesABv9SOVdcQ4X/KHJr8b8SkcbXOUXpNpxyA8q3Vt6YzO408q6j5dmyvBtTYzEYM tlYm7qOrU2ODbqJcCl1B1ds44hxwcNdQt1TV3aL0WpcqHI6FLM6mxXeliWHJuPE8SWx0tTIYKxs1 nqNO9xiWcgrQEGERhHXpvlgV6Lv2c7Z2f1ad49J+Tt9eNesdCua6ySFHVM8KxyFJJAODec1u4WIQ yLX9u3UGFf8A2o07cyh+QtQMNumyu2pFuqZLKJqXlZ9rpZUHXa17aLNa4MrAOP6DoaWszUwsHAib tHmV02f1ba7Ayl2m5V5w1dhte0uuGIawgxEzLE6EMHRlVjr1WBabqiLbVi3AxLAYescdN7rZe/Cp 25NOz+rTvHpPxpqa2zXrC1oMMnVKyVZhxsSFfKtQ8XBySA9aDzadWyKqmvZqGNRgHYNU2lsDBQMm 5SWSvZFeyK1sW+izWmntFRyRxtawurYNRZS62BGYRkFy0XvTarh4SJv6S7A09jymZxHIZb1/6V7F vClQAgJi4AYS9OgqJlNjGIqmcVw2upLKyxLMRiCN3rf3Q8df4dn9WnePSfj2fWyR0fH3VeLjjc55 So5G0MRsckMrIwv/ADtDCu3UuDLYgebNXA8ua0WNS+ptKwsXI7ppFLNHZ5LVYhmxoGs6tqhcB13t QXJrudewEEVWCbaLauttlrOfVrVxvaYslGyywuBGBN7O1d1L8gsHwcTywp4KRyKlHBhMYZln2Mjy 5+d/dz9vw7P6tO8ekwAk6uiXOuAgvUrcACtZm4oDV9VqJBtUvWMMKnnOX4h+9NPYKsjhhtVyshZ5 fJadjyn1tgW17FK3Ltadmvbq3ealNvGXV11trXDnYwDbunXsihrNWwWPyS1cbjtqbVWwLq3cE8ur 1o88tVOzkVOjOO23ZC5yJiMIwxEPVwWnPjK78zkCNjBFl4QAEHutoe74dn9WnePSZ2zUTGPLsTpN sckqYEV+N9RsSlsMP9+YC8vvIIldx5EAhGKFjNTZBVgCu3RatiXB6bES+vQ221bRYli7ahkN6VWr YrJU9bLtVV6tlG0tyhgD3XWF009nnAzA76G+nXst1iL1ISwGczAWjkkKa6WZij6+0lqrZA0GCHWc cE5EtRMBuBFoUbG/yZCWNzhEtYu/w7P6tO7+kzt9oavZryqsCEIZFBrsU4KPLuK3cvtVsrsKAa2w W6hXVltJV6WIn/Sg62yl63oLK1L61y2gSylbq9DasqLkMO4dtcjR3WoK7CKCRcnmnU2fOTHmAja1 GV69piotl65eksWqHEpyijo/hdSTY1TMxpspbX2PNCvFaA5hHVhHbEt261e3bssCACAgL3HYwvx7 P6tO8ekzRv8ALsrfmhBretzjYrLpTYGVTL1BSp8xGwcqRni3LlB9hdea0swWq3KH/wDVvqvS1N6q at+ZQ/E7aOh0+4C5Ddyncqlzp3goljCdzUsdC/lSHzEbJNdZjV1k30FGRwt1a9K5mEZFinFnhThh bqurU7WQtgAVwYTkMZstxTwdQMYwu1uLWLLGsf49n9WnePSYDg6G1yWxBbWpIiWkS5CjJZmK4ly+ W4fIVpcAQrRj9qP9pPVbKWN5LJpbQUsRYuwr031XB1D+YgsOrsiwGNixb9YoybBMdVurpDJcbX5I wIX7px6bFYatwJrWrZVXkQQiEYjICD9jq6MLdauwA267V3dFfkD0HcbcVLWHCVhZvbHkI7s7fJ2f 1ad49J+Gtd5b9t2ELbVAzzxFsDC1DUyWiZV1DNW4fqGBH+rAZWtiDiIQr12AraSllVwddivza62N NtbDG9TzaixkCOSVUEtr1ObkqqSzXbyKWZpXkSpkwD0sHTbB5at/B63gMOYV6EYl9eSlpraq4NCq vHqNDpcUZ7FZNl/NtUGKRO43eZf8vZ/Vp3j0n46ZF1KC8RqGYPXdTBZ5islqSu7rYBYA2RVZkW/c qWgi2zjKWV0vrxKrptrymleFlf3C3SWyJq7FUet3R0PKjmxTwTJm5UXWzYsqp17C1oFgNZ5AdI03 a+pUCamwpCuQQczAMcQ+F9XVLGQ0bCMLipRLFLbG7wSsdBNzdWlWJY/L2f1ad49J+Pb7/LsqTlKw xKr0soVLODIL9QMtNbAtrCyPU9RrYk2UMxNVnGmw1Su2u2Ppo0t1LVUV4sR7FepyQCWhQY2+j6X+ lS5iAAMAZ3GssVr8tq8GVzEYR0DC6riQnOUXB1qbEBhxLATAmF2yEcbqILO4W3IpsxapUV4Cbm+t Yd2dvm7P6tO8ek/EEg9v2fNrVwXBAlrDmqh1aotPLNVwUGbFOJUQbEQkNWxFoJatADWrR1PC7gh1 GUmoZiIBGGRv0lrtPjzpbBXqOk3wDLCwXUtzKbA3wMOJsJ9gbg7aqWBjs0zXu5Aw+NlgA2rVsZ6V ISpkFa8ps2hW2N9nBJJ+fs/q07x6T8lV1lLU92IKdx17RZehmrepXkDGZjfWBw2VJFRU369ambCc A78TWAVpXpgEb4AOn/vQcRYfDugmq4SxWUys5GJemW2tc1sOStTaCanDLCJYOQ2qmRtbYwLB51bN bQtm5s41N7zk27xWijohgUSwpRXda1tn0ez+rTvHpPzKxU13KVVgIu1cjDYW0azcqrELF6wl2njN 9Qc3VqLNVya6MFSJ3OvrXYyWVkAr4Hw3aPNrOn9upZxFLiCWD7rKw63KyMhwaL+BrIZTiGbSc1Ct W9dRaNrcajs1htdqVr3b3turIKgiFgJ3Da81/pdn9WnePSfoB2E81ppXEjRs6W5liAJp2fdcuRcg Mqbi2o5IIyN+vNJXprWBkofkuDggS1Aj5KNTaHVGyHBzxM3aSp6LEbidPZKMxzGYCM2RuMMUbGwh 2tjatWutGVKwBtMPPO/XUrdycy3aus+p2f1ad49J+lRcam0NjIe4EWWZmm48xkDVOq4P+utZh0OV sRWD0IhFZc6dj12rGWbdRK2NixHwdW7DEZHXOygI28I3mnFVoYa2ylqWL02L661W87DqMRhyrpHX d21pVnZm+t2f1ad49J+nqbBqYbIK2XAjR2FNtVgNLt93LjYpImu/JD1m6ArFuFzgWV6totqMsDza Ty2ptEWw517edbKTLLBy7jZUFXIP/RRq7Cot3cRx3bs169qq53KBF2aFqu7gzRmLH6/Z/Vp3j0n6 gtcA2OZTaa7NbdHlPYxNrkGqwGaNuIHBG7WXr2GmrsKJr7AptUo6uQF7kAAuyA42VYa9uAtmU2rq UTe2jdfXcgQbVKhraza29Si23Pa3wyf4XZ/Vp3j0n69G29U/JrL917ZRvsk0twOtVoYO2R3myug1 7diN+UbHau62va21Uo7t3VLYtjBtbc1cbO/Xrkd+umx3K26EknJmT/I7P6tO8ek/w9bZfXavvZSX d/vdbLHsb4KSpsvts/8AB7P6tO8ek/8At9n9WnePSf8A2+z+rTvHpP8ALpouvddLcY/1djyP5vZ/ Vp3j0n+X7Uvs17dVWp2tqxD2rsPadbc7f/U7LSPcFWql38rs/q07x6T/ACuza/t26pdT2KhGr7GE /qexuKN7MTS/qexodL2IZ3irtFWx/J7P6tL6U2KP157bn689tz9ee25+vPbc/Xntufrz23P157bn 689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPb c/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P15 7bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+vPbc/Xntufrz23P157bn689tz9ee25+ vPbc/Xntufrz23P157bn689tz9ee25+vPbc/XntuUewvb+vf/wC//9oACAECAgY/AP6XVmhHxdSO dkVnyTtsT9zz8TQl8CcxXUfGyKpeEb/Ewexrpqef4oTo7vsbN+5OKYpKUPzcC/J/Mm1yiiKp+uyg /wBFyJpKWvoNbTqS0Rk1g/d+K2glvratSEJOq4E7TRCa0fr+6E1xQjXcl4VeSSGlyUUeDg0+pD0Y na5Q1uq+q/UpjXCjNSNBp+lL0GlnkrjXGSFQWFCor1qqP0ZeEYvCNWTuJMrll6Y6EbE7FMHChpZ5 2zaD66kPXfBPPUnCNyMNcHlgjI23CR2VSUVw9ypJGFVk0ZuvfN2WWcrtVLLf1ZK9sFNDU8vD5Yp5 uGR63Z0W6OtiSS4Jf6naCdFsJ+csM0OTQqUKk5G36nFqwS4RHAicVcVKYU+maolzXNpkpqyB+XJB QfhEMawlGhwUuKpNcrCd8I4yJ+k2xt/Ih7juew53Y43wglENEpnDx7KmM4Q88lMUNzO434k8aIpo TjG5K1RF1GTayHQ63ObX+hSq2ZXJ5xSyxgxkkjbf8YwXFxJ7kMlFNSmvBRkUV2xDOt2edh++d4wL 6MlHVnV6o8M6vVEOqO1jOGif5I4E/wCSyfkijxT8ehGDJQ7Rp6kPmgr7PmdL1D2ezKc6kr9y2JWp 2ShrUlHZfNDKY1JIdRMjxknPDwTW42l+SOr04NKMdl0zsUo0dvqeLtSmhQW41kg0E7vodckehD12 Haymx3tXudLymvIrvrhplh4pGktD9iXln0JWDXOFT3xjLDqiUS9q4N+rXCUVxh+hoVhDtRFufwa5 4xXsSThOEEOqJQkK08Dj0qqSij0IxjJMEOjJmpqR8HOM4URVEuiRwJyS/ga5K49lcmS/oNrc0K/D UKv+8f/aAAgBAwIGPwD+l1cvhFLP1Iadj8/F1Y0vxtNq6EbvWUU24If7lr/v8RI4K7mn+x92Ub8s 2+YrraQTF08JE6eHr8NBXnGuhxhUhJIndFUUoVRDpPPwUe/paGmFVJFug5Zq/XrzqfL0pRXCpK2q boh0fqsj0IwqipQnBjjQo+vsKX2XkVy39OORXrVZ4SPycI0n3Pxi0ehBG+DxkdjfpUFNWRl8Du/j a6n4IhVGhJPDrbW77ZGNOhRyOZkSubdr5z+cPYl75KlMHZMS5GuR11Id312E1UhtWr9SkFKkYTjD qKaCarnSFmrhQ6zImuST8LotKts0NMjxlan/AJ3arTPSt32IWfhIlDf/ANDXGgmy618kFVkbwgqx sUbNPLBTQoTmhDXgr7jXDnCNmK+xsUPTkiEmVeFRjwrgo01eWuiIdMG4gquuVspuM6vRo8Ebj/xv 5FKPGuDyQx37RCyNmp+6CZkfgnLUt8s7W/Qtu0rhDRMwyqkhoo64RkjB2PWx/fK2qNDEJakZEkKN hN7YdloRcdkypysjwjCVqTLPF1uVsbmWyLPnBy884TsQ9NmUfZH5FCVhJTJrKJP/AEuWqhZelr01 JHGvo0IeEPTDxix/lD2IeqwoQW2pUn8nwi2y1QrLEsn6YNDeaScJJRDyNDIIIuU+dzkjC25rkd3L yOxfx+5InyiORPNDJWSMNSUJ84+xEEqg0y17u375HZbqtz/tQaPNomiHvp6lKjkk6x/1ZDpjJDqJ 3rrZr7i/xrf/AEydloxNHb6nvQgj/iQRwRjJDw7ErBrhYRhFzqtGQ8EluJtS1ydrqJE7KiyQOy75 Er5koh/utExPCUK5bkfytIbo8IdYGtmQVIOE9Mn+hGxalpbUqdU/xtzPjVFYaKLXY7LYgi75EW6o 63qPI7GyZ+hIngk/2tidukYSVIeKutUyS6SUq3qzrbrnjfY0lCcDW0YL2xXnFqdCBe40Q8GuSLqk L7nSKitROxFtPPp9koa4Ge1MJ5ExNbYUep2WHuSeSh2tH3dXsh33Ps3p4Ks62KFu/UhkrQY1xi4x TR1fyIJjQ7QztcutvLFEJITb+RwuPgIG7VMnkdPchLXQlbnVqXGx+dJJsacbCf8Aku62rjU6pUWh HVEaLx8NN1sn4WpYTH93/wD/2gAIAQEBBj8A/wBeM5kRjEEykSwAFySvzun82H1L87p/Nh9S/O6f zYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fz YfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzY fUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYf Uvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfU vzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUv zun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvzun82H1L87p/Nh9S/O6fzYfUvz un82H1L87p/Nh9SEIdZoSlIgRiNWBJJsAM2zrvT6vgl713QSnMD8iqj/AEDofUaXjjs670+r4Je7 sA5QAgw3lCWucx3IfbgD8AgDADtRE4xruCOpph9PHh7/AND6jS8cdnXen1fBL3YCIaOJKi/fkd4Q hG5wVLoE8o4LLIV3LK5BwKnpz7wIY9hRheJrE8Pfuh9RpeOOzrvT6vgl7o0Ikoamu7bgEIacSBvZ kJO8sHWdqtdUkyaIcIynFhgqYLNE1xRdhqRrA/7I6eoGkN/vvQ+o0vHHZ13p9XwS9zjmFEBlaIDH tQhEN/7ICKE5irUTA5QKFCEKkYLNNhwWTKX3rvUdOCwO5ZR3olZohpxxRjIMR750PqNLxx2dd6fV 8EvcWjbEoUeRxKeVhZGMS8AK9qjGJclZmeQxKBlIgcF9vTvxqjqakgSbAWWWEX4qoc4o0cbiFlNO CIc8F3i6fUGWR/kE+q+oNzrP0gMTjEld8N7z0PqNLxx2dd6fV8EvcBEYqgTm6jJ++WonDCX+6Gp/ IhyShqEkA4I6eiKihWbUk8z8kAKQFyqCyoDlxOC7wL4MHT5R8VludwRGUHcRVliXXKarvnNLcLIi IrgEYyDNsoCV3zlJsEXhmiP5CoTYpwNjSHuHQ+o0vHHZ13p9XwS9wMyHAQiO0qRlaNkdWVxy/BDU lXcFmJIhG4GK+zp0yqpeRuUCRlg90MofsRMo5QsuVZYEZrssrgE7kz1xKu6oKnFd+RKGUIDM02rI nFFwM4vxQ1taGaT0DsF/i0mruTgUF00QHNCTghqE5yd1E8SYjHFZtM/dG7FGMxXEG6LWVA65SuUq ob9PofUaXjjs670+r4Je4DiXQiLyU9MPRfbdhG4R0tM5RGhR0dM967nFEyrIp5tGAr2qgfciZBns EwHxKaB+S3yOKMpF5G5Oyzn9k5qnKDCyAsEJuexH7kXGAJRhHUEdL+1g/wA1FtVwf4shpxs9VYRA RgQ4NmXdAgMGus0ZNqCxa/asuoqCqqiwomIBWeFj+l0PqNLxx2dd6fV8EvcI9iE2qbIvXUnVkRGu oS5UoCurKpPFfc1iHwGCAiGjG5WWETKRoE+qWJqyuwxKyw+ae5RmWaNB2qjdqe4TPTcEybBcVS6A PeRJ+CBQ1CXESxjiyzQ7ox3qUYkjTjcn+ieRtZACr4rcsFkkO9hxTk0WUfEqlkRgUYnD9HofUaXj js670+r4Je4RPCi0/wC0I6h5Yhgp6loYI6oDQiG7ShGAo9ZIacA8ju3oZqyaqz6hpdl3aRwVk1kC cVmlQYBYPYBCINcVxK4bBI0CGZyu6OxGMYuEDGh/kpAnum5KAjhijxWaZbFZdMGcuFlygPxXfizW kE38hdE3dUossqFOMR+j0PqNLxx2dd6fV8EvcIiWEf6rTiN7lRjG2KjGNrFacdO71ZZQa8EGLA3K Ld471e9gq/NZpFzgpajVwQbvSTmg3JyXZErMU5qdwTgIZrKyDG64HFCES4uWWWAA3lEkZ5bzgs0i 5wCz6xaOEFkgBEcFVMQ4WaAY7sCsmoMp4p4yB+KILHcUd8f0eh9RpeOOzrvT6vgl+vXAOoxNkZbi w7EJfugDjcp3rZ1eqZ+0ogV4qoqLIAKgqUXJJBoMFaqMpFtwRYOSnkgDQCrBMA2yqqsrrKKcUSBU 3JVE8i5wiMVnlfAblWysnKzYYJpRHwRdqWKIBIbcmJI4qsiUSKI6kDmiLjEe30PqNLxx2dd6fV8E v1weCffZEYIA8oLp96FboP8ABHs2URkTVObDejEHKF3fmq2TRFVWp/ZMKnE+w7JjdVKZ2CyR7x3r NKpQQTnBUsEw+WwtQoCVCKFcFRVRpwZSlENCRp7XQ+o0vHHZ13p9XwS/VonKiLBNusswxQ/fYMHC Cu3FMC7psUwWUfFHKK7ypAVYnZU/BMKJgqBPMsrVTAJ07urqmx06fDBPw/dUTlOE45ghvConTYFS AvcIg3Hs9D6jS8cdnXen1fBL9TgqbIyBqgQa4ojABME25ZsQf6oRwTyFrRRlEfBZhYXKossayKyz kYC74lMAQCHA3phQLeVWgW870wG18F3l3a7bbGwxQYVGKYgyPBf8V8SV39OhxBdMTTB1Sqzg903C fBNFd4p4FynANb+z0PqNLxx2dd6fV8Ev0+CYKtAnNgnsIp2siBiKp9yf5lEEtEB0dRmB5RwRkUXR DsEIxqTZOe9qFOaDB0JSk53piLoKm2pVLlOmevscU5+SYX2WTYJiKHBNKIK3wOKaNRdASkKCsUWV QmZV04l94R/xgHeKJrwNjt6H1Gl447Ou9Pq+CX6XBMEN67E/8AhGI7dkuxMm+JRMqABCRsAyO5E2 GAQLPEIAAROAF1mAeTVKD4LL/EFghIVOKxdPYKl08qBCIDhbmsqoEIHZSpWYpk+2uyqINQmvFZ43 uml3o7lUZSnBTvskDcBwm2dD6jS8cdnXen1fBL9IU25eCEsrEiicplLsK4sqBgLlDTiKYlAD4BOb nBVLQFzihDTCMtS27gmTCiBlymoKaI7qDphZA4Aru4prbygxdb1VVCaIVanbUq6aNAnNCUHiSMcE 8bbiiv6og1a3YqKocJ4limEnC7wdE71Jt+zofUaXjjs670+r4JfoMLYphVkw+OxyhIjuYIRFhSid OVIm5HdCDc0kBKgu3+5WeJzlAj4ncjEVOClQmveG5fcPLvdERrI4oMHkU3zUSzxjdEMwTxTSFkQV lRhIXsUBL5pwXGyuy+1wHVSAqVQdcUxvv3JzyyxTYpzY0TjY63FVCLUKlCYYg7Oh9RpeOOzrvT6v gl+hQVKrcoAXcOggBimHwVUAmwK/2R1JnNIcoQAUYkIsKYoTgWITkVI7xTRpEYIhAHm3rPEuCu9b cmFynlZOFmZ1UdiqjA/Arvcu5d2JK3ban4BWrsqqM6qVRFGMqhkQcLJpdqcWNtnD2DqwHfj+4TFd D6jS8cdnXen1fBL23KDJtyAwC4rgFVPtEYhhidwQhpQpG8mqUO6xJUZAJzSKs0VmNhZUCMYh3uu+ aiwVKHcjElmRliLICT1Q3bBvUeIVD3hUKvMFZUG25CcTNME5b4hHNAFAGGXiu7JingcyaVNjjC6p 8SgqexXBMQs0R3J1C6H1Gl447Ou9Pq+CXt8UCblU+af91ljbErJCwx2uUIacb4lDTjWR5jxUiQ4U ps0RSIQiKkfsmO5RiaRsENGO5CMe62KzgnNi6ieFVL7YzB74LNOhTkVUYnBEDAplnuv6J96IwJ9q iYlUKL1CFGK7km7U2rQHEJ3cI7ipRT/sFSJVAyqndO/wVQpf3QqPguh9RpeOOzrvT6vgl7dU266Z VpELJp/EpymVVGAHwQoM9yU+4KUjQb0XletFlCbUKEJRbduQEV9uR7wqCnJpEVWQUhiUwFkQU6B3 I9qBRAWVd7lKEsCgnT7RsBTvaipsIITGxsVREi6rfcmIvbaNswdxXR+p0vHHZ13p9XwS9p1xKEYV JTzLlMCwTlVqqCpQnOvAr7gpIbkIz+a+4ZO/LHEoQjDLp3yipKIygFmZEuQRuWbSJ7t3qVEal94C i1ZYgLOTkG5ZBU4pjbBGYuAicUNzMq4o9roDY7UTb1QuNyysQQmkmehT5gndUVHTz7xO9AwgH7WT 5f3TSFVSxRBTHDZuIshHH+5VYqorimTFPcLUc4LovUaXjjs670+r4Je0AhGKL1kcVwW4JhYUQzF0 0RUJt1nXeYJtJ+3BRlM5msDZCQk0rF6r/IKvVkBoGhpxRiaG5WSIEctSUZmszcrKD3zYIz/k6qGk DdNiaLOcSGQQliFGXDa7JsUxuE4TEOrMU8QCExjVOzex3S3YjnubSwTF1XY2yyJqRwujmcE71Qrg mQ0xucrofUaXjjs670+r4Jey+5BMLrPK2ARj+6Y4Lumqc1ThViSnkGBwW4IGIDhd6krkIVYb0+iW hH+Z/wBlnnLOZXX3bwlYhEBNcA/0VEGFMVGG6604iydE4FF7iyqPinCbBZgg9AdjhFcFmus0Sw4o GVAnBcKiZGJxTYi6fEbAU/sUTSTk3UiK5aLofUaXjjs670+r4Jez2p1mlyj90zMiQVIixoUJYIDK yALMaogJzZDMKBExsqVJUJTsDZCUQwAUYRFAzqTct2Umo4RmauCfmgQi9gqJtwVU2G5EbKUTkON6 cV2B77aI0VasmkKJ9AtK7IR1RlO/eu6XVVmGF0GNGQAxQ9rsRMvgpTN5F10PqNLxx2dd6fV8EvZA CDhohXtgmp2Ji1VVgCpAVCYUCBP8UDgcEwsKlGRLNYIw0w4xWUHMYiu4FZG76JF2QN5zP7BMKhE2 JT/3JjgEd25DiVnhSQWTUpJFlIbHTIyjTsVs39UImnbRMSqq42OKJpCioWIsiNSL8UXHcNk4x2F9 1FQuOKbd7RWYfxNdnQ+o0vHHZ13p9XwS9kk4W2XTxNkA5eSj3qFu8Ue6Zg2IsiTQDBOeR6KgZd0l zc8EIRLgXKjp6Q/y6uKJlWRNSoyI7sseKlDhQKLGkQiyiAcUZi0U+66JGCpYOdh371knVGMqZrHa 4RIss8BXEJpgOngWPBd0uE+X5EIZSYkb00oZuK70cqcIvuTEPuWSVBgVdOKNinlbBPEu93WSdCqF 9lNupBriiMTQgsuh9RpeOOzrvT6vgl7LxLKpdMS0sQUYBhEVJ7VGOnXMWCIJeOZ0RDlKy2GJQiCo yNcTwCYDuqzB6lHUNBAd0ccE8r3KjHAKT3ITHFEpuLAKMTchynFsUZBSmRTAojZmGKzSuLJlTYQe UrMzBZo92YWTUod+GyhZOKpjRA1O4hASDI9i4Igh9yrZNgiJGiiYm6/yRBJTxDcFQsqAFMQ3FMiD dTaglULofUaXjjs670+r4Je06hPDFSJsA/aswOWMbb1EMbV4oRhRroEnui6JCedjaIRlJox/coiN AbBDX1A8SWiE4xsFGRxTkOcPiovSUaoSGKEyP8cLphZFHT3rLI1wT7tjSDhd4PCSzQrp/uFvXHY4 VVHNy/y3rPoEED+OKp3ZC4KqrbOV96ySruRcewQUISDMhE/A+z/uiP3UGvlquh9RpeOOzrvT6vgl 7eU3R1JlndhxQDAsKMnkWejYsuX5p2shki43r7UA87JpnNLjgiZEHUJ+SaH8bfBAm4wQH9q+6R/j hicSnFl9oVRgzSF0xumIVBayymkhgmeuxwmKadYFfc0iz4JtQNxTSsnBdUXesnYcUTGOXUOIojoa 9v4yKErjAph80ak70JAG90DGx2B7nbx3oZ6cU4L7K7QpkcsaD4LofUaXjjs670+r4Je2Az8F3h8E 0YuVnIqLBMQxKryRrJOA3DcFOIFQXT4qhy0qpwd4g0UtP5KOjEMaA9ijCAYRDKiztTEJ443QGwkX C7tJxwT2mLhVumTpiKsvtTtgmkAXT6R+CqDH4UTAZt6BxxComRE4vLejp6gzaT04ISwKp8U0hRu6 OKIq2AWad8H9moW8JwmTEqillPeZh8USbldD6jS8cdnXen1fBL2hEXKBAeTVOKdcUU87RoAmiKIx WY8sw3xRq74IhUoiR2ozPNOII2yjIXsjpyseUqL7tpk1DYoT06TF+Kc3FwqFcdhLd7eFk1CQDaSe 4TEU4rNpnKdwsnlUbwgQAUydGQFQsky4wW9CjEYpwaprEUTv7VExumZGRLAKUiXMjs6H1Gl447Ou 9Pq+CXtHWkLUiqoEII72XbsPyQ3tT4KPG6pdkHujmsLIa0jQFojFOLJ0Dhgoz0+aFwg9JOxBTFOE wuLJsMVnhSWBWWbxmEx+acJmdEHuk4rJrPLTFBLcqViag7CC1V9zRk+mecFZhfEPsIKzaaykMQrJ gKlPeOLICKf2aJwn+aYcgQA2dD6jS8cdnXen1fBL2TKVooABggdpGKEt0q/FSIsECoHipQwuPinF 7IBRDVBug3JOvxWU7CQKhZTaSGtEUHMP90CTQ22mcA8TWi+3qM7U4p3Y4FNqcuEx/uhE14ob1WyM WD4FWeBuN3YhKBfsVbhEGoxWaNIFCUTe+wB1mDJk+IqnEaG6+5o0fBZdUEHenjUeyVGILCV9jYDZ 0PqNLxx2dd6fV8EvZJasimR4BMiEeClFN80AgdxChq2bunZUJ7EJjcWPEKpaUboHBEGoKLReNws0 bihCJjXTev8A8qAkaLejAUdXdrbiEDjiFlIBBwWbSlS+U2WTUOUj90QTyrtQ4ItR7xOPEISBumem 5ZY3wR0NWVCb7irugBVkGVdmSDgy+TL7TvIYoiUQm0yW3FD7kC28LulV2MojcjIoy37Oh9RpeOOz rvT6vgl7AhG5UYDCiZEJtxXaiN6I3h1IDGoQO+pRjwosliQ3xQgcKFWoj/aVPSkWLuF9wVhLm4IR unCzC8atvRiItGXyddt0/Np78QhGVYn+SeJfsRiea8Sszf8A1RAWaBdU+RRB7sxaS+3qhpf3CxTu 6qnjQhHptWQJHLIqnzW5SiQ1UItmAxCzDmN1XaZChGKzA95NK4VUycUKb900vmgm3IDedvQ+o0vH HZ13p9XwS9g60uwIx4oHei6kOLhA4jZGe6h+KjIdmxjcKcDicw+KEhad+1M/BGJHEL7kQ0oFzxCr yyCEDUfxPBZSqBwV9wUEv2X2yWIosmoHiUdXQrA3gE4tiE4uiYBtSNX3ogho/wAnoxWYFAoT0/8A kjZkdMhv/dMfmiB2IShSYDr7WrEiQW9ZjHMSGG5Vs6BozewU4Ti/s3vZHNgpcFCO3ofUaXjjs670 +r4JbGCEtS25CMQw3J94QQUZi1kybcpBN/8ADpjcUTqOqP437CsoxqCgDQi6EkZDG6OibisexMfg cQUIz7shY4FAgoxnYrPChB7vFd498XG5NKy+9Edw8wGHFNGYMWsqEIyj/wAgF19rVLxJ7pOBWZ+3 cuKGrAsJXQmD2q9sBsBI2SyjvXX3SXGIR05UIVFX2XGCoUx2XtgibywHFObm6ER/Ebeh9RpeOOzr vT6vgls+5MOTbgjHA2QUZj+KZNuVKMmOyt1IWcuFmFd4QjKLPZEGvBGJvFDViK/yHBCvwXas4wLx UZi4oRxTSocCy+1ql44GzhZhUIvfBCcRlwnW/FCQLjet4NF9yBIifkFlcZhdUX3IfxGC+xq0lHHe mDMjSsbIGcSIWO5Ag0Nld1QJ0YkXUhqC9mWeAIDuHQIPexHtNvTtXgqGqMpGiOStVmkidwRkcTt6 H1Gl447Ou9Pq+CWyI3BkNQXF1Ei4uiJWKMD8E6qaImNjVCWwSFxddq4xqOxAg1xQnhKhW8WKzQDw NexOC5FxiEYjmwRB5DzLgnDOLFfbmXi7NuVcUZabEH9kNDWrgCng7bkRPFZTQA/shIG+5NRjclfd 0bgvRZZRMZYumkaIh+7ghB6K9Ct+3NEOSgZW3LPpn4BBy0hcJj7J3IgGo3LLFwDc7ckTU/09jofU aXjjs670+r4JbBE2NkxqGRibYbBOPNFMbplQVFXWUpjZFNZrKqzRPaEdxRiOcXWWRzDFDU0zmBuO CzxxR1MMUdGV427E2HFfd0v/ALk0ueN9g1IxvdZTzRsroTFzRZJc8LpnTlPIBWRnaJQYu6BBb2KX Re+JRhKyz6VFl1KSCfBU2yJwDoyONU42ZXruRkcfY6H1Gl447Ou9Pq+CWxwg97FZo80a/DZwX3YU ib9qBW9Zhyy/qnx2ZhgnT76FB/ihONxZCen3T/KOCEo3ijpmjlwjEm6zxqQf2QmMbjijGVigYmjs UCMVllUFZ9IuY4KtJDBNKhTQkIl2cppBpDEWTm4T7CECBlMf3QahVfZfY4DS3rvB4LNDlTjYYi8q JiqWQA5ijKRcn2eh9RpeOOzrvT6vglt4FGM6FsUZ6VRiAnHxTGo3LMOQ7CDVGMsNuXA1CZGJsUUR gbdqMZJ44FRnG5uFmF0xLRN+1XWYGhxQ0pmosd6s7JyE5ix3pyvvAd134ogkk4OhTZRMmLBtyAwN D2qttlNpLJjZWVRROK6Z/ZPePBGQKYFxH+uwogWjT2uh9RpeOOzrvT6vgl7Ak7TjQnFMZ0T4rMzx 4LLLFUrHApjQpxzBMaSGzMLioW7enjbFA71T5obxdOKI6crqhT4reMERKKBkWAQyyeO9MSuGw6J5 TvRNuCeJcblUMcdokyZuxZJ0kLJjbDbRVTxTFMT3kXqFKINBZHTiXkdye5NSU6MYl5lEm59rofUa Xjjs670+r4JexklaX9Uz1UovZMzxNwgAKHBFg43LPLuk7kwNRQp7SRMS+8ILNCm8JpBwUBK2CYrN ChW8b1UEEXITA5ohV2F0QqYUTmu0CzoEUa53oEYqu2qNFZiLFZJlpiyYnb3aIuu7hdZnDhCMOXer s92QYPvKBRhCskZSLk+30PqNLxx2dd6fV8EvYcXCBfvRoVZOFElUN0xRF3AKeyzgqZ3KivawUXGN UGorhHsTyFN4UsRgmwVNgy3Klp43WXaCBUISpVZTcJsdrJ0xsUJQLSTTGaIQBsbbSEdONge8UwCY VXZdMSwFSskKRTn9DofUaXjjs670+r4JezmgWKH3AqFih3g6YkOnTyDUYKoTxwwRagOHYmdFVDuF Et2KyZGLUdGDM4cJjtEhQrM9Y1+CExY7WOKe8TZUwQkDXEewRsaV1Q1QjIVFmRIJDbllkO810STU 0HauJ2VUtQlGRN/0uh9RpeOOzrvT6vgl7bhNK6cEj4oSjMlrgqGoD29qe6IFFEirGpRX9VIM4ZAG 4ohsExZRletTwQOBQ2FrhZybL7ZqDZZdjog2RG5Z8MVc5UCDfa2KYllmzngApak3Aa5KyiVDgvuz YNbigbAcoQOxzQLJA9yP7/p9D6jS8cdnXen1fBL9G+wjcQUQqFFrocU9kTim/uFO1McE6cCyfchC RaUbOuIVFVSh/GVQiBcFwhMFjiECNlFm33TGyy3BsvtztgVRVTpzfBldxhVNKZED/ELLIBxigLgY IhxRk0e8U4DKsqbh+p0PqNLxx2dd6fV8Ev03wNCgxQV2R4FP80adicXiVHcUyIOKnBnOCYUIxX2t Q9h37cwuE5TjllQ9qyS+GxsExHxTu3BCrIf3RumeoT3RJLCN0ZH4DgqohDfiskKzP7IyJcn9fofU aXjjs670+r4JfqMTQq6NVlJqj2JyiDYoNhZAqqExjQqh4oSiWnGoKBxx7UyIsCiDcFZVlJqLFAk1 Tgpjdf5Reg3o914mzrPAEbxwUSJfBNGsjuROoanlCzEsMVzOjqTk9KBH7YyvinJc+4dD6jS8cdnX en1fBL9VgVUoTGBqgAanYJFCqMSqlFl2YpiaoknuTr8U93xV3WcdhWXEWKAerp4yd7Jye1HMz/ui 57o5QhmlVVks8S0Xs6aAeSzSPuvQ+o0vHHZ13p9XwS9wY1iuVMKBATq2KExIEi4QIKY2TQLmWCe6 bKvtSkBHAEo55CIG9fa0K75LNdDMADin0ZCYNcowTEU7U1uKc+9dD6jS8cdnXen1fBL3R41BuFyI xgMr4ozmXkcdoILEYrvyMm3/AOg9D6jS8cdnXen1fBL/AFzofUaXjjs670+r4Jf650PqNLxx2dd6 fV8EvfMmjCWpNnyxDlvgtQR0Zk6X/I0T3e1f+R9qX2Xb7jHK/b790PqNLxx2dd6fV8EvfOr1dHRl r6v2hADT1TpagjKQzGJjXDBZOn6mWrp6fXTl1s56maR0jpj/AJZE94CoWpKEv/1x6CMIwEu5/wCR 9z+1+a60NbU0BqS/8+OnqzJI/wAOSMiDUUUNM9Jo6mbpuo1pSlKT59KZyCkqWXTavS6cNIa/T6er PT0+UTkO8zkt730PqNLxx2dd6fV8Eve9Q/8AcdXqdNqiTacYQlMGLX7oOKzQ/wC16iJ3jS1AfCi3 /a9QM3M2lqV7e6sn/wCV6jI75ftajP2ZUehh/wBrrx0DqfdLaOoJZmEb5eC//q9Ru/4tT6VX/tNc tQPpan0qMf8AqNefUaBi8pziYESezSA966H1Gl447NTp9R/t6sJQm1DlkMpXJq+YVyavmFcmr5hX Jq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcm r5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyav mFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+Y VyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFcmr5hXJq+YVyavmFafUacN X7mlOM4PqEjNE5h/6A//2Q=="/></g></g></g></g><path d="m9.085 25.873" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><rect x="9.085" y="203" width="6.915" height="1" fill="none" stroke="#fff" stroke-miterlimit="10"/><image transform="matrix(.24 0 0 .24 -2 -2)" width="159" height="166" opacity=".75" overflow="visible" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACnCAYAAAB9/eyWAAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABW9JREFUeNrs2olu2zgQgGHJZ5vN Hu//mNsj8RFrY4DcTGjKdtMWoaPvBwaS3QYmRr9mSEpdBwAAAAAAAAAAAAAAAAAA8L70xvlhGcj4 +8ZEyJ8XcSDjj4+lPzNGUl4v4XDFORnPiNdfOMd1Ug4XzpuTsm/k9/uRmBWfVcbrKuMQ4lB8HiqC NsGiMRFnZ4KUPy7hWMS/61sRcvHOv1+TcJ7GNS9iVqmcOJUwi/hUxD4d+0LKyVfGviJjlvAYy+IY 5cz/X3V8LVNux1G+Y+zScRa+K6tpE9Xxvdt0rIpZvlWKdThfVYRUHU+rYhRxG2ITOktXVNBJt+lz VfEo3acUn1Osg5g1IclYF3GT4iFMc7rKoqZvpTq20KbLqngU8Y8Qd0HKZRBSdTytirktZwm/p3zN QiuvLWa06UplXCfxjhL+9Rx/Psd9IeQiJHjKK+uhqHR5PhhFXKXcdmFRsw9zyN5q+nVVzDLmyphl PIr4d5DyrmjXs4kvZIai2sX2fBTxSxCxnEfuQv4OVtOvhYxzxnUS7z6J+E863idRV1r1aIvepqq4 LkQ8fv9Y5K7sLJNr0/2FNr0KrfouVcQs5H2ojksynsiY54rrcF2fQttej8hYXpNhKjLWVtOXhLwP VfIuLXCWZxI6NRkPQcbHcE3z/PHzBRGbqY6LBpKaEzIPQi7Dlk6WMotJxnEZSxHXlV2IZrfFWnkC UxMyV8lcKT+FWJHxRMZ5IWJ8WDD2wGDSc8ZLK+uakLlSLsOKeznx7Z3atk6eIy67149Ra49Sm8xV S226No+cdacvTERRZ51N70PY4qm9XDI2P9Smr5By7H3Gc6+WTVnGrht/3W42ktcmWTQ6rv6CpF4l uy4/3S1NYRY3nuSbSvZvqopvyVeTzG64GuCD5WPmOoKMABlBRoCMICNARpARICPICJARZATICDIC ZAQZATICZAQZATKCjAAZQUaAjCAjQEaQESAjyAiQEWQEyAgyAmQEyAgyAmQEGQEygowAGUFGgIwg I0BGkBEgI8gIkBEgI8gIkBFk/A0MLt3Hy8ei8QSPBTl/Ll9kfOOdPnyERL+DgMOt3ayLxhN7KM7L ONJPXMZaXmr5a/4GXjQkYVcR8RhPldiHOW8/QSmHQsb9SJ4OFSG7VqVcNHaHD4VwOXYh5ulvDkHG KVbHeNMe87Ut8hTzl3Ma86wyVu7sGKWI2xSb53gM431KUpLxRcZdytFjylfOXU3IWqVUGUdE3KWE HuPhOdZhrMd/X5JxVMbvKR5CDncjQk6+Mg5JnqGS0H2ohA8pqaWImyBjT8b/b+R8Ax9z9jVFlHIb hDy0WB0X7yRid6WIX8IcMYu4SuMm42sZc/4ekoj/pvxdI2QTW0AtzBlrMn5P0s3DHHGTqmSWcda9 PEGaqoxdWDGX+fuShMwVckxGc8bK9s0u3NmLioifQ8teTHhb59z2zr7oLF+TlN/Sd3nFXW77dGQ8 rYybsDDpwpZFXsQsteiLrXpXCPktyLi50KYnu7XTF3f1rGi9+fvHoj3PCxmnTm03YlvsRjykPG7D ylqbrqymY2Xsg4i5Kq7OiEjG8X3abfd6n3Z7YQEzTFHGWpvuu5dHfEMxIV9URJzywuXcQqb24GBX HPfd6WNCbbpIZLmoyQmcd6cb3KrieHWM3aZ8nv80IqInMJW7OiZzVkQpIRnrK+tzbzmNvTjRBH0j v9+PBAl/jZTn3nccyFgfQ18RtNOW39y2z503JWJrVaa/4lxlvK4y1j43/+Z3f0NjIuHbpWxawlu7 wET8dUICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwJv4 T4ABAGzCmEeBhCMDAAAAAElFTkSuQmCC"/><defs><rect id="a" x="6.783" y="4.3" width="18.553" height="17.054"/></defs><clipPath id="o"><use width="1" height="1" xlink:href="#a"/></clipPath><g clip-path="url(#o)"><image transform="scale(.0667 .0739)" width="480" height="456" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEOAQ4AAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABhhAAAxyQAAVQf/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAf4B4AMBIgACEQEDEQH/ xADOAAACAwEBAQAAAAAAAAAAAAAAAwIEBQEGBwEAAwEBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AgIABQMFAAICAwAAAQIAAxEEIRITBRAgMSInMEAUUEEyIwZgByQVcEIzEQABAwIEAwYEBQIEBQUB AAABABECITFBURIDEGEicYEyE0OjIJFCBDBAobHBUFJiktI00eFyIwVw8PEUFTMSAAIBAgUDAwMD BQEBAAAAAAABESECECAxQVFhcRIwgSJAkTKhsQNg8MHRUkIT/9oADAMBAAIRAxEAAADwQBwAAAAA AAAAAAAAAAAAAAABwJ7uac4eRj7eus/IGnmV1AHegAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAASCLLu2kaXoIvyZYcZKaRh3pxPjfbZ128eThr9IAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAJX+cp+jXrQxzapuaXZ86lOSi3nYRbAVUHJpHG817bH11wDUjXZmnedoAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4Lt+FyOBlhDZSa1VqVpRl2VJslGTRJ1m5yumnpm7N ai71Wvj27MD2mYvfOG3KvcqG1bXnlZb/AGncJe7V1Llk4QcOgcA4AAAAAAAAAAAAAAAAAAAAAAAA FynocXUsKdHzZWq9mVWsg6FS3DkKE4oGnkiNJCNlNXSN6OmU+co7lWytLTDWzdyLOpOMoprZ7Tjm 6Td8PIWt1HoZqPNE2wyM/YR3djEo+fcA4AAAAAAAAAAAAAAAAAAAAGnmbKzu2Kz44LDq1iVrT63c 9myWjlJ1Icsy58Z14R7AfkZRKEJqLRu0rJbZml+F0oQvRgsQhF+WLGe3itq2+vkWmM/X8qjV3Kmy 3namlm4vTAI9AAAAAAAAAAAAAAAAAAAAnq5mmkrrUtnjsOSSs6aGJYj05Tq5LKQnDnXdXI8rznYt aaOJakmU5M21dyLWe/F8i2YEjJatVr0meytYll7l61avnZPHz9TzM2l6Kd6eOr+28omyoBLUAAAA AAAAAAAAAAB0OMnYonLiHyjaIylBzkOnZnVE7tmcSvYMSU4mdZqNTWS9LSEuaqy7ZNlB9iK6IMig TqiD5pOVa49l1V8OaFio7P51hJWbCjrEbPJcHNmbuRpo218hy3Ux+4AKAAAAAAAAAAAdAf21ScHu X3Nzi+wpbatspysIsJXjVvlobXXV5Sx2Myys/RovWrYm993Grkm2fER6NEs7MSpvY8lNo8OQdwnZ VYjHthbpY3ItTTHkduZ+zx5zrWNuTknmhKVD0K6U8Kn0/mIeuASsAAAAAAB0Cx21WRbg/uVUOwiJ eizK7+xFVj0WJaIqtdWtC6x89NKc6vXbmaNR7trOG1Sr2E9aCJxeDgetc+6APhJia42F9Ttl+f2e bQ7StJgu2KT5YlUGx1+YmM2W8+mXOVFSnDYlTzHp/MP6SwM20AAAAAAt1r1UcxkmxyO1pIIkR0MZ DqsyxWvzq1la7F+JsrWi4s6XrzZE0cW6oVUU2Xa9VbYXXlRuLfPWtJd1rMFRTQ3ihpNYpqzc+s6U LtyjazwtyS2Oarn6mbs8xUuT0ee7sepTkuM0zr+f9PX188KWqsvcAOdAAAAdp0tTRln2MUyxr2Kk LDIyTR1vfQwpyzrUvNr569Wdt5GL3pTtd3JXqynXo9ehdXZ66r1aluXK7ua0lil1ZLktp6Idl6Ue MlxUFmRFVib45a1vvUxPhNfMUqXIafMh2PLYmTg8Itmyva0b6NcsPy/tfG89OAEtoABODmLtym6u KclKz870lO/XmjNj1XmJY7erzcRUWtCG6uNnTRx9euhyW5WB6tyNTNer6l2m9mvrs7odTtQ4JQ57 Il9c49ptGavd7V6nLTE2EyusU7MslzvIyy0a9yvt8mKXlMa3o6xZfWfbrlRlqTK8j6PzPfRAIbQA OvW+i2pRu8x1pNXnIxgwtGa7PBEZWB26mf2Idqba2jUuUkpcq9r8tYk3nNVCSJ1H0dGgW5MsteE1 N49Jlio0byHslspscpsq3rZzNZtU5xlpMq3M8YVL9KmNaur1+V1ym9hyLYq1eT01Rna3PRli4tup P3QBKAAMtI0aRnaTPmKdOypeqg1c7dsIaveTXLjtW+3KytbPtQrQ0K17lqFPTzXbQRapJpz7tTao 9eq9Jato5+kXRCzXGiqxBs67tTnG0ZZ1mdHLfanCld7NcUSxUMlqpyFMio95p8x/YSVZyh1HZCU+ PVyd7P2z8Yd5T2QAAAHXsubrpuoW6Z7EYznAS1GejJROPLrrSVXpUdjPaoiZx4WqVrlKT6W9y1BN vM7RexnafNSM/VqHczSoSsugsnPbUZMeKmsWuZ/FXE5WdY6kuXFSnB9SwszZy7Mdvlr7NbZZJmwE sexXSycFfnIQ1w8jT28S3rgHKgAAAWrmZqVnM72GZT7CZkXyclZrvshWveWudVolf6yKmnij2NnO 0I6kYPpMlxGjiaFKX1Mln2Z9bRraM1NzYsWG5tyeifLQkkrtWuZM+9WkRuRZGU6LqadeN/Fur552 UlSpN9ZlsMqtV7XUNK8qW6HoZsHGsV++wALQAABoP1W8n5/Wrekaj4XOW5GfJ2tcgyV+86LSvv4e 7CtfG9DiDK08m7Sl5FqOXT55elT3QfdyrSabarPI1ypaGfbNahC2vad2fFWx1F2MoZurWfNWfj29 OaWfbRfA5+Rpk2zXOTdW6PGRIhSM+RNM24Wlh6/RxgI7gA4AB3XqaiZnd7xMMLdSxwRZqv5VrUPn ZV6lcnfi3JWq93EvyrpZeqrJTz/Jt9Bb1vD1cemON6Oi3KFft/QtXVoJnXUjJsTNVr0LZnOzdJTt W9nEtBNR7QRVtQ04IKtcbPmctlGc7LsJzQkhsbEG852tT0cr0o1s+/jafpawGfEAAA4NG5GcvOsJ fX5GTlt5yvOair3IsTquzVml9avchlrlNTYu+tYx9vzrZCtjzujliFmTNbllaMKZ9TfxrzsspXDs XyqoaMFskmLauYuuGqtR2OZeqI05dBybCQkTJWoru1L53w5YXqS5xK12wU03Zelm77UcHaxLe0AR zgMCGyu+Y+SkSysWziqtqW9GVrdRWc+m/lu9ILXU0PP7OW1etqZHWZoVVcp6PO5fw08vrLqbl1q8 mwZ0aF1TGdfxtM9R2c9SroZcay1ExiZarnjwq5uzk15bvYuuvH9jLPaKbC2SMSTTG0+dLtZqLcjn zV6fp0Mi7ShtAEgbGPpNLQmxHfPtVrCYo51Zs1rPWdpZpWI85Dq3FHp4cZ9ipZnbWpKv52zLFOVX nsZyJPtee3ayKq35/Qq12lYyxNpVZhPM0lV6ytZV6s83OzNDqWZwdFV0NKs3Mx0+WbQbk6EeWhU4 2hxkWRdO1i756eYqW/0mc7mT9qjEM3mgBwnAD0Zl7VfNU+tJJxdBMmuVXQTk2VZnOdkgo9qOissV Jq1qzUrJ3Wx9TP4XGZ10ZOjh3zrM7SR2LUpf3lTQzLDdutqWJw7XurVsPUots+ixLoKLZHnakLdW 0mV3v51T6fed0IrZOlbA1aPta4znTr66M/hhgAckAAABLbwtJ47VKTq4Ekko3HrTJpyFq1mCXIs4 pBriuu5Ltfkjr7eLrKlK1aXziEX6HS1ZzdBUeppPtGrOreujaq2Ug+PST5dXUz9D6NrH0JzskWxo lVlTTznyqX5qqRZQqWM+vpeQtvpe/LDs5mZgCGUAAAAAAao6emdja2ry7C2J7CS7Ihm2GMnTNho0 kpOFyM50LtW0lLkW2YwwWORW2i9FyETH280rU0c3RoluUZ5qZtHVy9K2bmRoCXeHYPCleW88ya7l mbZzWy5fV3k2Xn3cn0BIzm/1eDKprsUKqcvO8CUAA4AAAAAAAAWK53ms7DfWO5b872s925jaq4eZ 2pRTts5YnLFurEvquTYzJlU9PIpTWuUL0JsoaCEr57XqmldZtW1l6iloqdMN4nRTXsZGnCbITghn o0M7SX6/Xuma6hbtpbRS7VvYxfH9GeA+rkgATgAAAAAAAAAAAAAAAAd4Bb3fM6lcu7X4imBunjbi Jn17tJXv6ONsZ+IxvQ5/e0tLKendiPZZ6Z9DZxbyt38m0hfgyEXpZu3j6uRsZb2r6GFW1DOjPfjb 9Dp9Zt9au9SUqtdPmSblxFQA4oAAAAAAAAAAAAAAAAAAAAxZ01o5g8tH03iN7uW9V7X7K5qYeikt anYhyeJZpQNG5bxNaKSyNfNpOhYx7PdnoLOPoSyxz7nl9Fnyrtt61m3iTnGxQTFb6LsgGsVwRADi gAAAAAAAAAAAAAAAAAAAAAAAAAAAE4AW1JOq3WxJC+0f48r5+nhR5P0LNjOOd9hiZfGj3Qzg16tW oC2K4L0A4ABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAejXBSvTsO+HPQbYeENjHOAAAAAAAAAAA AAAAAAAAAAAAAAAB9GA+cn0YD5yfRgPnJ9GA+cn0YD5yfRgPnJ9GA+cn0YD5yfRgPnJ9GA+cn0YD 5yfRgPnJ9GA8brbgdwzcAyFbgGHk+yA+cn0YOfOT6MB85PowHzk+jAfOT6MB85PowHzk+jAfOT6M B85PowHzk+jAfOT6MB85PowHzk+jAf/aAAgBAgABBQD9PMNyiC9YCCP3LWASyztOwx9JS/U/tyQJ Y5hPBMMBimVvx2H7UwmNGOJnnJwozEQxcCFpXcM+VYbcFLqSRVW6kEHB/Wb6GPGPLcr17NXWFAM7 TMwBLbXSfyrStVNhKXMhouRypBllKsCMH9N/oY31InUmKoEJnPwEYcN9VROvMI5SwKda9XAYzYXF n6bwwiED4CGAfALOsesFgOMGOcQiUOVNew0Ldw9WB+iqS45YxoRM5ggHIQzqBC4E7EzAMxDjDCMG 7VqYh4rYysqQ69W+dVxGMc5JjRjAkMT6locwLMTAEJh4jkRiIHwa2DCplwpnVWltfQ/Kq4GZYYYY xE7CO7dhyE4g4A+vEJxCQRnEbJhrJhUAEDNY6zODXcREtJl7Bk+SocscxjCYY7RsAAmZhJIWdeMl YDwcEACYEOY0cAwgg0Hg/QfWtoPuBGPkUYVjCcwmXXLWqbBexvqXAg7QZMXAgJy3MXkfDsYXjWQu DF6dq0wcTAMRZXLVx8UGSzR2hMZjNihrhTolWI58YnUCAESvgLCIDg5xCAYVzCojBIwWAHNZOASJ kRJWCJeR8VGA5hmJgT6RlyXIUJmBcWZ+7HCHktgmA5HYqewMMZQYwINJJijEaAyuwg1MCHOW+A+m IwEPwMZwDZ90sY9kOQvLO2Cv1sPKnIBhCtGQiF2WM4YKe0RCCPoQYRAcGh/kVp1j/T4FsS5sBeFc fda3RE+4Wn7q2GWAYfQlgZnMPYQ2RuZXkFTx9ZkgFxBhjUvJGD8Q/wBrvmZjNC5w33RmCV1Hst5y 1DiWJmA4KtCwjIRA8LsIwDKv1FeRjAJgYGMoiIQaV4Y5PxLEwxiZ/cjn++znGs2ZauQrYKtlbEyF bEVg0PdYzdg3ZTU2GNQzWMB1IhgMHMqQGFeqfFj8GjQ/V/qP8r1LCp+jky+oiUW4hJWOi2DJErsD SxSDUMwVlWQkANz2jJCpgJE0/ubYPPxP1EP0+saMMgMQzYmwpRqH8ilwI9RU02BgykH/ADgVlKf7 FVMHoGDcTJyrAgkieQzAaaQIa/8Az+DDgz+5gjCYl1eDWSyuocBWpsOLFx1hrKsh7hq4a+yqmJ2l ZzLF5MUz6E15lNRlNfQWNlov1cQiH4CGYjATqa2Kgh6xYKT0L0gyusYFZBwGiDEKgRjiVmHBDpiE YIM16e4SgILbML8R9wKxkx8MfAiFYUyqDEK4LVgxeB1AhUEssVuW5DfURTmZIhUEBcHUTFVjYQnP yJ9SpMKmGuFZj44jCdwYpBjiAgMI/wBB9VOQ6Q5EUz/ILWwZNckrhVusz8oiEMrDgiFYywrGELEH +znEpb7nh+tZ+11+CNgt9GQEAETVp7kVIpscBWtJHzAkRLMzAx/dhCI68FeVH22CVnDMMhxgo2J9 RYmIIgJCUnJoMoArj2ASyzsf0kaGARhw6xBLK8wLgoOLEyFBlYJBXgVnNFYEwgHkCqbGJJJ/V8kR uTCMxUhWNVyqYHjJnhPZawqg1GAVAtYSfK8JJ/Y9jAcQWARmycwucI7KWcsSxP8A5R//2gAIAQMA AQUA/TJAj7VawbixHVx+5svVYzO56QjMot8b/t2YLLryxAgEAjCOMTW2OsF9Zb9oTgXWHIECwCYE IMNJMTXUQJkKjJOwmTC2Atit+wsP2k5IEUQCAQLAsCwJAmYaBgoBGAMNIDXX2LBsNmlyV/UuOEA5 URRAIBAIFirAkRJYnDKe3SFJdqhxZSamo2QpUgj9O76ARIIogEAirFWcRG5ZftNXPQQ1cWACbKZB Kgrt2LNba8p/RZwIT2I4KxRAIBAIDER2lekzRdepJapWMJXVk3YlmJd9LR9xHNDMjqcj53cAdySi gA8soiiARVnTiihQEKKG2FwHBJsZilZMLR0YyysyxJsoQzAiFmi7VynXu8qfLZZLH5UZB4CrkqsC xEUBRyF5P3NYcqSxiqzKlbKwQsCEUWXKJdYWL5mxP75MwmdHGPksbCl4o7FBidcxVggiCJgTvKnJ boHDVYNXZWa22G14zExmjvHabXImRgqJTcabFYMvxvbnBMqAMAirCMARRARAYEJhQAVcR8q5Y5wC Cix6Vj0S2vEtBxe3wAM6nFleJoOSnwP0cZITMAAA4iNiNZAYGi8xYeWs4iNLBkBO8WyxIuyBH2I9 thju0sM2wMzOIDHYMNBcV/BjgO4WBiZlRGtRT3gOYogEHI6jpUfuuBxUhNYM5rZlVw6EQkiNaRGf MuOBe+YsKxlxDXk0J0q+FrYj9zE7iKTGCmAGKsEQcD/JieusnZXIK6h/12LiNnCXFF86GWBGli4j nEtsjnLQGYBCYSz4tUrG2srMcoDAuSsUfBTxQuWY4OrxXapIotKzsGVlwpYrO6mNxGaWkYucgk8/ 3FZM6uodmmu/er47ByoxkOWKxQIIoyTwaeBaJRbCchxiK7CLsKwsAjzyGO0sslrZIWFSIrtO4Ms5 ehOlfwJwLLmdmZp2wKzyIJXGlbQ8j6NVbH5hJU91MLkRnBlhj2cWuckMpUxlzDlSxOfWavkb47Fh xHg+ginMBiGHkAyt8iwRWzFtIjkGMSD5Mx2xLLOLXhzBZkfSKwMZQRXWGuwtWt8CQBY/Zl5hPCHM BiGAxTFOYeCDA+QxwQ8L4jMDC+Dbbw1uR/keo6sOpUAw1DHZkOmO+3sEgwkCbN2Vz9q/5tKj8EaA wNA2ISCA2JmduO+CbIbOLbIzExcKxAVhHWfULaRLGBnqdVg+ywNs2ATWPuVDGEbkVkK2SpQ4YPid sQPmB4bMTyceXl7IbwQLTm36oMxuD3UrkqVbIZREra19TSVWJWqsnJhGZahrdlzMBgnBZIPuXBwC SFbsK7AC1hUu/wBq34LWEGxszJyVxLPuRCcMOICZkidsj19eQqhBba1h+OwgZB1SDqSQrQTHVghz no6jq96FWL9lrbMcYbGVVcp/c/StuCChGDHXEHMJGK6LHbW1wibFgx8hGRfWyMv1DEF7CYj5UWsD YVKqTOzMirk46tb/AJj6KeXXq31B4jHgHrGORr1l7E1UlaBRZfx8xAMOtXl9JCbq2UVEQ8O5yifS vBWvhnlhVxUchhhuGVcgtEII5Beqzpq6vjSpMS+zs36W1V2VEM2AQycheGJ6k4zwQo+4HqzASsjs 9fDnE1NcuUoXIUKDa0LMf1CMjwLnc18itDLVKwuDDWWTJARv9j67GMSs1ddrCKa4dKgt2Ai3MCWL H9f6wIoltSuD65i1VK1o1SEVaddbBiIyqx/8o//aAAgBAQABBQD9yATOjf1mrVvuOp/zjvK/Uamu P4muy3+m17T7L09uof6pTr23vp+mWlk19emrgAZshNYUJLa/IvsdJ9S/+oqjMdT1N1x1dWnXX+Io i1V2Bqy4VTSnbuzhGnVgPaevG7TbW9T/ANPpoe1vX+uqra1Kak8ddVYqW9FyVANQD2OWtRYErDOu C6lV9v69L0ZSjf0xVZmp9eANLUXyKQl95CyylSlfksqqXxQJa9r39ICerFXPSvo3aWqSNz1tN5r9 TWtm766mtWVl/pOJp66oFr7LWhWipQK66g6kWXqj+Kuqu02XNY0RAge0d8VKX8bGy2tZs7NYmxuO 0drGNFLZ2NKuyixGrb4Uadt8t17aWgRjBr2GMjL/AEDVr8ltSyqryFUNqojXqq2WCoeKqmt67L7X siYRBaHbNSTZuWtb/Z4VrXY2FmhrE/2EYPbW1GfX3fWrYaPQeWpvW6VVdYAiVrZXZ/zWxY7ei2qF fT2altqrdba+jQKxhRhMH93oCUjq1RZDrlzXTmpNcGka/fzXO9rgqleu/ePcijY2a612tou2Gdmz Os6nJXMCBYNphLmcnWVr0/8ApmYD0O3SNb17VCnTSuvb8Aryom966y2HTvZqfWgBdQRtde1unVjY 1jV+60F4QjupHl1n6Nqk96lezY2LAHe1Kk1z5Ky4AuvCLbaXOBbY5XDMQQTjAAJE4ALcoGZNJSDq 2GXWGwsaqxue1ftbY9gGFCpkbOt2lSDJqdi1IrW9CGtqDJYhR/3Giv8ArGCjgNsVgHbbqNvZtWdU rrUI6Gx3F2wtYezMsYZqpYKVJgUAduoJJg4jtBknWUtKERUr2BWLd7xKPaNcxr6DtKFNge2quNtK 0tdS1N1bV2Esb6S0yynfQCz9x60KaQAtLDpD/pLp4qwFSPZ2d3Alu0Svc4IZoqqWNn2vaxDGwn6n PaHmMVyHyNdkRtawdVZO3tm6HXVKF7hyXUwbFtjIlSxcsW1xYLdWyo1tWwNP27WqrjdpZl/b0p5L NUgAAiA5gHY9uWuLnyMI7EkL2lnUB1woDGuutMdhk2AsckfUOyiM08gzXbk6d7CHZVVufyWGzgdm JKuUfJpqErRYGGbEpddvXyy7GwkbZuYWat9kf0t8v0digftdcHy6v+YciKw6lhlizRYeWX6llDEl nsYuAv3Bjh2YwBUhbI7oA1wJawRrBFt51XBNlmY9gAFior3ByLMzXrMr4HkJNKkAiX1ZBALeFQVr AgQSzXR6/Y6o1tj9mlRaUoFsrISw8hDwvABg/wAfJiKrRVAZ/oOErwGDAWPYAXsEsuXDWw2mKltp r0WMTURRjo1lhwzkxmGWftNcDNZxPJk6VBYKvVmUGWLibVcr/wBlYBEIMIGPbapsrIIP7AAk11RV wFqdTaOdewlF4gPK8IW+3qWYIQbT92VA8gARnl9jV2WbQjXM0HdyupY0q0lWBFUfSFsl6w8uWxZj gqYleTWgWK/KL0XX2eii6vJuUg7DKXIYITW/cZawKPLmbKN19hUEs/XAJNdeIlbE+EgX2gR7Ow18 LE5g5PJArzao/wBiusdgoNw6V19xtXgzc8jRUDMmpmV0IkAEzM5jnAXID34BctOYqRUCjyFjSAkF imKUMrNeE62C7TVgO9TO+ErbvHqwTUxiazGX+i1bjsf8ygXZ1bdWz9QAk11YlVOYECi2w5trKSkS sYKcBcBauTUeOyqWvCmy93NdKYYh51WbtxLrrlAGGO/JPUebtLLesyDC462th1GYFgUKHsNhppOB SxNeuMLT1lVIMSrEKHG1UGXJU/7Knq3a2IsqYCxc9sq75Ht9dL6SMH9IDJqrAFNWYigCw9VqT7bG 8j1IAKgCycgMMZFdfk6K1jNB5LDTpnXVrS79VEc9UK9trbZURKzgYRdhiFNgRPMrMpJDMSG7FqAC v2qCrWSupVCARcSvEaxElV2ZW/Ng6i0qxvQGVj7XqniIgN6RNtlH8lGm04IvXrd+iASatZgQiqtS 8Ks2Pue5hXXUuSkqBLK/21ZATUsefxVMsqTHr7a6rNi9LXv6otbWNG/wvQ56Kx8ZAyCt4DKpGFrr c64yvjBj64ytBiVBfgGAnlUA3kxbHiVuxqrYivXMKMFZmS237lXIiw1hp4us8eY9OZsa7hL8+b9H TrXKguRX9ir9rnouVAYm1q16jPULkTV12ua41Iuv2aroyiwMjfx6nFY8S2KbJr0fZcwRnWplYipq rwxNa4sq7NbWEsZCSuc6+wSWdFh2EhvnlMBZotbmJWoCCUosq6wYMZczZqWxT3DNllqBUr9DgwLg lMhk49364j9FV7HXq4CdV6khh1W27KuSwrHPbknlFLH+Ldr1moEpSERnWMy9V7MvSEdCHV4+PHZe gS+xnal0Va7WwoWbdQBNeVdCJWFsU64aHWxCpWAtFd4LIrJKwGNVLkJVcsrLrPIrSzGNjKsTKsBA cQEEAz+zYK3UrYnsdNtTY+ehcnXXg4ifXau46itQSYOAuSUr59P6vqN2hHdqSNhyBWV+2lMIuuK6 vGa5cHLGtVmxsBHdWZhqlpdUENYZCj8bTMT2Br7ZND+O/ExmFBPEDPCROjymo4WlhFH3VvcoTYsx /ITuzki4ZKTJx3xPKAEszMsYewmZ7zV82t8wGTrpkgBV4jW8CpUljGx1XECkxEnp/TK4ZcnfpwNf AtbLGuprGGuEl7W9i5dbbJdsKi+AOS6ZBM2MG9v/AOg4Fqhq0wIGGXGLlOV+A+AURFxEUxqV7Coq awZta4YLdYI7EwEqwBaJQpZaKwVRBBjBAxZUvXYA62r1s+WtcnUAnYCAvYS6VSyx7CqTqCaaHc06 Qrt1Hp8X0PtvZalVVDZmWLW7LVTzU2y6xQbb0WwlitaL3vACfW3v9rcbLY8uR0GCLEC2PWGFh4q2 D1W1WiPyIDPKgg21Eq2rWld1oK2o5VQY4xNqoEAFp4xHrZYtqiDYpJVwYmZkMHPG6/Q2t2s+WvgU fag/2F7jDmAYAVjKqAJXZVXWNpIPZLULvf2Xp0qYVKFexv47V2h1chBULdoOEpqS/wApuOFZ861V ZIKjpsgBiexUmD6X1dlDHColqPrhSiAsabDFa1IEtcLrWZq1BBrsAKLDKUFZQq0NymWnsxADK2Z1 ja4Zgq5p69yZ5OpLBl99d4lPygZKjmtD1JLyqmKqYJAjbAaLcyMb4bWyEd206qkNrV+O9yLGuYtT 0zcqDa9e6rPb7DF9SsJNtURGtPgHVNVlPTYPFINlSHBGZkFbVZG1rcMUDB6SCuQQVIVcOtvSU3iV 2KTXiFAYyN1ORC2ZYclPr/YrCoIKWJFvtWLarztif9JZ2v8AlqAlAHZnLGrXFdZyD2QMz5h1j0Sn Js0VClQsprwRwXu6w2sW09QBfYbCrRYD49N+ljN/I3qwJsKrDaIVkLMpGa9pVCeullSmYKFcGOgY WoKzQ/krwDHpBhqZYozEURagyhb6F17ldamGXdTLj0axwkUiLzAcCAcsvDpCCssvwnsr/PtfLX9K lOKaekWtgDWzA1N3NOJ9yhbWEN1jFvtnKhbhMs7U64CVP/8ACoU7FllQwlHianAvoyV2bfGXY2W2 VGqUlGTaq40CRaRkOuD0DANYhvK2DTcoiWqQpBnQNDrAnxMpqGTU7gfxVJpsYOxHWwlgcl2dTAB1 /sDOJgRkzGrnuS9et9fm1l7mtFSLcRBtYh2+GsLAmyx0VuxAyVKLWwL229U9Zq1vKa12r9itkd7A ulojFROW3mC1qOauoG2soTOy6gg1NW1r+UaiEbIjrmEFYHUxq1ydY4K3pFvZSm0wle0gCPr2A69f atGVhXL07Cm/Ku0Zgpr6u3lAYMCARMwGYhWe01vLrEYPy614pZdqpp3zNcLCK8PYDWEDEjxSpQFt IIKdYKHsc1nOrWoPsOnWwMR65hguS+/YSPXawtqYeIsBNFO26UhXB2x0s7/7a3DCWAYrQFgvL1W0 mm1XhoreHUqwlQQiitjVQazXgwggWIcWVN27u0FRxT1jgYaq1mV9hSGeVNDYogtBlgDp7TX/AI+5 81R+5WZCj9bO6tNhkZO46FwWcPkt3GrqO4SoVmgM+1RQKV2x2tLc66mtXYKuwTbdq0iqjfr+3zHx +qrHYnl1mxr+UeB0dGZGqtBDKCDQWPQoUaX0LXEssQrZiBEcfxzlFyDU6Cq4OLiwVzzxkmOpEZy9 SghAvCVrDUhja6ZeoiK+D/0lYFvzA4lbd01CWs69Q3jwlVjN4Sq2h1GvSFSm0ipKNmya9JoqFhdf YYVVDO9tQoS2wHX9XrB7F5G4uU2F6Pp2BAjBoAJYMHYq7qet0IspNGzmVurTxho1BUkBglBtUaW3 rTWvWyV5M6DDkEeTxWWv9rNyOYOZiPUQfJ9weI8Bz8GGZcvV/wDorM2fPWxDUsaUFPaCrqRUALXP XW02ZvD2vapRXRseNRYLDQep32Ct6nVKp7BftPNulX4zXxLVBm9qiV5pem7DKwaMgYdSrbetka9i WpbodT3es07WAllVgbXEVSkpchd3SYWaW0t4AlnI3UbFOyGUt3bHVVExCktpOaizQoylbCIrhoxw Nq0Cb2wdjZ+fS0rLnTXrQigErVWEs7g0axJq+1rDjcpfIGAa+3lP27N+ub/YIoCbdfeu7WQzTtOa 27BlyHrDDZpCXD/RKbIjAyyvIAm1quja+0GJqptB9cABQ1Z17OoFauBUVKjje1krbW3BYrPkbI4a pQ1KKi8GCCERhDEtMbmBnENrEe22GZfn1qTdbSqoHBUoxirlavttVjF5t3KwDrOCbRg0t2mwy+Rb yNqvBlqjG8PDZcq1zWuXCEMLFnsNcFa1BGDRNbZ4rZXD1CBcjZ02qbX2FtCOcBiw/jK01dhEcsrE YA2kDoRZr2LcWWwZlrsq1bhD0v2XtFMxmFcxlMaBisdgJdsCuv2DEU/Mqlm0NXwAjAs+6tDxUeGI Dq0U/ffjrr5RrcMlQ6jZrKtqr4rtZw6sMj2dBZaV7hQ+q2vcDOGW6rst9ZqsRUtremyg6+1iU2pa ttJiqBNv181tkOykCKol9C7Fevs+KzuMWtxcisPF0fxZl1X2XaQY0XPQ9diuARFMxCsdMhl42bPG iszn2dn2/N62vs1fM/8A0QgqvBrPGO0qcErxLuKSOt3+SKhxu9urEPXqbAMQhhtVd0tQ12W1G6rW sZDq7AcOuRtai2r2Smypg4u0FMpsat69hOhrUzrx7HSr6aWwzMg6wOAPYoTNLc8iswMvfMKiBSYy /bjlqa76/wCLsVGjaDRbBFcTIMIjDj2GOoPUbtne75vW1daK+Ci5FR5IxZUImRbXw/8Ad8tRy+vq 2d666j49hDjUbmhvFbqW9lcZHsNNWOrlDdqhpRd45rXrajJz7HTQjXuNZBBnipsH8bwNrXAuVEtq 8ibuvZrnS2RdUXEtZWFzeHYTbWxO5tfAMrSOuZdV9zX4srZWjaq2H+EQP9qlbSItgYN9PYf5bL+O hiWPy6lJvvrUJDw1ZjDrdZE5GwoV2OLFBIryZSer0kpdrsGS+slSr0bNlYddPYMpYWJdR2Tb8uvs 6tq21X6S7CVvZRZRe1oes43tFqhp7BeDAlU2KG1rKbw0LyxVtW42aV6Xi5S+RsVE7AAV6AQiCAwy xAQteClTIUYCA5hXMeoTsVPfsN/m72ZC6vygEn1WqapaOt2MrWZtKVsH3LS02B2pY9krfIVuhuPS 2wnro7AMIBbbozKSxrKsG09sqcrYvs9PyJTc2tbXbzYtW0iC2l6bVcWorDa1H1bNbervVLOpLeRB b/H3DYI9pl3jtH8a2hsuY9JzslRbpWixVMHwYQrFbiwYKWYgYEEZmxxFcK1z97/bsBV8lNL3Pq6i VNXxNtQJWcqk3OaqmijDgdl/wZW6upJFgL11v2FZamzWuDpevdLLBRcoAWzvRPWby2q+BPYaaE6l vgZG6x83Im50va0OGZbBvU/wrKrUtqrtbHtkJr0N9XQuTA3IPHBlqdkWntNV217lZTFImRCMxlxB 9Tho5INdpBFgM2LVEsvmAo9nf5Lvk9XWq13oUcfR0NtNLEReG6q4warM8hjizK2KA4AsSBo2EtT/ AGV6l7LA4ZdzVR5q7AK1uYyvr26e8uylwPXcd620ttdmmnYM3u1i6m7h+/Oyi7CV2Np390aOUsR6 hSat0MlV/Yg9gEjoZb3quvDE6u2yRbBA2YrZDAGFPuYRuVdup/kLWtuxbe1SkC+wIljdn+T1t+A6 i2lHPWl8C9fHYp7BGxNrsWRuyIxxbW1ioSCSMVXGXqStB7BqRculuMtjfcNujxXVXd1pdLFVv416 Wh029Sm8NXfo31bj3JTaJ7EGq6jbN1PczYorvC0bFUIsU7H3WoR5VxlFBijAb6XVqxekAtQliUXm ko4IVswGGNHOJsbjm4s7xRiduq+w2e3zU2mt9W4Ot6FWraYW1K2alw4yw7qpNdgbBFksBVlaNyqs rIrKjVWdDtEFdPZd12VFiV2NTso5DbFa3VaG69dnl53UN1dFza7rYoG8vkq0LvE/fBRsHuBDkzZq Xq5cNSQa62EzCY4Bj1kSo9Ht10tCi3WNWwrxLMzIhl7BUZWMrywPC7e7iEkn5vX7BU04vVkatleW 1+VUcgpbxsL2FdmQGjfeqkztlK2JBORXssQf9tdWw1FouBm9r5bWvyKnm/8A67qNgW1K02KEtni2 KojEK6gWZBaqwYryYAMWLxcprmjaxWsQCcRgIRLlKtTfkYDi7TZTXazSq3MPA9jdiutYq8+zuNdZ JP6COUbQ2jUbraNhWyJXcJeqsqWnCWS1TW4eK0tHVlxgfawGYT0apyDt/wCWpf5Kziyu6tqnpvRh uVCxEsSg13ISmDPqNlvHWlSW6tORYikStnUAkx5u14ZGdGpfKq2QRmdeCssTtHDVtTcxi/dNijMD kkX5rus8tqrFbB9hd5dj9H1tgKLRXlaUYPpdlRLlJ1C8PkpZbFsBDVmqzBLKyixklrl11LgUuq7B e9RuxYlFrU2U21sPFVYDoVAjWIF9YRtcLYayBK1zL6g67VdlC0OfKFRpSGAxGE2qiysjKaL3oK2A hHDARxCMSxBYCTU1G2ymy5RWNkG7Y2mK04K8Abu8RCc/pa9ppt1yjBUAsVedhB2NOY9KBK6fv8Il 9CAojhmoFgOsEGDRKNh8+OuxX0FKtSUdV7vSSAmWhXA9gvWzSlIBijEIzPY1ZVqgBS4YV8TEYQjj YpiJk1W/x2rtTCOGBMcAwKFG8YduxVXYsvRUEuT7EcV1bfsC0JJP6frNtVC2ZYuJc4IpIdTWO1tS pciEjYqUogbz1L2DVAS6okIp61ICOn27PauajlrKeSgGCOPZIpbWsUbKZV0OR9JugstmAutYUem4 Aggww5ly5SwlHrFd1d2maxrWsFNtYme0tsIOxebbCnYCkCVDJ3dlEe7Zst/WHEq3L65V7gmNvVsu t7GlIu3S5tyLaOVvAYBiNjWKltkKssLA6x7U0D7cz2IIbWyt9R6sh4/t7NS1Vbqj0Wi6qo5X6y5c nb1wQV5qt517gwGIY3M3KMDXuKFbq3VwqBuzzR2Lkm9silUHC5EGBL766KrLDY/7GrYKwXKQbEMo 2/LVpOGW0Am9FLajDyXKpmwD5dUkLrsCpE9igavDCVWdkrOV/tdWLE/ipjXs8bVOFZSJYOeuTt1d bElVpzr2rYh4hMuHYW1ipqG13DCimuzZLNq7daV7ztZZQSU7BY99SDd2v5D/ALTJmk7d9C7m3BD9 QuqxDWKGSxexU9DqtgqMrtVl6vGTKLxWNW1WAGQQRNpetlg62UWErTYHV1zOuRu05ViEKuAaLjTY G7qzYjMTNu1QK1dTdWzpSBFUCbt9ZubfKq21c0Z2b9ujsjev2cxriVstGNaweVOr0uQCRmUORKmy rAS5BXaVBer/AOLYjAhgDL6g9d/DI5aU2mthhlI5vAI36mWCzIovUzS2+wfBXa2lrWvYNtwGIOVR Sp3t5VUkk/uqbTU9e4Cr7KTV21GxqXA12nDWN1sDCaVoavmbw+y5gLK3S2vQuypIEdZvVhHquwRY FmncChAYWsyn2G2lKKGY+GxxRtJUG9g7pt3hErvVWPsUlXsqEru3brTkn97kiZMBKnR3s1NZmXth abgRp2dXWwEbKCyvZyDrbIUrsdLNfYS6tmHX2OPEdnrat7ONa1cV2AJtbldab+15b6tmtEG/Uos2 ksdvY4V3Zz/RK7XrP/2Fst2rbZVsWVT1+6LJRsK6s4x7vbpULa6kb14Hr/YMmzZ7PXqHs/cHYmTn W9l412/ZIQPZbWbdy60f06ux62T2u0ss9tuOCxY/Ekn/APGunp7O9sr/AM77h9qv0/srdT+s/wDN XPT7BU0Xut9jo7A9Bppteofc9XVv+62KtnR/qvpLPQI38j/19P5H/r6fyP8A19E9l/w1ev8AyP8A 19P5H/r6e7s9A7fuvxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxl PxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlP xlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlPxlP//aAAgBAgIGPwD1I1K0JX1VKicuN4Op BG31MLgUt1/UfR0RRK5m/U7EP6eWVe5126IaUV1uISotxJJor++LTZCqdCLr4J/jv8iH9C/7qRvc q9BUi1P7kx7E5JG7I9xeSU3cHn/JdFZglM+X5EQOFDIfrd1AktFr1P7hYQsrlNiuir0KlfsjgVVK wb2ur9BTPpjQllGyGxeVTyWnpTce2Z40wWR8YLpg7XvQdvHodSpOWhRFM0sls1KMkjfD5IXD0zS8 Ixrh4pU5KUwjPqaihiw1wt5TyzxliasVcIZTGosNcmpQjJBHoO65ktxOiF0IJdZ1EU98e2b/AGQ1 E5k+ca5KCUtQK/8AkejokdzhkavgjkeSpJRlXhK/TCMtqxnnNImydJoO7hSSLvOEYQRhU64VROVv FZn03F1Z2G3uMSJTploVTeEPCcntkgnLAh9RJask7IrjqQ9eTU4KupBoRhoTmrtjA3apG3qiX7Ev uNkMlFSPsyLqE2kXUZSGuDyt03XGCuWNSMXn7ogjoWzokQiUQJ/clHizxu12ZRkXEVjk6MlaMgnL KyRkQnhO4jpcSiGTqmTbRoi48bvZkDsu0ehDxqSq4pMVvov7kM6XHlseM6HjfpyeVv4s8Ln2I0Hb c6xRnY8X+SwXY7YV2JtZWpTD29LyRG6PFkcHklXdEa2v9BNaM8bvy2ZO6Fcuzwqh5ZWEvcb9KHhK 3Ia+VujIuRK/Fng/ZnVE6PGhUrlbdWQtX6kcHiyeDyjU8XoSqk5oIdUSiCeR9ssYVzyVIwUjrM+j PAktEjxWZPPRk5VkroSnhUlJe+ELTPQi5lGvQkpgsJwrhEHjvh0XpxmeSMKkC8iiRXYb5K+roVz0 U4eTKpDYmqJaYV+h1xnCNCUSVc/1R//aAAgBAwIGPwD06lJu7FbLvapNrlfVQvlcfLgr+JNKexX8 btf8P6ip426DcC25Y6tIrHSh34PC/TZiSbrvFPv9LOHvhUl6mzKktSyIg3adcNMKOe30D9PQoUPO 2jI0NRNuZ9WT3YvRpQax1qOTxegmvUfRE+lKwgqiCdytqIUQO1qLl6VDuoHbw8/xRN78UaSxuKYS QsWUE95E+fRoSN5Kks+agotCUN6DTemHjZpzhVYTsStCBK29xwyXRrXNCwSW5CyTNcE+HJ5PTYhc UFDXZlDST5fFcI2RyUWDTw0JiC6Hx6E5pZUjRFKFy4KOvHKKWpIq2VnDTBtYRgnt/gVy0eSMIWi1 eamFfYXeBw9B1nyRbctriTQpTGg8KFWTqO3/AJqvfI2cLghYwsZJLfuJ8ND6k7oi2jIZFyfc+Npw VwnGR8nl/wBZE3vof6FPsJN65UuWQNdIPYtvRB5J0kT5woVwlZaFlvCxg0KqCrFKU7CWRYXPeSHR kPkkiaCtaoip8XkeS1vTyWSuo7eRTOo+BXZW3sQzuxxqV3KGnuU0OMkE4cEKGQyy58ftkSj5FWJL QjJBBKIeEr3Qna5RDJWEPB5JwSRba9lX3xl7FKLY1El9xZJIxhkolaElHkoRdvkoX/zfyKbf47X4 9bsjtXuTw8F0ELLXDqiGUJWE4yeN3yX6oo/JY22PS5njaon44tvRFz5qXLpOHdfsLLJKIZKyRhGE YQ6FGQ9D+NLqy23hThLHbbpyWv2F1oNHZzh29TUl7FNHVYSRuQyh/wDe5Qoi0ujamDgj/kdj9u52 Fd7Mro9SNiu5GWSMOGa0O9SWSeLXvwV05IGNW7E3/Jk8KhOEMb2PK0nfcdr0f74dbTsztqNLVEPf BXckPQTTkT5WEiuX/nGCP0JX2JLrn/6cfY8nsS9NlkcruRLaPK16bFHUh6onY1pcO16aCeqe5K0d UQ9VujxcwQTBc1pj4s5Txjcjc8bVrqW2rY8F75YY+MOwmdkRNBTVso2O7hRhayWta4QnudMJ4K1T KOmCjRakq1SS4R42ac54aklKOxKbRD2oNPcgTwdvcaE1tUlTKIG0VIeDtfsRD7EeMzoV/K7XCF+N vptrBMa2GmdyVrr3wjkn7k8niSQ9Tya+K/UnxU9iWOKFW/UhmonaQTwJia1RWgoJS1Ha0edyixPX krB5XNtcCVqSS0RNCW5+gqSkh7Pk1SR468tjUKp5fkyh5O22e39U/wD/2gAIAQEBBj8A/M0Vj/WQ IQJfkhLflpGQQlo1fqUI+UA9nCbyxF8lrgDLb/b+qiG3EklRn9y0v8KBAiC3JO4pgUAAGxITGhCb USbgqUNwCUWY9iMDWJrE8v6k0QSeSB3OiOLptpjLMCqE92btVkJM4Fl0s+KqHzZOY0FiV0mvJaol yL80QBp3Y1gc+SMJhpC4P9QAApmoR0uWeRQhCIfJAsHuUJGgWjao1FWpuh0ERxWk0lkrM66JMDcJ pdQOOK1wpuR/91RjKhF/6bpjUlCW4XOSEWYBiVHbFpCvcgebBCW4SaWwTbbRH8I9WqZzWucdMRbm tLEk2WqQqtJqEwp+6MSXyKJm3aEZjokccCh5+60MwvM+1nrGMTdVDf0oSNZYp0N7k7LzvrkMVHek XesY4ImBYChWiHVIYLzN1ojAIQ24uTjkq1OZQiMUXABWoA1yLKpZEEEDDmmDAWWJQO5LSMlIgOwo cUYyDEcXjQc1pnEgjhQKyqP6AAbCpTDGy8t6AVRi7Q26EZoCJ0wFCvL2aCNCTgF5UDqndGe6zysA tO3AnnghqviU0QSM8EaNJAyjqyCaG0Y9v8LVPx4DALqqiWL4MFYRH6p7nFCRkBOX0f8ANSkQ0x4g pbsp6IRORLomMjI87/JAQwR1QO5gyG4ANuEqsDqTgiQ5hlrlB4Zxr/zXVdNccKBVH5wnMgKJIvQB TFpFHbh4i7ryoVkMO1SEq7kqsFrmGGAWjbgeZVcApPWITR+QTkOVqkWa2TITkKN0hWTmn7rIcBmh AFCQNLFS2RMiDORzR29rbE9Q8ZNk5jEg3Log1Jr2ICVSpQkQCiIPKt8EdzaiBuXIGK0ziQcihqur MtLAldQZahWP5oHmoE2ijuSDRkKDNT3SL2HIKe7Ohl4Y5BRkRpiLviow2x1OyGo1ayJkOkmgK0wp kEavJEk0QBcgVl2YJkwoqRrmVzTD5pzdOq07EdNGxzQL3QH0QI1LWOo5vQLydovI5YBMTa5VcU7d ydq4FGJDSGCaIonPiTmroxwKMTh+ZByW3EXJqtuA8MRVaRWLOclCMDRiZckBAvI2AQ3NxvMa5Qnu C9nWkdMPktO3cXKcl+SaIdGRpqNUdGH1JyKXJzTteyeVeSsqJ0xIC6S5xKLgvgtYkerxBHbuMAEZ SPXK/Zki5onI6eaYkR/dFhI5UQPhmLEp/qxROC6Q6MZBihMfV+ZgJYkk9icX1U7FEv1SFVHTeVzz UdwHqk2rNamGrAlDUNXIrrLAYJoeEC6r/wDKc0AyUpE0iHUWLQuAtG2KYoA0AwTnCwV2CpQZnFVc hMKLqNk7u6qLrTEeJanOso+ZLSMGuVZohCGx0wFDJOSdyeckzJpDvWrbLjEIRetmN07BE2kLELnH 8wIZqMY5sjE2gf3UZHAISlX+1A7gfThgnyQoxR1VOSawFSgwTksMlIBojFCUj2AqgoESbKlAtMbn HBldzwpbNBaSexVqcFr3C5FhgODytiSmjTbFzmtEKBObp0wwumDg4lPHpmMc0zk8isE7AOiQRXBP OPTmK/lokZqlhUKQP1XXl/qhEWAC7U2IQ5hElBORQWCYD5IxYyJqyOqpBZgtIo+SJKcnTHMrVKmQ VFXi+SsyYCuaedCVlEfqmAonN12LTFNnUlVRMfkg4raSYjvTX4SBAMcQpRj4DWJ/KwHOq0titQxQ IVVFsP3VbuuxF6C4TyRa6IF7BPI2GCmCGBk/caqif9U5LnBPiqKgTyKqnFAndldPIueFVRaY43Qk cahHLhyWuN8QgcVVUR/xBSYObhMfyLBOUwDKMyGaqE2utJ4Mn/tqgBcrRGw8RTu8RmolElGRzoiY h5SqBgyckGch1E4NkqFyr0TAOnlRPK6oODDg2qiu/wAGmNynxRAIiHxRJmE2paJVyTpvoOKbLHhz C1YZLULS/IME+KGa5lRhAv8A3c0AO9OcQVW6daI4hCLvGIGrtyTANEURGCk9ZWCqvM3OmAsM0I7Q bmFA6WbHNMnKtX4HdalRVrxc0TR+a1SqVa6BIdeEdq0zAORZdJMZCxWjc7jgUQcVGMBWVyVmyyTT kSE8zLkyJ2twg5EIw3Q2RwP4rBWqnKstELlaiXJsrOuwFcyET3BR01LMgM3c5pnWmJ7Vpjc3KBkT NrgWQJLQy7E4izmnYvLF3+SG5IMFQqlU5XTVMSxKZ3zTIVohwcpo+FVouSqgw4U4EEVzWncrkVr2 zQWyTboY54J4kEKiomRp1RqCm/DZOn4VuVr1c6qlgnQByQJyVb2ARL9ZpFCIucUTVlpgHJwC17oe RwyQgA0Rds0yJFwmleRcLQKlBNinKsnnUiwTsz8GNlUp1Wgy+Fnc5IlRwfND90QFyRibxVAqEgq+ pNKJCrRFrKY5n8JggZYpzVrIPwjAGqEIntT8CxrEOgcAEZaeo45BapUjzyQJN1pAZrBT1AAWfJCM WZGQADD5rWSwFlzUDab0KY1KDmgsyZGJWk3wREqSTE2TMnF+FfgpRUJK6qLTG3JOwRES3LBEEUKK JONPgzVEdPyU3oXNPwtcsLIy+SMpIZIlEyu7lOeFL/ytIN/EUIWhGpPJCMBZHVJySiHoPChMVEvE vMqIz+l8U3iLsCckXqnlYYJtLRzWb4rktLJwrsMUBAnm6fFEfUFonXIqpVKqnCjlVICzPPgCSqcW tK4K04i6MeYqjG/BiqLmiDij9xti3jH8/gsuRsgEInHBPkgBd0y5JkAm/RA7kjEz+gXbtQAk4Qk9 E1ybJneSZq4ps11UcUXSDTxZJ7haRfJUsLpwGK04KyEhghLNawKx/ZPHvVSrqisqBVge5XI7kwm3 agRuAvgFRiAusMqXTrVnQoHKjc0Hvc/DRGJqDQqUCOk1ieX4Dp8E5stR7kw7ghKXiNk3Ci7UPud6 NDWET+6Oq6G3AvieQQiaZlNH5oC8pXVfFIfotRqSfDiyEzDo5oSFAbqW2aRCOixTgs91GETV6lMb jgMkwwXIowwPG3BwUytXNWTVHOyDTcLri4zCaIqVkUQcVLVUiyYFCvAMrFWPA7kfFt17vjZMEIhO brTGpXm7prgESU/ARAqUN/dqBhmoxA6cuSlIB3CnIxLvbsTypkEIjGyABGr/AIISNxktQDSFwoxA uhEdUhYI7m9WRq2SMYgBuG23eigi+SZaT3KJzQ+KlFeiDVe6bnw1xpK60yoyrinwxTfS90ytwZMU 6lE2IZTjkSPjJyC1y7uSpQZotWSqUy5IMGGaiW1RDO6AiQOSBNgjCMxLdNABVAmQshjQISbQ1gFG cZESx7VGVw6BgXNiAtbMcE8vE61Cox7FLTZRGJQUuDGybBc8ChqBEhig54aT3cbqi6QAMynkYt8l QgqiZFqSFiq3HB4d4QkaEYJnVDROeDFHkFKWZPx1x/hEypEfqtMaNYBVuuatQoGRfkmDPinEhVOZ shsbUjGMi0tzFuSEpxOkXN3Wnbl0HO4QlLHBTMg4yQkJMXsr6duOVyjLSGCLViGdHcjgiTZmRlyq gVGce9RlmK9ybDhqFwuxVFcU4CcEjkgRMlNKVMHCpuKp705qqKoVYCX6J4nSBgmuiBieB5cNWKYi yNGH88WKvWQYfEAmQMqALTAImVwnxxRkQgBTmruMVSV00ZV5LqkSUDuEM+KPlgGOBCBjQkiyiN16 tQ/wn8sxg1DIM/NUqKj5qUc6ofbwpqv3og4qn1YJraiyAbqnROj+i6amOCYoJlyKY2PBwrJpBULD mq24MycqgTxpIW5rU7Vr2oEd/DkeNU8CU0lz4bcRgCfiJyTlCI+SpWRujRlUtzTGyBBfktJ7kDiy YCoxQIDlF4gFdNBYqJjWTob+60pkY4LTHGzJp+OI6ZZhEmtHQkbA07AF+iANSEALXUIntTBHNSCe xTG2CumZOLoS+fCnBimueaAFDmnkNUc1qFsk5+SpgnNpXHNNgcE8k5z+JwsiLqUncCg7vjDXKdnk blO9Ua1CINyiDhZNfJRkBY1XUbrMlUuBVMS5QiXY/KiJAo7ujI0YH9FKcvDBz81pzFFWwxWQBLFO pYlMcbqEmeIDFdJdF0Y8a3zTHqGBxVKHJVxPwOLouHWRTS6o4g5Iy2TpOSO3uMJDgQbFAXIdCJpi UPiLIyhQ0B7D8bZJ8V/Cs4VIrzNOnEBcyOxVuFKI8RoyDm2K1SHSEW+vAqW/9wWhHCzlGQAjtQpA ckIikTgpbWOkqAP1F5DsXUqUJomGdSgXwR5lCJxP6JkZbfeExDHFEZJuHJNJNMPE2KfalTI1TmPy VXCFiEDJUkEDEuTkqpxcrUKTFymmahOE4xoUMSmIIjgVQ8Rx3IM5Ip2psviJId0wKoaI66l6BBww Bc9iMGrFtJORT7kmPKlEWq9lrl4zV02dH7UxOo4AZrVJqUZbX2sTcvLvUtA6RJh2Cig3jBotN6V5 uq/SG/VVWl3LqW7LsCMZWwKJJdE3ESUyqgQGUZ7ZY/Uq34yBvg60GoKePVD9lVVAK8Pyoi1RzWIP JCUZGTYJyqLvTwLSFwtJFU5vgEzNIYp5GhPctW1IAZJpx+RVUxIVCKJ+E4jwnqHf8dcUAC8ZUZW1 lv1dAbl3qBkjMBgXER/02QlPHBamN6BB6ALSA5FQB/K1zPYMVIyu7gIaPGbHJaP1QB8LoAdhUpiv UQex0Z/qhCN5myjt2IuiQpRNwFLc+pApwmsQjEFifktMumWSzVECCxCc15rTcHBeZtS0k/Tmh5o0 koUcJ2qV00TSLEYp4mqb6hcIsHLIfqnbhqje6iDfFAAMQq1dWVgnAZOK8lyyW1uD6gR8vwACWIxT s5IY96JHVIuxyAUYmT4nvTEdODokh6KhdxdDB7lEbUam8zgpGI1CPiJRmR/3Hd1Q3xUNN3QjHxTo Foa1zzUhiLI78y5HhRKLVT2rVDRjf4NUR1BaJBpixxTTBbCSu6omThCOP7Iw3GIOJujKI8zawRAD SjeKzThMXa47VqwzxTgs9kHT8HWsYVIUW+J1tbeMQSe/8BhjRGMKzP1d1Qg4Zgzpo15rW780QKvQ BDzTUAOpw8MIkAjFAQiNIC0EARKkGYtbkVLbysok4gr/AOzuDql4BkET3rSTQotSJsFThrbtQP0k 15IYxOPFsFrgOrMLy5jqF1q2jW7YLreJTSrzV08VVMahef8Ab0MbjNHbkNO7G8VU0yVaDBUcze3J aJ0ITQrmgB8GqF8lpkE4HwByzX7lPcwJYdg/AE/DAYoAd5KqackQMRU4oQ2y5OC1TFQOkc81p73T YTH6o7fJVFlKZaoYDsWqwxW3t+m2olaRYUCbJGAFRV+aMJGsaISCoiJC6lBunFPfaNuRQY0TlOFp Nl5u0LX5piG5JpC66JkZA1X/AHRTAxshHVqjg904T/oivNgNMv7gbFaT440KwLISHYTyKJY9qcG9 3+NpJwnBVbrchGwDE/gRgO9CIDAU4sicTYp/kgfmob0fFGqfNPgbpxUAoZtULaEQ8g8ZdirimzVK vcclH7iNHIEkGNk4xVl5gv8AwjCdQcEzEwwOSu8VSyojGS87auKsgHaeIWZCIITxOkjFHb33BwOB VAwR5qQ5IkUGKBe6vRWcBEEsMAgT8VVyur0RIrI2Ck95fGIi5RlKspISXYmRyT/4iPmgOSPy+Sic Hr3ow/sP6IHDFBkN16EsR2qWoPN3BzCf5LtWvK6ls7lRghtk6oyLxP8ACAHAxIoUYkWrFCtUTt1h khK4xAQKeNExqjvbR0yFV5e4NO4McCgU4ryRGI8JyKOxuhjYHBclRdVXTRNDgnemC5KlDgUNvetg cE4PxEJyaYDMoyl3BaM/jnP+0cSM0Qjky3AM3CMjiAAu9AjBiobn9wY9oRjgqYIHDJR3Yh5Q/bFR axZDmpRzFkMJRvzTZ1ByK0yPXGh5802KcLUaSGKjpDYEFMjubREdz90Yy6Tlmg/etYFUYmqE4Uq/ YV5O7Q4SzV6Igm9l5sfELowkax+adRDJ5B1SyLrTItpTN3onak4GC07nTIKlVXiVAf4k6OQ+Mk3n /CZFMc2XJEckXxUo4A0TYDFECpaiJj4h1R7QonNPiiPkFuR/tNuRRg/SaxQOOKdkN23YjsbtSPCe SJFJDwzCANJi47FzyVbI7kI/9QCG3O30l0Kd6acQe0LXACUMQjbSR2qlXutK1tqiatkqVlGks6J2 711B42I5LXsDQI4ZoTDB8FZopsOIJ8H1BDQG2xQ81qBuiWd0+3IxIwuusPzCfDjEc1KSJOPxR28C a9i04AqiIUh3/NRkE4UJixoUCcQ3yQ4T2z9JtyNUYCkbx7EADgnZ5BayOiZY8nVC0xWJCD0bxBX7 EYmo5oGRPTgMQtTstW1TcFihDcBhMfIppAROCORujKP/APN3EsQvL3PFEXz5rlmswbjBDd2yRtyP UMAq9tE4qiNwOF5sI/8AalgEJRtkmQEKmQtkyMDIxL4IB35/AQtJHev8PwOKJhfJNjigMgiMyPiY BycEZ7gaZoOS5FA5J/0QmRSQb5KlgmRAuKjuQPYfknGNlehUZgUmNJP7ITF4V7sUz0Nk4saFShhJ V8UOmS8yGHjAx5qJfpNindaoh5xr2oxmCIE9wQlAvmyaQaYtLF0dqcXN4yzCEJGpRhMPE0Zaw8oD wkc8CmHjHiCEXHJkYSZihtyk0R4Sck4LhFzewC0yDjmn2iTA3irMV5jtprIp4HsXMfExQ4U4OqVf BSkKiyjHEn4dEA5TSDzF+EJ93EHEVCZdqqjD+007EwsahczZafqw7Qg98UB9J8J/hDMq1Rir9MmE x+xQlnZeZth4fVH+QtL1VnRmBe7ryZg6T4ZkXTg3QFtwVjLmhDehpkL/APEISFlomOllHc2wXJcN iFHchUGrKlORUd2NxdDbnfBUpwqmCMc6FSgY9YNCiJViTXkgc1f4KourUzTWTYpitEL8NItD4RL6 pVJUZi0roHAoxxCY3FCFyKY1GSMcrdiEgiy1GxWnvBQnqcWITjHFEC0q960P1XByIRhKhBqhiUZg doUvtzKsfCeS0kv2rz9oNE+IBXaQuMUQMboxJkdJeKiX6sURJgRgtW22qPJeXOgxGRTWWk3iCxWm T+WSxGAK1CylHA0RMZETBcDmENXiF0wp2q/CiJ2vFLOyecnlkENrdtgVfhX4GF0xDFaibIkUBsqo klGRxPw6DgtPy7VoOH78BuDwzv2pwua8xqChTY8GCrQihVbG68uXcU48UahOC2IKE4y6xiF5G7f6 ZIxNQboShQioK1YihGRWmV8QqHTjE/whIF3RBDSzdDy6RNxmgQUxL5rXCxqozjexPNOUxDSWjVqh grFOQ0kAc04oQn4h7A1T3Y0KJiKheXuPpwKeJp8LqUI0AoSmkaDBOnJXlg9vxCQwuhXBwvMFjfgY HFHbnhjnw0g0K0yuE4XNasJcG7wUCcloPgljktBBiR4TmozbScSM0Yz8UUT9Qsmkemd+RVVzAdeR M0NnTFUPVGyMZ0jLHmru6pcH9EdqXglYmlVVmzT3dc+HmAOQoyIaLoEjjVMiBZVTlMzwTDxJjQ8T I4ArXiaq1UXovL2/mnN/j0E2stF9QRjKhC5rUPGLLSaEYHhriOoJuBBTG4uuYRAwqmK8uY1aKAnJ NdVNLHsQexWsUiVomeuNjmFUvyWqNGqFGYNxUrNEaWJxWmQJjhJNIE9yMtPQ6HlTeB+nJMqjgRgu usXOleXI9ipwqqcKJkxDrVtFjkmnSYTG/DQPqLIA2VAhCJYyVfwBIXCjuSrCWOSd2OBTHuKZa40k LjNOO/hqHhl+6fDgJYHxKqcWTixWvCxVDQpzRCLuY0daZVeyEgLfsqVJuhIiyjpPRK8cl4mTu65I yArgtyZP/cDnsWk/ULpn7kxHBlm9kJN4ShIVXP4XFCnJQN1rhSYWqJaQujqwVPDHh+6LF4xoPwpb UsKhOBdN81q2yRMYFaZBGUKHEJpWTGoRiaxNkYk2THFaZ4LpwQBuniFpkKYFDFafokhqTJ4kgptR KL1YrU2mtgmCdMiQWibgFAmoOJQdwUxLjDiGuOFawP6ITiaFU+Cl8SmdCMvCbLUSwUjaKMdqgN5I MnKO3tmpufwxMd/Yom8ZIg2wQqxCgcXunBYtdV6pHNaAOY700g4XTQixWk3C6u4p9XaEDmUBIU5p iOxdJYtZAA05p49JFwgSsuFrqQyqn4gkO6FKYAIPcUKoafA4F0QbIxlWBsUDEuCnHBiiyJsI3K8P ZVNIsMgsSrsgZURht2zTn8Tytws3hKFXCqgRgVa6bBbYj9QL9ychyi4aWCIIalO5VR1B0wctUIFq FlR+BkB4cFKTNanwRMiwxKERWJo/waVU9b2REvCUxxsqcGC5pwgCKrXtybkoyl2FVkAnjUZo5Ix+ iJrzITBUotJNkIk2wTO0cvxw0nAWnciqApiWTCYfBRmS4JIHeOBBuo6s2BRDIkIab1fsUZZivcn4 HIqINpUTJ+D5FdVjiM0JjxC4T8AFriKi4VbIRlcWKY/BqCYFwtMyzox2puL8gpdQpmhCb6Sv8RoB zXbwqjM3wRnK5/JMU6uxzQEi8tshyiMQmNk8PpLv2J811JxZkY9446v7UCKEF1HcHehwMSpAjqCc WNJJsDwdVRA7U5uLLULi6Bxx4OjFOU5Ynmjubk4ilIrXGBMXujI1OEUJTxsMkOSqnlJlSkI2/K3R i9x+y7U6IzQGVE5Ro6icHY96MXvZOpRF0Q1UYz8Mv0KYFxhxEwKSoUQLSWifijY5hU4uLhfwtYsb rUC8TdAixVnRJTXlgE4kQclqlIyPNacFZkzuwWnbDc1WRXUSfy4lG4QwIV1VHmxXYHX8KcDfBQke 9dqsiAGEkYGzqMgT5UrvgUDhwIF8FmQaoSF44ckJXiU4x4Nngn09iavYvLNMlokKCxThEmw+ZUjO 8rchlwZNINV3Xl7Rcm8k5/NuLYq6vZCJLg0VC9GRJzQOBVMa96Aeo4CQuEJYFaJVcI7M/HCnaMOD vREAUNQme+aqeg35FaSXItwsTEYpyRJ7RzR3IsHwCcECWBWmfTMXC07bknHBS1nVOQoMkJHBdMSj IuZ4RRqwOSr+dpwBFwgBjcp3Wp7IY5LlKxVUQ90Y5Jvko7samxGaE4l3umitRoRZEAvFadJL5BYx NAQV1FGtck9wKMMExKzK1mhFgtMB3rVIuf6K8SywXUaKhcZIxJImC6DmqqUI7RB3Ddk4NUzqPmzM YnEWQM5hjaqO3s0hic06EZCoxQns03MckOugwTE0P9P1QLEK4PciNTA5JyXJx+Cp/wDTWH2v2u2d 3f3H0QFzpBkf0C3fsx9tLz9kRluQNG1+D54Ld+8hsSOxsGQ3JZaPHT/C9f61uS2/KO9LY3YbQ330 ylMadIqKkOt/7P7Oe19tuje+x+53oQJG2JbcZf8A2BA5QlJ1L/yO3uQH2/28f/Jw3IEtKUvupzOy 0cdYmF/5J4w1w3vsyJzbpjq3TNieQqtmG0Pt/I3fvfvBvjy4EHZMBoiXj4XX/i994H7qWzuD7gwj GBeO7IQ1CAApH+rb3/7W1u7sSI+T5J0sa6nqOS/2n3f+c/6l/tPu/wDOf9S/2n3f+c/6lu/bQ+3+ 7GxvmB3YavEdt9H1YOV/tPu/85/1L/afd/5z/qWz/wDi7W7tRAl53nHU5ppap5/m/S99el769L31 6Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vf Xpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS9 9el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+vS99el769L316Xvr0vfXpe+v/2Q=="/></g><use width="1" height="1" fill="none" stroke="#ffffff" stroke-miterlimit="10" stroke-width="1.5" xlink:href="#a"/></svg>
diff --git a/silx/resources/gui/icons/image-select-brush.svg b/silx/resources/gui/icons/image-select-brush.svg
index d04ba7e..8f88b4b 100644
--- a/silx/resources/gui/icons/image-select-brush.svg
+++ b/silx/resources/gui/icons/image-select-brush.svg
@@ -1,123 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata56"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><g
- id="g4"
- style="opacity:0.5"><defs
- id="defs6"><rect
- width="31.155001"
- height="32.250999"
- x="0.41100001"
- y="0.153"
- id="i" /></defs><clipPath
- id="h"><use
- id="use10"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#i" /></clipPath><g
- clip-path="url(#h)"
- id="g12"><defs
- id="defs14"><rect
- width="31.156"
- height="32.250999"
- x="0.41"
- y="0.153"
- id="g" /></defs><clipPath
- id="f"><use
- id="use18"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#g" /></clipPath><g
- clip-path="url(#f)"
- id="g20"><defs
- id="defs22"><rect
- width="31.155001"
- height="32.250999"
- x="0.41100001"
- y="0.153"
- id="e" /></defs><clipPath
- id="d"><use
- id="use26"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#e" /></clipPath><g
- clip-path="url(#d)"
- id="g28"><image
- xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEVQRVAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABm+AAA1uwAAW7v/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAfwB7QMBIgACEQEDEQH/ xADOAAACAwEBAQAAAAAAAAAAAAAABAIDBQEHBgEAAwEBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQMCBgICAgIDAAAAAQIAAxEEEiEFBhM2ECAxIhYXMEAyFEEjUDNgNBURAAEDAgQCBggFAgQGAwAA AAEAEQIhMUFREgMQBGFxInKzNCCBMpLSE5PTMECRoULBUrEjFAZQ0WKyMwVg4YISAAIBAgUDAwIG AwEBAAAAAAABESECECAxQVEwYRJxgSJAkaGxMkJSA2Dw0WIj/9oADAMBAAIRAxEAAAD6zzn77x4P oz5wOfRnzgH0Z84B9GfOAfRnzgH0Z84B9GfOAfRnzgH0Z84B9GfOAfRnzgd+jPntDi6IWJCsWyXr vnzh1/oz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6 M+cA+39G8d9iO4fj3sPjwABwAAAAAAAAAAAAAAAAB04psaT8MsGZRy542ShznMzUg/PgebeJu9IA 64AAAAAAAAAAAAAAAAAAAAAAAAAG37F477Edw/HvYfHgADgAAAAAAAAAAAAHQ5cxspI05dy4pzhb JukoI0iceEK7YvNf5b6tLSnxxpc0+jnDC/aAAAAAAAAAAAAAAAAAAAAAAAAbfsXjvsR3D8e9h8eA AOAAAAAAAAAAAAd1U9ZITepuliYnTbF7GIzjWM4No8ITEK6RK6XJVLaFgmxKuiNDWsjfFmtyz5Vm ozw+ePo0emX3Yjp5jjyStwCYAAAAAAAAAAABt+xeO+xHcPx72Hx4AA4AAAAAAAAAAABpaiGlLDO2 q+U776roVsC+NZ8OTeS8M2veLznpZaNp1qS+PKccTgtGHFNKbIn0pnTL1e580lkW825/n0Pskd88 a/T56GTLo2Ua2xYaeZi2gEgAAAAADb9i8d9iO4fj3sPjwABwAAAAAAAAAA7zobGiozHz771rpDVy zEL38plOlq1azvJezlH7G2obkexKcDhaEQ7TQ0srVy6LKrMTmPQpqLRncr3o8vG3kU24q+h5XUdQ 9WOJk/Q4k/VUAw1AAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAALqWTmoyqxHCxfRbPt4vbO91XeL UCJSEJR61hXXynYdj23ecp7bsK6qde1MHTnp0s+VE4zjyl5X2qPcGG15QmzXYcw4sX1PT8ihPVt2 r8up9ovy/wAeThH0QDgABt+xeO+xHcPx72Hx4AA4AAAAAAAAHWG5W5G9o3Xqt5YStpsXrEoEr2dq YS3IkuUrjyJWvi69HaqV49barmjSgw8c10Wdjx+0Rj3KR5YyMOq2Sszo5r2bz2e0iYuZrdevyztd mvAR7DYuBj/VfNd9ioDNpAA2/YvHfYjuH497D48AAcAAAAAAJDLc4zZfTLVHtEi5pZmBbOE1Lzlk tE7aaJ2srWaaslWI8tkxtvteDPOr6NhVDlb6qZNK2vqnUu5KwSFvaeUmzC5JztLI5bboXyxo0a6F /NWspht8tjk7tc6VdC2p8zifdfPLvwwM3o7fsXjvsR3D8e9h8eAAOAAAAEutusW4tPl7XeskpK2E L3X02rycq7p2sjbOdkRthb01tLrbtXOtZKZKmiu7ne3V5KtowYoZCqnQr48rK7l013HVpdcoTjpR StnidbSZngvTvQfDR2cdnk1VuDIpdYalrzdLP11+b53mP2dv2Lx32I7h+Pew+PAAHAAALOjl/GdG OF/OSjGmNcajFc0rOdTCOzZwjRonGdF5TCtdLdZeVU+c0VKTz7Ghamx3ZStrI9VXrNLSZsqF1S5C PUslVZxLb6LJxZcRchB25W7PmsSbopjzYTjv8ey+qaEo97Q5UzHZH5HM+2+O76ut7F477EmzD8e9 h8eAAOAADS+hWblnBsNilsYdojGyershlHPqrXfJvh52vnaeW1TuGqb5VO8aWaGoZjVVHRnbKtkb ozerSbUU0UwOPHriGgunh2SaK+XTJrNSunmh1mcskGar1wUdgrbz4x7Xq8yZG4Xls7G7XxruniOD 9Lj6O5/sXj3sOb3MPx72Hx4AA4B0LdLPevC8rhLPbR2cbcmNI9mkryFPru/HRxV066O6VujUdZvu U8lTnKe2lGPO2QZjZWydtNrux2q1NKnbKnhTexQPbNaSs51OxGv7Bpc5fGcsrLS10MpnOq3wL96a vIplbDpO5e5xmVPNR35/f+S0vb7F477Fk9rD8e9h8eAAOE4XMWuL3tmlYzTHPCvtaXOzmNVFxfga ityddQhxKtP350bUaWfPtVnk9DmlRZ7KfrpC81ZTNLb8qtnXzRNJ7gtLWfo8pRFyPO0Rs4Y5s0MJ BprOahFuuyM4JRkvt8s7GymCfJdR66WTvF7YV7ZX/Hb/AMvo37PsXjvsUPRw/HvYfHgADhfQ6y3P UybE3CnnJQhbVKsJnUrZwOE+0aiWUevqjZtXt869UfQ5RbRRfa+auzChddcrPcp3pWbdLHJ7l4T5 TMtdZwndejxK6fEm5rG261Mh2yyeNW1aNshTOnR5vWKjsLZVTXtkq7ErGpmNV+Vxvq/lNu7b9i8d 9i5qw/HvYfHgADhdSdH7s9ms9Hq1pj7KvmbsbqpLXsuaKOswMSs6po5kKVsUWM92U+r19RTWyoa1 hXTuX1Xxhuxq9NHVkbsz2028ra4NVC6wy1MriyZhYzNaL5WpCcqJpnoTdW1+fROZXz48idXnbreP RYx2dVuX0Xlz4j7P5bZdv2Lx32JfTw/HvYfHgADgAA0rc/dThamCudlsSqE9BaLscdjWi/vZWtzm kRmzWzpVzNLM1Ku6k5DLq+aavz9sdmxB7PuqX0F+mbFyNs67nFuW04LOSem+7i5aY6KhlZtQeRKk nsq+VtZe/RhskTXPGlrh1W+qbJdcuLZmsjqRT5De+Z06tr2Lx32Ke/D8e9h8eAAOAAS21dVMcLab Ey2rtUKzNkJTrS8oymntldk6w7TMptquQwX+f72v0F2LENLHqVxPo8uq5zdcNBrCGll1rqalbSzX l40k3XZdMqeoiiNd5KccmTGVtyaafI0x1MJrWzbcl7YlpyaVpgxU0oShy8pRrT30yMzQz5e9t+xe O+xcnh+Pew+PAAHBpXX5Nu6u2XnROxOMrXUc61Om1LWcBLszjbCynYjU3LszU8+2QnuYOrnNNaln 3V+M4r/O3aONujZF7vHuszXY0mu+LHE0K19EdTsewEHs7mjO3Rau+Ouzs6ZVaHlnRR2dPWctzWJs 7GuyVYUs02lkVWLez7mSv3mNdv2Lx32IXD8e9h8eAAOT3lHUxSvoZTLR2uw7dSxUqxuXY5psjZUl HNLF2suhBbUy3aezk2Trt52nDDTEtRe3qtqRUk+nnN3y787o1Ua56UeXwalxCYrWPqVtFO/Nu0Rv xtVG2SbObp9jZdCeekVHaWVFqNlJWdhdKy3Gq2XnKJ2llZulk+r9FnAZIbfsXjvsR3D8e9h8eAbZ bbMxXbGOGdtNqJT2UOvcRuVFLl5d0OVxmjGhmWpo+gQusyNmyWes9mx847mqzhfTZxyLWNpN3rVS Cd08l4ZMxzOv0Jo5DiAmrDJf7G2rsmyRpZq6uNprU2fbsWvzE4SklF+yhSPIzodGpI3v2temn0dJ ja3z57sQIYtv2Lx32I7h+P8AsHjwfQyztevmQuTZlGlimcmZSYoXlti9pxeya/aX3LnAaXtW1+pn Rg7efrZR1nijw7V+LpR7jNu4l+bUUWk4po4T9Fayn5Geksg082wqq2gxSzGM4TjOmctpraJr6NFB 3VsSYg18DqUrqtT1RWpSu9f0O3VUr7VGZOGTGAclt+xeO+xHcPx72Hx4Jb3z7jQ2Ys0P59qvbZ95 clbIhbGrjtVclxYzps613KpcVvijajFmNpJ3O0Kl2fSQczec2IL3LFFhiLdpVdUYYYRY5NqcbI9S ztjIs+ldnaKztOxjSFLEHmoytGnLINnOl6Fq9YzNDF21pt7Z6X0CORcvgiAJEADb9i8d9iO4fj3s PjwHeBzbYztbR59FT8yOfS9JHV50m0LeUp2/tcUJOZzByVtsFkoxGjtdhaOhPOjJ84YrSrVKO20s wmitrYzvFtHQdb7YzhyGbqUuZGknGr7FiLUFtrs4jrpuwtFZ/H7V9RKhfRVpddrX60lI5M9POBmx gAAAbfsXjvsR3D8e9h8eAAOT+i+aZpH6S7Ge0ebbci6q1UurL2aukqnEmqNCbJK6CaUZfWfhGvM2 8Qeb2fpCsd73NXDsKdfNVhVrOnc3STGzGKatPdq3Ofzp2NkF6oroZd1YLJnGLM6lH1KBOqKrWW+z 7NN0482LqKV4p94E4gBwAAADb9i8d9iO4fj3sPjwABwAAnA6PW5src13fnNHuX6NafO+ahpJszp3 N10FLtLI08/L8fazlbP0svQDQlCzLTNzfoM7QknsfQVXqLa4VVy9zL0pU9nzbu5xVjPyKTi9Zoto 812ezur30amS0g2p6alDbtPIrXgoBLMAAAAAAABt+xeO+xHcPx72Hx4AA4AAAAAAMLnT6VjB0L+b dbm385upOoGSh/OYlXbpnKRjLvouaGjkaeZupPUHMe9Wyvda7L08xxVtaiYkWM7Vr1Nb5fUlLRSl j2JWJNbPZtjPNWzWTzmbOAIgAAAAAAAAAAAG37F477Edw/HvYfHgADgAAAAAAAHbKjpZasHPraMZ iuBljEuV/qXMPUPPpxt75tqvt/MMS0fYQx9HuPNzu5nfQ3NPHG59Ipip8kX5R31NlVA62pnVic7w EWUQAAOAAAAAAAAAAAAAAbfsXjvsR3D8e9h8eAAOAAAAAAAAAAAAAAAAN6OGNLZyYAwAr2SpO8AO d6cO9AOcAAAAAAAAAAAAAAAAAAAAAAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAAAAAAAAAAAAAAA ACQESUQAAAAAAAAAAAAAAAAAAAAAAAAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAAAAAAAAAAAAAA A3Qa0Fg7Ykw0CmJuRD5QbUOAAAAAAAAAAAAAAAAAAAAAAAAbfsXjvsR1T5v68D5A+vA+QPrwPkD6 8D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrw PkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPmvpQD//2gAI AQIAAQUA/kLAT1UgYH+2SBHunImZzEYgqwYf2GcAM7FiTP8AjMBlTETkP67GMYYxGGODmIrGKuJk CG3ifUTBsEFqmJXW8srZD/QaNHIwT93/ABXVmAgTM5QgGWMQP9yzPK25qsotW1yicMemjC6vg38p jfRvrgxK4OkGfkuyDUiMQoEIOBhZq7K5VumyOSfyH6GNCJ0Hxx8AIBLUyETEAjdAcmKcGjYYBbiw 9IGYx/EqkyzASGGHpP8AmBSYEmVE5mZzAonSOMywHAU5qysrJlTddhB/Cq5mejsCDDCenHJIAgme hJM4wLiATM+sYiFhCwlVmZUQCpBgwRZSOPzKhMMdsAwxjCyxnIVSTAOv/J6wQwMIcQkmFCZ6YEYL KV6A9FsINdxiWDHygZJ6AmMckxiAMgzMJgMH1RYRiK2ZmEDOBDGzHjKJVkERupQyto64+WodWMdo YzYmzt8jU2ayQoJLFcxBiZPwBwY/1yZyMZ56kYiIoYAdOkVRKxCuV+QYCu0JhMcMw/8Azuq1qicY yKIB0A+4n4EQHMyDCBCojcBCUMYdacj4chE+qCcuKfFBkkxszE6fBusC4HLmXHJbDE6j6EnC5zAc R+kFkzGxHTIXkGQZh+kDkGi2Wnp8U+pEIhx8WOAXyeq1oTmz65wgbkD/AIq2DMjBRTCriF2nLqEz EHQ9SRDKm6k5+QHETqG6RvrGYCO3Ss5LdVX7RU3Jn6ID1VgQywMAC0IBhYiFsziZUTjJmIXInPMr UGYwvyIcGyzJzGbEZsEljEGClvOy7/FDxYEOrriI8DdDxaFXU8wQr5jqQaVBATiCYGhwQEzKV6v0 +VjDP+G+j/Rvo4PBGw+Mi0FTRYIesdShSyMAwywjDlOsrAdETB45BGJ9IGleCa64x+74scD4tD/i T0+q3KUah+SModetbo3qLzj14K2EEgOuDk1hgghaK3QlTGrMIIlJ+5ulPyMYfi3wvBBRuS3JzWqx kdxgNxsCsa2OHU/bGr5CospNYMrGA4wGiNgswMbkCr5lSfdYcVfHHRh1MH0P1ImOrpkLlGYYmxQG XXsOLK+vD1BXyQsgIqTr6XE9RFJyw5BlM+k+oUZi09aacS9uvxHVWWEQQ/AiMI6cpX1BUgvVgr94 9PBesGL9sHGdMOYPqrZhAaMk+k115NXQiyywKSST8VOCywrmFSPkxCvUpgkcgqiccTksXBDLCZWe jjHwBhGZyjJmaFf3E4Njcm+VRyBSFIUhQzEImRPqDlZ6nU/RziVkMGjHqjYJGQy4gPVDDSWleo+K lCS235634kMpn/LCFYRCI8rjzJz9VeVHBxkOuCDEORnqaiTRUSwRVUtiNYSf4AcEXCF1MI6FepEd Yg62LCOtbHFixfrWYwBBUg1g5XXZouv09MVxrwI9pb+QHEVsg/UiMsC9SuRZXgosZY9eDWhgqJD0 NKqeIS0cXsANlhc/zAkTJnIGEiBMxlwCAQlYhAy9AARUULaVjXEx7Gb+sGIhYn4Z/wDl/wD/2gAI AQMAAQUA/kZ1WHbqBS1H/tlgBZsMYwJPHEyVauwWL/YsuVQXZ4AJgwrGXpXaa39eriCGH9W58Ank VWKIFhEZMwa2SlSrPTYHkJygM5rkHP8AR2G+5RFWATE45gWBIEgWeiDDSBCAJZSHjO9anacmi5mI OR/LacsgiiAQCBYBFWKkVIEGLlInAwpLKeQ2NRlNdvpmm1XH8jfRx9yRYBAIBAIqwAQHEQBhZXkm sCCrMsQCWrkWqFZLzXK985+v8RYCO+ZYMFYoiiARRBFBMr1rXiaaLDWMN1IQksoVbfrZ9NgRhADn Us5V/wADMBHs6qMmyIIggirmKmZRSGNa1pDcojWhpZYRApMICR1cyytpYk2q+hUwlhFusSae27H5 mYKLHMXqaxgEZKLFWVqCcCKOlfStOgJOawTGpeVq+AiLLLVEtuyLCZf9Lf8AIZjYMo48/l+ksfJJ yUSHJipMQRRFWBunqdayCLaQsKFSr2hGsthZjHaM8dpcQQ/RlIEYAxhxmnseonyWthW6lBghcRVi rgGKIuAAYATK6xioS0EqWzNU5QqsatTHoEtpxLFl+RHOTicTGrBGqxS35Lus4xVCwYimep05ZgMQ kxRB/jWMJS3TOZjBNbpBe4h2cx7bDHZ47TYwQfrM9WsAmovO75LD1WzMWeooVLQw5ZiCAROhpHRj hhkrrrmwgqbFDSh+SvVLAQWdhGtzLDL3Ih+uAYU6MoM7fVx+RzhX5NAj5UkzPQDoq9AIv1Mq/wAU GbSOEqI9dxyDfVSyt/sER7a2FgWWSx5e2fgDFOY6TTflV8SAQ9I4leoUkEZigAL8F+oGS4wKDmw9 QQyvXeDCMmwdfUIjMpjGO82DGJM/4C5gqxLOYmgx9T5OXEH6l4vQKBB8MYFX1PUKSjV2AixYOhW5 kjWIwsGIzEQvmWviXPmBckpBkEWFZa446FRA+TZuOT9KjgIYpyFi/X/hTgo2RYIj8YtgYWCCwiFg YbMRzHsxLrMgIWAaDqHQwkzW1XvtuVUb42txVj93/FfSLKzFimKcw9CjYOQwzxIbE9XIfrOZEZo1 nS151adVOQ0V8QMrS1RjtaqtVjcn+OxZyZz1YdUPUGIYDAYrQ9QDAxEY5AYicoXljxrejW9XJygx LFyAGicCHrxGclaV4afxtvin72n1TOGEVsFWnKBorwmBpzxGeep0NozbZiFsw4h+8IwmAYQQzZB9 U409F7n2SFr+NqlLHBBbqK/qy4gPJf8AhXyofMWzrzxC/QW9WtxGs+03EF7CZnkg6lh0VyITyivg kgxxlqtJAaQFS6zm/wAb6+ag9QOJZJjmAOLEYb/ElirWZU+pyWuzJdyD6pYIxw3QqBio9SpV/wDh hMT6hWImunqX1Vgi2wsflvAVhbiCxRPtn2sMCWLleakfa9Q5IepNn+CAmKAHuxyUdMlWbDhWOWAI zghWiatrzU0xULLQg+a+n1Fel1LKQFJxWx5XNhqmOGPJkGGsH3hRxIJrqMsOJxDIvSMIozMxORHE s9FIVUpxHuOP4SimX66gAENbllpefRs4a3EU9OZWf4s/UIcF1zM9CcH0rLFp03462lwI4Kbrww/j IBFtBDvViuqWCE5CE4RhLMRh9qt0cypS6W1Mk19V7SlSgMFSO5Y/zEAwqCP9Uqz67FX5VnU+9m1X BtDqdegmu/ScCrRsZk4qCymM5P8AWfXrc11V1/Diuf8A5d//2gAIAQEAAQUA8l3tjt/Y/wA+8nn5 95PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5 +feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7y efn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+ 8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5415j37uHfJ5n7Y/rpW7nW7JuX yrx2hY/j2kRf486i6iyh/wC94Z7nnmftj+rXW9jdu7J6jVdq1daY4jitjMnGYYDu2hXtUMpVv7vh nueeZ+2P6YBM1e2bGwdHQTWFetathqYtYjGDgiqqMzh1LdB3ztzI/wDd8M9zzzP2x/S19d737f2e nk2tShFNdBal7C7PxVxWOSWxlr4rUMN6kuRXTuvbDrWf3PDPc88z9sf0FVmNPbmM7dpLy18Bj9t1 tbcnaxkQ+lVTl2a6pQK68uvIvWyixiRs0rYmx2i1W1+zX2zb07dV/wCz4Z7nnmftj+dVLHU1lrCo QVBoCg0LWjJY/q2s9y116wfL2FrFrRSxRyKq1VgBGZRNjYrl+4SXusZqaXtHcNBUT4rr3MhBHwCk zg39Hwz3PPM/bH8+jVyepItZYHlZCtlsb1riW4V6w4K13O4BEHJLJwqQbF1FbbHcqhGtbNv3k1os wJUT6l2k/o7faeJr7BsMjdprolQCm/t+tag7Buc//wA3Yqj1cZfqKQQQZg/y+Ge555n7Y/n0VwlP SKzLr/e9RYiuthTRpnCh/Vvs4IlQS1GetTffTXNjZLMASWMxADkpylShHG65LEl/Rt26bO02PE7X sINXRcAaigdxoqNdy12Jv6l1JXXstavtoEXRTB06ybe3rLK2rb+Hwz3PPM/bH8+iuJSVD18VTXsF VGqfTp01L2CwHYtsrqUKtlbMAL70rFlpY1oLLH4wt1+sKiEiHACsQ3EvNMlE1rSAWN1xNdE2u7O7 XWPaRgT08i7V4MlalfTdo9IrFinlt0c0/h8M9zzzP2x/MPrqjCoFN9KizY01FjahH+w1h9axa9de FeWsayXbIWO4Mc5KVsqEEwqgUtxhnSO0TPLWrLwIqVrtIiWdwFMbuDbScPSBbAorDR7aqw+xUw5o jlqxXZ90vrYHII2E4W/weGe555n7Y/mH1oRTUAVZRxsQlLAnpWpxqIYPa9iibG0WHOYYytVAezJa 4seTs0HWERuMDcjqsolTDgFrYbx5X18devkCOSxdi+4olSxV5SzTWwMltDBVcNSANrVCzerbn/B4 Z7nnmftj+bXrDtR98VjEOHQEMLAreqS3qsCx5BU5FwvK0dG5FFrUQsApcYbJg+4uwEZgILetdk1d hmV9oKrEF2si9Z0cozPKagIiKICpl9NTC+p6mG5eBZfbYLtK60P2fZUW0W0n5vDPc88z9sfzagM1 CQAcrWyswf7iWY1nr1yoAAcAgmOWdsHjy6OXc5VAxhdEDWiO4wbBmq37tWwAO+TY4htrrDW8irlz RWQFIADs5QHiwE2ayAK1ZxQmVrGPTBG7o1X03Vmqz5fDPc88z9sfyAZldJJ10BbXcAt9sUxZnr9I XzFVsIoEsHRieAwK62HBrAC1gBsuWNbDaYtN1kTQOE1UWVsUe2wxnbPIAluR1wJW2JzLTX1yK6xi Molq9LlNdnEkDoCDl1BXvGqfm8M9zzzP2x/GqljXUBFUmUo1djAo6vzrWKck9ATlq1Z3VWBPSx2V UezCBrAr3emz7XVrWaKtjlNJzKtREnECZxAclqsmwWciDCpJrryUAUKxcrhZVtfYt1cstBH+zylo BFTkTmDGuCz1OU3azx2K/Tt+Twz3PPM/bH8SqWNaYldTErUA1lwNrNyevpWnQVjrxLypFJq+pcGu yxQtlwIVFrF9xezZD+tXUHKagBStUAwJmZjnEzwV75yJmCYEJmFrAZnlRWsCxTEKRHXHFLlv0zFY iW2ACtTYTXgmhiV0xYLvHdS07fjbVrZW9T/Dwz3PPM/bH8KIWNdcqonECMzWNYnBqR0X/H/gYA+t dfUmxAH2enN7nVErj4MI4yyxr71qFLcxAxJdwgFpaNaCwIJscEA4sVYqZjFa1++xqqcBKGJXXGFq xK6QQlWI1c26uUJBiPdQatyph6leEsXLNLWyO96ysPh4Z7nnmftj+BV5GusCU1AADAvbEIFda/ey LgLjh9ApyXZQGuxHZsVa9+wRSuqqu1rYWXseGkg9fbcOyV9WbC2nFltxVUuXkM4sJITJevjgsFHp FylYEUCLiIVw16CV29KXVmsIU2kMLk+5QGR6YaiArXpBtuAdhWHcCGqP1nhnueeZ+2Pnrraxqtfh AoBRcADowFluzZlqki5wP/UWMrV+K6ZUDVQNaikaO1XVUbRbbtWcAgfFgYx0xeEVgUKxiCNgBpkM vCspSFYelmHXwVoMVAsBE5gT1gJ6zGL6pldTEpTYwroZZbW3AMym3rB0A6w0hp6fE+n0ejM7hr2C o/WeGe555n7Y+fWC1oqHHphTxEuOA9gVVUsVGITmf5TUoXF9gLKgatlPHDVWPrVBclVessK6lVXf DWhGDWiuU2iwWVjBoDNwxYUOUJxr3Fg19Sw7Kz1yZ6hMUOYtUQKIgzKgiisjC9SwE2qg8yxjL6kq zxH0OGAXEZJZXyHeNA69k8M9zzzP2x81ScjRVOJyqZa4+mLLSzPlpX0AbJBydXWs2HfXSlq60LlE qLWAh3DDgzAIDGb04CGmwwVbtkMHYsy2qBVYWmARcgW168FlNZVBYp1kMOuohVhAXitZA5iFTKwh lVKGLTaIrNXOYYX/AEsyrtAVnKZGF+pMfBm5qpsU7ND693hnueeZ+2Pm10lK8YSAVIQXM1r2FUi5 JzEUma2s9z6Pbhp1bdNRmrVyttYMbULLVVza2lQpRq5wsWxkVTZs8j6Lk/6iYNQa+okRWOLeS2s4 IPUaVhziYzOAM9EGehiei0roJAodRWuTWbFIvtCrs8msbkLRmL/6yRkWKD62YjOZxsjJYITieQao I8M9zzzP2x8qDLadeWzklgIS9psNdKKpJAxFTJopa6ztnbatWvgWfudRRNYOteDmnX5xVXk3qJYz FhY5L23taxrSlBaHnUSvrs19SOjbSgoDlVfMoHG+Zx8BAIoGUUREGRSGZayprHTb14LHwxM6gIoa VVVmKiCLxi9S2DLkGO6ANq+Ge555n7Y+Wpemv9qNYECoY9+BgsQoEVcnW0ix0aV17q9imxbdinXX und6dh0dSlZbk+y9dlexQz2XqlhtcvcCUo4rN37UpBy7EzX6XVkAkw4ZQALHrzHLqybMW1XFdgMB nNVn+yog3GMrtuIru9OVWq5QAy0dNivqq5hVcMjIU2FVl2VJRuQU8QTyFucd2t40+Ge555n7Y+QD JQdUPEKQgLs5CkkAwVnNIqSHcrCjdrjd5Sqf79+7YRxmuELXWmtssaS4D0a5dNy/0VpsJW5uJ3mz QlZVbMCOeF/TmpgmxVA2JwWxXpKFUQj/AF1J4soFKOE1BK9ZQP8AWJiar5pL1zmnE3hg/wBxY4i/ cOMFKgghZQ68TBZgu6svfbv+/wAM9zzzP2x8lY60qWYcawK2sC1qteRxaw1g2lilpWesM9XlVIY6 dlVJutzMs92ubTd1rUYV9O3NVzPsbmuoVdw4e1+RsOXuXAvJBWs2VIcFfq/3LZWyNqW9SgIakiLk TlkIoUrY4NV+JVbyiEThyl9f2t9sYxupTocQrCgYNSVK22LFtDRn4julnqbvhnueeZ+2PkT/AAo+ 0Up6rlVwwKw2rxBBZ6qjNehWe6ipYASagAVsIlt2Br1vZcqV61W3cNi+9GC03GqjSGXr6C8ho5zb X1exQybY66RzS9amAFSHSMoaWE12VtzQDMakNGpIgAITBgqS6NTsa4ovDLXaFFj5Fh4s7Hly4xRi Z+AEZY6RgVm9uCut2LN4Z7nnmftj5KwTKauZSkiekMWUhkSkEuiBcNFZwwzBlmYlQljWCul/UVVQ dxs4aejRhbaVeXIKqtfIi/8Ar2bWE1E9S+2t6XRlsTcrGO3n7CMx1weCsMWJL/ulNpVUvBiOpnEG HWDA67pKlzKuYDa9TrRcAbXBWzqBmKxazp8BB9cZhSPWcd/RlaeGe555n7Y+TUr5KDxAtIg2LI11 5li2ZKLitRxrX1JZ0NRZRazO+uyaevpa/wBhq4bHcLTZTrKYpxN+wGylW5F1C7SZna1za65j0sss /wCwaAAAjpkMpSCzII4T/WreHVuUr6qst7qa9pxE3aGiiq011lZYn2bK8gl4Ku0Zjmrlj1HWLYrQ NAwi/AjI77rGzVnhnueeZ+2Pkp2XqibnOKQwoccC2XYuxwgUjkQQsY5sUBprayE0Ya7XTjVsWCzZ 2EPp6dn/AE5IGw3O2nVVda1gh2Cop7Qg4lAQwxNnNdlLf9ldqsP+LRkV8cVhTH13qlFwYKEaNTyC 1lCiI0VErNTKRYmVtr6WUgla3YsgCo+RYQjHUQlabVgqsMRigN2Z60vVbqtqr0djwz3PPM/bHy0M AahxtrLMtdzKb7AWe7pWH5svCLU9q1atddPNFTt1AdmwqMOF1jB0RTUuzbwXQo/2dvH29xrlrs1e gAtI+rpmXay2Aaw5AtW1d4xxDD0FMNZU1mXUK1uX1zXYWi8WnoqSigy1USVXCxb+sY9QZ9ZYhnIW OAGYARQMcRGrBllZEVsTvahd/wAM9zzzP2x81bgrQpFDMoOTZKddRGVFnpiywdI9VronaT6bKalV gw235bGjrG99zKTZs9VO3rXXQuCu5XzFw4PrXAytuQlgIN9BsAw5souqFF5lVytFQMHoxOPKV00s tvbGqr1by8rGIR1t6KuwKrbrFaFsHHQLCsariUszZzMSyKQYYwGLcK3cbhdt+Ge555n7Y+bVANip Y4CKItRUu1YAqNz6tCIumEVrUBFb2xCba6Gyjhr9ymhaKe5VkSv/AK31QoCSxczd1DEzS2vaRK3D RlDLwKHb1i817w8s0q7C1V9Rq2XWV7aNDQrgVMJUxE3NAONPcyAwEtwRuJk1bTYpUuSOqiARlEso VjUMThiB8RLA0tbp3bcFNROT4Z7nnmftj5a0ax9TQrpVeIKhAHI4V0+s6UqqUHrSeOxUSyA4lK4F f/XZ27XVdsdRt1gi1A66lxC1MGLJkWV5FienYQ1RptlbZFlYIC4m1plZqbDMwZTG1abJ/rPVKbuB RVcGvjMfb3BCh1ds2I9oxe6sxXga7UMByB0gjCMIRFsKw4adBLrOFXdGZlnhnueeZ+2Pl7XrxDmO vFk+rr/1UnBBlB+7aHGzWbMuyppOA94Ldt9R9is9LVyNoNXsbBKPrXkxCGFlZncKCZXgSxHqmtsY FNiuLKsz7QNnQLSjYyVbMXJBqW1a9m/UZLOQLdNpFsVqnpdblaMymbHMCq9qnquVgCYpxPqCsZIy kHlwNlyqdjYN07m33Twz3PPM/bHyaet6ppVVDdDaMrXCw9JD/wBitkUnDXLmzUJEu6xMZvFZu1ia n17AysuZ3PXEo44/+tdrX8pjkt1IYX1WUvU62i3RcGm+xGo2kcNUDFBzu6K2JTe9Lq0Ugy6pLaqN h9eznkPljb0YJh+IAsQBrKK3i+tptRt12RXimfWERlEsX7d1iHGFTds52zwz3PPM/bHyaVfHWrHS wfaDyROkP/qUZrrJKocNeQGBCXAZUV9NqsqzEsmncTKyGG1SLEf/AK7rdZbKkseo6l/IWIGXao9R Gayq6lgRfrpcEp2KDRdY4AFihSJ3LWDTRv8ASinENhI7hUzHR2iysTGPKwwJkWp0HLPBXD6KMtVt 9cTZRitsVg0aW/47fW/Zs9OljyaeGe555n7Y+NNZsepAK6vqwBppaKMOFylY4tS3EJ/leC1dg9Sr WdXhrUrt1HjpnlVWxpfVuDB06b1Cg6uwgNmsLE520vq7IsVlxO4avNaLDTYpivLKQRp7KmZDR1Rx v6Lh9PY9StnwbWYKchxuchUvEICYowGUGWqayq2Ia3DBalMemtwaCk5MpSzlHmx1v7sxCfDwz3PP M/bHx7TrZSs4ijD1jKplXc/fX1F443fSxcRcMlDFV129KylxYl9QdSg17bALF09ji1FyWJfUjrtU Wa9+rsiys1UbSvRdrPruAr1qR3HRVRo3kTJErZZt1Cp9baFk5hjYyldrWs17adlLVLgQohsqtxZW QQsHwsUMFr4kVBYrkFWBhxHQGElWV8q7BrO7t/2fDwz3PPM/bHw1dJrTrKqKRxtKyvGdheF4GVpb psjKHrKnGFfBswtzk40dkQYM3KOlbc6zWZp7QUpYHTe1BsIPV07KnLIli2oahQ9FjGP9d/QZZqbN hiWnIZSibDae16nIM+DyyW1kLioA7RFVdgcHQtFlatB1mIwhAiGODkWFYlqsDjF/Q23cEUYncrOe z8PDPc88z9sTQ0FKV9DUcNtjFiHK1nM2kZhS2Yn+TlfTRoDwNdiPLFLpVZFPpWa94YXJyVzbVezq F2KfUna9/MYgzerXGtctN2Rk1pdXmzUtW1bVVhO502V36+wuwgcid1r9QaW4VnqARWE5gQMZsYet Fq9Om70La7gwV4GmOjrFBhzi2sLEcofVAXY3hyUlzs2enW7Fm+HhnueeZ+2B9dRwy7CenYCAzott VLGIcFcMv/rszgniVsHCysgg4BzCSttZDrTedd0sFi7tXKvXudCjiX0ETQ3S63oLF3tXYqOlvJbW t4rGzWuxXp7RrtNgEs42I6W6dw2lZfU9Rbg7NTba5qLCITAOjgS2oB2qZ2qe3Waq0OFbMVp9RgRh LCvFtlFbY3GsCIsBAHctjp8fDPc88z9sTt2xgti1FYiVvkbKlGRgyqemwqrEfmEYYsRGRGwS3KIS htQtK7CE+21Ne1tS0OrLu1cDr3rdXTYStjvqW07ld1djK43Klou17g9aWsB3AFLte4W084uHn+rU C1CGW1Mp12xaiGJ9MxhLARHwIqC1ON2s9OwlgVwIGhjGbj8KV/yC4n0m1trWLLGsf4+Ge555n7Yl bmt9TYDrfWIjkRbAVPKl0s65Vh1qsDRWzLgFZW6v0gs6K/B0Kqdluulsq1ewvq1o519iuyXf91On sGi/mRLqxehS3VsXZ5TZqNqaj2Iy3jkjdBljw6btfKshUetwyVkwQgwiPUCEbg5COLdTjKryrJbi cujfTuVn2elziJgbuyKA7s7fJ4Z7nnmftj4aV/A6LV3130tSwfBPG1TyqZLBLFFi12xXhwyqY2St bZXHSluM5LZWlxpuW0TcpBGtaylCeOzTYL6bywVwYKlYnSqzdWtaWVNSK3LrW0r44z0uGV2B9+nc Aa2BghJjCYlyYNN4U12I0s10tgDVNVeFNzgLsObLlgxx3rfVv+Xwz3PPM/bHwVirUM3AW7DK1DQv ZUXb1l5MhquBlqdefStwZaOJWzIa0I6qHW0Gtq7QZtBg2nerVhWYXaL5rGwkvXmubPUostJUnC5M 3q2Jv2+VOq/JgzKUCkDpG+u3UA6gKde5LUSzM+s4gxxiOARfUUaq/EqsR12VVlVww2t0KiLgDpNz bWmsnJ+Xwz3PPM/bHx7bdkIjEJyZTUli/wCuqWMgC3ajKKg0bUJmHqKNyj1WKXViuvcVgFV0bSZT fTYBSmLKdiwNW5IH3R6/s2P8tU/9dakxAALFBm/UWspX07K8yvGIw63VBxZXxKhgarfVStugMYCW A4KZS9/TsXbSs7HcXtCvYFsGHXAXc3lrDuzt83hnueeZ+2PjVY1VmreHSsrkHEYj1ihKvUzytBW/ py6ko1AUzgeNiPhhyuoQq1YMvX/rsWtTq4ZahmInEOuRt0n19PqlLZg+mBjeCh7Tiat3JKmDfAiG bVYAqYcm1rEI2rFam3mDD9bLFA2WW1rNcGKrIqLkXWgPs9wZozFj8/hnueeZ+2Pk1d23XlHdaiw2 q7JZZ91NgKZAivzuVE4bQxNZQWpq5LevAFkDoozUow6hl3QCdPBSjqF+h+nciyW6D8HTCsn0I6X1 B22KnVqmKNRbhkPIYmBm5eQtDI+vsKRs1tah2Gqj90tWU7SXV7l3BFGApBHAEWsNem257G/h8M9z zzP2x81drIVuDBL7UNXcb0f1QbKzmq1GYInp36nVL6S5sQBqX5LWMqRO4Jwt1beN1WAyxvp3Gguv +q6TXt5JUwIEcfdsUixHypqJU6+xggEgwzcr5yrmrKL8XUsKvVVpSK6qtjYe3YXGBiZxO4bZuf8A i8M9zzzP2x84JEFriC5ppX8k1LM1W8pavBdOzrcpzbXiUtxmtZyVhO5V/aVxKX5pWQyn6OoYWJ0r s9NqnGVOQ+ckNjaq4uPpWxmns81aMwAc9NtuJo371m7u7d4WlHAUkWf/AGG3aag3cut27db/ACeG e555n7Y/i1r/AE5pbHSy4GWPmaDZN1eUtRQmcHUf7xgrsUrYj0ItarYW0b2aDqGWbdfE8gLK34zV uDBhB1O3WGl5KP6zA1WjNdiWpYuJtXpWi2m8qMS8ZrpE3dtaAXYn+bwz3PPM/bH8ejtFIdgEW3Tt 14Z2cGhmJiHJqcq9TZUzaX07Kn4WP9jVOHQy8O6XDi1dgK13Hkj80YMI7qx7guvFbotr1zV2PTGz vqF37SyalgVvXqBa2qum3uEZmY/z+Ge555n7Y/jBII2bADc5mlearq9wGp7SS1nGyt8zStymQw30 Yrc+H171ZdLYFbYBFpxO5KFaraXkt4ZqLnVefJduymsbW012wti8TbSFSwB7NyipbbntbJmTC7MP 6PhnueeZ+2P59ffKD/8ARql+61jUdwAmntZCWZlpDjuti67U7zIT3QGdr7rZshtisDu/cksaq3i+ vZpGW9wGo48gJm13Ky6ZOebQsxmT/X8M9zzzP2x/T1N464q78iDY8gsdLLbLX+FN1tD27mzcfgGI hJP93wz3PPM/bH/m/DPc88z9sf8Am/DPc88z9sf21R3npvxKOF/u+Ge555n7Y/t+Jlxra9LV6nkK Adu7Z2HW2tO7tvaNarv+nTo91/teGe555n7Y/tdp7N2Xc06ex9hoi9j7CtT9i7BZW+j2U6B7D2Ax /HvHbG7nra2puf2fDPc87n26numh+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2G frPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9 hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/W fYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP 1n2GfrPsM7Z4J2jte/8A+f8A/9oACAECAgY/AOpVxhR/V1Gk4K3SbwhNEr6p12E5nljpRfibrgq/ vhr9PGG3clrTREtVaoisybucVO5MlKlX4+pT+y1sr9Cyi3HwnPqTFbkRWZ1JckLGomtUNO1eKUzI vGlu7EploVt9e4oSP0kbPTruuxOsqhq53Kr2zIaa7kW0tKU7m7PFv7lBONPqab5KMVaFXqfHqNLp UK5PjhXBCvW+vRnbCM0sWbsRhRkMqUZDqh3W7bZ52zck2qWV1eE9CWx1KMWLT3WaBLJLJKHBQruV JWfUo5zStHlnCMXbb+m3XuyU9cNYjbCuuPrmqTCYnblfp0WuSXc1bvyK23S33Je5L9BMT5ySQ8Ks 5NihUkri54jJ6VzRhpCW+EcHoInGUVKFUSqrNUS982mTlsa4PVsjBsrRjw5KlGUZ8rWu5QVywptk nJQrlbY2Q+R3Mae7GucZRDJRTV7FTc8ljOENFBZoWT5OUPsjtsRk7ole6OGUqijg8b36Xf8ASpDK 4ySsEssYsnC7abcEuSSOSGSSvdE2+5rKPj+rghiT1XQfrneMCXP5kkbo7kM7o8blJ5WOhKo1seSV d0JrYV613yVpkTXHQjD0E1oRudyLpoK+zc8X8bl/tMPO33JR52+5T7HktGMpkmStRQR2WSc8PBRu eduq1R4OqPxTGm/kifuhXLR/gO16XEFBSNZIeCb2PHqSv1I8WSvc87VRnjcoa3JWoruTsUy98Uid WMl75ZzySiR24VI+2eURd9yUS9sG80lCuWuOmKT26GgpUeo7URbnroajzRjPYnNFy9ygkJQdhxv0 ZRVFOhGMYQ8JiSNGJ7s1I+mnCUhSjyeiETJP0tcIPKUyW/YdBU0K6fT1/wAx/9oACAEDAgY/AOpN zSNX9j4ufq5bgasov5E196mzb/ATVHaK5b/UuKslyP8AITmps5KL7Er9L1R5eSglOU/poFOMaIpE FEVIVp5W7bYUOCPomj36NVjX8CNY3NTWnX+6Pbp1whk6pYSvt1WNdOuGmDIaTPgkhK9KHuielXBX LR54SNPE+Tk/+aHQiCpUePYh/t6ddRLNP7Zqyikjcg8bXTCNbvyJK4UO5oN23O19hW/2VnR9D1J4 Je5741ZTTDw0rUaVGXJPUhtEkR49yd+XhCWSh8kKsV6CQpIy1KUKEOr5E1zgkou7s+X4G+GmLxlH i/1W/ln5ufQpRHJPLZM/pK7jtf7WaGmaDUbkUcw/fLBT79CBrjCP4vB2s8rXRicSUtr3ZwVbKjxq Qzla5W9kcV0Kk8EqmWeT1GXWvghkp1HY/wBpNuGpXBrJDLr+0ZJKGqJn7DnREorltT5HvaxNb4cM bWp8kVKPCMkYJb2uMkM8rdthsUIgWRIUCfCwnaaEMlVOGRd9yVjQrjKdSZLrdrlP2yv0HO+yPG0q 5eWcO2HYhuHsytUVphTDXGSCLiR3vdQsvha9NSeRxrgs05IeFcWNp1W2SGW2LSfl6HhaoVtqWSm9 MI4H6wNEdCUyHhGDHhwyXS7lf8xktuiJTbHdy8jtX7BMfca5J5PTLDxjCHixYThEE2uCGWd7Lfxy O2zVasa/kegnxRiZH2KkdNyySEq26ehGMohidy8bNWW/1r/YydmJrY8luO3+R6He07i5R3IwkjBX FKnA/wDzk4u/Mh0wVq3Ym/lB5OEkN7aLJ3Q7LtUc2vUlE7rUnbcRByJrR1JWq1Ha3ErCuvI7Xvoe hUduxGMnP5kMUaW1JPGfjbpmcpdmRcpISlHlayjEm6rQTt1RF1LkQ3W3c1PJCcLjCLtCVoySSd9m Q8ZtUyTESct6s8bdfyz01RW1iY1tGLwjka7kGumhAimpGDtIuIiRWrVuBWonYi2nfpQ0jytUbMfq eR64JiuWELRsnZiIe5OCaPK1SPzo3oh33vyuenYq0eNkxu+pDwZ6PF4pnizuJw6ExqeTXjYt2KKJ CbfscLjr1Q1FGOFInA01Q8R+I7Gq9hedJE7GnBP9j8bV92K1Ki0IdqZGi4X003I+FsYTCnn/AC// 2gAIAQEBBj8A5vnOVkIb+zGJhIgSAJnGNj1rzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrlOT5rfjPY3pSE4jbhEkCEpXA 6OHP9yPiQ/MNEEnoTmOiOZX+dMv+i7MpeouidmRLZhGG5Egj8/yHfl4c+HP9yPiQ/LCMASTkh/qK ZRQMIDUqinQhS2JTwZ8lqIfMBSltwbdFY0qUYyDEXH57kO/Lw58Of7kfEh+Uon0tHEoCEQdw4lDc 3TpawC1ykSBYLSAT60xunBLZLslwmmKGxX+p2g8Je10H89yHfl4c+HP9yPiQ/JiMbHFNKpFyo7UH rSiB/lmtZk0BgtO3F+lDWrUGKYU6ke0T1rSwLWKMJUe8TYoz267ZqRl+d5Dvy8OfDn+5HxIfkWiH KBnjgnAYRUoAMY3Qp2jZCW5KgrpCA240zNE0qnFkZzB04OtIZ8lqapRIOnNAxLkJzGowREhQ3BRO z2o5Yo65DbA/uK0zqMJCoP5rkO/Lw58Of7kfEh+QAFynvLNCSGGq3rRkSTKZqV83cLnAZIFuw90I ipRnuBgbAoQhfErUQCc2RiUf6le2WyRr60+pwMETEMndyh8z2cHXzIBjjl6GuMSYjFV42/I8h35e HPhz/cj4kPyBmbBCIWv+MKkKO5I/5cTQZoSJbbjXrWmA7JvJRhAaiA1ETuit+pRjtua1yVW6SiBb MJ43OOK/zNXULJtuJL2Wo1l+wRJFUCe10J47Yj11KFySgZgSDOwqy1QNDZR3JbkYQliXdRMpieaa LMn0HXK2gVdHssMNTuhGW1qOBH/2tM4aDkQtUaHJMfx+Q78vDnw5/uR8SH5CIzqpU7RstMcfaKjt QFMShtwjqLNRCJrLFlKU6ICAcYnBOGBWqYdCIYJwHKMjV8EZzoTYZDhX9MVZhwByWgHrWkjsO9UI iQEY0DYoR2tqZnG5wWiW1IE4kKMGaWJQMqlPEgSF1oI+YLLVCMjtnodlYp5BUiiNKoWOSaX4XId+ Xhz4c/3I+JD8gPUpSllQKRmOkBdoPKVgjKXtkuQpSkGhg6EIVBuiHA6AomYQjEBsl2W1HELVL1Iy NRG3Wr+oK3rXZHrKZdnhQepB6KnspjbFB6Rbsp/aOdgvl7WHtEYKtkyzda4xbMJ0wjRMB2k0rpxe P4XId+Xhz4c/3I+JD8hE5sFECwFVMn2RbrUxKoiWBU4kvCOKjDbqSagZLUPbOKG5MObsVfTALTC2 JXaKaIfJAEsFSgzRLNl0pgK9Krcr+vB2qg7DrTA0TO0jRCBLtUIxj7VgFpcEmpzdP+yEpBlUgDI3 WZ6lqh7P8orVGrovR8U4DpipR/B5Dvy8OfDn+5HxIfjhPYxiP1W2I+1IVXyom90dmFHxUdsWlV04 HaNynkNUhZPuGuSIFBmrepOQwwWuRo7LtFoiwQER2QnNhgjI3TmgT2HSi9cgmFFU1QBRBFUNoJol 5G61bkmyiEJTpFEbfY2v7k/tyxJVAnAaSaX/AI81SqsjOFDiFrwP4PId+Xhz4c/3I+JD8ck2jVaR ZlGZvYLVjgtd5/0XzJVlg+C1XXZoVWpQJNBgmAXaPUFH+MQVqmXJzRIDDBHpWQQAsLkq7nNHBXYJ xdByuzWSO5IvM45Kl0TMkDNPL2BYZpo0iMAneqdV9lPD9M0Z7JMcwE0u10kJmd0RpZ04qm3ImPp8 h35eHPhz/cj4kPx5PYhEi9kIZYqODX6U4wtwBUjiqo/sjOQdUwVASY44BAmpK0uwCrUp5UGAxK7R 7RwVOIT/ALLJNEetV9rJPK2AQA4OmjRNkqokVF0QBQ1CsxCY16UyImB/0nIqUJYFvS5Dvy8OfDn+ 5HxIfjVUogYJjgE6og/rRbEfsgiMSq3RepKZAD1qT3k4YIaslT1p1QueFE4FE8jXgwV1dk5qeDld CYWCJN8VXgUJR9l/0QIVV0LSvmRFjU+lyHfl4c+HP9yPiQ/EpwYDqCBIvRUxXSE3AHA0Wl2a6d9M RZk8q4OiicU2JTQZ8ZHBSgCGBviqV6SqlUCqVUOUwHFwWKYyV/Q0xshiMkImQC9sOjpkHyWmV11r RL1Hg2KtU0REqgox9HkO/Lw58Of7kfEh+IwVP1QJLAXKp7IVLIjGjJ0OlMKRialSmaxc6UZStdED 1IZ4lBqnJfM3j2sI5LsDs5DFSMos+C6UHTD0L34MFVMmTlUoEMyrWTsgwAOa7QGrNmWraLHIowkG kEAcEwDRAuVQKhYox3CSiTKWpGWxN/8ApNEYTDSFxx5Dvy8OfDn+5HxIfhdCYBOVktMaRGKZ3Jug G9aPWEyH7qbWxTYBEOEdJ7IxTO0c1rYyOBKJmdVKBUDUWkWQMqEp3VAnJVLLS7HFPdkyINRxc3Vq YLpVVZWpwpwcUkLFaZ0knjUHArtjTLNOCCqJ8OHzohpC/HkO/Lw58Of7kfEh+CyA4UWl2zKJ1epO gpHEMyfFACpNzkhtxNTWSYUATkXstMBTE4JiAZZoykGGHUiyaNyiJUMUIR/VALTH9VF0wFU7PI48 XOCDlNGpTzKoON0wqUCtJkAujNErpwQfqTMuyTEr+5NKJCrRSGYR4ch35eHPhz/cj4kPwGiHVbhA AVOPByjXsj91pjYJ+Ep4UHqXTKyEYhnxzK1bhDmyc1OS1AWWnco9R0om4XZ9o4JyaywTAVxTvppU 5pxfNOalOukWXSiRSYQq54OFXjVU4AB650TyvkhRVbqXZ91GEsE4umJFa8WWapbJSMA9LI8OQ78v Dnw5/uR8SH4D/wAinxKi9zw0g3Qa7JygFps9+pMbYBfO3iABYdKaFFGJL0xTE+tM2qGSIxNR0IRH rKdqoE1OSaYYKzdKIVf1ThPJ2yREaDJOLpxQi60zoRimJqqKiZZdJTmSDMrrNU46o0lH90ckHoyY 8K8WIXzYD/LlfoPDkO/Lw58Of7kfEh6boC6YLqXSnGCcpzxEIByUNqRlID2nNB1IVQOaawFyho/V PYJgiDe61aWCEjULs4YrWah7IAUQBL8HGPD5gFD7QQItkrV4U4UYrtR9YKsV7Rihp3CfWuzJ12kW RbFdBXev6ThS25B3FFLalcLkO/Lw58Of7kfEh6YQJVKlPcrRGua0RvjxcoQ246pE4JiP8yQ7RUia dKlMHsRNOlAHCwTWUYRFF8uFwmh2s3onmxByRAxDsjCVcgn/AIpyaZIxjRhZBUunlZCSMTijA8bc KLoVk7LtBmxQ0zpgu2NQzCYUPTRVR/YrpxVSyvRUqrKyrFhwjzEBaklyHfl4c+HP9yPiQ9MPZUw4 NG2aMYl5m5TnhVCERToUdzT/AJhv0KTillJh6kwixzKzJR1lmqV/lSYizLUC5xQnG/8AIIvSIWja xvJO1Rcqn6KtlMi3AcGTG6P4FahFgw464UktMjXJMUXsUDIuMEaVCsqcGKcLciclyHfl/wBk+HP9 yPiQ9Jyg1ymFZFatwtiy0woE5TmwVLlA7ns5ITppyQEZAHJGe7IRjmo7eyCIA1maOiRInpWsENmU JHtDEiy1RGk3KqaEInbiwlclMDU3VmRNwaJxmiDkpBetBMUQU49rBAmLEYq78GJqODkpwuzddqen qZDVMkZMn4EZrVGkgnVlrhbEKgc4hViQUGV1S6Y+pbgzouQ78v8Asnw5/uR8SHosgEALstcvbP7K 6omiF2yyBBB6UGsMlQlNHtSyCB3ATGI7MRUP0p57erVlgtImwwBUoQqCm03un2wSR7WSG9M6pH9k BngvmEOCoSjiaoDNlGWZQQkLFE4GvHULp06cBEEMU8SmkZdaB1H9VdwqKidMzjpujLHELAquCPHU Lpyw60aivHpUtoHFyuQ78vDnw5/uR8SHovkmCc1K1G2Ct2l2QyDLtqljgmsrkBWQ7JKBBomgU0Yf MMadCMd5gZYBTBo+CYWCIkXEbIRIstMRaqhF7KEMAHQKHWhOP6JjTgy6FoPBwmKYh0XplksxmFX9 1lwonFCP3CEgtT0Kp6DFPEsql108N2QzZch35eHPhz/cj4kPR6SnQMvYF0NFGReyIauBQE7ZrsH1 IRkLf4J4gIPYKhZBy7I1vgFG8YyuhpDBR24l4i5Q1j2aasWU9OCnKXtMqolUzZEn+NE+CAAYApk7 JrhNiqoEUZCQx9BjVZAYJpU6UDE64IMet1ZVo6YezJGIFExFSh6ThSlI1AoEZG5LrkO/Lw58Of7k fEh6ICAwF038ehUXStJWnEFdmrIS1MDdNIphYXK1YOjGAJPRdEbkahqKLSBllkhmWCjKXtzL+pGJ FFIZhkQbmyfIVTCgQetUZAaom4VP0RzRGXFj+qu4wdOQxQAwVVQ8KKgVbrONiFqidMlpmahURdGX qZVFqfgQP8S44ch35eHPhz/cj4kPR1GyoGVCnjZAA1/5oRqZYqWqTHAJ3ogGaIr1phU4LTcyQ242 F0Ixi+/uV/VGc6zlV0RLCqEMiFSwDcAEJmoCNGfFE4BE30jgZ7dDiiJXUgT2suPQmILZrtViVq2z pPQnB1JpRPWFcjrQIjqjimmCD0onbsqIl7WT4iwWnHgdOKJZmsCmkHfJUNRh6LKUheBfhyHfl4c+ HP8Acj4kPRYVGSciiDWOLrREM1yyEQHlKnqUYzJcEh1p0ubOtED2cUItZATDA1WmNBnihKucitze IeMA0R02CBOVVGlhdSk9QmxKLoN1BRiRUhytErYKT4qUs0RkiFIr5tnwTcGWmVCEQaxK17VY5Jjf EcKBwqBhkqxCeI0nEJky6qLUKS6F2iqXFQmN0AzvktQkYyXtEjCis6Yxk6oCDkVVSBqCGKnt/wBp K5Dvy8OfDn+5HxIekxTYEOykQTGD1WoCwYSKDGlCSFp26vigGYG5Rk6c9kHE3K1Ggxkf6JoYUdat ykDWIzRGdkdWVFLpDN0qBwaoQY3RkfYhX18HC0G4QYMcQnFk4Re+CMD2TgVpmGOBwKDlk4TkVVLK v6IaOw/8kDuA6P708Tqj0KqcX6E0g/8ARAxNcExoRcJ9Xq9BxQhBleov6Fk8f0RH6qbYsuQ78vDn w5/uR8SHpgm6MpWNhmmIYRbsosAAaA5BFy6i57LrsuYg+pARGqRoEI7hL4RFkJylUm3QotaFPUhI pxhRGZ9iGOZTKMRXTdkNArigVRO3WnB4Nw1R9oI7W8K4KnajggMckxLHg4TSFFpmNQOaM+Vme6Vo l2dwXCrToXZuiC1UA9DQqn6otj6GuN8Ua19GqK3JizsPUuQ78vDnw5/uR8SHp1sKsog0jGyqNRKE 5Bo4Bdm5QiaQHtEIsGJBZarzepQkCjGNs8lIGpDh0Y4xXydv+Rr0KO3CwHBphgbFNHHhZGcRTFag OyaEJxWJ4Mq2XzIXC+XujtDBaodmWBC7UXjmEBcZJpDrKcW6E2CZfP2iY7l6IbfMgx3BQHAqiIOO KJB06bUumkKigK1y9QT+hqFCmkU8Sr8Zse1IaY+tOcVyHfl4c+HP9yPiQ9IQjcrVIPLEouE4CqFq fTEWWkdb5ojJbkDjUIg+pNZ7rTHrUuk1W7uEvJ6ILUQ7Ij+WCMSCJRoXVL8CDipAi5shKFds1IGC BwKpZOmkLr520WlitB9oXdNIBeyAcwuy0o5YrSRp6CgwVBw1jPDAoCZ7QTlOC70QJY9SBjb0mTFO OEpHAUQMjUnhyHfl4c+HP9yPiQ9I70h0RTHgOlEox/RMicyvmCjX9aA6EWuqqcjQBHelSMv34EYE J7AFR3oh4kNIqJzXSnQmB1rQR608Kx/tQY+pdPDTJfN2Q0hVfL3BpmP3TWKqXTN2sChtbtQbTC1X B4MVqFQnVE0CXK07lK3VKp/SfDhpj7Auox4ch35eHPhz/cj4kPR1S9kIRiGAQIQkgionCVEZYWQQ BtIEJsYUKBu6ZCIFJUkF8r+2xzCA4CYF6FHamLYFBv8Axn2ejoVeBBxTMSxp0ppRYi7rXtUOWBTE GMheJx6kAb5LUAmIYLVCPbvRDa33P9sv+aBBcJxToWmXqORR2twvHB0CC78NJRIjQ2VkJG1ijG72 KYjVA4oB+1l6XUhtiguTij0I5DhyHfl4c+HP9yPiQ9GJxNeD5IhdSKcXiXTCyChLBPhuBx1oJ8V8 yJtVR3o3jU9IQk7g8CDQppOCCz9Cc9qOCEJhpYHAppXToiIeWBRMw2BQerptLSwknI1AfyCcUAvm tQsL8NTCoXy5nVE0ByVBQ4JmYLVAEyF2Dr5MqTjnwu6DcGWgAGX+C0yYkXCMoHTIIRmNQzCYnSem i6PQ9SJKJz4ch35eHPhz/cj4kPQEQhEWA4HNMiEYZqUD1Ig4FMtQvGqBjeLSCiEMFIZVC04xLL5Z oDWJQBNcU7utZi8DSSnsO4jYLSMajoKEJ0P8TgVpkO0nC+aPaFxmEIyLQlYnBOC4XaDhHd2R2h7U bIxscYlOmkHC+ZsU6MExpuRoQrlEwkQSGotcS0om+KALiS1O5PoGcLmi+YC5N1ZPiqgErsGmSpdM eElCOBvx5Dvy8OfDn+5HxIehLdliGimypwYo5grUECgcJhv0XRLgekMyMDeJZGPriehZujnHBCcf YlSQ6VpsRWJQEqSFwmyRiRQ4omJbEdSGm4utG5SQsVpmX2z7M2qg5cGxTir3XzNoOP5DJfKkSWtI 2T4cPn7dQfaCMRcZ48DF70Xzdh9IrIK7SyVVuGQqbRC0SFFQMPQIKYlwU8U3H+qY3FkZHBSPSoxy HHkO/Lw58Of7kfEhxEp0ihCNhRSCBQdUtKq6VVCWMS6cXFU6cUBWoGk79aEx7Ua+pAP1J80QRQ2K H90aSC1x9sfuE4PWDcFA3RNpCoWpjoeoKG4MVo3LG60EtE1gTbqRjIUzRiQ4xR3Ng2qwwK+Xve2P 3CZqIhxWiMJViTRCQsVdhgFVa40JVarXEdrHqXzDQXCGfpNgnFvQEslLM2Cc3Rawpx5Dvy8OfDn+ 5HxIcPmblzYIxNwgozFjQ8RMVEUyIRf9E2RT/wATZNkmNxYdKBPrCBHsSt0FCt1ZzgtZDRtIdCjI ViV8zaLTH7r5e4WkKJ3XzMRei0RmflyxOBQLowkXBt0IxO5qGDrVH1rSTQ3XztokCNslQtIXHSma 2KG9EMRSiG3uEiJs+fCp4OylEipCMdwsRYFOPZJrkgYlwfRK0pwVVEyNAmFXstUvUpSyCMjc8eQ7 8vDnw5/uR8SCCDWohMWkgQXBuiDfBMbih4GJsUQ9jRA58HFiiJITFGpJOC6INpVC0TsbFCMxT+7B lqBpg1UZRrJHZ3LD2SUxsvm7VJC7Ibe57WBzRGaeL0Lg4L5W6WkAxQAlqGFGKMv5CxxXypmhLFXR gQ74lfMi5ifaZPE1KMT+6INo2Qi9sUxuqjjIkasR0JjbAKtYHBCUTddPonUnd+hfLgaYlV4fLGN/ Q5Dvy8OfDn+5HxIcNBNQiD6kxuEEN2NjdPimQkL4pjgmKLrqXXdCJrGScXjUIGIf+i0yABNijt7l ds/sU4qCpSwuCndpChWmRcLUA8HfqQmD1oiVQUZbdHsUJY2I4a441CjO5aq6Au1VamZUKlq9TrS7 9SHoOA5xCpQpjQ5p4VjiECKHEKqpxmehHVc8AmeuSMpY+hyHfl4c+HP9yPiQ4CQwQrdDdjbHgYyA IKb+JsrpjV1pwwThMbISFjfh0XCDlgtT9iVJDoXYnq2zbMISAeNitD1j/giLkVRJHZNJBODTBEfo jtyLxkrpjfArUPYNwLIF1rBaQFEYwGoG4K7NMwy1P6ldxwfJDcj7IugY+hXgxsqla9qhWjecZFNc Z8RAXka+pOmNWWke0UZSLk+jyHfl4c+HP9yPiQ46D6lISxwWcMCq2wWmXqOS0S9RV0/8hZMeBBxR ibhUwWkiuCKIeoRBoUMnqgXeJWuIvdfKkaC3B4XdwmNJD2gsfUqhxkU8Dp6EXmaqO6AYvYoy/kck xsqHgQzogBo5L5d8uLcKolaZ8C46ivl7n/5K0z9SJBRNxGnAqRFhQelyHfl4c+HP9yPiQ4iQwUd3 ZLahULTMBiqD1JphkK1Fl2hUcPmRrmEJDC6BQ3P1TAoDA4qmKcXCDWKJihF+0KFM1FqhfBf5kSVq Ygha3brTYcQ2CjtTFYm6kwocF2o9lPHiXxQlGhCBB7QuExv6FcU6HQnBRe4xRq5ihtD2jgungYRP bknz9LkO/Lw58Of7kfEh6HyiaguE4wui60Ti4wKMG6mTShqyK1x7L4LMImH6JjUYFMajJPCsV2gQ RigJX4ats0OC7QVDpJzWk2GSrwPUiECq8Kh00Wig1jcqhp6Fb4cPmbdCLjNCQLSxCrfi0VW5RxC1 OwODrTAdnEpo9l7nFDM3kg60wrJGUi5Pp8h35eHPhz/cj4kPQE43BQmLEVRAsVSyBOITjrWZyUoy Fj/ii1ECWMTgiWxZOy1MC2CiGYHBABAN1o0RcsU5vgmtxkBa6MQfZTYjiJAWun03sgXqLpxxZOBd aDR1r2pXwQG5Ex6U2PHqWiNh7RzTBMasnwTH2Y3WnaoM05Ln8DkO/Lw58Of7kfEh6LCscl2qJ4SQ Tp1ORF2TlOfYUoi1wr1RQEgxcEFAtwITZFEC8U3F4lnFVqNQaSXXxIOKInXJUtinBcJweJCdqhB7 p4ByovEiQFk9GeyeIY4ojE0HXwtXhKRNMESTf8LkO/Lw58Of7kfEh6dCyfUQU8ZlDWdUDdCcTQjg QLJswyNaq9FLEi3qUSboNwJApggDTVQpkOGoYLUSwOS0SrKOK6uBKJxFim/Vf9JWmR6k/F43TFPr YZKW5MnrK0EghHdJ0hrISPsigH9U/BzQZrRE9iP4fId+Xhz4c/3I+JD8CnGLmxb9UzotR1qxFU2a 6EZZoxxFQhwiUCozHtC6BHAxOKltm4sgcRfqQlE0PEgI5FaStJ9oWWiXtDg54agWOC7UXWiRaBwC BtIYoCRJAspdaZ3PQnATEsMh+JyHfl4c+HP9yPiQ/DMTY2V7r+q6EP0QOCJxUJjqK0m3AxOKljIJ 9ssUYTpIXHH5gF6FVxWkWNYrSTUcGXUroEYKO4Da6BiQqoyegWs+oZKqfELrWiBeZ/ZEk1N/x+Q7 8vDnw5/uR8SH4mkmyunBsixqC7LqRcowNnUZYihQKeyIFpojBR34Go9oZhCUTQ8JRAalyq3F02It 0ISFJRuEDmnFkaP0FEnsywZdoHoKaumVycEKggphU9CBmWrSKLlgU2oOjPckOgBEbI0vinkXJ/Ic h35eHPhz/cj4kPxHCZXQc0ldCILngCcU+KYm3DUMMVqCYl3uEdqRYP2E71z4GQtL/FXYi4UWk1al XdCtCtTsehGRNj2QgSQ6acgxXtEbeC7B1SWqR4sS/wCS5Dvy8OfDn+5HxIfkBGeGPDs0AQ1Fioyc ESuyBBRBsjtxLnBdpChdGEqiP6omUgGu6+Xsl2vJAyqMVg5WkHWBZkxDZJgT1p8VcqpV/wAvyHfl 4c+HP9yPiQ/KaZDVFWKMdoMTiUZ7kjKRxPHXtyMT0J9yZPRhxoVUv+d5Dvy8OfDn+5HxIf8AHOQ7 8vDnw5/uR8SH/HOQ78vDnw5/uR8SH5zsxMmuwdGWk6RQlqBCRiRGViRQ/nuQ78vDnw5/uR8SH5ze ht7O+Z8zvbez/qdiMZfKFb6nOLmijs03eS/0/OHmd4AGJ3YzlpMjnZlzkTFuV258t/oJaWiQds6t BavSuQ5iW3OQ3tvmpb04+yDs6tFWot8nlpbkuX2OX33M21S3WBB7Nqrf5bYcbUSDEGrAh2/N8h35 eHPhz/cj4kPzcd7nP/aQ5TeJIOzJnABoa5qXyf8AcENvWNMtJAcZGqlsR/3BAbUy84AjST0h1Dan /uCEtvb9iJMWi+VVschD/wB9t7e1y+tjEgatZMq16UX/ANwQLgA1jUCwujOf/vtuUjckxf8AxU9j lN8c1sxbTvRtJw+H5rkO/Lw58N7kOYlKO1vgCUtsgSDESpqEhhkvMc37+39leY5v39v7K8xzfv7f 2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb 9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K 8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/ t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY 5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/ srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc3 7+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZWzz/AC+9zEt3YJMY7koGJcGNdO3E45//AAD/ 2Q=="
- width="480"
- height="456"
- transform="matrix(0.0649,0,0,0.0707,0.4111,0.1533)"
- id="image30"
- style="overflow:visible" /></g></g></g></g><path
- d="M 9.08,25.873"
- inkscape:connector-curvature="0"
- id="path32"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><defs
- id="defs34"><path
- d="m 29.414,18.217 c -1.871,-0.678 0.144,-3.833 -0.466,-5.545 -0.066,-0.414 -1.702,-3.034 -2.118,-2.998 -2.93,-0.511 -5.872,5.612 -8.911,5.765 -0.366,0.018 -0.441,-0.135 -0.473,-0.196 0.434,-0.787 0.95,-1.54 1.395,-2.317 1.115,-1.95 4.476,-4.491 4.268,-6.766 C 22.437,-1.178 13.646,3.46 12.567,4.248 8.135,7.482 6.138,15.404 4.671,20.639 c -0.73,2.607 2.609,0.291 3.19,-0.24 1.66,-1.517 1.74,-0.953 2.638,-3.075 0.361,-0.108 0.772,-0.318 0.878,-0.104 0.47,0.947 0.457,0.149 0.122,0.745 -0.839,1.491 -1.671,3.074 -1.94,4.781 -0.816,5.176 7.249,0.398 9.932,-0.521 -0.322,1.715 -3.244,6.927 -0.517,7.915 3.104,1.123 11.856,-11.41 10.44,-11.923 z"
- inkscape:connector-curvature="0"
- id="a" /></defs><clipPath
- id="c"><use
- id="use38"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#a" /></clipPath><g
- clip-path="url(#c)"
- id="g40"><defs
- id="defs42"><rect
- width="32"
- height="32.374001"
- x="-0.0049999999"
- y="-0.37400001"
- id="b" /></defs><clipPath
- id="j"><use
- id="use46"
- style="overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#b" /></clipPath><g
- clip-path="url(#j)"
- id="g48"><image
- xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEOAQ4AAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABnBAAA1awAAXJ3/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAg0B7wMBIgACEQEDEQH/ xADWAAACAwEBAQAAAAAAAAAAAAAAAwIEBQEGBwEAAwEBAQEAAAAAAAAAAAAAAAIDAQQFBhAAAgIC AQMBCAIBBQACAwAAAQIAAxEEEiETBSIQIDAxNQYWF0AUMlBBIzMVYEIkNCURAAEDAgMDCAgFBAED BQEAAAEAEQIhMUESAxBRYSBxgZEiMhME0aLSszR0BTUwQKGxQlDBUiNi4RQG8XKCMxU2EgACAQIF AgQGAQQBBQAAAAAAAREhAhAgMUFRYRIwcYGRQKGxIjJCUlBgYgPwwdHhchP/2gAMAwEAAhEDEQAA APoAUgunxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8a4H2Y +NAfZT40B9lPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4y B9mPjIH2Y+MgfZj4yB9mPjIH2bP0M8PiQBgAAAAAAAAAAAAAAAAAAEgjLY9BKHmdLchHlzafo4Kv hUe18b1dsAHsAAAAAAAAAAAAAAAAAAAAAAAAAAAB99z9DPN+JAGAAAAAAAAAAAAAAAAAz0Cpj72g 3m5F2CcEUzvcFdZExWDvrqngjYx+30wDWAAAAAAAAAAAAAAAAAAAAAAAAAA++5+hnm/EgDAAAAAA AAAAAAAAO3HX0hLXqWOfjaxLJM6RGVeO4xdVF3BUKam0KmDu53Vucm02nbjGvktXgG6DIBwOhwlH QAwAAAAAAAAAAAAAA++5+hnm/EgDAAAAAAAAAAAACxXv4uhbU+PnNam1Le2VsjaXeWpU7Hk5NCuz KsraMY9Wqr2R6V+vllLuHvV57iN9DXdc5ly+h5Nvvq+Z4qt6XF9SONyxZyucbMaJkGjRnSAE9AAA AAAAA++5+hnm/EgDAAAAAAAAAAAADTzNZZ6bFPj57LCLEbMdFsKtETnRiVU3aNaUuhhLojq7KI/O SgVjYrXspb2M93A92WaleW5mQ51oTLLTyC/V7/MVzRqepzZlW8mvqYY5PmdAAoAAAAAB99z9DPN+ JAGAAAAAAAAAAAAG5jbKRtPrvlxvch8r2e1ZyraTXhlOQaujwfXZjxg1I5GJturYjayuZzdt6KWd a4mz+xh08NiNYC1KvZxWQtsSOM+/lel5Ds+0v0o4FPbzuf1apKMKAAAAAAffc/QzzfiQBgAAAAAA AAAAE9GadS4nPZfXnLnucS6dpzXJLd7CS1jBsB1dmgoR6raz4lDVsJRF2myFjb3W1GRt3ldTc9gq 2NW5eqNg1l6rEeCNPQQ/n5Epu9Hylyn3rnR8t7bztO3HA5fSAAAA++5+hnm/EgDAAAAAAAAA69iN iTqQg45zpc6tkpMch6W7wbPonx1edGJ5HacrOzXo1C21smd5+d1K3PidhyAAhyWhCDOtCFuItrLq 9iPPpMzXw4LladV+Hq4nV5LxXOznnRsy638en0udD1ss7yVwAPvufoZ5vxIAwAAAAAA6PbC123Tm jFkElVZF8LvauaSY+s+d2NrKnezUVb23Gc6lk0tHMe0rXEP32O8rZV8VJaVqaOAtta7s+NktOmDZ WcxT2WITRYJz4WzkyfDlVdPP7vIVcrq6uPR7m96U1UpOhcLD9R5iXs8A5+n77n6Geb8SAMAAAAAu Ni7c515mN51OdEeojYtLajsktyN1jnxvVLaFq1lXqX4rrWqmpoLa9UlJ78rXKuslc4vz2Z1bq9Ne dqK14xXMpYnTnk7XVPnyFntyXIp7ex5ctVqn2+UTVOvCcs8NrLt97ExvN+38rbvogQ7/AL7n6Geb 8SAMAAAAlfq6d4znOWcca868W4RZLoYQar9v3m81cy7UvmxUC0OXEp0IOy2ykSzqbByo2poTp3E7 6UWSeFV/ObkoXBb0+2OCcavqye5Lp89qzSuQ5rLUQnzdzdCh1ebBiZX4bPa81Zs0zupRuc7JeFhu Yc/d++5+hnrX4kAYAAd4zSzp1LXRxT4qUJcqM5HoJdelY71P2HBeGZsZ3C+I0PSTr4NnXnOoWort elK/LeXWtqraqPdj0vOmFe7SJi5weeiJZL0ZyhNW7Pklm19ZkuRsx6cPa17hw5yWL7PIXxqqcs3c eb1qnWYRaT1yyPJes8mel98z9DPh2/EgDAAB6X0y8xfd5GJlPnFy71Ku1MaaPtWfMrm/qM+voJkG U5a7VWqWPam2gl3LObeWdZ69I1LtF6Name3fXdJXqzRaZKs7iDVuJYvAsrOFhtiEqtxs5czOKrZy CHI7PK7wa3LUm6LDXUHXLXEnZHB89qZc/b++5+hnz6PiQBgADLNe1VH20XE4UQfTk3Od7lotH4tW ypyvYnXUjz1qGzHorUu2spCm+vtdBbqqdVF9S5bG52rn5ecl3Dprthzc5WtV9jf7XtS7UQuhGmxk d4WN5blzttZ7oxs0LVOnJBfOdfksbDqrOPZKy021vlYZjeiuPXBPa++5+hn43xIAwACxoUrtOey2 g45rCAXFQsKjWLTuNwBa2n80IWp2uISjLSGztXoOdRrGberrejqUdTeiim/ntq9DP0NvBNpWUWqT W56w6wImxEm1t2c+crDYW5csaejSbjEp51cADKcHZLThblVYu2ewmlo4m5X7J+EGLr7H33P0M834 kAYAANV3dvW6Nu/O/i+w52oi6NOEnq3LTETqzYo3+a2b3qnbtiKFpU9BmbEunJp6mJbLmhRuz7YU NRI2JYejohc5Tsp1wlaF1SbIccbKYLO30tTnGU+JBiEzflrwDr8vqmmwWxDt2bOMlaELXNal2xT7 uXzGdqZdPY++5+hnrb4kAYAAAA3Tpam86u2mR51qmxd42yud7FmEIWbzkVpV0c70SUysrex327ez tCPUvE9BW1sLSoT6V1oqtcvdUpai6xqVm23nTvRWtL6UaMsTb5KfNl37GTXm1lw6k8ycs/u4LbYO OQ72U2VWurdITiwxjKvaM+ha873ZjJBPZ++5+hn5vxIAwAAcrYyd2M+S82bEW8Wtco21vNcpJZ3U WZdEoSrrR21gb3PWGJ6DFGqaWfK7bS+u4erATsZPdDl5Ffa7Sk6HL0Us3ZjXnrWKL9SxBrp4PpSS VqjcrtDIurT28U0OTTihfx7W7ozSyJODOpStCyukYc5V7pu89oZXR7+eBBfvufoZ5vxIAwAC9qVb c+FpNa80bNd+Fa1XZlnOQ2deWqdyd5Iv1Z0VqZNjK7lKzLgr53r2+gidXGsRto5muqD4VuvPsmtt uCvb5Vuw2OTuIaFK7jalUtZF9GSmZGjbmjDjKcXIWY4tJbe1SrdZWxrraUpPbjBiOnJ18j1NRia2 HX3eAR5PvufoZ5vxIAwenayT5cnPgfWtV1SbkOFXFqSr3ofOq2okvRv1ZP4qYbpHQ97V83s8VjD9 Ph6Oro1LFXQRCTOxPR1jKNjL0L5aqWOyHdy7uJDK1anRzNhTdTmo8tZ/RHWdWtQRhzsr1q19Nudd qMM2zCLJ2rcsVbQdk3830ezPyNPMPUAJw++5+hnm/EpR29kjTQ7ODjCEpvXOSqmaH6zatqlmtfWn lW96haXNrBvc9rWdq5StYWS2muzA3ON8Rl7C613OosQZdjO62WMbYpVmx+ReZaV1OZWW5GtPOWxy PVRWVsZ9jmphaBul1M+d5KfHNSd48UMK1p6FXmV1VtIjDt+iyanecfOAYn33P0M834ltYtlpb0GI bzrlWc4oOqOmKYIHtonPEQxE9q9XHKMZWtJW47Lvw3Lsyz6vrLhFG2srlmeZGlTTc2Me9RxNQzbR NMbc2jUp6lNlq3s3VZnOWznyNS4llz42e2zlyiJulOq6LzhNZqsjSwfXd/Yz6/YnlzzeLo4BPhAA ++5+hnm/EgDNfR87v14VuZTyE+MTNrVeLZZydWYzVsUDZQ5mMcleZejylm7eTaYqrs5V8ajqZ8tN CjYcsc+xaTu5trina82ranJqHwm+Ndqw6H13V7HPMhPmMmrdRWc+0bgVn2aptrtN+FCnLvt+wUtD Bn3o4HJxgBgAH33P0M834kAYa+Rbeesyc7+bTjqIXaHNFM2Qpr0avNMp72LIZtuNa+sq8by8ypqZ Tzby3unGpQ3MVqM0KF/Eaqz2L4irdTpa9arWpwnycZPQpbOfcldy7BmlOs/nfinpZaiL2b0Lotwe 2tbrpj1djmLo19aWV3nHygCzAAAA++5+hnm/EgDAAN695a90cXoFUpPy6UFuyddqrqFCtfpTrZXc Wksy7V0J2suG88sQlC1NC3Vt86dydfKKqv4+vWduUJ81aGfrZ3RKGhkW23VFt59Wmwtky7Ndl9Lk ayLpwxreO/Js0fT6Aazr9aFWzgc1H1g5uYAxQAAAAAPvufoZ5vxIAwAAADtmqOX553aZ6HT8zvb5 bKN6sTtSr3JyybHIpfXZVu8y5NDXyqPpXcrS50bUuQnTCstp9Ka9jOvczQS+Orhlup0vb0sS5NdC HYSWtRv5/YXJ5HerojfznU66tml07b/chCVfUCHKAYoAAAAAAAH33P0M834kAYAAAAAAAA3ZwbLy 9HXrqtxaGv5r0S89WnYrK17VwtiKyzNbPMzbtK1j64h3K9XK2sTom+7lvQ2IRnFq+JtZ3VlGzQ7X t9JLIsS4u5HanZ6mjOq+3dFVWpzocCEAAAAAAAAAAAAAAPvufoZ5vxIAwAAAAAAAAACfImjPSeXs tDcr067S29LyuwsPQ1uTfhwGoyk9L0+r4rRSfosm3gUiuzi62+pr3vNqTi9D5flN+vSbkG9d1uYK TgCId4ZgAAAAAAAAAAAAAAAAAH33P0M834kAYAAAAAAAAAAAAAAAAPQbmvzJNlKILY7wBiwAADvA NADAAAAAAAAAAAAAAAAAAAAAAAAAAPvufoZ5vxIAwAAAAAAAAAAAAAAAAAAAAAAAACQRJ8CIAAAA AAAAAAAAAAAAAAAAAAAAAAAAAffc/QzzfiQBgAAAAAAAAAAAAAAAAAAAAAAAB6Gvqm6dFXArWbVU MbL9XhmUAAAAAAAAAAAAAAAAAAAAAAAAAA++oeG+MPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeM PZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMP ZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgf/aAAgBAgABBQD/AEt7lWG9jBc0rs5D+SzhQ92Y zEwkzlK34lWBH8ctHOYfmfkxEDRYhInIiBgfcx/BY9DGOI56McH/AHqQkqoE5YhaV2Op/sdWuUSn yZDV7aWDtkn+u0ep0+M/yMfEY9SIlc+QBmfYxxLh3INd8V1IgLYOtsERDmMFYMOLfEeGNCpgQQGG D2CMuQ1bAjPHEOBBYQdTcGFtSXqC3wwCZYMEwiGH2iBYFhwIy+rhCuA4JLECVPg12ERHj18k+Cq5 nRZZ/kY0JxB1mMRFzMAQuBCxMxBn2E5jQoAawsXpKwZW+I9Z5e+q5mI7YDHMMaEEk4WExJ8wBmBZ iHpM5jOAGshYkcjmlshLsRLVMVhNhAD7qqWJAUExjkmMcRmnIwrlugCtiZin2NkTkTMEwpCFEdwJ zyayDDEc5reWsWX3axgMYzQwmNcpdzPlA4MyIizpGBEBOD8uU5CEAxowM4EmgYhExiV5idQwwfaB knoHaEwmbuyUXXc9w9S3KBYoGF9QWNFPSEGGEmMGhLCI+GQDAOYDElcvGPcSO0Y59jKTDrq0WtK4 V6jBgyWGOS9AsMBwTkANmEiE4jOY1mYleYg6E4nKVkGVrLWy3tGAG6wqfaYRLWMGFgEXPIxD1YkN 84uYwIIsnIGMY6ZFK4gEPWZxEfBps6E5PtHUYMbpCfZ0ljkT/KP/AJAhUTobGw6HJs+atM4haEoY yRmIlRyVTEJwOOYUM6g0k+6Dg9MOR7CYSTLSSR8v8jsP1q6rbnkj4nIEFSJ3IGhAMJYQHJVOLD5A 4hHRi0QkypY3z9w2YUtCcQsY3UY6bD8VpYFLh1ps4xgGDZUq85FYSjRspGYGA9wKhBRQVJhMVofm lcrHFfcY4EMYT/dujAeraGDrNk2LyGSrVvyUgOG5IUsxGUEciIUzKgQ2A0XEdchhAcRWE1xyloAX 3GPWGND83isC1qclUlLC4xdWHFVhQt1BcEMvGVWYNiSleLGriflA3XJhKtCgMwQdH53/AOftJ6Qf M/L5howzOqMTmbVJmpaDGDoWCuKbipdIMgtThqvkK8QdQ/T2I3Q+qdQUBYaicZacv7AMlhDP9zBC JiXV5FRyMS2ko9ebEZSCasyrpGr6hAy8CBjErPSxMwqYDg/7ivkKKDDxRCcn2KcFxGWEe5iMDHTB xyXjmKj1sUDCtcE14PLEQjLxvmhxM9GUNGUxZqVgq+FWxy3uochlxGScSJj2kZnEEKOJZYVyP8YG BPQxhFJyRkPAYpjKRAwaCs8ql41XthfdQ4PAQpCkKQqRMQ9JyEYZhZhK2zHgbDDqHgPVGyGUGMMR TK1LRNNiw1wga0AMxY+8lowSCMQiMIRHGIfn/tZmUn1OIfnWRhlzCMFT1OcY5DssJp1AA4l1mAST 8FHKzvAwHMYTEdejL1UZFixMg/MWLiKYDkWJkKJVWWC6xE/rrBYFLX5hJJ+GjYJMHWMIyxRHTI4Y KL0dMhUOa6zDrvF1zyTFbd1TGu6fHyYrYhYY6GKkbAJVSeIARFaNWqszKB32ndaE5/jc2/8AmP8A /9oACAEDAAEFAP8AS32FWPfa0D2qaLu4P5NlqoLLWeBRAoEKRXatq7FsX+PZdiMxdlWAQAwpmOJR 3VIa0FHDD+I5wrsSVEUQL0x0K5gqEVIEhqhR52zHDAJa3JrFWDYSKwYfFt/xEUQCATECwLAsCRa8 x04hj1IJj1gjYUgq5JobK/F2P8QOqiAQCAQCBYqwLEAjqCDV14Q1GWVAjYo4mo2oyWoR8S45CxYs AgECxVi4EzK6rDHUYKgEV5LoFFgmwuQ2QSxmjeeXwScRrMxSTMYZRFEAiiYxEqdpVokhKK6wX628 JxzFVUFpzLAZcpxaPUQCUIQpt0t8AkAWWQGfJQMlViiKpMVYEyVIrLWlQ1zTuYFY5HgEnaYx6RLk AlgE2UGWUGdozi3LTcmv3ScB3ySclFzG6xEigQYit6a1JIXEUgm0HBwZTwedhVIetY+wJZaxlgJl gmz09hToSRNG5T71z4hfpWsAwFWBegEURVimc5WSprIYcVJQDmdfMNDiMrAMGjkx2myQROUJGA5V 6bBZX7lrEtxlakQCIsYdBFxA0XMACk/OsdLBhz0i2qwzkNiWduWhZaoxsEgwAEACWgCaGeHtb5H5 qFEE6wNiF8kGDMHQcSAo5NacFTGHIVFXLVFCHdY1haMBHEsbE2TkgZhzM4DWEzVXjT7bD0sYxDmB jGawNkmKCYogGQnzYgLT1l6+mpQ9OcRyBFcMtlQMdSI5IjPL2yLGyR0mMx0ldfcdQAPbdyJatYFU RTM5ZV6qIIvyQEs/UaqjtWHA1GHCxYy9AZ3rBGvzLCDLTiW2Q9TOWICCoYI4OR7RibFYUgeoKFig RQYsEHQULgOcGggJYgIRihS4MGXo4htIjODHaWP0uPqmeqKmWrWOuDr57PubFizugRYhyVMErEPz qPR1yKrCsVgwsWAgwWusaxXjwtiO/Sy0CMeRVRGXEWd3Eqra+0AAe22zggOWbof90OCIIkaVtgg5 B6FLCp5Bg46i2M2YXljdLLY7BmZQIrQqCGQwKWbS1P6+t7l7ZI+TewRfkDFM+YESzEfBitAxBNnK POcssxLLOjtkms4BIJOYLCsDBhqLna2HxX7b7O2jGJG+VZzAYhgMUxWjQHMDkRoHhaM/RrcG26Bi 0T5/7OvUeiZVg44nxal9rY/7PZbZ21uYvPmikB3GDVnGcytoG6BoGnPIDdec5w2YLWTugiywmZzA xBcYiuDGXIx0yVNdVl7aOouuljcm9lyc0URfSzKQcckBKsRghuJ54heK+QLOrWEEW5At9VlmD3Ww HObsgpjD/MOwnSJZG+WpQLDrUhTsXAL7mzWVIw4WAFCUi/LHQdRX6othRrGIjPyQOwLEmMeQGMtj BXlXXiEZmMT5Qgzn00KeNdv/ABp7ty5RnOVuzFtBnMKekVkywKMti8rlViGOK8hrP8+HpUqUHzI6 K2Iw6o2Y4ieojXuaUaA5DjWtlhc+9dqEkU2AkMpcxCSgY8rWIVRkD/qrAyf8rRxZeoU+qxeoOQwh +WcxgeOlTk11ZjkVBmLH4JRTNmrjKziN6XJ5IhyEPROjPORcVNHHVWyuOJYyrkxXStLHRDxK0RRe ih2LN8O+oOqU4O0hV0HQelm+bEzlkJguQVYtkUk9xtdjDVYW1tUVBEWNYAPj4E2KBYE12B2NdlBc 5SnuVPrWKuvXY9n9VWj6NobW1lpAcCdyZ/ikAj+tTn2AAf8Ay7//2gAIAQEAAQUA/wBf8zdZR4f8 t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuS flv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9 yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/L fuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn 5b9yezz/ANB/jpW9h1fBbV8q8BrVRvC6DC/7eQza1LdWz/QPP/Qf4qVvY2h4Xk9XjNXWGMDAclRj DzyGpXuUXVPTZ/P8/wDQf4YBM1fG7Gw2loV6oGpaHNPM2VsYgWtQEdnVlJyB53xpdT0/n+f+g/wq aXtfx/iKub6tFQGvXQHqe2FmCK3bXuJaSKuK1DLCxZaAV8x4vtN/O8/9B/gAEmrx7meP0l7lGFts wtl1TNC7munNVdbGy1rqkASol1DFqyFdmIvrDrteIfnr+I2LW3NC3Ub+X5/6D8cDJ09UJFQ4QGlU BqCo5e022zuLVTr83e231LUmWKMy1VqHABYrnYvrxsbgJsvsc0V2XDe8cq1e1KLXBBBgBM4N/D8/ 9B+Pp19y2pOi1Fwxa5GFlys9jxP+KjVXrdeC6qizkjnt1INiylJf5DXUNcWNx7hNSCcUMUnn/Udt fc8V1q8JtWI3h1qWlRXLdDVuQ+E2y48bfUGp4S/UVgylTMH4/n/oPx9BfTQAGqdkqQt/XRu3TrkU 0aZy9loe0pWiVcbVParl9lNc2tnm+C7MZjM45JXMrrCsN1hLWJdUs2NezxdhWvxl6DV0XVE0hx39 ao1WpW6b+pbTOzZaavGmLoJG0aybfHLLamrPw/P/AEH4+gvSnj3qgpOo6ImofTr5tvsdUuYV0qoF 1RKot1iVi65rDxFtj8RGInpM4jB4gQPhurro+hdWzEtfu28K6Tt+WCnY2LLYoCjt5W/UVWrrUrxO WoCC4MW2qOdZ6H4Xn/oPx9MYQKC4UPta6B7qfTt3WdpzStQNa2w2lxdsCqWOWljAGlHCNnIRIGVQ TmACORFOW10ayVVCuurYREfdFQs8mLkFbJM9KVFsPFBZdQ0JVGXtBLTzmwjA5BG1X27vhef+g/H0 6w9K5RfVW6E0OFNLoiozuLbGbMv2gFNgMPqKJks8e1QGdmJ6keqHrGAgImqZSV4LVU08i3F9esa6 8mthKtP7blhUDFRDLNNXhFtBCBwaABtanGb6En4Xn/oPxqq+4+t/irZAJNgyz8w7tfybu8WscvOJ aWIoNnIKc9pa2aYQQsIzEiOcRiILAClnXU2WZTsKgubu3NYIpZyTzNbYFNTE11AQcSb9ZCLq7KGG /ZizaLi+iywP47aWPW6H4Hn/AKD8bUz3NM4YHKLhpyAdnJKYhJ5AZgKhuXJrW5H/AOvMlXsbAUAE 5AIAaxY75hcSu3rqvg2WAmx1UAoFa3kRYCNdDExjumVA8SomzWQO0hcay5Wrp2VI3PG1X1XVNTb7 /n/oPxUrLHXqAs1ioZukU4ikwHBHReYypYqidXGF6KlYxKiCrMoLuM2WjD3ZhtmXcpqWtK9PErPb ayyNaSWcszNma4ya2xDZNWhmFYOWSWL0vTtPjIA6HMYEp5jVx8Dz/wBB+GBmV1RVUCgFLWHB0YPU nSAwHAJwByZ15cmJFmFxzAQWYWywo9mwoL7BMLlitNryrREWlEHymeroxNr2ZJaEGIhJqTiA0QcR rbGK1ZpY7Af2FYWgMKXxMgkuqgurTcTkuzV2rfe8/wDQfhAZldYERItRze6rZa+Wo6InzT5tkqiM 11Sjn6SjsMWWDjXWbRsXLW22+blrLFNQmVayJAoE6CZzHJEU4D3ABn5mBJWgUGzJoAWclMVVJRKs ClLFv1rVK2cg7AIp5FkOSjw69l42ftyy5tnwG3SrKVPuef8AoPwQCTXViVU5i1hZZZgurqagCEHR RhVHpUlZV8hhQ14SWXlmSiOS8FSTbsVraqSrdBOYyWwDcI1pEJJjsOLMe4qwJFQKLLOZpqOAjkrQ cLViVVExKyIyZm1RDiwVXvQ9VtF04oIrAMxEtII83pqfd8/9B+ABk1VYlNWYihRaxVUrIjnuPUmA gyB1gOQc11CwIHvYkuxlGr217iuxSWEKlFfc2dwhQvcnRFusaGxK1DozKejucciz1LyGFQNztFdI WIoEUCVgYJVZVaMVHkXHE3gNLq/UqB62p4wNeoXZsWJuVlTarDfw9bDB9vn/AKD746ymhiRWoFa9 FEvBay9uCVLFiZ48xiriAtNth/qsxtoTHjE1xNko9li10qlrNLCODKa73rLnDAsARsrkHDqKMioF 1NIMOvxZFsioYABARA6iG+DZcRe5Y1YPGtXzY1nEWnNwyF+WAY1WZ2sQ0gx6SJtq6Ixy3t8/9B9/ TpWAZgr6BcBm4L6VDE2PWuBkKFJC61DXtaldMU2WU5YAnjYdZwKyEW/lYKaOSOK+VtCGKQkR0sDV cQ9bsxVksPIGuxlFFy2A8YbEENyzvTuMYq2NEqGEUCVVgypFAUAllm1RicsxiSKicKOjKGgBEKS2 oOvlNE6t3t8/9B95VLGislQgA48ox4i63MsYmVATl1z1UMxrGzVX23Z663QPxxaF4lmINcCgQPL1 Ui2xFW+1mekqipbzXtIRfVwtavB48GSvAeq152rBOomREsAi2KYpMQWStdjCNYsqfMYgy3pLPQxP GIoABwIJ0jqMeQ012aLamqs9nn/oPvULmULCOtY67VsK8V+cHQLklKyZ4jxQxu6nOytbO/ccrZlV Sv0f1u3UF4SzDWCgJLr1IYvn+tYY6uj0uQVfpsWFrHI4kBxp2dcQoDDUphogrdZhsV1ZCIVlVtoN e1cIL6nAuQGxuQuySvqTkwncbPcACuuS0LYmen3Bp8W9nn/oPugZOtXkhQoPze0ACrEd2sdVxACS iYnifCmwlAG30NY1CoLEsVRrIlBra29u67KRcyk33qk/rFyRWID0Yf8A5gA5r0OzUpReqqQZV6di CYgE4iCsGVqRFUmf18MikFFDC+l6SuyWVmzFbEHJolDMV1hEpQQKpj1IRbTxHkkFmtjrPP8A0H3a lydRQIDiB2c5SqW3PaypOPWmpnbS0wuzSirSo9Xmbaqqq14rzHcG0tVnIiywqbGuWtrG6U1hn2QF Wtm5EiVEnZUes4ww5oFId6+JZgHS8EBgwRswQQMARfWJXuBpTexIKsypLVBGxXwOORNWRlqjWyq3 JchohjdZYcjfsCpn1Tz/ANB92voKOidbY1wWMSYFwBkymgk1rVWgu4yryjVDa8+9wapbnp7gPMVF it1YsspIezYLpVUi3dw2HtHbbOtUnRlAj/8AHsH/ALA2QDL6yrcsx9atx2ijIriE7Csl9hBbYKql zGvVYwVsgCu010rWL0jOhlvqgAWA5BXI7BDrUmaADMkQWYlmCvnLe37fP/QfcUZKD1IpYMxxXUxU VKB6BGtXKbLAnYeHZtWFrrToailr0pCm9qbWt79lNVLKawbtHj2fJ7HKzUqHb21CLfaWoKKlNgPH YxBkohzATmwBkYlTq2Bg9QYdsqUaFEcVmwFLVEqsWIUMRFMNYEflWnNxGPqc9UmIQRChi2XVRdrM 5AzmcfcFhbd9nn/oPuVr011HJmLFNftJ0EAxGPONRYoSp3lmnYkCBTTWAycJZsFQLj3dbx6k79q1 LZNK3iE/592pRNqsMb2w4Y2NaCa9pMLogGlqeJU4gGZbSrTrTYhDKUDR6CJhhAMgJkCtwK7ikqsU ivBlhWPgF34BesQZAn+wEZY6QMyS28Bd+7v7Xs8/9B9xP8awQKauEHcAsVivByTWwBvfFdypY2wb JgCLYUPc9PI2tRrqgtsxp0izZsv1wypWVXUOHr6rfcEBzbcR27QuU26zjxzelhHGGw+FtmyMnUtx UrKQADDSGn9dhFUrKS0HbuUUXUim3mLDhbSWDEMzcWIXAzAYB1IjJmOnTzN70V/P2+f+g+5rpzlV YSLagg2KxDs0hS6qXdmKAseOFOVlJVnudVr8dpd9aNZLrGLht5x/5+kqivozb2EWoAMi8V2l66K8 ti+lXCl6JsEWDx4PMCWLmAkHCsDSrE1XVwXFTXskFdpZXZU0/rI4/rGtql64ZFtDVlbudbN1JCFF VmV0aZ6CAwfPEKAjz2ty1fb5/wCg+5p21pO4hnIymsMhqQyxq2UVuQG7YpTjLfUePECl7bAjO+mg VN1Al2ySU0SGQP6t60ltTU7lGSBanJfFoWvKmFBi3/jspc1XpgggGWoMV18hwLxXeplFdoOjUSdP ErqiU2CUi5GRQQ2Qlikq3Osm3lDWStKIAyZhe9GTYzBYTKiTCwWcwZuUrbTfUarfZ5/6D7tBJNdh DVuEZeNjX8FhIxyDOzHk5Eo17XFNXAays2xRV267svsWYI0811uwQWg2301CujfVkNt+afFVcV/+ zrg7euzxEdJVc0RlYOmYKnVlBU8VtVq7NU03lorIZ/XUwVOhVGYA2VTmGS9gobAKqgJ+TE1S48oP SBWDFoSHXWGgiMpWK+R52rt73s8/9B91WKlGydYAzjxFqEhedpFPGW8gaaFVBaiUh7Wmmn9dS5Yb n/HcgdmsrWqvasPY8VrM1g6jfXK2AhtNxWqkGcQY4AN9XbZ61cpcVlV6sFCmNTynbKF15FtZr1R7 aZTarBMmBOJtJK0W8Hvc8S3UQRlBGHVxYOfIRGBghAjpmMvFvPvz3PZ5/wCg+9S5lbLTVwdileGF ZQ3WELRq2XPVU1zvSla0vQtT8LK6HJTdcC7xeqQnkFxOth0QyIn+N6chu6xVtaxlei4ZHWWV5AAM 2Kjrv2qtmtta3XNV5Bp2EYcFcGgpKyVA4XV21WaNutYl1YyZYMjbd6yuwLlJ5PjAVZxzGTIdXret uYBKlbRAQY5wNm4Kdu437Hs8/wDQfe0ta2yyvWCkUuZ/XUJZY4lOuWNHQ1nGwGD1qFzQTyp6XLS2 z5IAcN+rmtuuUOpcGCHq6y/XW1bKfXW/E02ReosrxGQWKyvq3VXJYLdCq2NpXIKueaX5A0AxUKko HR620ba9hLFsebIPJayrUV8BjMWD5sIRB6StgYMSItpWPZyXzG0TX7fP/Qfd1aDfbTWiKSVZWzCC U1wOYYYq/wCy5DVs62Iw4tSQ0twtutcg3kGRfXlbz27Av9e3XsEC5FigHe1yjioXJXYUNF4YABw1 XEvUttbVWalldnIK+QyV2jsOk07EtU8WIAC79RevXual+6SLS7S2xVlO5yiMCMjK9YRGWMME9CGj HB2LxXX5I4q9vn/oPuKpY+O1uynVTcBhDF61qcODk1H17S8jqOZeuZSOItWxLfHhVeluSuuZ5Kgi zgdmnXtZDRYCHQMu3QLE/wAGs1xaitZQdbaAgCWK9bqWorsW3Vu02otS0LiKuJtauBq7SWgvLml+ ujlBaGKOZfUWlmrYjam3yikEAxTkEQpHrjjA2big7jWTyb5Pt8/9B9zx1QIrj/4kBq6zFPoHyrbI r+d5xKhwvbLVgETbsIdiEs1bhB1nkKedSnt27FbsNS/pTYrrYk3dLlKnFb9qq1bNO2iau0wgdGBq wXrWxNvVs1X1LxsLXyEyAm4Dr3UbIuqcgy5hz4DOJYmV6ubtQWBLdmiU3pYFcCKwPsYSxRx3/wDs yFXbs53e3z/0H3NGvjq1CFc11eoKPUo9FIzKOoB9Wwf+K1iqVtyQV4TaQFaCLKNO0rNd+S2AGbmp atuvxuqtoZJq3hIjCxHrDDe0+zZq35GQYdGpzWjUvruHhTE2qO6jl9S2q5XQuudla7RTsDVvNycQ 4ss45iJ0sTo1Z7qXViwKCP6fq7WzXFtOUtmQY/y3f+3cs7dBOT7fP/QfbqUG+6pQFXo6dUrPF3GL E6x17dwOLFyTgOlOLKtSw8l9SbSDGqTXbahQ6WxOPcTboLp/ZevarC2Js6TVzU2eES1blvoFiX02 UWa1yXqpnEWIht1r67A0LgTb1q9hdfY/qWGzlHbkLkbvVm3FQwqKIIZfXyValYVcliEex61MeoiK /EswM2+ux5Y4p9zz/wBB9mJ4jW4IMizGDV0lg4XHLCk5G18mPqRsys4me3cX4WaV3IMnKbdTAK3J a2NL6e5kupYeW0gG0dnBpuKNsaddp17sBSLF29ddisGzUuS6uxa7MTYUbFepsub+eC1pM3NevYFT bFDczDW62Oxru135qsHscQqAQFYHKslkzmMMy0BWV+MdudvmD19zz/0GJW9jaekqSnpNheNwwVrP XdxmvBFeVNiF6wQRU5B5HF5yOli6t7VvVYGXaQEI4rftjiL21m09lbq7URhu6JrfTvV1qsauXzV2 6DZY4zs01bSf/oXBsRLunks6+xrbld9bPkg9SAw4jO0rGntc08dcVK9Ss6QjMYERT1YBgXxKryZz BGwy4tvIGAo8jcLdj3PP/QZ42hK6yvbtU4O0peulwRX87au6lTcWHRy5CciLMExHsVukUlGPJl09 nkGII3NQq9Wx3aTxtr1dh9K6u9Lk215V2bXasruWyum5WXeVKn1dxbVD9fJa67I0tri/Lrtp36az ZqkbKMtdwM5MYoMfljmaXsLq2ruLaFeBopBDLmcTkjBtAKhgCb1rS7bstNecbNvCtjyb3PP/AEKe PuDJs18kVwwrb08e1YDiI4EuIFvL0q2V2FJlbYL9QlqutoKtRyEeuys6e2twuQWoytrXrbCiXVaN 7UOxDDf8atg1dqzUsGyCFYWJZY2ps/2FYdw42tMOVsvAFhU3Kpso62VgAopgHR/lbTyc0+p9cia2 yHitiK0BzCOrSxuIs3cu91lsXpOXFfI7HI+75/6DNO/tWU2clZe29bHF9XdrotyFaXqXSl+qtg8h g5Rg2YfTGVXWsnFFw42Youo2O7Xu1+nUuYNS/E7tRxoeQa1O9meSrLTTvwqPxnkk5Tx9/KsPko3U 8RCoJ2aVQo2LqwvGsj2HBligixTijEv08mrYdIlwIRwwz0abbcKsFSuCCMLt7vGMSx93z/0H2aG0 SrJ36wSIlhEvrIKWZi2CXrwdXyFaXepVbIY5VHPEnMXYrtN/J009sqxdXGzVZVdTcLFVuaNYdbZF gYdGXY1QWW2yN27K6gBaXs5VuMJhpxGNhA1dvy1bu7VWCIBCBGGIyghvQ6WqwspS1TXfrNXcSEcM GwB5K30IgaKgE8lsNUCST73n/oPs17TW/jtpVbaqVzzwUtBFydopbAwdctW4fqrZB9DgZWtipx0Q hXrsOLiy2U3ixb0Ftans3VuuN2gO1VnalbklR1atGmz26kt1z/VoJMrDCVuMA5FgyNxTz1ryllbw GEGFYRiXVkxXepqbiZgNLajSyWsjParV3P3bVBisAN27u3+/5/6D7dNluoSpxDrlhZr3VBWLK1Fq hLipYC0cjiq3IswyrcDLrCJQ6ul9WJVcZtqHGlscJXxYWaaWhdG2uPTYyOgVtdeZQgBATNunmL7L qa9WwtaFYmslgI03Kzkgiau0AFcqQcwRxD8r6g0WwoaNpSLnXhXcpOzunjWBx+U3d4ICcn3/AD/0 H26F/btqQNK1MRTLKgtxrdRfrIVpqOW1lsj0lDWWJs1i8NFgWpzTKb1sj6tdgu0bAoq42Vlw9TdF y0ZQBtjFmn/11LkIMBhmeRq5Nw4NXxaV5mIwjoCL6uJCFxRcpFbBYDDLBynEBNtgrHfVBZt3XqFY i5SAhVU3PIQksfgef+g+0Eg+O2u7Wj5fIlrDmih0NXKGs1XhQRsUgSo8nROQavK2KxetAGrUyxSU vK1nTYGVDMRQIw6b1Ia/SKmykkFeom/1lpYDUt6UWBoIYZsp6A/B21qrQ67NE17SQSIfnZZgX3d5 3pDRaigqXkNm9UfY3bLfh+f+g+5Xa9bU+WsUp5Si0WbNZmtt1cRYphZ+/WPRsrkUsDfrohGyoUWO VNYyKV6dCN4erT/zoIEWH5eVXrq2LW6spFZyMZlyZba1u2wDBqbgTU4dYRLBym1UyNrbBAcLcjtZ Utmxskae61qbuwK1VcBCRAFl9levVZY1j/D8/wDQfeViprvXirrF2LEYbC3TXblVYnItWEv08S6p WNyKLNZj26SCpE8mnqrdq7K2AZfkflu0d2s6gCatnGUuIJYPU9YdblZGQ4NF/A1kMphmyncUKa3r qVhZriqk7VYam2murbtey9DlQQIzqo3trv2fE8/9B+AGIncaaNp46Ng42gyxQE07PVcoIuRTKjxb UclSMjyFeaSOmvapSh+S4ODiWoEs9SNVaGVG5BwclTN2ni2QprbidPZKMxzGYCM2RuMMU3bCTae+ 0VorKiKJsuv9hvIIgbyFpll9tnxvP/QfhUXGptDYyLLsiyzM0nHN0DVOBgnKa1mLEOVsRWD0okFf cOlY1dq4jLNurKu2LEfB1buLMOnXOygI28I3d6VWhl1tlLksAA2tmutKrje6jEccq6RN7cWtSST/ AAPP/Qfh6ewamGyCtlwI0NhWtR+VLt1DcbFJU678kM3QFflwucCxNW1bqiZYrkbKdtqrRhbDmi3n Wykx7PX5G2pVXks/5UGtsqi3eR9O9b/x69qK53aRBtUJTd5Cx4SSf4Pn/oPxBa4BsYyi01W6+6Oy 9jGWuVaqwGaNuAHBG9WXr2GmrsLjX2BRapR1sOF8mAAmyA42FYa9uAtmU276a03do3bFdyBBtUqp srNr79SLZa9rezJ/ief+g/Ho3HqH/prL9x7ZRvsk0twOtdoYO3IeZtroarbsrP8A6jEeJ8rbZY23 Ug8t5VLitjBtbc1MbO+muw89fnY8lbdCczJmT/K8/wDQf4ettPrtX5wpLvPbDrZY9jexWZGs2Lrf bmZJ/n+f+g/675/6D/rvn/oP8tK3sIpuI7Vgr/n+f+g/y/tO9taalF1G7uD/APh+C8Jr7+n/AOX4 mqn7g1NfW3P5nn/oP8rwvifE72vR4PwOu6eE8FWp8F4A016PhKvG/wDheAMf7e+3XPmNLS0tv+Xu 6qbmn+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8 TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+s vEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mf rLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXif9f//aAAgB AgIGPwD+lxqzhdDX3OvxVTz0QqqfoRtyia+pKJXxFD5LzFVU1Y6Qp9WJtRwiXPQ5wllPh6c0HSlr 9xXNVu2GqtkuSmLkq0uhKu+ZCSex2/7LUn8j7dDVEtU8f0H5T6Cb3UJFHWavgllMkjiokqW6M+1e uEXaCGnuNcPx/qTuVwl5XAl74cfUodtxqd1te7xKEeFqTkaW2C4w7lrbr4cIeWp54UxrjA3yQ9SM IG7VT4Co29ic0LIkyHhqK5fss0ELJLJW+DumehU88kmmFWaGgqEonFf45p5y9nGokSUKlSCgs2lr NGssMjJBGRK3W7cVsTI2cKBQtiuxI8IyUNCGdCUUyW5Jy/dEHbYoOg1wdqokQRy8krCqKJFURoTJ GOpJ/wCtMizpW70Fb7lzW5QWDwh4VKFVP1JTzVJ8JufLyLX6jFO5IuiJ3JINSqnCl0FXPVFSmmFM YyzhGL2IWgn0J5YrV+v1F0G8ZRU6FNeCpG2SlcKkjyxviyHNBripbYv2VfIQ5yTtuSq2nDKOUStS P3XzwRGPTCX4PpgxRxBDOq1IZ1R1K6HNrJVVh32unHBJJBKypeChPBrg8hXqvJKPLUV1rIv9ybXK I/VkrRldHqU0YlhQrQo5w9PDfXDuW+p32bVOy7ccV6cndavu3O27TclVTIa+1kHbdo/li8IOMKjY /DlHa/Qi5Hdb+L3IeqO6PMV9sna/xZDFOtpoa4SsmhOxQnJPgd1uhI7Xoyh3RXca2ZBDU5ZJWPdc OKIjbLDwnNDPPBPBQqk8UKZpRD1KFq6Ec5q74U8DUeEk84xkhVNIO51ZJLzpMpg/A88EsUSiN8O5 kiW5XwaFbfAlYSLCVhCJdCZoNTRFCX8LBGGhoJe46nbb7/Cxi5cESJW++Djf4fX+8f/aAAgBAwIG PwD+ltWruj2Ne3oj87n80Ofyt1/7/FV14GtEjSmxK14ZFJe6FctufmpFdb8RCJeCGl7kKClD7NHr Oh3XO3t/il/1JXwrKZNiIyTaVOMO29dr52Ks1JT8f08SuG5QUbeNCcRXxGzTCGj7aSSvqKWk+J8W 7yJ8DQlWshmmRrHsucp6eInGqGlpOaiJuZRS+p26H2tzvhN2uLGVE+BLvU9fAnCWVy0LbVux2WqS upE1H1Giqm7ZE3Ys7kcMo0VUEP8AX6ZpxXFuWIwmaopqyGtSq0Fa9eu5W7tKVKI4JbzOx6vTNBIm yMtShTclqZKl0ciX8tH1N588m+DyK62grudfPKytehN2v0xnJHIlGpYv8hslfsJv9XJRkoqalMIx iCVqXcSsvXwJO4nhCe6cnmeR23blNBxcyXczXO7Wi3/JTkgStdPqOou2BQvt3ySJPBvaSS17pFan fbqhPlFCuFcsoVu7ElsoyRsSykudSEQTiimxBXdkbHbwSiWj7bo6Fan3IoUNcklt6/V1JW+SpK/F oVaFXUTyt8nmJcEEToQyjOGQymeiILJ/jlVrelYPM7rvTJOSMOqP43IrVHGRonHWGQyLapKX0Qkt qZG99ite7BMXgdChO5Dwh41O6yq3W6yJKpffd+f+xey4y3dHBPDwfQQskEYQymeSUTEPoVRQtSLb PV5G99EeZcukiF1Ue2HnknCGThONGQuCuFCdVhKO56W2sa4xnXgluZE+KCbGh9KkkceFE1w0HB3p UesbPCUQyjItWhOtzrcy67l4tcHa9tBp6Mhif8SUShPYkk8sZIb1GiJ98F1WEkyTb6ojC665TAla oH/rtq9G8vfauuHbd6E7blNB2vaqHyh9NB2v0K+TE1o6ota1ipKJ0O7in/nCUJrVVw0w6E/MrqWy vyqylG9M1NVUcPQhqvJF25Gx3In5HdbVCuX28ncnE1O35EcjXU6jT/JyRhBNvqsJO0iIXU7r6pbE sl6bLO7rPYh2tDoKeEPoigsG98FFCcHPJ3LFXW+oo1Jp6H/0a8sEtWS34VVJC2Z50PM8iOB2v/kj Twab0O17DIJ2w7V+xqu3kSlpbiVEraFE7mO57+I+cEP3PMoKdHVdMIPIlFFMkQdltrZ90d93yHVE W+/wK5RVE/MSaqmJ6cDu2WonFOdjWGNJqOZJb7r3vsvIoiiSfPw0NSie1Y0Uf3d//9oACAEBAQY/ AP6/5/X0ZGGrpeW1p6cxeMo6ciCOYr7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7h q9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avW PQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L 7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4a vWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j 0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+ 4avWPQvuGr1j0bPqXymv7uX5gCAclZpDJHigdbHegIx6kfBcc6yag5j/AEH6l8pr+7l+WEYByUD5 kMDaKBjAZk5twQDWqSUDEsU9DIYKcTECbHKW/lgpacw0oliP6B9S+U1/dy/KUVItHeUMsQdQ0coT 1TlAqwQmZEgVEcE0QS/FASoWTh2HUngecFPIPGV1/wB1ohzGkxw3/wBA+pfKa/u5fkxGIvihGVZM 5KEIi9EC1RihISaCy6cc2DoZ+lMA43pqV3I9olGIYjAoxlSTMdxR1tEdk1lEfuPz/wBS+U1/dy/I sA5QM6DcgAO7co6YpK7qMiK4IHUk0cQEBpRcLt1JrRGRByCzhM4B3ITIqVQ5SMQnBc705FQi4YHA oy0Kgnu4ppEaYGMl2mlE2lGo/OfUvlNf3cvyDLNKskJbqoalhJHWkXlLHgo62oaCsQuyHicU1yjO QMY4OhCAeRWabGW9ZET+5VJ03K/Su9QXXYDbk5Kafd4o6kAxG6x5BlGJIG5Mabbfk/qXymv7uX5A PaNUBiVljQRuhVtKLP0YLLGmniUIaQejPuUYAZpC/OpS1QzlwCox06l2YJyz70YivMswrLeV/sJG 9l2KrPK+EcAnldPKvBDLpjnKqXQlKLxIdro6kKCRQ1A0YGjlCU5iVaoCADIznECRxiKv0LswOTDN RAT0n4iqacMp3EJ40O5MfyP1L5TX93L8g+Mj+yc3agUyO8XdDSgHJuefFCAGaTNTejn7xNsVKcgw wdCOnU4rMwBGKOew3JogB05NUZFstmRmRlA7o/unVbcUzU4qiiSA6EAUY5ezKq8HTEYiP8gskRqT 1Ad3ZWWelIE4kKMZR7b04IHULkcETEASCyajarYN/dGemJS09zWVi6eY6FSKbLVdksmkPxPqXymv 7uX5CPMhI0iAtQypA1DqU50BJbmU9WdHLxB3IkD/AF7yowhUm4RlSPFOXb91lgOhZj3tyeVhimJo Kn+wV2TN0lUBkf0C4lUunKf/ANUMOdHLUYrCqhAd2z7ynmXNwAF4WmO3uFUwJbFMaKocHqWeEW3g J00YmmKcjtHBNKiP+Qqm/D+pfKa/u5fkIngAtOIxusn8QKhS0jaK8I1izlDJclmC8aXevzIakyWu yENPsx3pgXliV2imv+q3GRcqlSMSiSbByeKBZ+Cc03Ljsr0IUX7p3GYUZCMyCCcwUoxwsBc8EZS7 07ndwRwQJwxXAYld6L7nCzQrH+UVnFXRPUnuqojA1/D+pfKa/u5fkI78pJWnP+UqL/lNqoxHflUl B+9qGsl4hrJ6PggNQkjABdo5YiwRjClGdOVQMEZEsIoRtEYoQgOcoBuyMFmNhZBlS29FzRARvvVT ZMUXAohpC70RmSM5RkSIgYm6v2d68LQDt/LALNrS8SW7BUiOgLNEZZLJLuHHct6sjOFN4Qnhb8P6 l8pr+7l+O2FyowibhlEm0KdIQmcLLxDcd0ITmaRqBxTvRAgV3omRxsgH7OKA/ZXYLLEUJqSs0y4w CLCgx4omyYdJQgKvfmVT0bKYKhQe4WZ6rxZ4d0J8UxLDfgsgkcguVk0wwxTk9Gxusrsl94WfRNMY mrJpxB5qJjDqRAgap8iaQIPH8H6l8pr+7l+OdxBDp/8AEIw/kS/Wogd568yp/FMED1ondVElNgjI 0iLIAdSMSScWCcluAWSNHTyVKRxKMiWBsNh2MnwVFvKeVOdEAtDHissU7X2NFMRW5K3OjJnfFMBS QcLcUxTMOdGMogHCe4qWnK8S34H1L5TX93L8cR3gugDTes3SqX3oPdA8EP1TncyqiZKmKcDtFSkS wTE2JD8y4rf+yqeYKpfZ2QSnNECU2FFQKieZ6Ewsqm2zKDzrMRg/QVXYQdyEh3XpwQkFUMmRi+Ls jqxHaBqfwPqXymv7uX4jJyqKMjYpxYqtwEEyBwsUALoQjge0V2sL7k1giZIkqozSlURUhIOTXgHV 68FSg2O1E80wDbGCeJTEKt+RlF0M2NygAHejp1TAJimOOC8M3FlxVU/QiJhxJ0Y4Ycv6l8pr+7l+ I5qVboQ3uhAV3nihipc1E6fArILuCiHbKwccyIAYBEX3LPI9p6BX51mlTTH6ptLG5TxdiGJOwOuP IdOVRV2umis0jUq/Fd48wLIXJ4l08exIYArPA5jiERK4Q/y3oRjUmqqSU8aIibB+CzDUAItRGQaY G5GMgxFxyfqXymv7uX4TBcUHsqX3rJEPJPK5sFV3UuATYlA44KRjU5aIAY1JxJKIxWUVIWSAclA6 sqXYJny6YFOZAs770IAdqyBNBsZOVSqYM5wQc2umCym21ysotsZldNghtzwDTH6ppUkzMqh423WT gsdxT4K6CZePphpDvDk/UvlNf3cvwWTpzscX3IzkAXuXXAW2S4B+pPwX6AJ/5S7IHAoAX38AiXbe U0QST1rPrAiRwXh6YaIvxKYl2T9AVb5iShH+XBAEp7yQBNCWTrPItuCcC6ouZBOUwpFDkVW5AAO6 bFFOKFA9HSi1F2ZPwK7cekJnqqFSicQyI5H1L5TX93L8FyECegL+2wQF2qEIDdXbM4AV6VwCBNZG 24BZiCAMSnkWBuqWFwpGQGcGhKyiwxRlEUH7oyaiGKhOHekKhEk13J7MgypcVTnDBGcTarIE7HTB dovyGGCZ09QhEU/VCRemKc9oDHFSjK6dGl6qqpRMaqoVAiTUDFHkfUvlNf3cvwPElYWRkgTvDbRM mtcyfZS9ulHTGIqUIgNGPeOCGWuPVvQe53JyKigWXUtKr8EcsmF4dKEpD/YVU0GCGakRZGOO9Zge 2NyIKbFUsmBojG/FExxuE8TQYJrSFwq7KKi/sFbrQeqoGTyQ2cyz6feFwmbigIFiCmN0CqXTFOiC FmA/1ytyPqXymv7uXLZAWCAZRHF+pObKPWmFto4JghEtDPiLoCRerKLml02OCeTE7kAMA3NsLiiA hKn7ISkK70CCmdhiU4LkoRIqrVTixT76rN/CVCgdPrTmRV1vVQrMu83OqSBRysVUUKrEsnNEUTwR AtJODTDnQ3486ZPtopachU1B3FS05hjEtt+pfKa/u5cvnQKc2WY2wTDoWaR7RsE2ymwa+vGl4ROK lJ6iy8O7XUYi4xKJjWTGqANZFnVe8aoS1KOqggWBsjH+Jqjp2bFEX48EQ18VGES6BN9gGCiRhQox R0zhyKLemZOy3c1F2Z2wNUBKAPMmkDEogF1RHeKhEnCgCYJjyGfZHzEBS0tv1L5TX93LlMgN6AGC c9SAFSjq63RFOU+wRAeRUdfX/wDrBtvQhEAACwUj+qlqSk5kSeJTmgFh6U0RwUSRmIuE8gcpwZCY rE/ohEVLOECS5AoBd0dTULOXyhdkOmQGCPOgFmFwmdUuLo8a8ugCYgJhcjBB8ExDheJp2xCtVcVI GxQiKHFXsql9gAFUwDJwtSBrQtzhNs+pfKa/u5cp1m3IylTcmisxrJXoqXXBCMRVAatQ90IxsBRP wCZxnlQRxUiItR00qAFPGkTStCgRMGJwQEsbc6MSezIWRmBVmCE5VKaz4o7kALkLtI8CgcUQjFZo oTBqMEHoqFNiNrvZXXYiSyrAjjsoiCs0bfyCdF0AaxWZ6GipIbHKfZqcAU/HZ9S+U1/dy5XOg9rp zSAvxKaAYWVVxTBDNZBm2d9gN5Q0fLSaZ70xgOCzy1C5rmkXL9KOmanfzI5izim9GWoXlgSol2iU DDswjTNj0LMQ53lM/ZBWbAllI8KInAkIFCWBRaxqm2Zx0qqEgFUlkTE8yelVYOFQAb0xTlBkAXbn ZdsyHTROO6FdMi3OqJrhf8dye3MiHcC2xk4uFKH+VNv1L5TX93LkhBB6RCywWc2WY1xTy3r/AFpp HmTEumjUrtS6EM5/VkIgOxouwaPQIHULPcoxg5iLHed6kJdph2VlOCHltOzjMjGWJWUlw7hRhvUI jvSIOx8QVGQ3NtZEELKejZwTHBPYoxdwMUxTLeqhURMe7iFem1trxLFNcLtBk4KqaLK9IxG36l8p r+7lyTJZjhgsscVWpNyiApMRTBZd6BZNi6fN1INU4oEh3WIbejG4FuhRJGYmwXjeYDyNo4BRjp9m RLUxXiCk3aUeO9SM8KqWphU9SDUTk2FkIvQKH/EJgneu5EGqeJZNK+xxdAvjVA4HY8dlKFVqV/rL ncV/siYk3QJtgq2VKhqrJL/4rKTXApygeXTpWpPB2HMNv1L5TX93LlBg5Nk5rP8AZVrwRICIYvZP YgrtFRLP6VULidhrVZQb1UZNUG68SwZeJMvGLD9VIAdrBTEqUIKMhuqgUXqTgmGJTSo4ABW9EojZ ZPEsdyaYylZo2URJUO0kKoZPFZNWPTxXY7cBh6FuIuE4XEVCc7kBE86DW5RdAQ/mSH3cj6l8pr+7 lyQyzGpVQmPWuAuvEjUKTDoTkXQa70QJDEXRlKwst5lV1LW1Tl04qUtOOXTiGHpXhDuuyMB3gAtO Nge0U5WWN5IAY3R3NRcSovvc9CYhMawXZUttVxRiTlKtmjvCYuOdXTEMmJFVSuwiQRbnZeJpuXqU 5Owj/JCR50QDblmQFYF+R9S+U1/dy5JEqEpgX2ZplrshWjVfeokRqCImODomJyA3CL97BCZ7xv0o Rudy7QFDSIxKcho2AWl5OJYXm3FdkUJKhKN5UIUo4NXoWfcAAiovgUdQ42RB7wRJuylI4BHgiDij EWTRrGV042k4ustpCxWTUHSqgJwG5qJxIjnqm1KtYr/XqEcEPEOYGidHmTYYp41j+yosx6AiY13o Yc1EWjmgmIIOyqfZOBtIEKenK8SRt+pfKa/u5cpnZCEg5ehUszuLRFqqGaWWJLy6FnjYnMBzllmk cr1ZPIuDYJmYBRlG8bDeV4kqBZpYE0U8ozakwQOD4rJiAhg1utSiA7gqD2lVOUNONTI05io6YsAs wwRIujqEvmXPszRD70QzkdavtzQxuE8rrJMPxVO3DdigDTgmknCpUJosDiMCgSHCcVorJsCiQNhI Djco4UQEVUVVQuySOYrvEjcVWgRBtgUSP5gS2/UvlNf3cuU6jqR/jUqf+X8ecJ5VnK25kImQ7I6F VyAgW7QIYIxbtGy4m8jwTaYz6jf/ABij2Sd5aijqHvyPa5iuzjdQMcUIQrKVB/dCH+NlGQOICPmd TmiFz7GPdKEMDyBqRFMQjPSpPEYFZS8SLgoCXWqKmyMhWUagGyeMTDUFXfFEeZgQ1pAUQlEuFW5T 4I1AbFZSWBsi3I5wgTWO9AYN+vKI6kAP4xA2/UvlNf3cuXk32RiA+oXiSjlJAYCvBAGsinKpd6J5 0bBGFtMFs3ALLEMEdPKzVKOW1uZcRddo4Ahf9xqhpSHYG4J0YE9kIwNhZMiCicMEITxsVlN9jhZS FnhbEIENmVBmjiyoehVoU4ThccFk1A4KlKIMtAmrb0J6RcG+9MbBdm4QkTfAIHNVMK8QhFFMmKzX C4qvIzGgAJPQp6p/kac236l8pr+7lyxKIYDEprkYq7AIse1vQhdeIf490cd64u56VqaYoxfrRGIT yrRTJDCRcKccCvDlWMCDJADCios0D2434rMUNxT3RBvgpQdmNJLJM9oWO9Ma8djhGJWPhmjq7p40 OBThpDhdNmMCLAoCY7W9OyrZGMqg/wB0ZaUiAS5jgUJRL8EOCLXkGdUlcqtSceU8bqt1wVnGycYH gTw5H1L5TX93LlCAtjzLLEMANjI81VIyrLjuTo7roamEqHpR4ojC6dFjxoqBzOIrxGxllJ7xQALw 1LcCo1ei4bDMWkU0qGNiFlmWkMcCmN9jhGJHWsxGbTxG5CUSCgT+icxD71m0y4GBVZMRcKi4lFr3 CMcHxVLFMSnIy8Qspq1k+/lbk0uZMif5GgCbEmvI+pfKa/u5clgHKMpjty/ZDcUCEEQdyHEfqEwX OUI7wQOe6i+FDzqlmQGCJP8ALuleJN/Edi+CzbMwFDigD2ZwshpagaYNUydZWrvVaEFiFvf9FkmK PSS7RYGycKlisuoHdHU0xm08Y8E8Da4xBTJjYrxtDsyjcRxCyk9sYbGT2PBZCXbFOTzIRONEZab0 wWWfZkMCnFeUTiE5LNTnRlPoCEeR9S+U1/dy5MtQixYbAjv2EIS/xlXmKkTd6IKB4qUcJdodKHOh uUXpEEEKOqD2J0lz4LK77DSoqE47poedDU0x/sjhvCEsDfgqVTsjqwoDcLJmzRIomIdZoPPTxGI5 kA/ZBxug56Vmd3sjCWN0J6J4kb+dMKSjcG4TFkXXiwoChLdQp0MqzFwUy44c6zUpcIT0qSu67cc0 RchAxkObHknioDgUTwRO7kfUvlNf3cuSP+RdMjwCZEKXBSicVxFFzIS3EFQ1RUxLE8Cg2KfejmFq OssuMSiJd6FEDwXAoyhaVgiDTUjQjGiM9PDvx38QgXoU4ruRjIUxWaNj3TxQiXEhcJn51mh2Zb4r LquR/E3UgakWX7oBnIQzDKcDYEcVGQq+KujGZyxOPMiHMtElif7oHA4qlhiuZVVFlNIlySjpjuCx 4oggEFPF41wTg5wq9k7lXY29AbgicTQJzjyPqXymv7uXIEMBU9CA3U6k3FEIjcWXOuBumFiHHQpA Y1CB6SjE2IWSdu7LoWU/wLFUqszXoVLSmO8Xj0Lxo4UmOCA/inFE470ag8ykZnKDQjF0DcLxdAPE 96IVD2cRiE8QpachQ48UC3aGOBCzRodyoWKMNSoNjivCn2omxxT7HlgpaE3GkT2XVLJipQIzYjmW WMrYFAMxaqrtKb+QWWWxlUKlQmuEGR4KI48n6l8pr+7ltojqSHalQcylHihLeudSH+VQgd2KDqMx /E15ioy3GvMqLLLrU4C0+0P7qMxQS7Mv7JsUY4GycDtwLxKEriQQA/8ArJpw4LLJOCvFAcHvLwZm ooExrFePoMNTEYFVBExSQVOdGBpId08Uc9B/KLX4oSgXeybEYJmaQsVLTkXahH90xNAms5X/ACAo RvXh6jGOEmXZFUZWBDGRwTvR6oSdxyXAXHZXbSgkiD0KZ40UI9PJ+pfKa/u5bMsA5WadZfsgED/k NgUJ9BTbDHeEx5imNxRPcqOpjGrcFlwKyyuLoF8FmjfFHQlYl4H9wmNjcIDUcx/jMfsUGNUROrom Bq7xNmR05H/ZHvf9EHqvG0w8gO3DeFSRHApw7IxIYtQoQkexO43cUJ5qb1a+KjrQcZqlkC/aF04v vOyqoFIR5+pZw5niF4U6HBUPKd7K5TX2HejGHeIZ9ha0acn6l8pr+7lsEiHlKpRibGqAxQmLxQ3J kXwsmPMedcFQdKkJUeqzRrIX4hATsbJt+9Sh/jY8MENSAecbgYhBXujOJxeJ3IEEZ40kOZZZh1lk /hnuk7kJwIIKkGctQoahYGNCGuEJxqGdggWoaLxdOFD3sqyE1FjvCojOIeQFl4Gsbd0qkqIh3OCj NwWwBctzISBof0VKqivVNgpREc5OAuFnHZLuwQBpMX5bgOgI3RmSGRMHqU5upHgid/J+pfKa/u5b IjFm6kJjvR/ZR3jFMcUYGxqE6rZGQDA/ugVzrMBUVXOmxFYqlxdRnhaXSnFd4XiaVI3IRj/MXiUY Ikd3+QWYWKv0owegLSj/AHTHFGWma4heDPuYPggYRAJ3IiVXVLAuEJRq4d1emKz6VJCvShDUixFH XaspEVG5MbblSxVDteNCRUrNLmKGppmu9CMy0xRNySpCIcg3TEtHdscrwweflfUvlNf3ctgB7pV+ dGOBsmdPHvxsspuNjAVuEx5mTIpjTEJihKNCLovY3R0naQx3hM7gUMSo6miWP78EJ9aOoOpS0J4V iFuXjQLEXKOnKs4rjuXiRAsxXhS7w7r7leqjIXND0LwZHtQtxCY3CrdVqV3Rzo6mBQYMECqbWHWm u2KMJVG5Zo0PBZNW4sU4LpxsKnLcHCdrpxsyQqd6JNzyvqXymv7uW0PcUK7PejUbKLxY2PeA/dA7 M8bG647HF41Tp+goG7XWaNJCoWfLlnYtZAi8bIwlaR/VGJxWaFwXBQnjiOKMZ2KEo0YsUCMU0rFZ tInODRNMNIJp7kBmMA9CFlkxb+QXEJ9ko8E8g0o2QehF+SydWTMxWaPajuWeNOCcX2DTH8j+iYqi EI3Kc35f1L5TX93LbwNCjHULFqI6mkQ+IVKbxszxPZN+dc6MSHdGJ6ObYyy4GoTIgmhRRBtK3OjE hwnjRiozjfFf8sFWgN+dXQkaA3Q0pyoB2SqEU3pyu1HpXdqaBDWDHFudSjihR1ZlRMmlghgJUKrY 7OG0kBbwhRVWeFYG4WaNQUZIkWjTp2FSOAoPwPqXymv7uXIjm70Sy75PBO+F1nh2o8ME0wWKeNY4 MmlQ8U4uLFGMqSGxwe0KhVpvQMbIcQqIA0kLpxivClhVXX912ZIiTFCU8NyBB7KYm2wcF4JpAlEk 1WaEuhVDHaJAYMUxC8LUvgVU0wQ5Dx6VlKymhCJPd4qYFhYrwoVe5wCDJyjp6dzcp/wPqXymv7uX IyS7sv3TE1wUg7MqWNwhl/kKhHJ1J51kdyYXFCq0O9HJfEIb1mjQ4pjUFAStgmITxuE4LhdqLgYh dkvEWVdh4oxKpgWT7QJYqJFG/VAjFV21RYVRBuLLw9TvCxQD7WBZVRMaAXQlVwgxaKYmm5BrYoE0 RhpnpTm/4P1L5TX93LkOEHPbjQqoVKKMrtdc6IKlEV7Il/ZOcUJi4NlM7iqdCqWOCiTgQ5QwrdBi i25ZpRcWdSNwSt4VNgsHq5UtPeH6Qmw20FQhJ6nBZTQiyY32snTGxQIpLeFU5ojBAGgkHCvsI3Ix HdB6ymZNFPuumJpHDisoLR3fh/UvlNf3cuTmgWKGcOmPZKDSTGYdUIKeVyGHQVZZo3GCL9nMLcyI RaqZgXFehRLcQrJkYtR1LTZnDhNtjILM7SjWuKGpGxQ2MRdZhWJ/ROKMnFCLhDaRsYpszHBCDiRj iEZAmm4rJNhJr4oh+1KkRx2Mq3UpvXAcUZSNT+J9S+U1/dy5bhNK6cFulCUJ1FxvUNQHeDzpwXRF lGUagGp51J7quCmAKMog3FENgmLKMsHrzIHCSGwtcWXiPZeHgbLLsdEEIjcs+GKepiUCC77W3JiU +Yk4AKWpqNENiapsxAPUvEmz/wAWxQlKhHdHBAqqzSIAxTRPYjQfi/UvlNf3cvwb7D/xIJRC50QL ocVmROJdZcJCnOExwTpwLF0+5DTkWlG3Mq3CoqqUP4yqEYi4LhCYLHEIEbKLMLG6Y4rLeJsvDmaG xVLKqeyc3NlemFUPEmTE4PRZSHbZKooyywqU67Uj+N9S+U1/dy/DO40KDHBBXbcjwP7p910QzUoh IXiVHcUyIOKnACuBWWxGK8HUL/4neNuaPeH7JynHdlQ86yS6NjYJiOlPbgrsgf5RumxCdSkaCKMp d44bhsI4ICxxXh6Z7RudyJNSfyP1L5TX93L8TKTQq6NUQTX0I8ycog2KDHu25kCNycoTH8qFUpiE JRLThUFRkL4jimxRi7AoxxBWVMT2hWJ3oEmuKcFNjZf7RU0G9HsuDYFZ4AgfyHBRIl0LLCpO5HxD 2jYblmJYYqhdGcpOWoERDsgpzU/kvqXymv7uX4rAqpUZjfVARNdgkUN6MTgVUosn3JiaouexOvMU 93q6GKzjGhCIxFjvQD2IKeMneyBJ50X/AOqJJoKRG5DMaqsuhZwWiTZ02mHkjKRc/l/qXymv7uX5 BjWKsUwoEBOrYoTEn3hAg3VbLJplzKrbk902VeFKTRFoko55iIG9eFoVAvJZroZgAcV/pkJg1YYJ iKc6Z24p/wA59S+U1/dy/KPGoNwu6jGHZfFGUyZSOJ2iUSxFiF25mXOeRX8/9S+U1/dy/r31L5TX 93L+vfUvlNf3cvzjQiZG7RDn9FMjTkRp98sez/7tyGqYS8MlhNjlfc/9A+pfKa/u5fnPPeYhoa+v Pw9PSB8uBKcBqagctf8AioaEJnzGh/8Apeah9R1SAc2mNGDeKRambpWrAA//AJw+l+Vlolux/wBy dWOZpf5ZszryOtPRlqHV+ony+vKLt4I04Tq1rlREvLZ5HyGt5wyMiDn0dWUYjmIFVo/9tDw9PX8t oa5gC4jLVgJSA4P+d+pfKa/u5fm56nnvqMPJakZ5Y6cmeUWBzVXiaH/kENObEZokAselakIf+Qwj HWDaoBDTH/KqHlz/AOQQOjE5hpvHKJb2dD6dpfXtPT0xrS1zOJAkTKMYte3YBX/9BDumF4901Iug Z/XtORAEQ5jYWF0NHyXmo+c0TASOrFmzEl405vzmv5PUJjDzGnPSlKNwNSJgSH518X5j1PYXxfmP U9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y 9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5 j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxf mPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF +Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8 X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2P6/8A/9k="
- width="480"
- height="456"
- transform="matrix(0.0667,0,0,0.0739,-4.8828e-4,-0.3735)"
- id="image50"
- style="overflow:visible" /></g></g><use
- id="use52"
- style="fill:none;stroke:#ffffff;stroke-width:1.5;stroke-miterlimit:10;overflow:visible"
- x="0"
- y="0"
- width="1"
- height="1"
- xlink:href="#a" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g opacity=".5"><defs><rect id="l" x=".411" y=".153" width="31.155" height="32.251"/></defs><clipPath id="m"><use width="1" height="1" xlink:href="#l"/></clipPath><g clip-path="url(#m)"><defs><rect id="n" x=".41" y=".153" width="31.156" height="32.251"/></defs><clipPath id="o"><use width="1" height="1" xlink:href="#n"/></clipPath><g clip-path="url(#o)"><defs><rect id="p" x=".411" y=".153" width="31.155" height="32.251"/></defs><clipPath id="q"><use width="1" height="1" xlink:href="#p"/></clipPath><g clip-path="url(#q)"><image transform="matrix(.0649 0 0 .0707 .4111 .1533)" width="480" height="456" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEVQRVAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABm+AAA1uwAAW7v/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAfwB7QMBIgACEQEDEQH/ xADOAAACAwEBAQAAAAAAAAAAAAAABAIDBQEHBgEAAwEBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQMCBgICAgIDAAAAAQIAAxEEEiEFBhM2ECAxIhYXMEAyFEEjUDNgNBURAAEDAgQCBggFAgQGAwAA AAEAEQIhMUFREgMQBGFxInKzNCCBMpLSE5PTMECRoULBUrEjFAZQ0WKyMwVg4YISAAIBAgUDAwIG AwEBAAAAAAABESECECAxQVEwYRJxgSJAkaGxMkJSA2Dw0WIj/9oADAMBAAIRAxEAAAD6zzn77x4P oz5wOfRnzgH0Z84B9GfOAfRnzgH0Z84B9GfOAfRnzgH0Z84B9GfOAfRnzgd+jPntDi6IWJCsWyXr vnzh1/oz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6M+cA+jPnAPoz5wD6 M+cA+39G8d9iO4fj3sPjwABwAAAAAAAAAAAAAAAAB04psaT8MsGZRy542ShznMzUg/PgebeJu9IA 64AAAAAAAAAAAAAAAAAAAAAAAAAG37F477Edw/HvYfHgADgAAAAAAAAAAAAHQ5cxspI05dy4pzhb JukoI0iceEK7YvNf5b6tLSnxxpc0+jnDC/aAAAAAAAAAAAAAAAAAAAAAAAAbfsXjvsR3D8e9h8eA AOAAAAAAAAAAAAd1U9ZITepuliYnTbF7GIzjWM4No8ITEK6RK6XJVLaFgmxKuiNDWsjfFmtyz5Vm ozw+ePo0emX3Yjp5jjyStwCYAAAAAAAAAAABt+xeO+xHcPx72Hx4AA4AAAAAAAAAAABpaiGlLDO2 q+U776roVsC+NZ8OTeS8M2veLznpZaNp1qS+PKccTgtGHFNKbIn0pnTL1e580lkW825/n0Pskd88 a/T56GTLo2Ua2xYaeZi2gEgAAAAADb9i8d9iO4fj3sPjwABwAAAAAAAAAA7zobGiozHz771rpDVy zEL38plOlq1azvJezlH7G2obkexKcDhaEQ7TQ0srVy6LKrMTmPQpqLRncr3o8vG3kU24q+h5XUdQ 9WOJk/Q4k/VUAw1AAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAALqWTmoyqxHCxfRbPt4vbO91XeL UCJSEJR61hXXynYdj23ecp7bsK6qde1MHTnp0s+VE4zjyl5X2qPcGG15QmzXYcw4sX1PT8ihPVt2 r8up9ovy/wAeThH0QDgABt+xeO+xHcPx72Hx4AA4AAAAAAAAHWG5W5G9o3Xqt5YStpsXrEoEr2dq YS3IkuUrjyJWvi69HaqV49barmjSgw8c10Wdjx+0Rj3KR5YyMOq2Sszo5r2bz2e0iYuZrdevyztd mvAR7DYuBj/VfNd9ioDNpAA2/YvHfYjuH497D48AAcAAAAAAJDLc4zZfTLVHtEi5pZmBbOE1Lzlk tE7aaJ2srWaaslWI8tkxtvteDPOr6NhVDlb6qZNK2vqnUu5KwSFvaeUmzC5JztLI5bboXyxo0a6F /NWspht8tjk7tc6VdC2p8zifdfPLvwwM3o7fsXjvsR3D8e9h8eAAOAAAAEutusW4tPl7XeskpK2E L3X02rycq7p2sjbOdkRthb01tLrbtXOtZKZKmiu7ne3V5KtowYoZCqnQr48rK7l013HVpdcoTjpR StnidbSZngvTvQfDR2cdnk1VuDIpdYalrzdLP11+b53mP2dv2Lx32I7h+Pew+PAAHAAALOjl/GdG OF/OSjGmNcajFc0rOdTCOzZwjRonGdF5TCtdLdZeVU+c0VKTz7Ghamx3ZStrI9VXrNLSZsqF1S5C PUslVZxLb6LJxZcRchB25W7PmsSbopjzYTjv8ey+qaEo97Q5UzHZH5HM+2+O76ut7F477EmzD8e9 h8eAAOAADS+hWblnBsNilsYdojGyershlHPqrXfJvh52vnaeW1TuGqb5VO8aWaGoZjVVHRnbKtkb ozerSbUU0UwOPHriGgunh2SaK+XTJrNSunmh1mcskGar1wUdgrbz4x7Xq8yZG4Xls7G7XxruniOD 9Lj6O5/sXj3sOb3MPx72Hx4AA4B0LdLPevC8rhLPbR2cbcmNI9mkryFPru/HRxV066O6VujUdZvu U8lTnKe2lGPO2QZjZWydtNrux2q1NKnbKnhTexQPbNaSs51OxGv7Bpc5fGcsrLS10MpnOq3wL96a vIplbDpO5e5xmVPNR35/f+S0vb7F477Fk9rD8e9h8eAAOE4XMWuL3tmlYzTHPCvtaXOzmNVFxfga ityddQhxKtP350bUaWfPtVnk9DmlRZ7KfrpC81ZTNLb8qtnXzRNJ7gtLWfo8pRFyPO0Rs4Y5s0MJ BprOahFuuyM4JRkvt8s7GymCfJdR66WTvF7YV7ZX/Hb/AMvo37PsXjvsUPRw/HvYfHgADhfQ6y3P UybE3CnnJQhbVKsJnUrZwOE+0aiWUevqjZtXt869UfQ5RbRRfa+auzChddcrPcp3pWbdLHJ7l4T5 TMtdZwndejxK6fEm5rG261Mh2yyeNW1aNshTOnR5vWKjsLZVTXtkq7ErGpmNV+Vxvq/lNu7b9i8d 9i5qw/HvYfHgADhdSdH7s9ms9Hq1pj7KvmbsbqpLXsuaKOswMSs6po5kKVsUWM92U+r19RTWyoa1 hXTuX1Xxhuxq9NHVkbsz2028ra4NVC6wy1MriyZhYzNaL5WpCcqJpnoTdW1+fROZXz48idXnbreP RYx2dVuX0Xlz4j7P5bZdv2Lx32JfTw/HvYfHgADgAA0rc/dThamCudlsSqE9BaLscdjWi/vZWtzm kRmzWzpVzNLM1Ku6k5DLq+aavz9sdmxB7PuqX0F+mbFyNs67nFuW04LOSem+7i5aY6KhlZtQeRKk nsq+VtZe/RhskTXPGlrh1W+qbJdcuLZmsjqRT5De+Z06tr2Lx32Ke/D8e9h8eAAOAAS21dVMcLab Ey2rtUKzNkJTrS8oymntldk6w7TMptquQwX+f72v0F2LENLHqVxPo8uq5zdcNBrCGll1rqalbSzX l40k3XZdMqeoiiNd5KccmTGVtyaafI0x1MJrWzbcl7YlpyaVpgxU0oShy8pRrT30yMzQz5e9t+xe O+xcnh+Pew+PAAHBpXX5Nu6u2XnROxOMrXUc61Om1LWcBLszjbCynYjU3LszU8+2QnuYOrnNNaln 3V+M4r/O3aONujZF7vHuszXY0mu+LHE0K19EdTsewEHs7mjO3Rau+Ouzs6ZVaHlnRR2dPWctzWJs 7GuyVYUs02lkVWLez7mSv3mNdv2Lx32IXD8e9h8eAAOT3lHUxSvoZTLR2uw7dSxUqxuXY5psjZUl HNLF2suhBbUy3aezk2Trt52nDDTEtRe3qtqRUk+nnN3y787o1Ua56UeXwalxCYrWPqVtFO/Nu0Rv xtVG2SbObp9jZdCeekVHaWVFqNlJWdhdKy3Gq2XnKJ2llZulk+r9FnAZIbfsXjvsR3D8e9h8eAbZ bbMxXbGOGdtNqJT2UOvcRuVFLl5d0OVxmjGhmWpo+gQusyNmyWes9mx847mqzhfTZxyLWNpN3rVS Cd08l4ZMxzOv0Jo5DiAmrDJf7G2rsmyRpZq6uNprU2fbsWvzE4SklF+yhSPIzodGpI3v2temn0dJ ja3z57sQIYtv2Lx32I7h+P8AsHjwfQyztevmQuTZlGlimcmZSYoXlti9pxeya/aX3LnAaXtW1+pn Rg7efrZR1nijw7V+LpR7jNu4l+bUUWk4po4T9Fayn5Geksg082wqq2gxSzGM4TjOmctpraJr6NFB 3VsSYg18DqUrqtT1RWpSu9f0O3VUr7VGZOGTGAclt+xeO+xHcPx72Hx4Jb3z7jQ2Ys0P59qvbZ95 clbIhbGrjtVclxYzps613KpcVvijajFmNpJ3O0Kl2fSQczec2IL3LFFhiLdpVdUYYYRY5NqcbI9S ztjIs+ldnaKztOxjSFLEHmoytGnLINnOl6Fq9YzNDF21pt7Z6X0CORcvgiAJEADb9i8d9iO4fj3s PjwHeBzbYztbR59FT8yOfS9JHV50m0LeUp2/tcUJOZzByVtsFkoxGjtdhaOhPOjJ84YrSrVKO20s wmitrYzvFtHQdb7YzhyGbqUuZGknGr7FiLUFtrs4jrpuwtFZ/H7V9RKhfRVpddrX60lI5M9POBmx gAAAbfsXjvsR3D8e9h8eAAOT+i+aZpH6S7Ge0ebbci6q1UurL2aukqnEmqNCbJK6CaUZfWfhGvM2 8Qeb2fpCsd73NXDsKdfNVhVrOnc3STGzGKatPdq3Ofzp2NkF6oroZd1YLJnGLM6lH1KBOqKrWW+z 7NN0482LqKV4p94E4gBwAAADb9i8d9iO4fj3sPjwABwAAnA6PW5src13fnNHuX6NafO+ahpJszp3 N10FLtLI08/L8fazlbP0svQDQlCzLTNzfoM7QknsfQVXqLa4VVy9zL0pU9nzbu5xVjPyKTi9Zoto 812ezur30amS0g2p6alDbtPIrXgoBLMAAAAAAABt+xeO+xHcPx72Hx4AA4AAAAAAMLnT6VjB0L+b dbm385upOoGSh/OYlXbpnKRjLvouaGjkaeZupPUHMe9Wyvda7L08xxVtaiYkWM7Vr1Nb5fUlLRSl j2JWJNbPZtjPNWzWTzmbOAIgAAAAAAAAAAAG37F477Edw/HvYfHgADgAAAAAAAHbKjpZasHPraMZ iuBljEuV/qXMPUPPpxt75tqvt/MMS0fYQx9HuPNzu5nfQ3NPHG59Ipip8kX5R31NlVA62pnVic7w EWUQAAOAAAAAAAAAAAAAAbfsXjvsR3D8e9h8eAAOAAAAAAAAAAAAAAAAN6OGNLZyYAwAr2SpO8AO d6cO9AOcAAAAAAAAAAAAAAAAAAAAAAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAAAAAAAAAAAAAAA ACQESUQAAAAAAAAAAAAAAAAAAAAAAAAAAAA2/YvHfYjuH497D48AAcAAAAAAAAAAAAAAAAAAAAAA A3Qa0Fg7Ykw0CmJuRD5QbUOAAAAAAAAAAAAAAAAAAAAAAAAbfsXjvsR1T5v68D5A+vA+QPrwPkD6 8D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrw PkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPkD68D5A+vA+QPrwPmvpQD//2gAI AQIAAQUA/kLAT1UgYH+2SBHunImZzEYgqwYf2GcAM7FiTP8AjMBlTETkP67GMYYxGGODmIrGKuJk CG3ifUTBsEFqmJXW8srZD/QaNHIwT93/ABXVmAgTM5QgGWMQP9yzPK25qsotW1yicMemjC6vg38p jfRvrgxK4OkGfkuyDUiMQoEIOBhZq7K5VumyOSfyH6GNCJ0Hxx8AIBLUyETEAjdAcmKcGjYYBbiw 9IGYx/EqkyzASGGHpP8AmBSYEmVE5mZzAonSOMywHAU5qysrJlTddhB/Cq5mejsCDDCenHJIAgme hJM4wLiATM+sYiFhCwlVmZUQCpBgwRZSOPzKhMMdsAwxjCyxnIVSTAOv/J6wQwMIcQkmFCZ6YEYL KV6A9FsINdxiWDHygZJ6AmMckxiAMgzMJgMH1RYRiK2ZmEDOBDGzHjKJVkERupQyto64+WodWMdo YzYmzt8jU2ayQoJLFcxBiZPwBwY/1yZyMZ56kYiIoYAdOkVRKxCuV+QYCu0JhMcMw/8Azuq1qicY yKIB0A+4n4EQHMyDCBCojcBCUMYdacj4chE+qCcuKfFBkkxszE6fBusC4HLmXHJbDE6j6EnC5zAc R+kFkzGxHTIXkGQZh+kDkGi2Wnp8U+pEIhx8WOAXyeq1oTmz65wgbkD/AIq2DMjBRTCriF2nLqEz EHQ9SRDKm6k5+QHETqG6RvrGYCO3Ss5LdVX7RU3Jn6ID1VgQywMAC0IBhYiFsziZUTjJmIXInPMr UGYwvyIcGyzJzGbEZsEljEGClvOy7/FDxYEOrriI8DdDxaFXU8wQr5jqQaVBATiCYGhwQEzKV6v0 +VjDP+G+j/Rvo4PBGw+Mi0FTRYIesdShSyMAwywjDlOsrAdETB45BGJ9IGleCa64x+74scD4tD/i T0+q3KUah+SModetbo3qLzj14K2EEgOuDk1hgghaK3QlTGrMIIlJ+5ulPyMYfi3wvBBRuS3JzWqx kdxgNxsCsa2OHU/bGr5CospNYMrGA4wGiNgswMbkCr5lSfdYcVfHHRh1MH0P1ImOrpkLlGYYmxQG XXsOLK+vD1BXyQsgIqTr6XE9RFJyw5BlM+k+oUZi09aacS9uvxHVWWEQQ/AiMI6cpX1BUgvVgr94 9PBesGL9sHGdMOYPqrZhAaMk+k115NXQiyywKSST8VOCywrmFSPkxCvUpgkcgqiccTksXBDLCZWe jjHwBhGZyjJmaFf3E4Njcm+VRyBSFIUhQzEImRPqDlZ6nU/RziVkMGjHqjYJGQy4gPVDDSWleo+K lCS235634kMpn/LCFYRCI8rjzJz9VeVHBxkOuCDEORnqaiTRUSwRVUtiNYSf4AcEXCF1MI6FepEd Yg62LCOtbHFixfrWYwBBUg1g5XXZouv09MVxrwI9pb+QHEVsg/UiMsC9SuRZXgosZY9eDWhgqJD0 NKqeIS0cXsANlhc/zAkTJnIGEiBMxlwCAQlYhAy9AARUULaVjXEx7Gb+sGIhYn4Z/wDl/wD/2gAI AQMAAQUA/kZ1WHbqBS1H/tlgBZsMYwJPHEyVauwWL/YsuVQXZ4AJgwrGXpXaa39eriCGH9W58Ank VWKIFhEZMwa2SlSrPTYHkJygM5rkHP8AR2G+5RFWATE45gWBIEgWeiDDSBCAJZSHjO9anacmi5mI OR/LacsgiiAQCBYBFWKkVIEGLlInAwpLKeQ2NRlNdvpmm1XH8jfRx9yRYBAIBAIqwAQHEQBhZXkm sCCrMsQCWrkWqFZLzXK985+v8RYCO+ZYMFYoiiARRBFBMr1rXiaaLDWMN1IQksoVbfrZ9NgRhADn Us5V/wADMBHs6qMmyIIggirmKmZRSGNa1pDcojWhpZYRApMICR1cyytpYk2q+hUwlhFusSae27H5 mYKLHMXqaxgEZKLFWVqCcCKOlfStOgJOawTGpeVq+AiLLLVEtuyLCZf9Lf8AIZjYMo48/l+ksfJJ yUSHJipMQRRFWBunqdayCLaQsKFSr2hGsthZjHaM8dpcQQ/RlIEYAxhxmnseonyWthW6lBghcRVi rgGKIuAAYATK6xioS0EqWzNU5QqsatTHoEtpxLFl+RHOTicTGrBGqxS35Lus4xVCwYimep05ZgMQ kxRB/jWMJS3TOZjBNbpBe4h2cx7bDHZ47TYwQfrM9WsAmovO75LD1WzMWeooVLQw5ZiCAROhpHRj hhkrrrmwgqbFDSh+SvVLAQWdhGtzLDL3Ih+uAYU6MoM7fVx+RzhX5NAj5UkzPQDoq9AIv1Mq/wAU GbSOEqI9dxyDfVSyt/sER7a2FgWWSx5e2fgDFOY6TTflV8SAQ9I4leoUkEZigAL8F+oGS4wKDmw9 QQyvXeDCMmwdfUIjMpjGO82DGJM/4C5gqxLOYmgx9T5OXEH6l4vQKBB8MYFX1PUKSjV2AixYOhW5 kjWIwsGIzEQvmWviXPmBckpBkEWFZa446FRA+TZuOT9KjgIYpyFi/X/hTgo2RYIj8YtgYWCCwiFg YbMRzHsxLrMgIWAaDqHQwkzW1XvtuVUb42txVj93/FfSLKzFimKcw9CjYOQwzxIbE9XIfrOZEZo1 nS151adVOQ0V8QMrS1RjtaqtVjcn+OxZyZz1YdUPUGIYDAYrQ9QDAxEY5AYicoXljxrejW9XJygx LFyAGicCHrxGclaV4afxtvin72n1TOGEVsFWnKBorwmBpzxGeep0NozbZiFsw4h+8IwmAYQQzZB9 U409F7n2SFr+NqlLHBBbqK/qy4gPJf8AhXyofMWzrzxC/QW9WtxGs+03EF7CZnkg6lh0VyITyivg kgxxlqtJAaQFS6zm/wAb6+ag9QOJZJjmAOLEYb/ElirWZU+pyWuzJdyD6pYIxw3QqBio9SpV/wDh hMT6hWImunqX1Vgi2wsflvAVhbiCxRPtn2sMCWLleakfa9Q5IepNn+CAmKAHuxyUdMlWbDhWOWAI zghWiatrzU0xULLQg+a+n1Fel1LKQFJxWx5XNhqmOGPJkGGsH3hRxIJrqMsOJxDIvSMIozMxORHE s9FIVUpxHuOP4SimX66gAENbllpefRs4a3EU9OZWf4s/UIcF1zM9CcH0rLFp03462lwI4Kbrww/j IBFtBDvViuqWCE5CE4RhLMRh9qt0cypS6W1Mk19V7SlSgMFSO5Y/zEAwqCP9Uqz67FX5VnU+9m1X BtDqdegmu/ScCrRsZk4qCymM5P8AWfXrc11V1/Diuf8A5d//2gAIAQEAAQUA8l3tjt/Y/wA+8nn5 95PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5 +feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7y efn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5+feTz8+ 8nn595PPz7yefn3k8/PvJ5+feTz8+8nn595PPz7yefn3k8/PvJ5415j37uHfJ5n7Y/rpW7nW7JuX yrx2hY/j2kRf486i6iyh/wC94Z7nnmftj+rXW9jdu7J6jVdq1daY4jitjMnGYYDu2hXtUMpVv7vh nueeZ+2P6YBM1e2bGwdHQTWFetathqYtYjGDgiqqMzh1LdB3ztzI/wDd8M9zzzP2x/S19d737f2e nk2tShFNdBal7C7PxVxWOSWxlr4rUMN6kuRXTuvbDrWf3PDPc88z9sf0FVmNPbmM7dpLy18Bj9t1 tbcnaxkQ+lVTl2a6pQK68uvIvWyixiRs0rYmx2i1W1+zX2zb07dV/wCz4Z7nnmftj+dVLHU1lrCo QVBoCg0LWjJY/q2s9y116wfL2FrFrRSxRyKq1VgBGZRNjYrl+4SXusZqaXtHcNBUT4rr3MhBHwCk zg39Hwz3PPM/bH8+jVyepItZYHlZCtlsb1riW4V6w4K13O4BEHJLJwqQbF1FbbHcqhGtbNv3k1os wJUT6l2k/o7faeJr7BsMjdprolQCm/t+tag7Buc//wA3Yqj1cZfqKQQQZg/y+Ge555n7Y/n0VwlP SKzLr/e9RYiuthTRpnCh/Vvs4IlQS1GetTffTXNjZLMASWMxADkpylShHG65LEl/Rt26bO02PE7X sINXRcAaigdxoqNdy12Jv6l1JXXstavtoEXRTB06ybe3rLK2rb+Hwz3PPM/bH8+iuJSVD18VTXsF VGqfTp01L2CwHYtsrqUKtlbMAL70rFlpY1oLLH4wt1+sKiEiHACsQ3EvNMlE1rSAWN1xNdE2u7O7 XWPaRgT08i7V4MlalfTdo9IrFinlt0c0/h8M9zzzP2x/MPrqjCoFN9KizY01FjahH+w1h9axa9de FeWsayXbIWO4Mc5KVsqEEwqgUtxhnSO0TPLWrLwIqVrtIiWdwFMbuDbScPSBbAorDR7aqw+xUw5o jlqxXZ90vrYHII2E4W/weGe555n7Y/mH1oRTUAVZRxsQlLAnpWpxqIYPa9iibG0WHOYYytVAezJa 4seTs0HWERuMDcjqsolTDgFrYbx5X18devkCOSxdi+4olSxV5SzTWwMltDBVcNSANrVCzerbn/B4 Z7nnmftj+bXrDtR98VjEOHQEMLAreqS3qsCx5BU5FwvK0dG5FFrUQsApcYbJg+4uwEZgILetdk1d hmV9oKrEF2si9Z0cozPKagIiKICpl9NTC+p6mG5eBZfbYLtK60P2fZUW0W0n5vDPc88z9sfzagM1 CQAcrWyswf7iWY1nr1yoAAcAgmOWdsHjy6OXc5VAxhdEDWiO4wbBmq37tWwAO+TY4htrrDW8irlz RWQFIADs5QHiwE2ayAK1ZxQmVrGPTBG7o1X03Vmqz5fDPc88z9sfyAZldJJ10BbXcAt9sUxZnr9I XzFVsIoEsHRieAwK62HBrAC1gBsuWNbDaYtN1kTQOE1UWVsUe2wxnbPIAluR1wJW2JzLTX1yK6xi Molq9LlNdnEkDoCDl1BXvGqfm8M9zzzP2x/GqljXUBFUmUo1djAo6vzrWKck9ATlq1Z3VWBPSx2V UezCBrAr3emz7XVrWaKtjlNJzKtREnECZxAclqsmwWciDCpJrryUAUKxcrhZVtfYt1cstBH+zylo BFTkTmDGuCz1OU3azx2K/Tt+Twz3PPM/bH8SqWNaYldTErUA1lwNrNyevpWnQVjrxLypFJq+pcGu yxQtlwIVFrF9xezZD+tXUHKagBStUAwJmZjnEzwV75yJmCYEJmFrAZnlRWsCxTEKRHXHFLlv0zFY iW2ACtTYTXgmhiV0xYLvHdS07fjbVrZW9T/Dwz3PPM/bH8KIWNdcqonECMzWNYnBqR0X/H/gYA+t dfUmxAH2enN7nVErj4MI4yyxr71qFLcxAxJdwgFpaNaCwIJscEA4sVYqZjFa1++xqqcBKGJXXGFq xK6QQlWI1c26uUJBiPdQatyph6leEsXLNLWyO96ysPh4Z7nnmftj+BV5GusCU1AADAvbEIFda/ey LgLjh9ApyXZQGuxHZsVa9+wRSuqqu1rYWXseGkg9fbcOyV9WbC2nFltxVUuXkM4sJITJevjgsFHp FylYEUCLiIVw16CV29KXVmsIU2kMLk+5QGR6YaiArXpBtuAdhWHcCGqP1nhnueeZ+2Pnrraxqtfh AoBRcADowFluzZlqki5wP/UWMrV+K6ZUDVQNaikaO1XVUbRbbtWcAgfFgYx0xeEVgUKxiCNgBpkM vCspSFYelmHXwVoMVAsBE5gT1gJ6zGL6pldTEpTYwroZZbW3AMym3rB0A6w0hp6fE+n0ejM7hr2C o/WeGe555n7Y+fWC1oqHHphTxEuOA9gVVUsVGITmf5TUoXF9gLKgatlPHDVWPrVBclVessK6lVXf DWhGDWiuU2iwWVjBoDNwxYUOUJxr3Fg19Sw7Kz1yZ6hMUOYtUQKIgzKgiisjC9SwE2qg8yxjL6kq zxH0OGAXEZJZXyHeNA69k8M9zzzP2x81ScjRVOJyqZa4+mLLSzPlpX0AbJBydXWs2HfXSlq60LlE qLWAh3DDgzAIDGb04CGmwwVbtkMHYsy2qBVYWmARcgW168FlNZVBYp1kMOuohVhAXitZA5iFTKwh lVKGLTaIrNXOYYX/AEsyrtAVnKZGF+pMfBm5qpsU7ND693hnueeZ+2Pm10lK8YSAVIQXM1r2FUi5 JzEUma2s9z6Pbhp1bdNRmrVyttYMbULLVVza2lQpRq5wsWxkVTZs8j6Lk/6iYNQa+okRWOLeS2s4 IPUaVhziYzOAM9EGehiei0roJAodRWuTWbFIvtCrs8msbkLRmL/6yRkWKD62YjOZxsjJYITieQao I8M9zzzP2x8qDLadeWzklgIS9psNdKKpJAxFTJopa6ztnbatWvgWfudRRNYOteDmnX5xVXk3qJYz FhY5L23taxrSlBaHnUSvrs19SOjbSgoDlVfMoHG+Zx8BAIoGUUREGRSGZayprHTb14LHwxM6gIoa VVVmKiCLxi9S2DLkGO6ANq+Ge555n7Y+Wpemv9qNYECoY9+BgsQoEVcnW0ix0aV17q9imxbdinXX und6dh0dSlZbk+y9dlexQz2XqlhtcvcCUo4rN37UpBy7EzX6XVkAkw4ZQALHrzHLqybMW1XFdgMB nNVn+yog3GMrtuIru9OVWq5QAy0dNivqq5hVcMjIU2FVl2VJRuQU8QTyFucd2t40+Ge555n7Y+QD JQdUPEKQgLs5CkkAwVnNIqSHcrCjdrjd5Sqf79+7YRxmuELXWmtssaS4D0a5dNy/0VpsJW5uJ3mz QlZVbMCOeF/TmpgmxVA2JwWxXpKFUQj/AF1J4soFKOE1BK9ZQP8AWJiar5pL1zmnE3hg/wBxY4i/ cOMFKgghZQ68TBZgu6svfbv+/wAM9zzzP2x8lY60qWYcawK2sC1qteRxaw1g2lilpWesM9XlVIY6 dlVJutzMs92ubTd1rUYV9O3NVzPsbmuoVdw4e1+RsOXuXAvJBWs2VIcFfq/3LZWyNqW9SgIakiLk TlkIoUrY4NV+JVbyiEThyl9f2t9sYxupTocQrCgYNSVK22LFtDRn4julnqbvhnueeZ+2PkT/AAo+ 0Up6rlVwwKw2rxBBZ6qjNehWe6ipYASagAVsIlt2Br1vZcqV61W3cNi+9GC03GqjSGXr6C8ho5zb X1exQybY66RzS9amAFSHSMoaWE12VtzQDMakNGpIgAITBgqS6NTsa4ovDLXaFFj5Fh4s7Hly4xRi Z+AEZY6RgVm9uCut2LN4Z7nnmftj5KwTKauZSkiekMWUhkSkEuiBcNFZwwzBlmYlQljWCul/UVVQ dxs4aejRhbaVeXIKqtfIi/8Ar2bWE1E9S+2t6XRlsTcrGO3n7CMx1weCsMWJL/ulNpVUvBiOpnEG HWDA67pKlzKuYDa9TrRcAbXBWzqBmKxazp8BB9cZhSPWcd/RlaeGe555n7Y+TUr5KDxAtIg2LI11 5li2ZKLitRxrX1JZ0NRZRazO+uyaevpa/wBhq4bHcLTZTrKYpxN+wGylW5F1C7SZna1za65j0sss /wCwaAAAjpkMpSCzII4T/WreHVuUr6qst7qa9pxE3aGiiq011lZYn2bK8gl4Ku0Zjmrlj1HWLYrQ NAwi/AjI77rGzVnhnueeZ+2Pkp2XqibnOKQwoccC2XYuxwgUjkQQsY5sUBprayE0Ya7XTjVsWCzZ 2EPp6dn/AE5IGw3O2nVVda1gh2Cop7Qg4lAQwxNnNdlLf9ldqsP+LRkV8cVhTH13qlFwYKEaNTyC 1lCiI0VErNTKRYmVtr6WUgla3YsgCo+RYQjHUQlabVgqsMRigN2Z60vVbqtqr0djwz3PPM/bHy0M AahxtrLMtdzKb7AWe7pWH5svCLU9q1atddPNFTt1AdmwqMOF1jB0RTUuzbwXQo/2dvH29xrlrs1e gAtI+rpmXay2Aaw5AtW1d4xxDD0FMNZU1mXUK1uX1zXYWi8WnoqSigy1USVXCxb+sY9QZ9ZYhnIW OAGYARQMcRGrBllZEVsTvahd/wAM9zzzP2x81bgrQpFDMoOTZKddRGVFnpiywdI9VronaT6bKalV gw235bGjrG99zKTZs9VO3rXXQuCu5XzFw4PrXAytuQlgIN9BsAw5souqFF5lVytFQMHoxOPKV00s tvbGqr1by8rGIR1t6KuwKrbrFaFsHHQLCsariUszZzMSyKQYYwGLcK3cbhdt+Ge555n7Y+bVANip Y4CKItRUu1YAqNz6tCIumEVrUBFb2xCba6Gyjhr9ymhaKe5VkSv/AK31QoCSxczd1DEzS2vaRK3D RlDLwKHb1i817w8s0q7C1V9Rq2XWV7aNDQrgVMJUxE3NAONPcyAwEtwRuJk1bTYpUuSOqiARlEso VjUMThiB8RLA0tbp3bcFNROT4Z7nnmftj5a0ax9TQrpVeIKhAHI4V0+s6UqqUHrSeOxUSyA4lK4F f/XZ27XVdsdRt1gi1A66lxC1MGLJkWV5FienYQ1RptlbZFlYIC4m1plZqbDMwZTG1abJ/rPVKbuB RVcGvjMfb3BCh1ds2I9oxe6sxXga7UMByB0gjCMIRFsKw4adBLrOFXdGZlnhnueeZ+2Pl7XrxDmO vFk+rr/1UnBBlB+7aHGzWbMuyppOA94Ldt9R9is9LVyNoNXsbBKPrXkxCGFlZncKCZXgSxHqmtsY FNiuLKsz7QNnQLSjYyVbMXJBqW1a9m/UZLOQLdNpFsVqnpdblaMymbHMCq9qnquVgCYpxPqCsZIy kHlwNlyqdjYN07m33Twz3PPM/bHyaet6ppVVDdDaMrXCw9JD/wBitkUnDXLmzUJEu6xMZvFZu1ia n17AysuZ3PXEo44/+tdrX8pjkt1IYX1WUvU62i3RcGm+xGo2kcNUDFBzu6K2JTe9Lq0Ugy6pLaqN h9eznkPljb0YJh+IAsQBrKK3i+tptRt12RXimfWERlEsX7d1iHGFTds52zwz3PPM/bHyaVfHWrHS wfaDyROkP/qUZrrJKocNeQGBCXAZUV9NqsqzEsmncTKyGG1SLEf/AK7rdZbKkseo6l/IWIGXao9R Gayq6lgRfrpcEp2KDRdY4AFihSJ3LWDTRv8ASinENhI7hUzHR2iysTGPKwwJkWp0HLPBXD6KMtVt 9cTZRitsVg0aW/47fW/Zs9OljyaeGe555n7Y+NNZsepAK6vqwBppaKMOFylY4tS3EJ/leC1dg9Sr WdXhrUrt1HjpnlVWxpfVuDB06b1Cg6uwgNmsLE520vq7IsVlxO4avNaLDTYpivLKQRp7KmZDR1Rx v6Lh9PY9StnwbWYKchxuchUvEICYowGUGWqayq2Ia3DBalMemtwaCk5MpSzlHmx1v7sxCfDwz3PP M/bHx7TrZSs4ijD1jKplXc/fX1F443fSxcRcMlDFV129KylxYl9QdSg17bALF09ji1FyWJfUjrtU Wa9+rsiys1UbSvRdrPruAr1qR3HRVRo3kTJErZZt1Cp9baFk5hjYyldrWs17adlLVLgQohsqtxZW QQsHwsUMFr4kVBYrkFWBhxHQGElWV8q7BrO7t/2fDwz3PPM/bHw1dJrTrKqKRxtKyvGdheF4GVpb psjKHrKnGFfBswtzk40dkQYM3KOlbc6zWZp7QUpYHTe1BsIPV07KnLIli2oahQ9FjGP9d/QZZqbN hiWnIZSibDae16nIM+DyyW1kLioA7RFVdgcHQtFlatB1mIwhAiGODkWFYlqsDjF/Q23cEUYncrOe z8PDPc88z9sTQ0FKV9DUcNtjFiHK1nM2kZhS2Yn+TlfTRoDwNdiPLFLpVZFPpWa94YXJyVzbVezq F2KfUna9/MYgzerXGtctN2Rk1pdXmzUtW1bVVhO502V36+wuwgcid1r9QaW4VnqARWE5gQMZsYet Fq9Om70La7gwV4GmOjrFBhzi2sLEcofVAXY3hyUlzs2enW7Fm+HhnueeZ+2B9dRwy7CenYCAzott VLGIcFcMv/rszgniVsHCysgg4BzCSttZDrTedd0sFi7tXKvXudCjiX0ETQ3S63oLF3tXYqOlvJbW t4rGzWuxXp7RrtNgEs42I6W6dw2lZfU9Rbg7NTba5qLCITAOjgS2oB2qZ2qe3Waq0OFbMVp9RgRh LCvFtlFbY3GsCIsBAHctjp8fDPc88z9sTt2xgti1FYiVvkbKlGRgyqemwqrEfmEYYsRGRGwS3KIS htQtK7CE+21Ne1tS0OrLu1cDr3rdXTYStjvqW07ld1djK43Klou17g9aWsB3AFLte4W084uHn+rU C1CGW1Mp12xaiGJ9MxhLARHwIqC1ON2s9OwlgVwIGhjGbj8KV/yC4n0m1trWLLGsf4+Ge555n7Yl bmt9TYDrfWIjkRbAVPKl0s65Vh1qsDRWzLgFZW6v0gs6K/B0Kqdluulsq1ewvq1o519iuyXf91On sGi/mRLqxehS3VsXZ5TZqNqaj2Iy3jkjdBljw6btfKshUetwyVkwQgwiPUCEbg5COLdTjKryrJbi cujfTuVn2elziJgbuyKA7s7fJ4Z7nnmftj4aV/A6LV3130tSwfBPG1TyqZLBLFFi12xXhwyqY2St bZXHSluM5LZWlxpuW0TcpBGtaylCeOzTYL6bywVwYKlYnSqzdWtaWVNSK3LrW0r44z0uGV2B9+nc Aa2BghJjCYlyYNN4U12I0s10tgDVNVeFNzgLsObLlgxx3rfVv+Xwz3PPM/bHwVirUM3AW7DK1DQv ZUXb1l5MhquBlqdefStwZaOJWzIa0I6qHW0Gtq7QZtBg2nerVhWYXaL5rGwkvXmubPUostJUnC5M 3q2Jv2+VOq/JgzKUCkDpG+u3UA6gKde5LUSzM+s4gxxiOARfUUaq/EqsR12VVlVww2t0KiLgDpNz bWmsnJ+Xwz3PPM/bHx7bdkIjEJyZTUli/wCuqWMgC3ajKKg0bUJmHqKNyj1WKXViuvcVgFV0bSZT fTYBSmLKdiwNW5IH3R6/s2P8tU/9dakxAALFBm/UWspX07K8yvGIw63VBxZXxKhgarfVStugMYCW A4KZS9/TsXbSs7HcXtCvYFsGHXAXc3lrDuzt83hnueeZ+2PjVY1VmreHSsrkHEYj1ihKvUzytBW/ py6ko1AUzgeNiPhhyuoQq1YMvX/rsWtTq4ZahmInEOuRt0n19PqlLZg+mBjeCh7Tiat3JKmDfAiG bVYAqYcm1rEI2rFam3mDD9bLFA2WW1rNcGKrIqLkXWgPs9wZozFj8/hnueeZ+2Pk1d23XlHdaiw2 q7JZZ91NgKZAivzuVE4bQxNZQWpq5LevAFkDoozUow6hl3QCdPBSjqF+h+nciyW6D8HTCsn0I6X1 B22KnVqmKNRbhkPIYmBm5eQtDI+vsKRs1tah2Gqj90tWU7SXV7l3BFGApBHAEWsNem257G/h8M9z zzP2x81drIVuDBL7UNXcb0f1QbKzmq1GYInp36nVL6S5sQBqX5LWMqRO4Jwt1beN1WAyxvp3Gguv +q6TXt5JUwIEcfdsUixHypqJU6+xggEgwzcr5yrmrKL8XUsKvVVpSK6qtjYe3YXGBiZxO4bZuf8A i8M9zzzP2x84JEFriC5ppX8k1LM1W8pavBdOzrcpzbXiUtxmtZyVhO5V/aVxKX5pWQyn6OoYWJ0r s9NqnGVOQ+ckNjaq4uPpWxmns81aMwAc9NtuJo371m7u7d4WlHAUkWf/AGG3aag3cut27db/ACeG e555n7Y/i1r/AE5pbHSy4GWPmaDZN1eUtRQmcHUf7xgrsUrYj0ItarYW0b2aDqGWbdfE8gLK34zV uDBhB1O3WGl5KP6zA1WjNdiWpYuJtXpWi2m8qMS8ZrpE3dtaAXYn+bwz3PPM/bH8ejtFIdgEW3Tt 14Z2cGhmJiHJqcq9TZUzaX07Kn4WP9jVOHQy8O6XDi1dgK13Hkj80YMI7qx7guvFbotr1zV2PTGz vqF37SyalgVvXqBa2qum3uEZmY/z+Ge555n7Y/jBII2bADc5mlearq9wGp7SS1nGyt8zStymQw30 Yrc+H171ZdLYFbYBFpxO5KFaraXkt4ZqLnVefJduymsbW012wti8TbSFSwB7NyipbbntbJmTC7MP 6PhnueeZ+2P59ffKD/8ARql+61jUdwAmntZCWZlpDjuti67U7zIT3QGdr7rZshtisDu/cksaq3i+ vZpGW9wGo48gJm13Ky6ZOebQsxmT/X8M9zzzP2x/T1N464q78iDY8gsdLLbLX+FN1tD27mzcfgGI hJP93wz3PPM/bH/m/DPc88z9sf8Am/DPc88z9sf21R3npvxKOF/u+Ge555n7Y/t+Jlxra9LV6nkK Adu7Z2HW2tO7tvaNarv+nTo91/teGe555n7Y/tdp7N2Xc06ex9hoi9j7CtT9i7BZW+j2U6B7D2Ax /HvHbG7nra2puf2fDPc87n26numh+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2G frPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9 hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/W fYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP1n2GfrPsM/WfYZ+s+wz9Z9hn6z7DP 1n2GfrPsM7Z4J2jte/8A+f8A/9oACAECAgY/AOpVxhR/V1Gk4K3SbwhNEr6p12E5nljpRfibrgq/ vhr9PGG3clrTREtVaoisybucVO5MlKlX4+pT+y1sr9Cyi3HwnPqTFbkRWZ1JckLGomtUNO1eKUzI vGlu7EploVt9e4oSP0kbPTruuxOsqhq53Kr2zIaa7kW0tKU7m7PFv7lBONPqab5KMVaFXqfHqNLp UK5PjhXBCvW+vRnbCM0sWbsRhRkMqUZDqh3W7bZ52zck2qWV1eE9CWx1KMWLT3WaBLJLJKHBQruV JWfUo5zStHlnCMXbb+m3XuyU9cNYjbCuuPrmqTCYnblfp0WuSXc1bvyK23S33Je5L9BMT5ySQ8Ks 5NihUkri54jJ6VzRhpCW+EcHoInGUVKFUSqrNUS982mTlsa4PVsjBsrRjw5KlGUZ8rWu5QVywptk nJQrlbY2Q+R3Mae7GucZRDJRTV7FTc8ljOENFBZoWT5OUPsjtsRk7ole6OGUqijg8b36Xf8ASpDK 4ySsEssYsnC7abcEuSSOSGSSvdE2+5rKPj+rghiT1XQfrneMCXP5kkbo7kM7o8blJ5WOhKo1seSV d0JrYV613yVpkTXHQjD0E1oRudyLpoK+zc8X8bl/tMPO33JR52+5T7HktGMpkmStRQR2WSc8PBRu eduq1R4OqPxTGm/kifuhXLR/gO16XEFBSNZIeCb2PHqSv1I8WSvc87VRnjcoa3JWoruTsUy98Uid WMl75ZzySiR24VI+2eURd9yUS9sG80lCuWuOmKT26GgpUeo7URbnroajzRjPYnNFy9ygkJQdhxv0 ZRVFOhGMYQ8JiSNGJ7s1I+mnCUhSjyeiETJP0tcIPKUyW/YdBU0K6fT1/wAx/9oACAEDAgY/AOpN zSNX9j4ufq5bgasov5E196mzb/ATVHaK5b/UuKslyP8AITmps5KL7Er9L1R5eSglOU/poFOMaIpE FEVIVp5W7bYUOCPomj36NVjX8CNY3NTWnX+6Pbp1whk6pYSvt1WNdOuGmDIaTPgkhK9KHuielXBX LR54SNPE+Tk/+aHQiCpUePYh/t6ddRLNP7Zqyikjcg8bXTCNbvyJK4UO5oN23O19hW/2VnR9D1J4 Je5741ZTTDw0rUaVGXJPUhtEkR49yd+XhCWSh8kKsV6CQpIy1KUKEOr5E1zgkou7s+X4G+GmLxlH i/1W/ln5ufQpRHJPLZM/pK7jtf7WaGmaDUbkUcw/fLBT79CBrjCP4vB2s8rXRicSUtr3ZwVbKjxq Qzla5W9kcV0Kk8EqmWeT1GXWvghkp1HY/wBpNuGpXBrJDLr+0ZJKGqJn7DnREorltT5HvaxNb4cM bWp8kVKPCMkYJb2uMkM8rdthsUIgWRIUCfCwnaaEMlVOGRd9yVjQrjKdSZLrdrlP2yv0HO+yPG0q 5eWcO2HYhuHsytUVphTDXGSCLiR3vdQsvha9NSeRxrgs05IeFcWNp1W2SGW2LSfl6HhaoVtqWSm9 MI4H6wNEdCUyHhGDHhwyXS7lf8xktuiJTbHdy8jtX7BMfca5J5PTLDxjCHixYThEE2uCGWd7Lfxy O2zVasa/kegnxRiZH2KkdNyySEq26ehGMohidy8bNWW/1r/YydmJrY8luO3+R6He07i5R3IwkjBX FKnA/wDzk4u/Mh0wVq3Ym/lB5OEkN7aLJ3Q7LtUc2vUlE7rUnbcRByJrR1JWq1Ha3ErCuvI7Xvoe hUduxGMnP5kMUaW1JPGfjbpmcpdmRcpISlHlayjEm6rQTt1RF1LkQ3W3c1PJCcLjCLtCVoySSd9m Q8ZtUyTESct6s8bdfyz01RW1iY1tGLwjka7kGumhAimpGDtIuIiRWrVuBWonYi2nfpQ0jytUbMfq eR64JiuWELRsnZiIe5OCaPK1SPzo3oh33vyuenYq0eNkxu+pDwZ6PF4pnizuJw6ExqeTXjYt2KKJ CbfscLjr1Q1FGOFInA01Q8R+I7Gq9hedJE7GnBP9j8bV92K1Ki0IdqZGi4X003I+FsYTCnn/AC// 2gAIAQEBBj8A5vnOVkIb+zGJhIgSAJnGNj1rzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwr zMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPp bfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrzMPpbfwrlOT5rfjPY3pSE4jbhEkCEpXA 6OHP9yPiQ/MNEEnoTmOiOZX+dMv+i7MpeouidmRLZhGG5Egj8/yHfl4c+HP9yPiQ/LCMASTkh/qK ZRQMIDUqinQhS2JTwZ8lqIfMBSltwbdFY0qUYyDEXH57kO/Lw58Of7kfEh+Uon0tHEoCEQdw4lDc 3TpawC1ykSBYLSAT60xunBLZLslwmmKGxX+p2g8Je10H89yHfl4c+HP9yPiQ/JiMbHFNKpFyo7UH rSiB/lmtZk0BgtO3F+lDWrUGKYU6ke0T1rSwLWKMJUe8TYoz267ZqRl+d5Dvy8OfDn+5HxIfkWiH KBnjgnAYRUoAMY3Qp2jZCW5KgrpCA240zNE0qnFkZzB04OtIZ8lqapRIOnNAxLkJzGowREhQ3BRO z2o5Yo65DbA/uK0zqMJCoP5rkO/Lw58Of7kfEh+QAFynvLNCSGGq3rRkSTKZqV83cLnAZIFuw90I ipRnuBgbAoQhfErUQCc2RiUf6le2WyRr60+pwMETEMndyh8z2cHXzIBjjl6GuMSYjFV42/I8h35e HPhz/cj4kPyBmbBCIWv+MKkKO5I/5cTQZoSJbbjXrWmA7JvJRhAaiA1ETuit+pRjtua1yVW6SiBb MJ43OOK/zNXULJtuJL2Wo1l+wRJFUCe10J47Yj11KFySgZgSDOwqy1QNDZR3JbkYQliXdRMpieaa LMn0HXK2gVdHssMNTuhGW1qOBH/2tM4aDkQtUaHJMfx+Q78vDnw5/uR8SH5CIzqpU7RstMcfaKjt QFMShtwjqLNRCJrLFlKU6ICAcYnBOGBWqYdCIYJwHKMjV8EZzoTYZDhX9MVZhwByWgHrWkjsO9UI iQEY0DYoR2tqZnG5wWiW1IE4kKMGaWJQMqlPEgSF1oI+YLLVCMjtnodlYp5BUiiNKoWOSaX4XId+ Xhz4c/3I+JD8gPUpSllQKRmOkBdoPKVgjKXtkuQpSkGhg6EIVBuiHA6AomYQjEBsl2W1HELVL1Iy NRG3Wr+oK3rXZHrKZdnhQepB6KnspjbFB6Rbsp/aOdgvl7WHtEYKtkyzda4xbMJ0wjRMB2k0rpxe P4XId+Xhz4c/3I+JD8hE5sFECwFVMn2RbrUxKoiWBU4kvCOKjDbqSagZLUPbOKG5MObsVfTALTC2 JXaKaIfJAEsFSgzRLNl0pgK9Krcr+vB2qg7DrTA0TO0jRCBLtUIxj7VgFpcEmpzdP+yEpBlUgDI3 WZ6lqh7P8orVGrovR8U4DpipR/B5Dvy8OfDn+5HxIfjhPYxiP1W2I+1IVXyom90dmFHxUdsWlV04 HaNynkNUhZPuGuSIFBmrepOQwwWuRo7LtFoiwQER2QnNhgjI3TmgT2HSi9cgmFFU1QBRBFUNoJol 5G61bkmyiEJTpFEbfY2v7k/tyxJVAnAaSaX/AI81SqsjOFDiFrwP4PId+Xhz4c/3I+JD8ck2jVaR ZlGZvYLVjgtd5/0XzJVlg+C1XXZoVWpQJNBgmAXaPUFH+MQVqmXJzRIDDBHpWQQAsLkq7nNHBXYJ xdByuzWSO5IvM45Kl0TMkDNPL2BYZpo0iMAneqdV9lPD9M0Z7JMcwE0u10kJmd0RpZ04qm3ImPp8 h35eHPhz/cj4kPx5PYhEi9kIZYqODX6U4wtwBUjiqo/sjOQdUwVASY44BAmpK0uwCrUp5UGAxK7R 7RwVOIT/ALLJNEetV9rJPK2AQA4OmjRNkqokVF0QBQ1CsxCY16UyImB/0nIqUJYFvS5Dvy8OfDn+ 5HxIfjVUogYJjgE6og/rRbEfsgiMSq3RepKZAD1qT3k4YIaslT1p1QueFE4FE8jXgwV1dk5qeDld CYWCJN8VXgUJR9l/0QIVV0LSvmRFjU+lyHfl4c+HP9yPiQ/EpwYDqCBIvRUxXSE3AHA0Wl2a6d9M RZk8q4OiicU2JTQZ8ZHBSgCGBviqV6SqlUCqVUOUwHFwWKYyV/Q0xshiMkImQC9sOjpkHyWmV11r RL1Hg2KtU0REqgox9HkO/Lw58Of7kfEh+IwVP1QJLAXKp7IVLIjGjJ0OlMKRialSmaxc6UZStdED 1IZ4lBqnJfM3j2sI5LsDs5DFSMos+C6UHTD0L34MFVMmTlUoEMyrWTsgwAOa7QGrNmWraLHIowkG kEAcEwDRAuVQKhYox3CSiTKWpGWxN/8ApNEYTDSFxx5Dvy8OfDn+5HxIfhdCYBOVktMaRGKZ3Jug G9aPWEyH7qbWxTYBEOEdJ7IxTO0c1rYyOBKJmdVKBUDUWkWQMqEp3VAnJVLLS7HFPdkyINRxc3Vq YLpVVZWpwpwcUkLFaZ0knjUHArtjTLNOCCqJ8OHzohpC/HkO/Lw58Of7kfEh+CyA4UWl2zKJ1epO gpHEMyfFACpNzkhtxNTWSYUATkXstMBTE4JiAZZoykGGHUiyaNyiJUMUIR/VALTH9VF0wFU7PI48 XOCDlNGpTzKoON0wqUCtJkAujNErpwQfqTMuyTEr+5NKJCrRSGYR4ch35eHPhz/cj4kPwGiHVbhA AVOPByjXsj91pjYJ+Ep4UHqXTKyEYhnxzK1bhDmyc1OS1AWWnco9R0om4XZ9o4JyaywTAVxTvppU 5pxfNOalOukWXSiRSYQq54OFXjVU4AB650TyvkhRVbqXZ91GEsE4umJFa8WWapbJSMA9LI8OQ78v Dnw5/uR8SH4D/wAinxKi9zw0g3Qa7JygFps9+pMbYBfO3iABYdKaFFGJL0xTE+tM2qGSIxNR0IRH rKdqoE1OSaYYKzdKIVf1ThPJ2yREaDJOLpxQi60zoRimJqqKiZZdJTmSDMrrNU46o0lH90ckHoyY 8K8WIXzYD/LlfoPDkO/Lw58Of7kfEh6boC6YLqXSnGCcpzxEIByUNqRlID2nNB1IVQOaawFyho/V PYJgiDe61aWCEjULs4YrWah7IAUQBL8HGPD5gFD7QQItkrV4U4UYrtR9YKsV7Rihp3CfWuzJ12kW RbFdBXev6ThS25B3FFLalcLkO/Lw58Of7kfEh6YQJVKlPcrRGua0RvjxcoQ246pE4JiP8yQ7RUia dKlMHsRNOlAHCwTWUYRFF8uFwmh2s3onmxByRAxDsjCVcgn/AIpyaZIxjRhZBUunlZCSMTijA8bc KLoVk7LtBmxQ0zpgu2NQzCYUPTRVR/YrpxVSyvRUqrKyrFhwjzEBaklyHfl4c+HP9yPiQ9MPZUw4 NG2aMYl5m5TnhVCERToUdzT/AJhv0KTillJh6kwixzKzJR1lmqV/lSYizLUC5xQnG/8AIIvSIWja xvJO1Rcqn6KtlMi3AcGTG6P4FahFgw464UktMjXJMUXsUDIuMEaVCsqcGKcLciclyHfl/wBk+HP9 yPiQ9Jyg1ymFZFatwtiy0woE5TmwVLlA7ns5ITppyQEZAHJGe7IRjmo7eyCIA1maOiRInpWsENmU JHtDEiy1RGk3KqaEInbiwlclMDU3VmRNwaJxmiDkpBetBMUQU49rBAmLEYq78GJqODkpwuzddqen qZDVMkZMn4EZrVGkgnVlrhbEKgc4hViQUGV1S6Y+pbgzouQ78v8Asnw5/uR8SHosgEALstcvbP7K 6omiF2yyBBB6UGsMlQlNHtSyCB3ATGI7MRUP0p57erVlgtImwwBUoQqCm03un2wSR7WSG9M6pH9k BngvmEOCoSjiaoDNlGWZQQkLFE4GvHULp06cBEEMU8SmkZdaB1H9VdwqKidMzjpujLHELAquCPHU Lpyw60aivHpUtoHFyuQ78vDnw5/uR8SHovkmCc1K1G2Ct2l2QyDLtqljgmsrkBWQ7JKBBomgU0Yf MMadCMd5gZYBTBo+CYWCIkXEbIRIstMRaqhF7KEMAHQKHWhOP6JjTgy6FoPBwmKYh0XplksxmFX9 1lwonFCP3CEgtT0Kp6DFPEsql108N2QzZch35eHPhz/cj4kPR6SnQMvYF0NFGReyIauBQE7ZrsH1 IRkLf4J4gIPYKhZBy7I1vgFG8YyuhpDBR24l4i5Q1j2aasWU9OCnKXtMqolUzZEn+NE+CAAYApk7 JrhNiqoEUZCQx9BjVZAYJpU6UDE64IMet1ZVo6YezJGIFExFSh6ThSlI1AoEZG5LrkO/Lw58Of7k fEh6ICAwF038ehUXStJWnEFdmrIS1MDdNIphYXK1YOjGAJPRdEbkahqKLSBllkhmWCjKXtzL+pGJ FFIZhkQbmyfIVTCgQetUZAaom4VP0RzRGXFj+qu4wdOQxQAwVVQ8KKgVbrONiFqidMlpmahURdGX qZVFqfgQP8S44ch35eHPhz/cj4kPR1GyoGVCnjZAA1/5oRqZYqWqTHAJ3ogGaIr1phU4LTcyQ242 F0Ixi+/uV/VGc6zlV0RLCqEMiFSwDcAEJmoCNGfFE4BE30jgZ7dDiiJXUgT2suPQmILZrtViVq2z pPQnB1JpRPWFcjrQIjqjimmCD0onbsqIl7WT4iwWnHgdOKJZmsCmkHfJUNRh6LKUheBfhyHfl4c+ HP8Acj4kPRYVGSciiDWOLrREM1yyEQHlKnqUYzJcEh1p0ubOtED2cUItZATDA1WmNBnihKucitze IeMA0R02CBOVVGlhdSk9QmxKLoN1BRiRUhytErYKT4qUs0RkiFIr5tnwTcGWmVCEQaxK17VY5Jjf EcKBwqBhkqxCeI0nEJky6qLUKS6F2iqXFQmN0AzvktQkYyXtEjCis6Yxk6oCDkVVSBqCGKnt/wBp K5Dvy8OfDn+5HxIekxTYEOykQTGD1WoCwYSKDGlCSFp26vigGYG5Rk6c9kHE3K1Ggxkf6JoYUdat ykDWIzRGdkdWVFLpDN0qBwaoQY3RkfYhX18HC0G4QYMcQnFk4Re+CMD2TgVpmGOBwKDlk4TkVVLK v6IaOw/8kDuA6P708Tqj0KqcX6E0g/8ARAxNcExoRcJ9Xq9BxQhBleov6Fk8f0RH6qbYsuQ78vDn w5/uR8SHpgm6MpWNhmmIYRbsosAAaA5BFy6i57LrsuYg+pARGqRoEI7hL4RFkJylUm3QotaFPUhI pxhRGZ9iGOZTKMRXTdkNArigVRO3WnB4Nw1R9oI7W8K4KnajggMckxLHg4TSFFpmNQOaM+Vme6Vo l2dwXCrToXZuiC1UA9DQqn6otj6GuN8Ua19GqK3JizsPUuQ78vDnw5/uR8SHp1sKsog0jGyqNRKE 5Bo4Bdm5QiaQHtEIsGJBZarzepQkCjGNs8lIGpDh0Y4xXydv+Rr0KO3CwHBphgbFNHHhZGcRTFag OyaEJxWJ4Mq2XzIXC+XujtDBaodmWBC7UXjmEBcZJpDrKcW6E2CZfP2iY7l6IbfMgx3BQHAqiIOO KJB06bUumkKigK1y9QT+hqFCmkU8Sr8Zse1IaY+tOcVyHfl4c+HP9yPiQ9IQjcrVIPLEouE4CqFq fTEWWkdb5ojJbkDjUIg+pNZ7rTHrUuk1W7uEvJ6ILUQ7Ij+WCMSCJRoXVL8CDipAi5shKFds1IGC BwKpZOmkLr520WlitB9oXdNIBeyAcwuy0o5YrSRp6CgwVBw1jPDAoCZ7QTlOC70QJY9SBjb0mTFO OEpHAUQMjUnhyHfl4c+HP9yPiQ9I70h0RTHgOlEox/RMicyvmCjX9aA6EWuqqcjQBHelSMv34EYE J7AFR3oh4kNIqJzXSnQmB1rQR608Kx/tQY+pdPDTJfN2Q0hVfL3BpmP3TWKqXTN2sChtbtQbTC1X B4MVqFQnVE0CXK07lK3VKp/SfDhpj7Auox4ch35eHPhz/cj4kPR1S9kIRiGAQIQkgionCVEZYWQQ BtIEJsYUKBu6ZCIFJUkF8r+2xzCA4CYF6FHamLYFBv8Axn2ejoVeBBxTMSxp0ppRYi7rXtUOWBTE GMheJx6kAb5LUAmIYLVCPbvRDa33P9sv+aBBcJxToWmXqORR2twvHB0CC78NJRIjQ2VkJG1ijG72 KYjVA4oB+1l6XUhtiguTij0I5DhyHfl4c+HP9yPiQ9GJxNeD5IhdSKcXiXTCyChLBPhuBx1oJ8V8 yJtVR3o3jU9IQk7g8CDQppOCCz9Cc9qOCEJhpYHAppXToiIeWBRMw2BQerptLSwknI1AfyCcUAvm tQsL8NTCoXy5nVE0ByVBQ4JmYLVAEyF2Dr5MqTjnwu6DcGWgAGX+C0yYkXCMoHTIIRmNQzCYnSem i6PQ9SJKJz4ch35eHPhz/cj4kPQEQhEWA4HNMiEYZqUD1Ig4FMtQvGqBjeLSCiEMFIZVC04xLL5Z oDWJQBNcU7utZi8DSSnsO4jYLSMajoKEJ0P8TgVpkO0nC+aPaFxmEIyLQlYnBOC4XaDhHd2R2h7U bIxscYlOmkHC+ZsU6MExpuRoQrlEwkQSGotcS0om+KALiS1O5PoGcLmi+YC5N1ZPiqgErsGmSpdM eElCOBvx5Dvy8OfDn+5HxIehLdliGimypwYo5grUECgcJhv0XRLgekMyMDeJZGPriehZujnHBCcf YlSQ6VpsRWJQEqSFwmyRiRQ4omJbEdSGm4utG5SQsVpmX2z7M2qg5cGxTir3XzNoOP5DJfKkSWtI 2T4cPn7dQfaCMRcZ48DF70Xzdh9IrIK7SyVVuGQqbRC0SFFQMPQIKYlwU8U3H+qY3FkZHBSPSoxy HHkO/Lw58Of7kfEhxEp0ihCNhRSCBQdUtKq6VVCWMS6cXFU6cUBWoGk79aEx7Ua+pAP1J80QRQ2K H90aSC1x9sfuE4PWDcFA3RNpCoWpjoeoKG4MVo3LG60EtE1gTbqRjIUzRiQ4xR3Ng2qwwK+Xve2P 3CZqIhxWiMJViTRCQsVdhgFVa40JVarXEdrHqXzDQXCGfpNgnFvQEslLM2Cc3Rawpx5Dvy8OfDn+ 5HxIcPmblzYIxNwgozFjQ8RMVEUyIRf9E2RT/wATZNkmNxYdKBPrCBHsSt0FCt1ZzgtZDRtIdCjI ViV8zaLTH7r5e4WkKJ3XzMRei0RmflyxOBQLowkXBt0IxO5qGDrVH1rSTQ3XztokCNslQtIXHSma 2KG9EMRSiG3uEiJs+fCp4OylEipCMdwsRYFOPZJrkgYlwfRK0pwVVEyNAmFXstUvUpSyCMjc8eQ7 8vDnw5/uR8SCCDWohMWkgQXBuiDfBMbih4GJsUQ9jRA58HFiiJITFGpJOC6INpVC0TsbFCMxT+7B lqBpg1UZRrJHZ3LD2SUxsvm7VJC7Ibe57WBzRGaeL0Lg4L5W6WkAxQAlqGFGKMv5CxxXypmhLFXR gQ74lfMi5ifaZPE1KMT+6INo2Qi9sUxuqjjIkasR0JjbAKtYHBCUTddPonUnd+hfLgaYlV4fLGN/ Q5Dvy8OfDn+5HxIcNBNQiD6kxuEEN2NjdPimQkL4pjgmKLrqXXdCJrGScXjUIGIf+i0yABNijt7l ds/sU4qCpSwuCndpChWmRcLUA8HfqQmD1oiVQUZbdHsUJY2I4a441CjO5aq6Au1VamZUKlq9TrS7 9SHoOA5xCpQpjQ5p4VjiECKHEKqpxmehHVc8AmeuSMpY+hyHfl4c+HP9yPiQ4CQwQrdDdjbHgYyA IKb+JsrpjV1pwwThMbISFjfh0XCDlgtT9iVJDoXYnq2zbMISAeNitD1j/giLkVRJHZNJBODTBEfo jtyLxkrpjfArUPYNwLIF1rBaQFEYwGoG4K7NMwy1P6ldxwfJDcj7IugY+hXgxsqla9qhWjecZFNc Z8RAXka+pOmNWWke0UZSLk+jyHfl4c+HP9yPiQ46D6lISxwWcMCq2wWmXqOS0S9RV0/8hZMeBBxR ibhUwWkiuCKIeoRBoUMnqgXeJWuIvdfKkaC3B4XdwmNJD2gsfUqhxkU8Dp6EXmaqO6AYvYoy/kck xsqHgQzogBo5L5d8uLcKolaZ8C46ivl7n/5K0z9SJBRNxGnAqRFhQelyHfl4c+HP9yPiQ4iQwUd3 ZLahULTMBiqD1JphkK1Fl2hUcPmRrmEJDC6BQ3P1TAoDA4qmKcXCDWKJihF+0KFM1FqhfBf5kSVq Ygha3brTYcQ2CjtTFYm6kwocF2o9lPHiXxQlGhCBB7QuExv6FcU6HQnBRe4xRq5ihtD2jgungYRP bknz9LkO/Lw58Of7kfEh6HyiaguE4wui60Ti4wKMG6mTShqyK1x7L4LMImH6JjUYFMajJPCsV2gQ RigJX4ats0OC7QVDpJzWk2GSrwPUiECq8Kh00Wig1jcqhp6Fb4cPmbdCLjNCQLSxCrfi0VW5RxC1 OwODrTAdnEpo9l7nFDM3kg60wrJGUi5Pp8h35eHPhz/cj4kPQE43BQmLEVRAsVSyBOITjrWZyUoy Fj/ii1ECWMTgiWxZOy1MC2CiGYHBABAN1o0RcsU5vgmtxkBa6MQfZTYjiJAWun03sgXqLpxxZOBd aDR1r2pXwQG5Ex6U2PHqWiNh7RzTBMasnwTH2Y3WnaoM05Ln8DkO/Lw58Of7kfEh6LCscl2qJ4SQ Tp1ORF2TlOfYUoi1wr1RQEgxcEFAtwITZFEC8U3F4lnFVqNQaSXXxIOKInXJUtinBcJweJCdqhB7 p4ByovEiQFk9GeyeIY4ojE0HXwtXhKRNMESTf8LkO/Lw58Of7kfEh6dCyfUQU8ZlDWdUDdCcTQjg QLJswyNaq9FLEi3qUSboNwJApggDTVQpkOGoYLUSwOS0SrKOK6uBKJxFim/Vf9JWmR6k/F43TFPr YZKW5MnrK0EghHdJ0hrISPsigH9U/BzQZrRE9iP4fId+Xhz4c/3I+JD8CnGLmxb9UzotR1qxFU2a 6EZZoxxFQhwiUCozHtC6BHAxOKltm4sgcRfqQlE0PEgI5FaStJ9oWWiXtDg54agWOC7UXWiRaBwC BtIYoCRJAspdaZ3PQnATEsMh+JyHfl4c+HP9yPiQ/DMTY2V7r+q6EP0QOCJxUJjqK0m3AxOKljIJ 9ssUYTpIXHH5gF6FVxWkWNYrSTUcGXUroEYKO4Da6BiQqoyegWs+oZKqfELrWiBeZ/ZEk1N/x+Q7 8vDnw5/uR8SH4mkmyunBsixqC7LqRcowNnUZYihQKeyIFpojBR34Go9oZhCUTQ8JRAalyq3F02It 0ISFJRuEDmnFkaP0FEnsywZdoHoKaumVycEKggphU9CBmWrSKLlgU2oOjPckOgBEbI0vinkXJ/Ic h35eHPhz/cj4kPxHCZXQc0ldCILngCcU+KYm3DUMMVqCYl3uEdqRYP2E71z4GQtL/FXYi4UWk1al XdCtCtTsehGRNj2QgSQ6acgxXtEbeC7B1SWqR4sS/wCS5Dvy8OfDn+5HxIfkBGeGPDs0AQ1Fioyc ESuyBBRBsjtxLnBdpChdGEqiP6omUgGu6+Xsl2vJAyqMVg5WkHWBZkxDZJgT1p8VcqpV/wAvyHfl 4c+HP9yPiQ/KaZDVFWKMdoMTiUZ7kjKRxPHXtyMT0J9yZPRhxoVUv+d5Dvy8OfDn+5HxIf8AHOQ7 8vDnw5/uR8SH/HOQ78vDnw5/uR8SH5zsxMmuwdGWk6RQlqBCRiRGViRQ/nuQ78vDnw5/uR8SH5ze ht7O+Z8zvbez/qdiMZfKFb6nOLmijs03eS/0/OHmd4AGJ3YzlpMjnZlzkTFuV258t/oJaWiQds6t BavSuQ5iW3OQ3tvmpb04+yDs6tFWot8nlpbkuX2OX33M21S3WBB7Nqrf5bYcbUSDEGrAh2/N8h35 eHPhz/cj4kPzcd7nP/aQ5TeJIOzJnABoa5qXyf8AcENvWNMtJAcZGqlsR/3BAbUy84AjST0h1Dan /uCEtvb9iJMWi+VVschD/wB9t7e1y+tjEgatZMq16UX/ANwQLgA1jUCwujOf/vtuUjckxf8AxU9j lN8c1sxbTvRtJw+H5rkO/Lw58N7kOYlKO1vgCUtsgSDESpqEhhkvMc37+39leY5v39v7K8xzfv7f 2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb 9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K 8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/ t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY 5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/ srzHN+/t/ZXmOb9/b+yvMc37+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZXmOb9/b+yvMc3 7+39leY5v39v7K8xzfv7f2V5jm/f2/srzHN+/t/ZWzz/AC+9zEt3YJMY7koGJcGNdO3E45//AAD/ 2Q=="/></g></g></g></g><path d="m9.08 25.873" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><defs><path id="a" d="m29.414 18.217c-1.871-0.678 0.144-3.833-0.466-5.545-0.066-0.414-1.702-3.034-2.118-2.998-2.93-0.511-5.872 5.612-8.911 5.765-0.366 0.018-0.441-0.135-0.473-0.196 0.434-0.787 0.95-1.54 1.395-2.317 1.115-1.95 4.476-4.491 4.268-6.766-0.672-7.338-9.463-2.7-10.542-1.912-4.432 3.234-6.429 11.156-7.896 16.391-0.73 2.607 2.609 0.291 3.19-0.24 1.66-1.517 1.74-0.953 2.638-3.075 0.361-0.108 0.772-0.318 0.878-0.104 0.47 0.947 0.457 0.149 0.122 0.745-0.839 1.491-1.671 3.074-1.94 4.781-0.816 5.176 7.249 0.398 9.932-0.521-0.322 1.715-3.244 6.927-0.517 7.915 3.104 1.123 11.856-11.41 10.44-11.923z"/></defs><clipPath id="r"><use width="1" height="1" xlink:href="#a"/></clipPath><g clip-path="url(#r)"><defs><rect id="s" x="-.005" y="-.374" width="32" height="32.374"/></defs><clipPath id="k"><use width="1" height="1" xlink:href="#s"/></clipPath><g clip-path="url(#k)"><image transform="matrix(.0667 0 0 .0739 -.00048828 -.3735)" width="480" height="456" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEEOAQ4AAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABnBAAA1awAAXJ3/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAg0B7wMBIgACEQEDEQH/ xADWAAACAwEBAQAAAAAAAAAAAAAAAwIEBQEGBwEAAwEBAQEAAAAAAAAAAAAAAAIDAQQFBhAAAgIC AQMBCAIBBQACAwAAAQIAAxEEEiETBSIQIDAxNQYWF0AUMlBBIzMVYEIkNCURAAEDAgMDCAgFBAED BQEAAAEAEQIhMUESAxBRYSBxgZEiMhME0aLSszR0BTUwQKGxQlDBUiNi4RQG8XKCMxU2EgACAQIF AgQGAQQBBQAAAAAAAREhAhAgMUFRYRIwcYGRQKGxIjJCUlBgYgPwwdHhchP/2gAMAwEAAhEDEQAA APoAUgunxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8ZA+zHxkD7MfGQPsx8a4H2Y +NAfZT40B9lPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4yB9mPjIH2Y+MgfZj4y B9mPjIH2Y+MgfZj4yB9mPjIH2bP0M8PiQBgAAAAAAAAAAAAAAAAAAEgjLY9BKHmdLchHlzafo4Kv hUe18b1dsAHsAAAAAAAAAAAAAAAAAAAAAAAAAAAB99z9DPN+JAGAAAAAAAAAAAAAAAAAz0Cpj72g 3m5F2CcEUzvcFdZExWDvrqngjYx+30wDWAAAAAAAAAAAAAAAAAAAAAAAAAA++5+hnm/EgDAAAAAA AAAAAAAAO3HX0hLXqWOfjaxLJM6RGVeO4xdVF3BUKam0KmDu53Vucm02nbjGvktXgG6DIBwOhwlH QAwAAAAAAAAAAAAAA++5+hnm/EgDAAAAAAAAAAAACxXv4uhbU+PnNam1Le2VsjaXeWpU7Hk5NCuz KsraMY9Wqr2R6V+vllLuHvV57iN9DXdc5ly+h5Nvvq+Z4qt6XF9SONyxZyucbMaJkGjRnSAE9AAA AAAAA++5+hnm/EgDAAAAAAAAAAAADTzNZZ6bFPj57LCLEbMdFsKtETnRiVU3aNaUuhhLojq7KI/O SgVjYrXspb2M93A92WaleW5mQ51oTLLTyC/V7/MVzRqepzZlW8mvqYY5PmdAAoAAAAAB99z9DPN+ JAGAAAAAAAAAAAAG5jbKRtPrvlxvch8r2e1ZyraTXhlOQaujwfXZjxg1I5GJturYjayuZzdt6KWd a4mz+xh08NiNYC1KvZxWQtsSOM+/lel5Ds+0v0o4FPbzuf1apKMKAAAAAAffc/QzzfiQBgAAAAAA AAAAE9GadS4nPZfXnLnucS6dpzXJLd7CS1jBsB1dmgoR6raz4lDVsJRF2myFjb3W1GRt3ldTc9gq 2NW5eqNg1l6rEeCNPQQ/n5Epu9Hylyn3rnR8t7bztO3HA5fSAAAA++5+hnm/EgDAAAAAAAAA69iN iTqQg45zpc6tkpMch6W7wbPonx1edGJ5HacrOzXo1C21smd5+d1K3PidhyAAhyWhCDOtCFuItrLq 9iPPpMzXw4LladV+Hq4nV5LxXOznnRsy638en0udD1ss7yVwAPvufoZ5vxIAwAAAAAA6PbC123Tm jFkElVZF8LvauaSY+s+d2NrKnezUVb23Gc6lk0tHMe0rXEP32O8rZV8VJaVqaOAtta7s+NktOmDZ WcxT2WITRYJz4WzkyfDlVdPP7vIVcrq6uPR7m96U1UpOhcLD9R5iXs8A5+n77n6Geb8SAMAAAAAu Ni7c515mN51OdEeojYtLajsktyN1jnxvVLaFq1lXqX4rrWqmpoLa9UlJ78rXKuslc4vz2Z1bq9Ne dqK14xXMpYnTnk7XVPnyFntyXIp7ex5ctVqn2+UTVOvCcs8NrLt97ExvN+38rbvogQ7/AL7n6Geb 8SAMAAAAlfq6d4znOWcca868W4RZLoYQar9v3m81cy7UvmxUC0OXEp0IOy2ykSzqbByo2poTp3E7 6UWSeFV/ObkoXBb0+2OCcavqye5Lp89qzSuQ5rLUQnzdzdCh1ebBiZX4bPa81Zs0zupRuc7JeFhu Yc/d++5+hnrX4kAYAAd4zSzp1LXRxT4qUJcqM5HoJdelY71P2HBeGZsZ3C+I0PSTr4NnXnOoWort elK/LeXWtqraqPdj0vOmFe7SJi5weeiJZL0ZyhNW7Pklm19ZkuRsx6cPa17hw5yWL7PIXxqqcs3c eb1qnWYRaT1yyPJes8mel98z9DPh2/EgDAAB6X0y8xfd5GJlPnFy71Ku1MaaPtWfMrm/qM+voJkG U5a7VWqWPam2gl3LObeWdZ69I1LtF6Name3fXdJXqzRaZKs7iDVuJYvAsrOFhtiEqtxs5czOKrZy CHI7PK7wa3LUm6LDXUHXLXEnZHB89qZc/b++5+hnz6PiQBgADLNe1VH20XE4UQfTk3Od7lotH4tW ypyvYnXUjz1qGzHorUu2spCm+vtdBbqqdVF9S5bG52rn5ecl3Dprthzc5WtV9jf7XtS7UQuhGmxk d4WN5blzttZ7oxs0LVOnJBfOdfksbDqrOPZKy021vlYZjeiuPXBPa++5+hn43xIAwACxoUrtOey2 g45rCAXFQsKjWLTuNwBa2n80IWp2uISjLSGztXoOdRrGberrejqUdTeiim/ntq9DP0NvBNpWUWqT W56w6wImxEm1t2c+crDYW5csaejSbjEp51cADKcHZLThblVYu2ewmlo4m5X7J+EGLr7H33P0M834 kAYAANV3dvW6Nu/O/i+w52oi6NOEnq3LTETqzYo3+a2b3qnbtiKFpU9BmbEunJp6mJbLmhRuz7YU NRI2JYejohc5Tsp1wlaF1SbIccbKYLO30tTnGU+JBiEzflrwDr8vqmmwWxDt2bOMlaELXNal2xT7 uXzGdqZdPY++5+hnrb4kAYAAAA3Tpam86u2mR51qmxd42yud7FmEIWbzkVpV0c70SUysrex327ez tCPUvE9BW1sLSoT6V1oqtcvdUpai6xqVm23nTvRWtL6UaMsTb5KfNl37GTXm1lw6k8ycs/u4LbYO OQ72U2VWurdITiwxjKvaM+ha873ZjJBPZ++5+hn5vxIAwAAcrYyd2M+S82bEW8Wtco21vNcpJZ3U WZdEoSrrR21gb3PWGJ6DFGqaWfK7bS+u4erATsZPdDl5Ffa7Sk6HL0Us3ZjXnrWKL9SxBrp4PpSS VqjcrtDIurT28U0OTTihfx7W7ozSyJODOpStCyukYc5V7pu89oZXR7+eBBfvufoZ5vxIAwAC9qVb c+FpNa80bNd+Fa1XZlnOQ2deWqdyd5Iv1Z0VqZNjK7lKzLgr53r2+gidXGsRto5muqD4VuvPsmtt uCvb5Vuw2OTuIaFK7jalUtZF9GSmZGjbmjDjKcXIWY4tJbe1SrdZWxrraUpPbjBiOnJ18j1NRia2 HX3eAR5PvufoZ5vxIAwenayT5cnPgfWtV1SbkOFXFqSr3ofOq2okvRv1ZP4qYbpHQ97V83s8VjD9 Ph6Oro1LFXQRCTOxPR1jKNjL0L5aqWOyHdy7uJDK1anRzNhTdTmo8tZ/RHWdWtQRhzsr1q19Nudd qMM2zCLJ2rcsVbQdk3830ezPyNPMPUAJw++5+hnm/EpR29kjTQ7ODjCEpvXOSqmaH6zatqlmtfWn lW96haXNrBvc9rWdq5StYWS2muzA3ON8Rl7C613OosQZdjO62WMbYpVmx+ReZaV1OZWW5GtPOWxy PVRWVsZ9jmphaBul1M+d5KfHNSd48UMK1p6FXmV1VtIjDt+iyanecfOAYn33P0M834ltYtlpb0GI bzrlWc4oOqOmKYIHtonPEQxE9q9XHKMZWtJW47Lvw3Lsyz6vrLhFG2srlmeZGlTTc2Me9RxNQzbR NMbc2jUp6lNlq3s3VZnOWznyNS4llz42e2zlyiJulOq6LzhNZqsjSwfXd/Yz6/YnlzzeLo4BPhAA ++5+hnm/EgDNfR87v14VuZTyE+MTNrVeLZZydWYzVsUDZQ5mMcleZejylm7eTaYqrs5V8ajqZ8tN CjYcsc+xaTu5trina82ranJqHwm+Ndqw6H13V7HPMhPmMmrdRWc+0bgVn2aptrtN+FCnLvt+wUtD Bn3o4HJxgBgAH33P0M834kAYa+Rbeesyc7+bTjqIXaHNFM2Qpr0avNMp72LIZtuNa+sq8by8ypqZ Tzby3unGpQ3MVqM0KF/Eaqz2L4irdTpa9arWpwnycZPQpbOfcldy7BmlOs/nfinpZaiL2b0Lotwe 2tbrpj1djmLo19aWV3nHygCzAAAA++5+hnm/EgDAAN695a90cXoFUpPy6UFuyddqrqFCtfpTrZXc Wksy7V0J2suG88sQlC1NC3Vt86dydfKKqv4+vWduUJ81aGfrZ3RKGhkW23VFt59Wmwtky7Ndl9Lk ayLpwxreO/Js0fT6Aazr9aFWzgc1H1g5uYAxQAAAAAPvufoZ5vxIAwAAADtmqOX553aZ6HT8zvb5 bKN6sTtSr3JyybHIpfXZVu8y5NDXyqPpXcrS50bUuQnTCstp9Ka9jOvczQS+Orhlup0vb0sS5NdC HYSWtRv5/YXJ5HerojfznU66tml07b/chCVfUCHKAYoAAAAAAAH33P0M834kAYAAAAAAAA3ZwbLy 9HXrqtxaGv5r0S89WnYrK17VwtiKyzNbPMzbtK1j64h3K9XK2sTom+7lvQ2IRnFq+JtZ3VlGzQ7X t9JLIsS4u5HanZ6mjOq+3dFVWpzocCEAAAAAAAAAAAAAAPvufoZ5vxIAwAAAAAAAAACfImjPSeXs tDcr067S29LyuwsPQ1uTfhwGoyk9L0+r4rRSfosm3gUiuzi62+pr3vNqTi9D5flN+vSbkG9d1uYK TgCId4ZgAAAAAAAAAAAAAAAAAH33P0M834kAYAAAAAAAAAAAAAAAAPQbmvzJNlKILY7wBiwAADvA NADAAAAAAAAAAAAAAAAAAAAAAAAAAPvufoZ5vxIAwAAAAAAAAAAAAAAAAAAAAAAAACQRJ8CIAAAA AAAAAAAAAAAAAAAAAAAAAAAAAffc/QzzfiQBgAAAAAAAAAAAAAAAAAAAAAAAB6Gvqm6dFXArWbVU MbL9XhmUAAAAAAAAAAAAAAAAAAAAAAAAAA++oeG+MPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeM PZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMP ZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgeMPZgf/aAAgBAgABBQD/AEt7lWG9jBc0rs5D+SzhQ92Y zEwkzlK34lWBH8ctHOYfmfkxEDRYhInIiBgfcx/BY9DGOI56McH/AHqQkqoE5YhaV2Op/sdWuUSn yZDV7aWDtkn+u0ep0+M/yMfEY9SIlc+QBmfYxxLh3INd8V1IgLYOtsERDmMFYMOLfEeGNCpgQQGG D2CMuQ1bAjPHEOBBYQdTcGFtSXqC3wwCZYMEwiGH2iBYFhwIy+rhCuA4JLECVPg12ERHj18k+Cq5 nRZZ/kY0JxB1mMRFzMAQuBCxMxBn2E5jQoAawsXpKwZW+I9Z5e+q5mI7YDHMMaEEk4WExJ8wBmBZ iHpM5jOAGshYkcjmlshLsRLVMVhNhAD7qqWJAUExjkmMcRmnIwrlugCtiZin2NkTkTMEwpCFEdwJ zyayDDEc5reWsWX3axgMYzQwmNcpdzPlA4MyIizpGBEBOD8uU5CEAxowM4EmgYhExiV5idQwwfaB knoHaEwmbuyUXXc9w9S3KBYoGF9QWNFPSEGGEmMGhLCI+GQDAOYDElcvGPcSO0Y59jKTDrq0WtK4 V6jBgyWGOS9AsMBwTkANmEiE4jOY1mYleYg6E4nKVkGVrLWy3tGAG6wqfaYRLWMGFgEXPIxD1YkN 84uYwIIsnIGMY6ZFK4gEPWZxEfBps6E5PtHUYMbpCfZ0ljkT/KP/AJAhUTobGw6HJs+atM4haEoY yRmIlRyVTEJwOOYUM6g0k+6Dg9MOR7CYSTLSSR8v8jsP1q6rbnkj4nIEFSJ3IGhAMJYQHJVOLD5A 4hHRi0QkypY3z9w2YUtCcQsY3UY6bD8VpYFLh1ps4xgGDZUq85FYSjRspGYGA9wKhBRQVJhMVofm lcrHFfcY4EMYT/dujAeraGDrNk2LyGSrVvyUgOG5IUsxGUEciIUzKgQ2A0XEdchhAcRWE1xyloAX 3GPWGND83isC1qclUlLC4xdWHFVhQt1BcEMvGVWYNiSleLGriflA3XJhKtCgMwQdH53/AOftJ6Qf M/L5howzOqMTmbVJmpaDGDoWCuKbipdIMgtThqvkK8QdQ/T2I3Q+qdQUBYaicZacv7AMlhDP9zBC JiXV5FRyMS2ko9ebEZSCasyrpGr6hAy8CBjErPSxMwqYDg/7ivkKKDDxRCcn2KcFxGWEe5iMDHTB xyXjmKj1sUDCtcE14PLEQjLxvmhxM9GUNGUxZqVgq+FWxy3uochlxGScSJj2kZnEEKOJZYVyP8YG BPQxhFJyRkPAYpjKRAwaCs8ql41XthfdQ4PAQpCkKQqRMQ9JyEYZhZhK2zHgbDDqHgPVGyGUGMMR TK1LRNNiw1wga0AMxY+8lowSCMQiMIRHGIfn/tZmUn1OIfnWRhlzCMFT1OcY5DssJp1AA4l1mAST 8FHKzvAwHMYTEdejL1UZFixMg/MWLiKYDkWJkKJVWWC6xE/rrBYFLX5hJJ+GjYJMHWMIyxRHTI4Y KL0dMhUOa6zDrvF1zyTFbd1TGu6fHyYrYhYY6GKkbAJVSeIARFaNWqszKB32ndaE5/jc2/8AmP8A /9oACAEDAAEFAP8AS32FWPfa0D2qaLu4P5NlqoLLWeBRAoEKRXatq7FsX+PZdiMxdlWAQAwpmOJR 3VIa0FHDD+I5wrsSVEUQL0x0K5gqEVIEhqhR52zHDAJa3JrFWDYSKwYfFt/xEUQCATECwLAsCRa8 x04hj1IJj1gjYUgq5JobK/F2P8QOqiAQCAQCBYqwLEAjqCDV14Q1GWVAjYo4mo2oyWoR8S45CxYs AgECxVi4EzK6rDHUYKgEV5LoFFgmwuQ2QSxmjeeXwScRrMxSTMYZRFEAiiYxEqdpVokhKK6wX628 JxzFVUFpzLAZcpxaPUQCUIQpt0t8AkAWWQGfJQMlViiKpMVYEyVIrLWlQ1zTuYFY5HgEnaYx6RLk AlgE2UGWUGdozi3LTcmv3ScB3ySclFzG6xEigQYit6a1JIXEUgm0HBwZTwedhVIetY+wJZaxlgJl gmz09hToSRNG5T71z4hfpWsAwFWBegEURVimc5WSprIYcVJQDmdfMNDiMrAMGjkx2myQROUJGA5V 6bBZX7lrEtxlakQCIsYdBFxA0XMACk/OsdLBhz0i2qwzkNiWduWhZaoxsEgwAEACWgCaGeHtb5H5 qFEE6wNiF8kGDMHQcSAo5NacFTGHIVFXLVFCHdY1haMBHEsbE2TkgZhzM4DWEzVXjT7bD0sYxDmB jGawNkmKCYogGQnzYgLT1l6+mpQ9OcRyBFcMtlQMdSI5IjPL2yLGyR0mMx0ldfcdQAPbdyJatYFU RTM5ZV6qIIvyQEs/UaqjtWHA1GHCxYy9AZ3rBGvzLCDLTiW2Q9TOWICCoYI4OR7RibFYUgeoKFig RQYsEHQULgOcGggJYgIRihS4MGXo4htIjODHaWP0uPqmeqKmWrWOuDr57PubFizugRYhyVMErEPz qPR1yKrCsVgwsWAgwWusaxXjwtiO/Sy0CMeRVRGXEWd3Eqra+0AAe22zggOWbof90OCIIkaVtgg5 B6FLCp5Bg46i2M2YXljdLLY7BmZQIrQqCGQwKWbS1P6+t7l7ZI+TewRfkDFM+YESzEfBitAxBNnK POcssxLLOjtkms4BIJOYLCsDBhqLna2HxX7b7O2jGJG+VZzAYhgMUxWjQHMDkRoHhaM/RrcG26Bi 0T5/7OvUeiZVg44nxal9rY/7PZbZ21uYvPmikB3GDVnGcytoG6BoGnPIDdec5w2YLWTugiywmZzA xBcYiuDGXIx0yVNdVl7aOouuljcm9lyc0URfSzKQcckBKsRghuJ54heK+QLOrWEEW5At9VlmD3Ww HObsgpjD/MOwnSJZG+WpQLDrUhTsXAL7mzWVIw4WAFCUi/LHQdRX6othRrGIjPyQOwLEmMeQGMtj BXlXXiEZmMT5Qgzn00KeNdv/ABp7ty5RnOVuzFtBnMKekVkywKMti8rlViGOK8hrP8+HpUqUHzI6 K2Iw6o2Y4ieojXuaUaA5DjWtlhc+9dqEkU2AkMpcxCSgY8rWIVRkD/qrAyf8rRxZeoU+qxeoOQwh +WcxgeOlTk11ZjkVBmLH4JRTNmrjKziN6XJ5IhyEPROjPORcVNHHVWyuOJYyrkxXStLHRDxK0RRe ih2LN8O+oOqU4O0hV0HQelm+bEzlkJguQVYtkUk9xtdjDVYW1tUVBEWNYAPj4E2KBYE12B2NdlBc 5SnuVPrWKuvXY9n9VWj6NobW1lpAcCdyZ/ikAj+tTn2AAf8Ay7//2gAIAQEAAQUA/wBf8zdZR4f8 t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuS flv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9 yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/L fuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn5b9yT8t+5J+W/ck/LfuSflv3JPy37kn 5b9yezz/ANB/jpW9h1fBbV8q8BrVRvC6DC/7eQza1LdWz/QPP/Qf4qVvY2h4Xk9XjNXWGMDAclRj DzyGpXuUXVPTZ/P8/wDQf4YBM1fG7Gw2loV6oGpaHNPM2VsYgWtQEdnVlJyB53xpdT0/n+f+g/wq aXtfx/iKub6tFQGvXQHqe2FmCK3bXuJaSKuK1DLCxZaAV8x4vtN/O8/9B/gAEmrx7meP0l7lGFts wtl1TNC7munNVdbGy1rqkASol1DFqyFdmIvrDrteIfnr+I2LW3NC3Ub+X5/6D8cDJ09UJFQ4QGlU BqCo5e022zuLVTr83e231LUmWKMy1VqHABYrnYvrxsbgJsvsc0V2XDe8cq1e1KLXBBBgBM4N/D8/ 9B+Pp19y2pOi1Fwxa5GFlys9jxP+KjVXrdeC6qizkjnt1INiylJf5DXUNcWNx7hNSCcUMUnn/Udt fc8V1q8JtWI3h1qWlRXLdDVuQ+E2y48bfUGp4S/UVgylTMH4/n/oPx9BfTQAGqdkqQt/XRu3TrkU 0aZy9loe0pWiVcbVParl9lNc2tnm+C7MZjM45JXMrrCsN1hLWJdUs2NezxdhWvxl6DV0XVE0hx39 ao1WpW6b+pbTOzZaavGmLoJG0aybfHLLamrPw/P/AEH4+gvSnj3qgpOo6ImofTr5tvsdUuYV0qoF 1RKot1iVi65rDxFtj8RGInpM4jB4gQPhurro+hdWzEtfu28K6Tt+WCnY2LLYoCjt5W/UVWrrUrxO WoCC4MW2qOdZ6H4Xn/oPx9MYQKC4UPta6B7qfTt3WdpzStQNa2w2lxdsCqWOWljAGlHCNnIRIGVQ TmACORFOW10ayVVCuurYREfdFQs8mLkFbJM9KVFsPFBZdQ0JVGXtBLTzmwjA5BG1X27vhef+g/H0 6w9K5RfVW6E0OFNLoiozuLbGbMv2gFNgMPqKJks8e1QGdmJ6keqHrGAgImqZSV4LVU08i3F9esa6 8mthKtP7blhUDFRDLNNXhFtBCBwaABtanGb6En4Xn/oPxqq+4+t/irZAJNgyz8w7tfybu8WscvOJ aWIoNnIKc9pa2aYQQsIzEiOcRiILAClnXU2WZTsKgubu3NYIpZyTzNbYFNTE11AQcSb9ZCLq7KGG /ZizaLi+iywP47aWPW6H4Hn/AKD8bUz3NM4YHKLhpyAdnJKYhJ5AZgKhuXJrW5H/AOvMlXsbAUAE 5AIAaxY75hcSu3rqvg2WAmx1UAoFa3kRYCNdDExjumVA8SomzWQO0hcay5Wrp2VI3PG1X1XVNTb7 /n/oPxUrLHXqAs1ioZukU4ikwHBHReYypYqidXGF6KlYxKiCrMoLuM2WjD3ZhtmXcpqWtK9PErPb ayyNaSWcszNma4ya2xDZNWhmFYOWSWL0vTtPjIA6HMYEp5jVx8Dz/wBB+GBmV1RVUCgFLWHB0YPU nSAwHAJwByZ15cmJFmFxzAQWYWywo9mwoL7BMLlitNryrREWlEHymeroxNr2ZJaEGIhJqTiA0QcR rbGK1ZpY7Af2FYWgMKXxMgkuqgurTcTkuzV2rfe8/wDQfhAZldYERItRze6rZa+Wo6InzT5tkqiM 11Sjn6SjsMWWDjXWbRsXLW22+blrLFNQmVayJAoE6CZzHJEU4D3ABn5mBJWgUGzJoAWclMVVJRKs ClLFv1rVK2cg7AIp5FkOSjw69l42ftyy5tnwG3SrKVPuef8AoPwQCTXViVU5i1hZZZgurqagCEHR RhVHpUlZV8hhQ14SWXlmSiOS8FSTbsVraqSrdBOYyWwDcI1pEJJjsOLMe4qwJFQKLLOZpqOAjkrQ cLViVVExKyIyZm1RDiwVXvQ9VtF04oIrAMxEtII83pqfd8/9B+ABk1VYlNWYihRaxVUrIjnuPUmA gyB1gOQc11CwIHvYkuxlGr217iuxSWEKlFfc2dwhQvcnRFusaGxK1DozKejucciz1LyGFQNztFdI WIoEUCVgYJVZVaMVHkXHE3gNLq/UqB62p4wNeoXZsWJuVlTarDfw9bDB9vn/AKD746ymhiRWoFa9 FEvBay9uCVLFiZ48xiriAtNth/qsxtoTHjE1xNko9li10qlrNLCODKa73rLnDAsARsrkHDqKMioF 1NIMOvxZFsioYABARA6iG+DZcRe5Y1YPGtXzY1nEWnNwyF+WAY1WZ2sQ0gx6SJtq6Ixy3t8/9B9/ TpWAZgr6BcBm4L6VDE2PWuBkKFJC61DXtaldMU2WU5YAnjYdZwKyEW/lYKaOSOK+VtCGKQkR0sDV cQ9bsxVksPIGuxlFFy2A8YbEENyzvTuMYq2NEqGEUCVVgypFAUAllm1RicsxiSKicKOjKGgBEKS2 oOvlNE6t3t8/9B95VLGislQgA48ox4i63MsYmVATl1z1UMxrGzVX23Z663QPxxaF4lmINcCgQPL1 Ui2xFW+1mekqipbzXtIRfVwtavB48GSvAeq152rBOomREsAi2KYpMQWStdjCNYsqfMYgy3pLPQxP GIoABwIJ0jqMeQ012aLamqs9nn/oPvULmULCOtY67VsK8V+cHQLklKyZ4jxQxu6nOytbO/ccrZlV Sv0f1u3UF4SzDWCgJLr1IYvn+tYY6uj0uQVfpsWFrHI4kBxp2dcQoDDUphogrdZhsV1ZCIVlVtoN e1cIL6nAuQGxuQuySvqTkwncbPcACuuS0LYmen3Bp8W9nn/oPugZOtXkhQoPze0ACrEd2sdVxACS iYnifCmwlAG30NY1CoLEsVRrIlBra29u67KRcyk33qk/rFyRWID0Yf8A5gA5r0OzUpReqqQZV6di CYgE4iCsGVqRFUmf18MikFFDC+l6SuyWVmzFbEHJolDMV1hEpQQKpj1IRbTxHkkFmtjrPP8A0H3a lydRQIDiB2c5SqW3PaypOPWmpnbS0wuzSirSo9Xmbaqqq14rzHcG0tVnIiywqbGuWtrG6U1hn2QF Wtm5EiVEnZUes4ww5oFId6+JZgHS8EBgwRswQQMARfWJXuBpTexIKsypLVBGxXwOORNWRlqjWyq3 JchohjdZYcjfsCpn1Tz/ANB92voKOidbY1wWMSYFwBkymgk1rVWgu4yryjVDa8+9wapbnp7gPMVF it1YsspIezYLpVUi3dw2HtHbbOtUnRlAj/8AHsH/ALA2QDL6yrcsx9atx2ijIriE7Csl9hBbYKql zGvVYwVsgCu010rWL0jOhlvqgAWA5BXI7BDrUmaADMkQWYlmCvnLe37fP/QfcUZKD1IpYMxxXUxU VKB6BGtXKbLAnYeHZtWFrrToailr0pCm9qbWt79lNVLKawbtHj2fJ7HKzUqHb21CLfaWoKKlNgPH YxBkohzATmwBkYlTq2Bg9QYdsqUaFEcVmwFLVEqsWIUMRFMNYEflWnNxGPqc9UmIQRChi2XVRdrM 5AzmcfcFhbd9nn/oPuVr011HJmLFNftJ0EAxGPONRYoSp3lmnYkCBTTWAycJZsFQLj3dbx6k79q1 LZNK3iE/592pRNqsMb2w4Y2NaCa9pMLogGlqeJU4gGZbSrTrTYhDKUDR6CJhhAMgJkCtwK7ikqsU ivBlhWPgF34BesQZAn+wEZY6QMyS28Bd+7v7Xs8/9B9xP8awQKauEHcAsVivByTWwBvfFdypY2wb JgCLYUPc9PI2tRrqgtsxp0izZsv1wypWVXUOHr6rfcEBzbcR27QuU26zjxzelhHGGw+FtmyMnUtx UrKQADDSGn9dhFUrKS0HbuUUXUim3mLDhbSWDEMzcWIXAzAYB1IjJmOnTzN70V/P2+f+g+5rpzlV YSLagg2KxDs0hS6qXdmKAseOFOVlJVnudVr8dpd9aNZLrGLht5x/5+kqivozb2EWoAMi8V2l66K8 ti+lXCl6JsEWDx4PMCWLmAkHCsDSrE1XVwXFTXskFdpZXZU0/rI4/rGtql64ZFtDVlbudbN1JCFF VmV0aZ6CAwfPEKAjz2ty1fb5/wCg+5p21pO4hnIymsMhqQyxq2UVuQG7YpTjLfUePECl7bAjO+mg VN1Al2ySU0SGQP6t60ltTU7lGSBanJfFoWvKmFBi3/jspc1XpgggGWoMV18hwLxXeplFdoOjUSdP ErqiU2CUi5GRQQ2Qlikq3Osm3lDWStKIAyZhe9GTYzBYTKiTCwWcwZuUrbTfUarfZ5/6D7tBJNdh DVuEZeNjX8FhIxyDOzHk5Eo17XFNXAays2xRV267svsWYI0811uwQWg2301CujfVkNt+afFVcV/+ zrg7euzxEdJVc0RlYOmYKnVlBU8VtVq7NU03lorIZ/XUwVOhVGYA2VTmGS9gobAKqgJ+TE1S48oP SBWDFoSHXWGgiMpWK+R52rt73s8/9B91WKlGydYAzjxFqEhedpFPGW8gaaFVBaiUh7Wmmn9dS5Yb n/HcgdmsrWqvasPY8VrM1g6jfXK2AhtNxWqkGcQY4AN9XbZ61cpcVlV6sFCmNTynbKF15FtZr1R7 aZTarBMmBOJtJK0W8Hvc8S3UQRlBGHVxYOfIRGBghAjpmMvFvPvz3PZ5/wCg+9S5lbLTVwdileGF ZQ3WELRq2XPVU1zvSla0vQtT8LK6HJTdcC7xeqQnkFxOth0QyIn+N6chu6xVtaxlei4ZHWWV5AAM 2Kjrv2qtmtta3XNV5Bp2EYcFcGgpKyVA4XV21WaNutYl1YyZYMjbd6yuwLlJ5PjAVZxzGTIdXret uYBKlbRAQY5wNm4Kdu437Hs8/wDQfe0ta2yyvWCkUuZ/XUJZY4lOuWNHQ1nGwGD1qFzQTyp6XLS2 z5IAcN+rmtuuUOpcGCHq6y/XW1bKfXW/E02ReosrxGQWKyvq3VXJYLdCq2NpXIKueaX5A0AxUKko HR620ba9hLFsebIPJayrUV8BjMWD5sIRB6StgYMSItpWPZyXzG0TX7fP/Qfd1aDfbTWiKSVZWzCC U1wOYYYq/wCy5DVs62Iw4tSQ0twtutcg3kGRfXlbz27Av9e3XsEC5FigHe1yjioXJXYUNF4YABw1 XEvUttbVWalldnIK+QyV2jsOk07EtU8WIAC79RevXual+6SLS7S2xVlO5yiMCMjK9YRGWMME9CGj HB2LxXX5I4q9vn/oPuKpY+O1uynVTcBhDF61qcODk1H17S8jqOZeuZSOItWxLfHhVeluSuuZ5Kgi zgdmnXtZDRYCHQMu3QLE/wAGs1xaitZQdbaAgCWK9bqWorsW3Vu02otS0LiKuJtauBq7SWgvLml+ ujlBaGKOZfUWlmrYjam3yikEAxTkEQpHrjjA2big7jWTyb5Pt8/9B9zx1QIrj/4kBq6zFPoHyrbI r+d5xKhwvbLVgETbsIdiEs1bhB1nkKedSnt27FbsNS/pTYrrYk3dLlKnFb9qq1bNO2iau0wgdGBq wXrWxNvVs1X1LxsLXyEyAm4Dr3UbIuqcgy5hz4DOJYmV6ubtQWBLdmiU3pYFcCKwPsYSxRx3/wDs yFXbs53e3z/0H3NGvjq1CFc11eoKPUo9FIzKOoB9Wwf+K1iqVtyQV4TaQFaCLKNO0rNd+S2AGbmp atuvxuqtoZJq3hIjCxHrDDe0+zZq35GQYdGpzWjUvruHhTE2qO6jl9S2q5XQuudla7RTsDVvNycQ 4ss45iJ0sTo1Z7qXViwKCP6fq7WzXFtOUtmQY/y3f+3cs7dBOT7fP/QfbqUG+6pQFXo6dUrPF3GL E6x17dwOLFyTgOlOLKtSw8l9SbSDGqTXbahQ6WxOPcTboLp/ZevarC2Js6TVzU2eES1blvoFiX02 UWa1yXqpnEWIht1r67A0LgTb1q9hdfY/qWGzlHbkLkbvVm3FQwqKIIZfXyValYVcliEex61MeoiK /EswM2+ux5Y4p9zz/wBB9mJ4jW4IMizGDV0lg4XHLCk5G18mPqRsys4me3cX4WaV3IMnKbdTAK3J a2NL6e5kupYeW0gG0dnBpuKNsaddp17sBSLF29ddisGzUuS6uxa7MTYUbFepsub+eC1pM3NevYFT bFDczDW62Oxru135qsHscQqAQFYHKslkzmMMy0BWV+MdudvmD19zz/0GJW9jaekqSnpNheNwwVrP XdxmvBFeVNiF6wQRU5B5HF5yOli6t7VvVYGXaQEI4rftjiL21m09lbq7URhu6JrfTvV1qsauXzV2 6DZY4zs01bSf/oXBsRLunks6+xrbld9bPkg9SAw4jO0rGntc08dcVK9Ss6QjMYERT1YBgXxKryZz BGwy4tvIGAo8jcLdj3PP/QZ42hK6yvbtU4O0peulwRX87au6lTcWHRy5CciLMExHsVukUlGPJl09 nkGII3NQq9Wx3aTxtr1dh9K6u9Lk215V2bXasruWyum5WXeVKn1dxbVD9fJa67I0tri/Lrtp36az ZqkbKMtdwM5MYoMfljmaXsLq2ruLaFeBopBDLmcTkjBtAKhgCb1rS7bstNecbNvCtjyb3PP/AEKe PuDJs18kVwwrb08e1YDiI4EuIFvL0q2V2FJlbYL9QlqutoKtRyEeuys6e2twuQWoytrXrbCiXVaN 7UOxDDf8atg1dqzUsGyCFYWJZY2ps/2FYdw42tMOVsvAFhU3Kpso62VgAopgHR/lbTyc0+p9cia2 yHitiK0BzCOrSxuIs3cu91lsXpOXFfI7HI+75/6DNO/tWU2clZe29bHF9XdrotyFaXqXSl+qtg8h g5Rg2YfTGVXWsnFFw42Youo2O7Xu1+nUuYNS/E7tRxoeQa1O9meSrLTTvwqPxnkk5Tx9/KsPko3U 8RCoJ2aVQo2LqwvGsj2HBligixTijEv08mrYdIlwIRwwz0abbcKsFSuCCMLt7vGMSx93z/0H2aG0 SrJ36wSIlhEvrIKWZi2CXrwdXyFaXepVbIY5VHPEnMXYrtN/J009sqxdXGzVZVdTcLFVuaNYdbZF gYdGXY1QWW2yN27K6gBaXs5VuMJhpxGNhA1dvy1bu7VWCIBCBGGIyghvQ6WqwspS1TXfrNXcSEcM GwB5K30IgaKgE8lsNUCST73n/oPs17TW/jtpVbaqVzzwUtBFydopbAwdctW4fqrZB9DgZWtipx0Q hXrsOLiy2U3ixb0Ftans3VuuN2gO1VnalbklR1atGmz26kt1z/VoJMrDCVuMA5FgyNxTz1ryllbw GEGFYRiXVkxXepqbiZgNLajSyWsjParV3P3bVBisAN27u3+/5/6D7dNluoSpxDrlhZr3VBWLK1Fq hLipYC0cjiq3IswyrcDLrCJQ6ul9WJVcZtqHGlscJXxYWaaWhdG2uPTYyOgVtdeZQgBATNunmL7L qa9WwtaFYmslgI03Kzkgiau0AFcqQcwRxD8r6g0WwoaNpSLnXhXcpOzunjWBx+U3d4ICcn3/AD/0 H26F/btqQNK1MRTLKgtxrdRfrIVpqOW1lsj0lDWWJs1i8NFgWpzTKb1sj6tdgu0bAoq42Vlw9TdF y0ZQBtjFmn/11LkIMBhmeRq5Nw4NXxaV5mIwjoCL6uJCFxRcpFbBYDDLBynEBNtgrHfVBZt3XqFY i5SAhVU3PIQksfgef+g+0Eg+O2u7Wj5fIlrDmih0NXKGs1XhQRsUgSo8nROQavK2KxetAGrUyxSU vK1nTYGVDMRQIw6b1Ia/SKmykkFeom/1lpYDUt6UWBoIYZsp6A/B21qrQ67NE17SQSIfnZZgX3d5 3pDRaigqXkNm9UfY3bLfh+f+g+5Xa9bU+WsUp5Si0WbNZmtt1cRYphZ+/WPRsrkUsDfrohGyoUWO VNYyKV6dCN4erT/zoIEWH5eVXrq2LW6spFZyMZlyZba1u2wDBqbgTU4dYRLBym1UyNrbBAcLcjtZ Utmxskae61qbuwK1VcBCRAFl9levVZY1j/D8/wDQfeViprvXirrF2LEYbC3TXblVYnItWEv08S6p WNyKLNZj26SCpE8mnqrdq7K2AZfkflu0d2s6gCatnGUuIJYPU9YdblZGQ4NF/A1kMphmyncUKa3r qVhZriqk7VYam2murbtey9DlQQIzqo3trv2fE8/9B+AGIncaaNp46Ng42gyxQE07PVcoIuRTKjxb UclSMjyFeaSOmvapSh+S4ODiWoEs9SNVaGVG5BwclTN2ni2QprbidPZKMxzGYCM2RuMMU3bCTae+ 0VorKiKJsuv9hvIIgbyFpll9tnxvP/QfhUXGptDYyLLsiyzM0nHN0DVOBgnKa1mLEOVsRWD0okFf cOlY1dq4jLNurKu2LEfB1buLMOnXOygI28I3d6VWhl1tlLksAA2tmutKrje6jEccq6RN7cWtSST/ AAPP/Qfh6ewamGyCtlwI0NhWtR+VLt1DcbFJU678kM3QFflwucCxNW1bqiZYrkbKdtqrRhbDmi3n Wykx7PX5G2pVXks/5UGtsqi3eR9O9b/x69qK53aRBtUJTd5Cx4SSf4Pn/oPxBa4BsYyi01W6+6Oy 9jGWuVaqwGaNuAHBG9WXr2GmrsLjX2BRapR1sOF8mAAmyA42FYa9uAtmU276a03do3bFdyBBtUqp srNr79SLZa9rezJ/ief+g/Ho3HqH/prL9x7ZRvsk0twOtdoYO3IeZtroarbsrP8A6jEeJ8rbZY23 Ug8t5VLitjBtbc1MbO+muw89fnY8lbdCczJmT/K8/wDQf4ettPrtX5wpLvPbDrZY9jexWZGs2Lrf bmZJ/n+f+g/675/6D/rvn/oP8tK3sIpuI7Vgr/n+f+g/y/tO9taalF1G7uD/APh+C8Jr7+n/AOX4 mqn7g1NfW3P5nn/oP8rwvifE72vR4PwOu6eE8FWp8F4A016PhKvG/wDheAMf7e+3XPmNLS0tv+Xu 6qbmn+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8 TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+s vEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mf rLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXiZ+svEz9ZeJn6y8TP1l4mfrLxM/WXif9f//aAAgB AgIGPwD+lxqzhdDX3OvxVTz0QqqfoRtyia+pKJXxFD5LzFVU1Y6Qp9WJtRwiXPQ5wllPh6c0HSlr 9xXNVu2GqtkuSmLkq0uhKu+ZCSex2/7LUn8j7dDVEtU8f0H5T6Cb3UJFHWavgllMkjiokqW6M+1e uEXaCGnuNcPx/qTuVwl5XAl74cfUodtxqd1te7xKEeFqTkaW2C4w7lrbr4cIeWp54UxrjA3yQ9SM IG7VT4Co29ic0LIkyHhqK5fss0ELJLJW+DumehU88kmmFWaGgqEonFf45p5y9nGokSUKlSCgs2lr NGssMjJBGRK3W7cVsTI2cKBQtiuxI8IyUNCGdCUUyW5Jy/dEHbYoOg1wdqokQRy8krCqKJFURoTJ GOpJ/wCtMizpW70Fb7lzW5QWDwh4VKFVP1JTzVJ8JufLyLX6jFO5IuiJ3JINSqnCl0FXPVFSmmFM YyzhGL2IWgn0J5YrV+v1F0G8ZRU6FNeCpG2SlcKkjyxviyHNBripbYv2VfIQ5yTtuSq2nDKOUStS P3XzwRGPTCX4PpgxRxBDOq1IZ1R1K6HNrJVVh32unHBJJBKypeChPBrg8hXqvJKPLUV1rIv9ybXK I/VkrRldHqU0YlhQrQo5w9PDfXDuW+p32bVOy7ccV6cndavu3O27TclVTIa+1kHbdo/li8IOMKjY /DlHa/Qi5Hdb+L3IeqO6PMV9sna/xZDFOtpoa4SsmhOxQnJPgd1uhI7Xoyh3RXca2ZBDU5ZJWPdc OKIjbLDwnNDPPBPBQqk8UKZpRD1KFq6Ec5q74U8DUeEk84xkhVNIO51ZJLzpMpg/A88EsUSiN8O5 kiW5XwaFbfAlYSLCVhCJdCZoNTRFCX8LBGGhoJe46nbb7/Cxi5cESJW++Djf4fX+8f/aAAgBAwIG PwD+ltWruj2Ne3oj87n80Ofyt1/7/FV14GtEjSmxK14ZFJe6FctufmpFdb8RCJeCGl7kKClD7NHr Oh3XO3t/il/1JXwrKZNiIyTaVOMO29dr52Ks1JT8f08SuG5QUbeNCcRXxGzTCGj7aSSvqKWk+J8W 7yJ8DQlWshmmRrHsucp6eInGqGlpOaiJuZRS+p26H2tzvhN2uLGVE+BLvU9fAnCWVy0LbVux2WqS upE1H1Giqm7ZE3Ys7kcMo0VUEP8AX6ZpxXFuWIwmaopqyGtSq0Fa9eu5W7tKVKI4JbzOx6vTNBIm yMtShTclqZKl0ciX8tH1N588m+DyK62grudfPKytehN2v0xnJHIlGpYv8hslfsJv9XJRkoqalMIx iCVqXcSsvXwJO4nhCe6cnmeR23blNBxcyXczXO7Wi3/JTkgStdPqOou2BQvt3ySJPBvaSS17pFan fbqhPlFCuFcsoVu7ElsoyRsSykudSEQTiimxBXdkbHbwSiWj7bo6Fan3IoUNcklt6/V1JW+SpK/F oVaFXUTyt8nmJcEEToQyjOGQymeiILJ/jlVrelYPM7rvTJOSMOqP43IrVHGRonHWGQyLapKX0Qkt qZG99ite7BMXgdChO5Dwh41O6yq3W6yJKpffd+f+xey4y3dHBPDwfQQskEYQymeSUTEPoVRQtSLb PV5G99EeZcukiF1Ue2HnknCGThONGQuCuFCdVhKO56W2sa4xnXgluZE+KCbGh9KkkceFE1w0HB3p UesbPCUQyjItWhOtzrcy67l4tcHa9tBp6Mhif8SUShPYkk8sZIb1GiJ98F1WEkyTb6ojC665TAla oH/rtq9G8vfauuHbd6E7blNB2vaqHyh9NB2v0K+TE1o6ota1ipKJ0O7in/nCUJrVVw0w6E/MrqWy vyqylG9M1NVUcPQhqvJF25Gx3In5HdbVCuX28ncnE1O35EcjXU6jT/JyRhBNvqsJO0iIXU7r6pbE sl6bLO7rPYh2tDoKeEPoigsG98FFCcHPJ3LFXW+oo1Jp6H/0a8sEtWS34VVJC2Z50PM8iOB2v/kj Twab0O17DIJ2w7V+xqu3kSlpbiVEraFE7mO57+I+cEP3PMoKdHVdMIPIlFFMkQdltrZ90d93yHVE W+/wK5RVE/MSaqmJ6cDu2WonFOdjWGNJqOZJb7r3vsvIoiiSfPw0NSie1Y0Uf3d//9oACAEBAQY/ AP6/5/X0ZGGrpeW1p6cxeMo6ciCOYr7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7h q9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avW PQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L 7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4a vWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j 0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+4avWPQvuGr1j0L7hq9Y9C+ 4avWPQvuGr1j0bPqXymv7uX5gCAclZpDJHigdbHegIx6kfBcc6yag5j/AEH6l8pr+7l+WEYByUD5 kMDaKBjAZk5twQDWqSUDEsU9DIYKcTECbHKW/lgpacw0oliP6B9S+U1/dy/KUVItHeUMsQdQ0coT 1TlAqwQmZEgVEcE0QS/FASoWTh2HUngecFPIPGV1/wB1ohzGkxw3/wBA+pfKa/u5fkxGIvihGVZM 5KEIi9EC1RihISaCy6cc2DoZ+lMA43pqV3I9olGIYjAoxlSTMdxR1tEdk1lEfuPz/wBS+U1/dy/I sA5QM6DcgAO7co6YpK7qMiK4IHUk0cQEBpRcLt1JrRGRByCzhM4B3ITIqVQ5SMQnBc705FQi4YHA oy0Kgnu4ppEaYGMl2mlE2lGo/OfUvlNf3cvyDLNKskJbqoalhJHWkXlLHgo62oaCsQuyHicU1yjO QMY4OhCAeRWabGW9ZET+5VJ03K/Su9QXXYDbk5Kafd4o6kAxG6x5BlGJIG5Mabbfk/qXymv7uX5A PaNUBiVljQRuhVtKLP0YLLGmniUIaQejPuUYAZpC/OpS1QzlwCox06l2YJyz70YivMswrLeV/sJG 9l2KrPK+EcAnldPKvBDLpjnKqXQlKLxIdro6kKCRQ1A0YGjlCU5iVaoCADIznECRxiKv0LswOTDN RAT0n4iqacMp3EJ40O5MfyP1L5TX93L8g+Mj+yc3agUyO8XdDSgHJuefFCAGaTNTejn7xNsVKcgw wdCOnU4rMwBGKOew3JogB05NUZFstmRmRlA7o/unVbcUzU4qiiSA6EAUY5ezKq8HTEYiP8gskRqT 1Ad3ZWWelIE4kKMZR7b04IHULkcETEASCyajarYN/dGemJS09zWVi6eY6FSKbLVdksmkPxPqXymv 7uX5CPMhI0iAtQypA1DqU50BJbmU9WdHLxB3IkD/AF7yowhUm4RlSPFOXb91lgOhZj3tyeVhimJo Kn+wV2TN0lUBkf0C4lUunKf/ANUMOdHLUYrCqhAd2z7ynmXNwAF4WmO3uFUwJbFMaKocHqWeEW3g J00YmmKcjtHBNKiP+Qqm/D+pfKa/u5fkIngAtOIxusn8QKhS0jaK8I1izlDJclmC8aXevzIakyWu yENPsx3pgXliV2imv+q3GRcqlSMSiSbByeKBZ+Cc03Ljsr0IUX7p3GYUZCMyCCcwUoxwsBc8EZS7 07ndwRwQJwxXAYld6L7nCzQrH+UVnFXRPUnuqojA1/D+pfKa/u5fkI78pJWnP+UqL/lNqoxHflUl B+9qGsl4hrJ6PggNQkjABdo5YiwRjClGdOVQMEZEsIoRtEYoQgOcoBuyMFmNhZBlS29FzRARvvVT ZMUXAohpC70RmSM5RkSIgYm6v2d68LQDt/LALNrS8SW7BUiOgLNEZZLJLuHHct6sjOFN4Qnhb8P6 l8pr+7l+O2FyowibhlEm0KdIQmcLLxDcd0ITmaRqBxTvRAgV3omRxsgH7OKA/ZXYLLEUJqSs0y4w CLCgx4omyYdJQgKvfmVT0bKYKhQe4WZ6rxZ4d0J8UxLDfgsgkcguVk0wwxTk9Gxusrsl94WfRNMY mrJpxB5qJjDqRAgap8iaQIPH8H6l8pr+7l+OdxBDp/8AEIw/kS/Wogd568yp/FMED1ondVElNgjI 0iLIAdSMSScWCcluAWSNHTyVKRxKMiWBsNh2MnwVFvKeVOdEAtDHissU7X2NFMRW5K3OjJnfFMBS QcLcUxTMOdGMogHCe4qWnK8S34H1L5TX93L8cR3gugDTes3SqX3oPdA8EP1TncyqiZKmKcDtFSkS wTE2JD8y4rf+yqeYKpfZ2QSnNECU2FFQKieZ6Ewsqm2zKDzrMRg/QVXYQdyEh3XpwQkFUMmRi+Ls jqxHaBqfwPqXymv7uX4jJyqKMjYpxYqtwEEyBwsUALoQjge0V2sL7k1giZIkqozSlURUhIOTXgHV 68FSg2O1E80wDbGCeJTEKt+RlF0M2NygAHejp1TAJimOOC8M3FlxVU/QiJhxJ0Y4Ycv6l8pr+7l+ I5qVboQ3uhAV3nihipc1E6fArILuCiHbKwccyIAYBEX3LPI9p6BX51mlTTH6ptLG5TxdiGJOwOuP IdOVRV2umis0jUq/Fd48wLIXJ4l08exIYArPA5jiERK4Q/y3oRjUmqqSU8aIibB+CzDUAItRGQaY G5GMgxFxyfqXymv7uX4TBcUHsqX3rJEPJPK5sFV3UuATYlA44KRjU5aIAY1JxJKIxWUVIWSAclA6 sqXYJny6YFOZAs770IAdqyBNBsZOVSqYM5wQc2umCym21ysotsZldNghtzwDTH6ppUkzMqh423WT gsdxT4K6CZePphpDvDk/UvlNf3cvwWTpzscX3IzkAXuXXAW2S4B+pPwX6AJ/5S7IHAoAX38AiXbe U0QST1rPrAiRwXh6YaIvxKYl2T9AVb5iShH+XBAEp7yQBNCWTrPItuCcC6ouZBOUwpFDkVW5AAO6 bFFOKFA9HSi1F2ZPwK7cekJnqqFSicQyI5H1L5TX93L8FyECegL+2wQF2qEIDdXbM4AV6VwCBNZG 24BZiCAMSnkWBuqWFwpGQGcGhKyiwxRlEUH7oyaiGKhOHekKhEk13J7MgypcVTnDBGcTarIE7HTB dovyGGCZ09QhEU/VCRemKc9oDHFSjK6dGl6qqpRMaqoVAiTUDFHkfUvlNf3cvwPElYWRkgTvDbRM mtcyfZS9ulHTGIqUIgNGPeOCGWuPVvQe53JyKigWXUtKr8EcsmF4dKEpD/YVU0GCGakRZGOO9Zge 2NyIKbFUsmBojG/FExxuE8TQYJrSFwq7KKi/sFbrQeqoGTyQ2cyz6feFwmbigIFiCmN0CqXTFOiC FmA/1ytyPqXymv7uXLZAWCAZRHF+pObKPWmFto4JghEtDPiLoCRerKLml02OCeTE7kAMA3NsLiiA hKn7ISkK70CCmdhiU4LkoRIqrVTixT76rN/CVCgdPrTmRV1vVQrMu83OqSBRysVUUKrEsnNEUTwR AtJODTDnQ3486ZPtopachU1B3FS05hjEtt+pfKa/u5cvnQKc2WY2wTDoWaR7RsE2ymwa+vGl4ROK lJ6iy8O7XUYi4xKJjWTGqANZFnVe8aoS1KOqggWBsjH+Jqjp2bFEX48EQ18VGES6BN9gGCiRhQox R0zhyKLemZOy3c1F2Z2wNUBKAPMmkDEogF1RHeKhEnCgCYJjyGfZHzEBS0tv1L5TX93LlMgN6AGC c9SAFSjq63RFOU+wRAeRUdfX/wDrBtvQhEAACwUj+qlqSk5kSeJTmgFh6U0RwUSRmIuE8gcpwZCY rE/ohEVLOECS5AoBd0dTULOXyhdkOmQGCPOgFmFwmdUuLo8a8ugCYgJhcjBB8ExDheJp2xCtVcVI GxQiKHFXsql9gAFUwDJwtSBrQtzhNs+pfKa/u5cp1m3IylTcmisxrJXoqXXBCMRVAatQ90IxsBRP wCZxnlQRxUiItR00qAFPGkTStCgRMGJwQEsbc6MSezIWRmBVmCE5VKaz4o7kALkLtI8CgcUQjFZo oTBqMEHoqFNiNrvZXXYiSyrAjjsoiCs0bfyCdF0AaxWZ6GipIbHKfZqcAU/HZ9S+U1/dy5XOg9rp zSAvxKaAYWVVxTBDNZBm2d9gN5Q0fLSaZ70xgOCzy1C5rmkXL9KOmanfzI5izim9GWoXlgSol2iU DDswjTNj0LMQ53lM/ZBWbAllI8KInAkIFCWBRaxqm2Zx0qqEgFUlkTE8yelVYOFQAb0xTlBkAXbn ZdsyHTROO6FdMi3OqJrhf8dye3MiHcC2xk4uFKH+VNv1L5TX93LkhBB6RCywWc2WY1xTy3r/AFpp HmTEumjUrtS6EM5/VkIgOxouwaPQIHULPcoxg5iLHed6kJdph2VlOCHltOzjMjGWJWUlw7hRhvUI jvSIOx8QVGQ3NtZEELKejZwTHBPYoxdwMUxTLeqhURMe7iFem1trxLFNcLtBk4KqaLK9IxG36l8p r+7lyTJZjhgsscVWpNyiApMRTBZd6BZNi6fN1INU4oEh3WIbejG4FuhRJGYmwXjeYDyNo4BRjp9m RLUxXiCk3aUeO9SM8KqWphU9SDUTk2FkIvQKH/EJgneu5EGqeJZNK+xxdAvjVA4HY8dlKFVqV/rL ncV/siYk3QJtgq2VKhqrJL/4rKTXApygeXTpWpPB2HMNv1L5TX93LlBg5Nk5rP8AZVrwRICIYvZP YgrtFRLP6VULidhrVZQb1UZNUG68SwZeJMvGLD9VIAdrBTEqUIKMhuqgUXqTgmGJTSo4ABW9EojZ ZPEsdyaYylZo2URJUO0kKoZPFZNWPTxXY7cBh6FuIuE4XEVCc7kBE86DW5RdAQ/mSH3cj6l8pr+7 lyQyzGpVQmPWuAuvEjUKTDoTkXQa70QJDEXRlKwst5lV1LW1Tl04qUtOOXTiGHpXhDuuyMB3gAtO Nge0U5WWN5IAY3R3NRcSovvc9CYhMawXZUttVxRiTlKtmjvCYuOdXTEMmJFVSuwiQRbnZeJpuXqU 5Owj/JCR50QDblmQFYF+R9S+U1/dy5JEqEpgX2ZplrshWjVfeokRqCImODomJyA3CL97BCZ7xv0o Rudy7QFDSIxKcho2AWl5OJYXm3FdkUJKhKN5UIUo4NXoWfcAAiovgUdQ42RB7wRJuylI4BHgiDij EWTRrGV042k4ustpCxWTUHSqgJwG5qJxIjnqm1KtYr/XqEcEPEOYGidHmTYYp41j+yosx6AiY13o Yc1EWjmgmIIOyqfZOBtIEKenK8SRt+pfKa/u5cpnZCEg5ehUszuLRFqqGaWWJLy6FnjYnMBzllmk cr1ZPIuDYJmYBRlG8bDeV4kqBZpYE0U8ozakwQOD4rJiAhg1utSiA7gqD2lVOUNONTI05io6YsAs wwRIujqEvmXPszRD70QzkdavtzQxuE8rrJMPxVO3DdigDTgmknCpUJosDiMCgSHCcVorJsCiQNhI Djco4UQEVUVVQuySOYrvEjcVWgRBtgUSP5gS2/UvlNf3cuU6jqR/jUqf+X8ecJ5VnK25kImQ7I6F VyAgW7QIYIxbtGy4m8jwTaYz6jf/ABij2Sd5aijqHvyPa5iuzjdQMcUIQrKVB/dCH+NlGQOICPmd TmiFz7GPdKEMDyBqRFMQjPSpPEYFZS8SLgoCXWqKmyMhWUagGyeMTDUFXfFEeZgQ1pAUQlEuFW5T 4I1AbFZSWBsi3I5wgTWO9AYN+vKI6kAP4xA2/UvlNf3cuXk32RiA+oXiSjlJAYCvBAGsinKpd6J5 0bBGFtMFs3ALLEMEdPKzVKOW1uZcRddo4Ahf9xqhpSHYG4J0YE9kIwNhZMiCicMEITxsVlN9jhZS FnhbEIENmVBmjiyoehVoU4ThccFk1A4KlKIMtAmrb0J6RcG+9MbBdm4QkTfAIHNVMK8QhFFMmKzX C4qvIzGgAJPQp6p/kac236l8pr+7lyxKIYDEprkYq7AIse1vQhdeIf490cd64u56VqaYoxfrRGIT yrRTJDCRcKccCvDlWMCDJADCios0D2434rMUNxT3RBvgpQdmNJLJM9oWO9Ma8djhGJWPhmjq7p40 OBThpDhdNmMCLAoCY7W9OyrZGMqg/wB0ZaUiAS5jgUJRL8EOCLXkGdUlcqtSceU8bqt1wVnGycYH gTw5H1L5TX93LlCAtjzLLEMANjI81VIyrLjuTo7roamEqHpR4ojC6dFjxoqBzOIrxGxllJ7xQALw 1LcCo1ei4bDMWkU0qGNiFlmWkMcCmN9jhGJHWsxGbTxG5CUSCgT+icxD71m0y4GBVZMRcKi4lFr3 CMcHxVLFMSnIy8Qspq1k+/lbk0uZMif5GgCbEmvI+pfKa/u5clgHKMpjty/ZDcUCEEQdyHEfqEwX OUI7wQOe6i+FDzqlmQGCJP8ALuleJN/Edi+CzbMwFDigD2ZwshpagaYNUydZWrvVaEFiFvf9FkmK PSS7RYGycKlisuoHdHU0xm08Y8E8Da4xBTJjYrxtDsyjcRxCyk9sYbGT2PBZCXbFOTzIRONEZab0 wWWfZkMCnFeUTiE5LNTnRlPoCEeR9S+U1/dy5MtQixYbAjv2EIS/xlXmKkTd6IKB4qUcJdodKHOh uUXpEEEKOqD2J0lz4LK77DSoqE47poedDU0x/sjhvCEsDfgqVTsjqwoDcLJmzRIomIdZoPPTxGI5 kA/ZBxug56Vmd3sjCWN0J6J4kb+dMKSjcG4TFkXXiwoChLdQp0MqzFwUy44c6zUpcIT0qSu67cc0 RchAxkObHknioDgUTwRO7kfUvlNf3cuSP+RdMjwCZEKXBSicVxFFzIS3EFQ1RUxLE8Cg2KfejmFq OssuMSiJd6FEDwXAoyhaVgiDTUjQjGiM9PDvx38QgXoU4ruRjIUxWaNj3TxQiXEhcJn51mh2Zb4r LquR/E3UgakWX7oBnIQzDKcDYEcVGQq+KujGZyxOPMiHMtElif7oHA4qlhiuZVVFlNIlySjpjuCx 4oggEFPF41wTg5wq9k7lXY29AbgicTQJzjyPqXymv7uXIEMBU9CA3U6k3FEIjcWXOuBumFiHHQpA Y1CB6SjE2IWSdu7LoWU/wLFUqszXoVLSmO8Xj0Lxo4UmOCA/inFE470ag8ykZnKDQjF0DcLxdAPE 96IVD2cRiE8QpachQ48UC3aGOBCzRodyoWKMNSoNjivCn2omxxT7HlgpaE3GkT2XVLJipQIzYjmW WMrYFAMxaqrtKb+QWWWxlUKlQmuEGR4KI48n6l8pr+7ltojqSHalQcylHihLeudSH+VQgd2KDqMx /E15ioy3GvMqLLLrU4C0+0P7qMxQS7Mv7JsUY4GycDtwLxKEriQQA/8ArJpw4LLJOCvFAcHvLwZm ooExrFePoMNTEYFVBExSQVOdGBpId08Uc9B/KLX4oSgXeybEYJmaQsVLTkXahH90xNAms5X/ACAo RvXh6jGOEmXZFUZWBDGRwTvR6oSdxyXAXHZXbSgkiD0KZ40UI9PJ+pfKa/u5bMsA5WadZfsgED/k NgUJ9BTbDHeEx5imNxRPcqOpjGrcFlwKyyuLoF8FmjfFHQlYl4H9wmNjcIDUcx/jMfsUGNUROrom Bq7xNmR05H/ZHvf9EHqvG0w8gO3DeFSRHApw7IxIYtQoQkexO43cUJ5qb1a+KjrQcZqlkC/aF04v vOyqoFIR5+pZw5niF4U6HBUPKd7K5TX2HejGHeIZ9ha0acn6l8pr+7lsEiHlKpRibGqAxQmLxQ3J kXwsmPMedcFQdKkJUeqzRrIX4hATsbJt+9Sh/jY8MENSAecbgYhBXujOJxeJ3IEEZ40kOZZZh1lk /hnuk7kJwIIKkGctQoahYGNCGuEJxqGdggWoaLxdOFD3sqyE1FjvCojOIeQFl4Gsbd0qkqIh3OCj NwWwBctzISBof0VKqivVNgpREc5OAuFnHZLuwQBpMX5bgOgI3RmSGRMHqU5upHgid/J+pfKa/u5b IjFm6kJjvR/ZR3jFMcUYGxqE6rZGQDA/ugVzrMBUVXOmxFYqlxdRnhaXSnFd4XiaVI3IRj/MXiUY Ikd3+QWYWKv0owegLSj/AHTHFGWma4heDPuYPggYRAJ3IiVXVLAuEJRq4d1emKz6VJCvShDUixFH XaspEVG5MbblSxVDteNCRUrNLmKGppmu9CMy0xRNySpCIcg3TEtHdscrwweflfUvlNf3ctgB7pV+ dGOBsmdPHvxsspuNjAVuEx5mTIpjTEJihKNCLovY3R0naQx3hM7gUMSo6miWP78EJ9aOoOpS0J4V iFuXjQLEXKOnKs4rjuXiRAsxXhS7w7r7leqjIXND0LwZHtQtxCY3CrdVqV3Rzo6mBQYMECqbWHWm u2KMJVG5Zo0PBZNW4sU4LpxsKnLcHCdrpxsyQqd6JNzyvqXymv7uW0PcUK7PejUbKLxY2PeA/dA7 M8bG647HF41Tp+goG7XWaNJCoWfLlnYtZAi8bIwlaR/VGJxWaFwXBQnjiOKMZ2KEo0YsUCMU0rFZ tInODRNMNIJp7kBmMA9CFlkxb+QXEJ9ko8E8g0o2QehF+SydWTMxWaPajuWeNOCcX2DTH8j+iYqi EI3Kc35f1L5TX93LbwNCjHULFqI6mkQ+IVKbxszxPZN+dc6MSHdGJ6ObYyy4GoTIgmhRRBtK3OjE hwnjRiozjfFf8sFWgN+dXQkaA3Q0pyoB2SqEU3pyu1HpXdqaBDWDHFudSjihR1ZlRMmlghgJUKrY 7OG0kBbwhRVWeFYG4WaNQUZIkWjTp2FSOAoPwPqXymv7uXIjm70Sy75PBO+F1nh2o8ME0wWKeNY4 MmlQ8U4uLFGMqSGxwe0KhVpvQMbIcQqIA0kLpxivClhVXX912ZIiTFCU8NyBB7KYm2wcF4JpAlEk 1WaEuhVDHaJAYMUxC8LUvgVU0wQ5Dx6VlKymhCJPd4qYFhYrwoVe5wCDJyjp6dzcp/wPqXymv7uX IyS7sv3TE1wUg7MqWNwhl/kKhHJ1J51kdyYXFCq0O9HJfEIb1mjQ4pjUFAStgmITxuE4LhdqLgYh dkvEWVdh4oxKpgWT7QJYqJFG/VAjFV21RYVRBuLLw9TvCxQD7WBZVRMaAXQlVwgxaKYmm5BrYoE0 RhpnpTm/4P1L5TX93LkOEHPbjQqoVKKMrtdc6IKlEV7Il/ZOcUJi4NlM7iqdCqWOCiTgQ5QwrdBi i25ZpRcWdSNwSt4VNgsHq5UtPeH6Qmw20FQhJ6nBZTQiyY32snTGxQIpLeFU5ojBAGgkHCvsI3Ix HdB6ymZNFPuumJpHDisoLR3fh/UvlNf3cuTmgWKGcOmPZKDSTGYdUIKeVyGHQVZZo3GCL9nMLcyI RaqZgXFehRLcQrJkYtR1LTZnDhNtjILM7SjWuKGpGxQ2MRdZhWJ/ROKMnFCLhDaRsYpszHBCDiRj iEZAmm4rJNhJr4oh+1KkRx2Mq3UpvXAcUZSNT+J9S+U1/dy5bhNK6cFulCUJ1FxvUNQHeDzpwXRF lGUagGp51J7quCmAKMog3FENgmLKMsHrzIHCSGwtcWXiPZeHgbLLsdEEIjcs+GKepiUCC77W3JiU +Yk4AKWpqNENiapsxAPUvEmz/wAWxQlKhHdHBAqqzSIAxTRPYjQfi/UvlNf3cvwb7D/xIJRC50QL ocVmROJdZcJCnOExwTpwLF0+5DTkWlG3Mq3CoqqUP4yqEYi4LhCYLHEIEbKLMLG6Y4rLeJsvDmaG xVLKqeyc3NlemFUPEmTE4PRZSHbZKooyywqU67Uj+N9S+U1/dy/DO40KDHBBXbcjwP7p910QzUoh IXiVHcUyIOKnACuBWWxGK8HUL/4neNuaPeH7JynHdlQ86yS6NjYJiOlPbgrsgf5RumxCdSkaCKMp d44bhsI4ICxxXh6Z7RudyJNSfyP1L5TX93L8TKTQq6NUQTX0I8ycog2KDHu25kCNycoTH8qFUpiE JRLThUFRkL4jimxRi7AoxxBWVMT2hWJ3oEmuKcFNjZf7RU0G9HsuDYFZ4AgfyHBRIl0LLCpO5HxD 2jYblmJYYqhdGcpOWoERDsgpzU/kvqXymv7uX4rAqpUZjfVARNdgkUN6MTgVUosn3JiaouexOvMU 93q6GKzjGhCIxFjvQD2IKeMneyBJ50X/AOqJJoKRG5DMaqsuhZwWiTZ02mHkjKRc/l/qXymv7uX5 BjWKsUwoEBOrYoTEn3hAg3VbLJplzKrbk902VeFKTRFoko55iIG9eFoVAvJZroZgAcV/pkJg1YYJ iKc6Z24p/wA59S+U1/dy/KPGoNwu6jGHZfFGUyZSOJ2iUSxFiF25mXOeRX8/9S+U1/dy/r31L5TX 93L+vfUvlNf3cvzjQiZG7RDn9FMjTkRp98sez/7tyGqYS8MlhNjlfc/9A+pfKa/u5fnPPeYhoa+v Pw9PSB8uBKcBqagctf8AioaEJnzGh/8Apeah9R1SAc2mNGDeKRambpWrAA//AJw+l+Vlolux/wBy dWOZpf5ZszryOtPRlqHV+ony+vKLt4I04Tq1rlREvLZ5HyGt5wyMiDn0dWUYjmIFVo/9tDw9PX8t oa5gC4jLVgJSA4P+d+pfKa/u5fm56nnvqMPJakZ5Y6cmeUWBzVXiaH/kENObEZokAselakIf+Qwj HWDaoBDTH/KqHlz/AOQQOjE5hpvHKJb2dD6dpfXtPT0xrS1zOJAkTKMYte3YBX/9BDumF4901Iug Z/XtORAEQ5jYWF0NHyXmo+c0TASOrFmzEl405vzmv5PUJjDzGnPSlKNwNSJgSH518X5j1PYXxfmP U9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y 9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5 j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxf mPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF +Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8 X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2F8X5j1PYXxfmPU9hfF+Y9T2P6/8A/9k="/></g></g><use width="1" height="1" fill="none" stroke="#ffffff" stroke-miterlimit="10" stroke-width="1.5" xlink:href="#a"/></svg>
diff --git a/silx/resources/gui/icons/image-select-erase-rubber.svg b/silx/resources/gui/icons/image-select-erase-rubber.svg
index 0c091a2..b6fb880 100644
--- a/silx/resources/gui/icons/image-select-erase-rubber.svg
+++ b/silx/resources/gui/icons/image-select-erase-rubber.svg
@@ -2,12 +2,12 @@
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
- <polygon id="b" points="21.065 26.312 0.489 22.273 10.937 12.341 31.512 16.375"/>
+ <polygon id="c" points="21.065 26.312 0.489 22.273 10.937 12.341 31.512 16.375"/>
</defs>
- <clipPath id="a">
- <use overflow="visible" xlink:href="#b"/>
+ <clipPath id="d">
+ <use overflow="visible" xlink:href="#c"/>
</clipPath>
- <g clip-path="url(#a)">
+ <g clip-path="url(#d)">
<image transform="matrix(.0953 0 0 .1337 -.2744 -11.418)" width="480" height="456" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEC9AL0AAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAAB/FAABB4QAAa07/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAosB7gMBIgACEQEDEQH/ xADSAAACAwEBAQAAAAAAAAAAAAAABAIDBQcBBgEBAAMBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQIFBAICAgIDAQAAAQIAAxEEEiEFMSITNAYQIDAWQDJBI1AUQjNwQyQHEQABAwIEAgcGBQIGAQMF AAABABECITEQQRIDUQQgYXEisnM0gTKSE6PTMECRQtKhsVDBUmIzkxTw0SNg4fFjBRIAAgECBQQB AwMDBAMAAAAAAAERECEgMUFRAjBhcRKBQJEioTJCsVIDUHBicuGCE//aAAwDAQACEQMRAAAA++wd jhR105EHXTkQddORB105EHXTkQddORB105EHXTkQddORB105EHXTkQddORB105H6dbORB105EHXT kQddORB105EHXTkQddORB105EHXTkQddORB105EHXTkQddORB105EHXTkQddORB1/e4V3UX4V3Xh QAOAAAAAAAAAAAAAAAAP84lp7z1GTKYbspzYeF9snZb8WSjq9AAAAAAAAAAAAAAAAAAAAAAAAY7r wrurq/Cu68KABwAAAAAAAAAAAAAPbdqMF9qTubCF0c/IllZ5GcZQ+VyPtvjtu2oCzQAAAAAAAAAA AAAAAAAAAAADHdeFd1dX4V3XhQAOAAAAAAAAAAAenl9uvCpvRrnkwXe1WVWS8lDkpe2wj2NVsJV1 Yuytop+L811tfpojanZgDoAAAAAAAAAAAAAAAAAAx3XhXdXV+Fd14UADgAAAAAAAAAA6rsRrteXb pwX+xup7NimVNpfGUJ+TnVHsa7qbK6lopaavEAu0eUuucs+VGKL7vCzSjzJNPO72IzdeQL6KwBEA AAAAAAAAAx3XhXdXV+Fd14UADgAAAAAAAAADWvma9eVmdNlWViyN9N1k65U2etewqs8lKgoy5r7E arYWTqjeJ0buZfVbUTb7DMq2Y84tPS16Hyan1+Hqz/P5u7kelJaeoxKOHDdpl3HL6M9wBEAAAAAx 3XhXdXV+Fd14UADgAAAAAAAAAGjr5enVhuuptqrYtqbovkyr7TZeRrhP3MtU0drtrlZOvyR2fnnv nLPK51rGH09Km7UsU9wVtrQyLc9lZ7shJLVrnmzS1n2PKQS1c7XoSy9vJzelSBkkAAAAAx3XhXdX V+Fd14UADgAAAAAAAAAGvoKNU4GLqLa+X30sUX3xplVbYl5RZP2m2M5WwK+TlV6dsieerqvPYyse 1sTWy6ZJ6WRzJBmny6iV6sByHtnKk5vI6vO8pYu9nz8LO+jwnqZoHn6gBwAAAY7rwrurq/Cu68KA BwAAAAAAAALK7nNRtNynFdeuzWsKva72K/Yxs8kRWRqsr7Oz2uHLCv3ztp75V2/yvymfW9HG0Y6N RCdFNRCVdlU5rsONuL254X+eS5iyKNJH0vIqU0Lt0fmlPsluX/JFldPoAHAAMd14V3V1fhXdeFAA 4AAAAAAAHp41FmcGWVXM2SVq90e3yhKq62NdkbvPZ+RsqjZFZT5GErfYV0ystpqjOc4MN90Ivzrj pYXKOUzrh5KpjRQcrtbmrqZsnsydeFXN1UdfleS8ntweeS82Q+Zyvp/mue1EDPoABjuvCu6ur8K7 rwoAHAAAAAAA9Y8Ytr8tlZygYVYy8sshKPGA8r0eswYqvolXWmQlX21ZX2m6Z5e53Yo3b7X6B4V8 tkR8lVRGXk8sJyt52dlF0JMtqWUYHZU3V4lfCjT5vt1Rp86cCOyNXzf1al2r5Q2cjL6UQIzY7rwr urq/Cu68KABwAAAAAui1OMmyyeStRiumXrazVXbJwnAx7H2q++NS0bplTi4otI359Xjt2j32izm+ zyqBbCmcqr07lkbplyXkZ1cslfZfXCu2+dGeDPjFeGCOopPz8zyUd/kPe5t2ul2xFq+Hnzf0OZbo +VPfMHtsd14V3V1fhXdeFAA4AAAHo3Lg5BizJOF1EahW6vPexfTbHk/a7YXWwusquS9cnG8Wdphd CFU52o3RnZpqujLt60LaZU0tVXd5GjQhGzy6q6N8bvJRvttW8rp0IpWwxNsqtQwNJ3IMUIWV7PIK mfe1JSZ91F1Xk9k/mIThl9pjuvCu686vwruvCgAcAAD0abXd05osRsrz+UTXplC6q+u+cq5R7e7Q VXOe+XUzU8uFtVV4vhKyvmmpdjOtk3JVvupNfTTlWuXVzqcuT9hsagpJFiNdqHt/k66bmk2aaX70 2s2aaT60seXC2Ho+N6xTdDnsJliNTUNtPyOb9h8i9e7uvCu6w1L8K7rwoAHAALK2JcebqvuwBJWq FPk66NM5eexsk7T9Vnuy19rIr65TbVyULB+N6NbNK6n1jLlKlNmy+SrNM5aX1bVoaZVWRnV6wk/G 6upk5NX1rztVV0WIZpN0+U5tK7PYqyXwXnLGlXbTs8u2VB2tr1ewv8881Qj8t9RmaLfnu68K7rR7 a/Cu68KABwAPXFdG6t32NbFMF8/arPJw1eX+P12a+17Pwr8vG+hw9sfZQvt7bXMrujTKqVlatlll qnizdt6s6rZWXekoaUvPfLc0NDPbjddKuVeycoyjydtc4UsyXuqxTv8ALYYFk9XNv82qqz3V5NVt THeWXRJSunXZolRm6mTso+Z7nwzueT31+Fd14VzoA4AFz6Lt9N0666c/vnsqbSYxGbzWd5TP6K75 KNFmhLzy2N9fkY2eXpOrPAVjfZKvzt2ezG225K2qc5Xzptjpo8YU7UVvQTp99sQs8hOEozuajRTd bOnPJ1W+nNYhbTbio9881eP4u553lLVFlnGpVw0rcHb+Z0yyu68K7rl9xfhXdeFAA4e+WSWvKMzz ysvhRnjXZRC48l4n7FirjzSWZj1/PkrXNnSPKb03Ebe2U3qvtNSWjldkzKlnurMtjbOMbpVtNqT0 eRWdz9DllMHK+drjI7jmyvfXS41lv0VNQtKs+d5Ojb5sfCVvnWHvsJV0se94tdCvbUx8t9B8pp1+ d14V3XP6q/Cu68KABwtqukYbqf7ilBg5ly/Gq69NdlPsLXKPTkbbKfI2Sv8AGq9Glk6KlFtq2kst z9HO0u3UZTqdhporhuT8YWsg/SxCG6j2Xk8y91Uew05JMU6raWbYVoMXR7gZqtvqyQtTv7noWYX0 +aWUMzyEo+wlP3yUbKqmoXVYfzn0nzW30GO68K7rHWvwruvCgAcGlbpR1PVpzy3+Tnyuuu2VJf0s haRl7yVWko5Xcz41XnurITTaUYzY2R0fItCqj61ndJZyqrfmwsX0ZdM8nT6asGaLc57OHKYRbZ5H OavrjBhha6iu+0nVlQobS2YJU+W3edH2Qq8sW8G7FboSv8jHs1fivv8A4rdfDuvCu6vQX4V3XhQA OABY0m1b122iUsFxVXlSnGyFsb/NGEqvanK7tHO08/PZ5UX2Sllu0rNlHSTy7MmxV3XB+EpZvQzs /cR0Zl3VCVjdVl8NKt04cootsiys2IvVx8vlOumF8Fme1RpO/CHnt/m1ezolxicLa5zJTr0LVuV6 aFvmvovn9ss/uvCu6w9dfhXdeFAA4ABfROXdX2DHMNVwxRyqI9GdTMHqbvJwnTbJS9KU2bnV6bcZ /P0rpP0XGPX84aGXuo1783Qo3RpcX5LO9apvzKO2JrNX1B6m2piyMc1mfqVMk78zTjCvN08y3Ncu tfpw2yJ8zeV3+RknfEsrtYoIWsxiaOK/J/RfI7Lre68K7rV6S/Cu68KABwAB5X6KNELIWV4bVG6e dsY98rtrdTar0y98nXbCm+KzaWahhvwSdO+OvYq9j1q4n0GVdBF1cv7reUOZdiqOpCdCTma7OBW7 OCttNqqEpzK6MqyzI25dlP2meVVxeq/Dpe12VdmEoW0wuqnT6VytgShXtrxsHXyOfRsd14V3WMV+ Fd14UADgF45qU31eb55KHK21WVY9c9rlG63yVdd7Z6VXL+XV9s3pUM+dfhLa+XuibGM9C7QRfry3 fP2S930LaVC3LdyjxrLcpna5blVYy9KUb6GLaY03ZWhKqOa9TfjSlOejCmhr0zj45lNcP2UW0TlC 3yM1oNUXUKp2L+x6SGW6ll3Md14V3XlK/Cu68KABw0c7YjU1fSzX51cPfS5diji22i6N90fa67np 0vUXZ3jKkrH9XB2MlssH6PJdoocr0ddax9fJeti/RZd1fsk359z9KdUeueRvz8zk9nE1Z9aalsOK 1NY+nNsrlfclki1TQs+nOPq9jMuJOwI9ZmnZCd9VkO9yVWkfa9fHq98yGO68K7q4vwruvCgAct3E dCGL1ldiGVa2Enb6rPIxqtpvaL67Ka7LtrC18+iOXt5XJeuqeLfo1Z3+bb8xoq+ejCcnV65OQqdo l8243kbK9S6i2mSuhSqjorzjyrHfXo2Z3ct9aeRbQzNKdd91c89ntF8BCyyy2idi11VxQ1AXsp90 50MzQzPU+iyQMlLHdeFd1dX4V3XhQXe6vab/AGUq/OLarK4Q8nWnZZXfytOyr3ulyHnsJDiNkNH0 Ck7McsuVLl9ktr5zQzWNfO/U5nEG8jQn31iCUGlmPRRxtDPY1R0MlxLkNGOY72mdUpyx1eXQ7DEe ohontWUXZUoyIWUeyrsp9hYvKDckWeyqomh6HYZmpg3fSrgZsLHdeFd1dX4V3XhRt3LP2+bG2lmm ha9e6qTCTa3OW2U2Iq2eedukzRZFXesxG9zSxX886a38bstCj1hPShl6uaXzuqvn6ufQU03U8Xbx NSyJlaiM6XK1LJVIPK12807lGa89kbY1zzFtFTRyejktRaFi9medlVnnJVwsqvpWsz1/Sn7ZVdo+ hrwNHMyACGRjuvCu6ur8K7rwoc3fl9+zEMQjzNZ5apTFuEbocXuVuTvUvqJ+Vzdu9j5Hr9UJVz1E fL62c7kaNt3rtGbXzeyHa1SzmQ9ZKmwS7HWktbHPZCfsY5y2pk3W6jK19dN3gVW0quU21VUXMzVM pEe6Xq91Nvi7CWmvDuhZ7fuewnjZNkKwz4QBxjuvCu6ur8K7rwoHkZ9h9Ov45d5a3tFtcqmKq6pX RmtAz7Ra5XZCaXsqreQ9ZRa5ynTx3Iyh43m9amY9TyLNuc3yHqz9nOJpaa0u1sJs943dTbQrydjJ tlZoYus4z74USjC2EoJTmndHSW9ar6k1VVLj2U/kbNEbIz9H6HNy2VsGUAhWADHdeFd1dX4V3XhQ AOazWbsX4YUPWSz51Tsq7E7PI1yhb6vDrUYwgm0hc5f4zTyqqM11uz4roV5UbXTncS7yVtmhbQ1n qXz9nJnYs7n6Vhi2u2iEUX6usd2mu6evcg1RC+Eiu2hVuq7Om/mls9XO8Rvm0vTft9ixWzEhsh4G XEAOAAx3XhXdXV+Fd14UADk/o/mdW3Ps2LX6PMjKpiChd6mMhV+qsgzQ7XYss+nCV+ik/VTLL2cr nYvZ+j3l9pLNZiDCulpsqN0Q9QfTTzr1vNPNe5NvPAjOEZKqaOZfGbXtLmhNJqmfkJrWVpZrJ7Xq UMeTs21Rpzcls6QoygHOAAADHdeFd1dX4V3XhQAOHvgOaWD7ZT9A1gWX1fRrZWhzNpL31xzZ2jn6 FVsc3Wzomn83UzxsydfNjNPRytTvHZQsy2ZmbsZGprNZmhVVeuzTVZmJ7ORq5fpYzvI6XgZ5V5mo rdBZ3LbseJv51snfPM2yydsLPR9qcTNo0owDHgAHAAAAAGO68K7q6vwruvCgAcAAAPbKiXb3ctqV f0003LfHUvqjCWghpJcrp0st+iegi/RVLBfWJ92bU3ckqs/STsrz9HOYm1YRszWVZmsnbXmzqL7t djI1aK/KLV51Jxro9Lc/ls13bLU3sqGjQhl10y0M/wAKqwDlYAAAAAAMd14V3V1fhXdeFAA4AAAA ASiGxpfO6l+G/wBT9R+mTYRYKGFbq79wpvp5nZ+nmWcY18p7PJii6uPcO2Ebmg/j6Wfk67V5Rx1N XG16ndP5/QhzZzpZdsaW81zR7LNNuYuuzPfMuYAjAAAAAAAAAABjuvCu6ur8K7rwoAHAAAAAAALq Tq32kc+upy3LvN8vQlGe9oYunHFVi/QfPysvbwHq7fovEG+Zs3L0vnJ7dnRyG+tqlZFmSM2U/a11 E49s1syqNfPfArhKIAA4AAAAAAAAAAADHdeFd1dX4V3XhQAOAAAAAAAAAAezrOvfYnGxufHNWYvr vnE1Oj2JVtd2vmPZUNKBy5uSRKciJHgBwAAA4AAAAAAAAAAAAAAAADHdeFd1dX4V3XhQAOAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAx3XhXdXV+Fd14UADgAAAAAAAAAAAAAAAAAA AANtmSaOcB6HgAAAAAAAAAAAAAAAAAAAAAx3XhXdXV+Fd14UADgAAAAAAAAAAAAAAAAAABtEvoF5 uzytBsh85uVnxpqZbgAAAAAAAAAAAAAAAAAAADHdeFd1do5J2IOOnYg46diDjp2IOOnYg46diDjp 2IOOnYg46diDjp2IOOnYg46diDjp2IOO2deDkh1sOSHWw5IdbDkEOxBx07EHHTsQcdOxBx07EHHT sQcdOxBx07EHHTsQcdOxBx07EHHTsQcdOxByPrgH/9oACAECAAEFAP8AiiQA+xDYYlxz/KZwI9hy GEzmCVPyH8hnADHLHwmRFOJWSCGGAc/xmMaGNjDEZBJikmIsGBOeCDmMwEDAxaHIZSp/gN4tGJhz ktkAFiihRmcpZlobCF9euW7fCau7cQbVuVaMw6pjKVP5W8W8HPUjMwSa0xD45mfpaQAa8vTRyIwB VaQ1NvNU8NpPzHxaNOOIqYmYM/ZespOXPUkZGcTX2OLI2RaC1f5D4GNCJif5HhgkzEAli+VEAgEP gxJI6HXvYBbiYagZjH4ymEMMMMzMzECwLCQITyirAscRzxGetLStpW3XZr4t+FVAlhysMMYzGZ/l VGCQIXJgEwfoTG8GGZ0BTBFXUp0jkujIy/gVfo7dTDDApMJxB0g6AiBZiAQmCM4hsjPKX6o3GJYD FMK81+5VJJ8WPSGGFhGc8VJmMHpDBDA0OISTChM9MAtxlKiL/UNiV2mVWQ+P2johjmGGHJJPXMz1 zkpkwgiK2foVyeIh6RiY4MZTKSQRGlZlbRxg/YgyzGMYTDNi4VrU+VEd8QHqvmIIE8Qo8wjdDynM RiMHiYVipgr4cYqmViMMr9lQjGMcwmO2BdcXs1m5VNnA8QIMCYx9P8xhmEQw5hDiFulDZA6QmLEM QZH+fqDhXMJhjITDpIWwOOI4AAGRiE/QwHIDdTiELGcCF1j9TUpUwNEPVBAeK/VRkk9HzmdJ0jdY q4jNyZxlW6LX1B6QnC5zAcF4H+jYliQEgoMzwEDYNFktPk+q+J6wrCIfoYzROgVpZEGATyA6qp+h GQyETmROYI5YhTrWMBoYZU3VmJ+xTg4zOMY4MMcgjkS5HkRfMzBmBwitB1ByCDkZhciFgwZUhJzX ggYEz14gxl6Vgxf6/ZWY/SOcmO2I5wKyeR6BfKtbedx5M4KPGHIcis5AzOQ6kQsYF5CodIOsbMyc 1dYBhfsU4Nj9SYxwHbqeWUHnFnK23+oOGUhlsXERoGJGVeMjKeQYI+DYpBo8QnGEwNCQRxzKV6v0 H2M2IfoxzH8D4ZOFbD+K2eU0P1YZjAqyPguJzYSwdOWQi80rTBIJBE/yDEHWuvq5832E5MEM/wDH /wAfFX8r1Nmu5OS1OVbOQwVx1QpZguuJyKl6+tXSZEVujLmMIDiVN1rXCE5P1bwP1Mx0c4gOV2Um q+IG631lTr2DLAqzMrw+U0sGUp1rXkiqRCcBGzCSsYoYUlQ8w/8AR9jQ/T/J+l69KmyHXko5V2MA yBwYw4MrCxGHQr6iopB4hhWMRx0aKcEvGWIxiJkt0q+uI3iYPAwzEdcgZV2yJs08l1bMS1JxLrXy QsoYVLhvT4nqICcsMhhPCDqFGYK+tFOZe3T64yrCGCH6ERhLUieZSMRq+DlRYgTiz19ax0CEQqCG AgPVSI6gxlgOJUMmrWJhwssbk31QxhGX6j6ETj1C8XdYU5LWvEskC5UrASIpyH+imE4JUEMuJqrl x0l7eb7AcEjIIjJMfYRGXMHUKMErOeIrDBEbOajHH0Bg6jqpIDDRr87GWHL/AGoOQKAwpCsKzEIm fo2RPUn+HOJU2Q0bxQ4JAIdYPFDDXyFWsxFShJdZj76WwYR1YQiFYRHlZjwnqDlLJUfMRkOMERDk ZBLLg1Lk11KEzgWWYYnP4FsYQDMYQiEQiOIg6uIfGs+WwYiHBRsh1yP81nqUyVr6VVebkMWWAD8Q YiCxjB4MIRHWKOrr0ZcGuOMzGGrPWWJg1Lk16+QEVTaVRWuOCSfyo2QYRGE49cdLUiLCssTrWsWo kPQZVTgJb5XsAjuWP5gSJkwHIOM8cwr0Kgha+pUZeg4rqEW0KWuBj2lh/FVwI9mRAxEzmeo3HP8A 8F//2gAIAQMAAQUA/wCKZgos2TCbGNV7If5T2qgd2sJUmFcBup1beS/yLLVUZLQAZx0IIjrkByjr fWVVgw/i2txVm5RRFByFhGIyieiWNdCLMMpzmE4gIMyP4Ww0AiiAQDExAggWBYqiGk5FZE9OWq4l dgKtsqIt6sfzbH9lEUQCYgECwLFWBYtcs6QmcZenR24nWbLIen5bTl0EUQCAQCARVirFXqq9L06B IVjV5mzqCcyh1r+Y/IfC3+yxYIBAIBFWKvQdIg5C1CSa8QJmOgEtGRcArLdwle8cg5H4nbpZ/ZYs UQCKIog6QHMr1rHgpFYfxIzFrwt3U2CbKxoD11bOVf4XeFurjyLEEAgEUdFUk1ajMa9ZEjtgcl4n GUrybGGLessUzZUgNABNbZSs1212D73bEd8lPGwxBEEERYi5lFfKLZmNccmwsbXzEQmP0hpOLKcS xcTYUFWXBNZhUqNRij/czBQ7dFOWrGARmIsUStQScZQdKshE6Bv7Vg5akyoWYCKossUS24mPmX+F 3j1haVleQ8PttbqzZiLD4KsAgixRmAgAuBKzlbaiBxIKX8UOwxhsYxzGYR2Eu8Lejp4sMxgVOnd6 lf2McB2OVBLIIBmKsMERYDicsBFZpUzZubyNgzXAdGoBja5EsrMdSI+Za0u/tkzlHJmlYUt+y44X GSqkmKIF6MMFYDAYozKiCKuoYdBnGs6q3IZMfEtKS0CbA6Mcn/PQT/Cf+z/H1u6zGYoAAMUzmQAc wRMmL4r0FS4Ws9QcxvKzUjAZwDsOYxYxwY5lx6P/AGwRB4s+JqgPf9lpyQ+YviGXC2Kw5ZiRRE6G kdX6FOq0jNuCpsXkNdsiyuWA5LEQ2Zlhl74LdTjM49GUGdvrxZ9T4WvOWCrmYBCKFirmKIB1xKfB iS6jiU8t9i5ByIj8bBapliBhYpEeO/TZaCCCOk0sel9XBKlCISAQSB/hB0UQeC+JPRBxVRmx8EBs WA5Dr5n8pwDGZhGtYxzLmxLWzP8AH+EbqzLNF/N9hUMjDqiZHTI6RR9FgGWb+tJ8/iLEwareJ6NL QRCSp9QEOYzS85B8fCKAYFUixAJpf+77AcRv7M+AoACwfQDC1ePiM8WqsyHE8CtjJDarCwYjmF8y 1sS54BklOngVYrLGBXQr6/ZsW8FJaVHBUkxT0WCf4U4KHIsErfEVgy2CLZGxC8cxmxLn6HkYDB1D LC3QBmJoWlPqTgXPycf1q8UlZ6LFg8D41tiN1APVLCsZgweCzMY5hfpa8dyYlhWMsRoVzLExO1ay s2yc2/W84Rz18Chi+KQQGKY0BiPkPA2QGIjNkMcEvGs62PFXJdcFcggNFtxLCCva/LQxy312Hy7+ B8V/sp6IYpgMUzOQDg5xOWRnB5TliWNGs6PZ1fMToHGQFJiOJYgILEDUXjo/W20KM5saDrWTgrFb BUzMBitGMDTliM059GfrY+IWySBCQyoYRmHoW8Rb016GvstAr1/rYSLXyC8rhEzleRIVvLyyFeBo XgeF4z9PVANlkLclJ6lRxR8FsRHjAGWdJXqu806ERdtst9duuMOSp1XqpdZX4+BRiIr9S+CW6B8g 24Lv0V+SM08ZUcwHDE9D0IJBivkMMtXXPUFVbEk/V15Kco5UiEcgnUFcRsRxg2SwZWt+S12YezxV jhDguMFCIn97V4v/AIYQDMWeB1l9S+lOlzZf7b/KwtIPqAToYCGAAli5RXUquDWQVJJYsSa0GSBh 78cl8D0JwwUkE9QehwYlFlk09QVC2wIv3bVfJGBBPQI/RHw1rGVPmWHJTIa0eZV8vU11SzABXKJG igzIMVujTWpwiVdWsCBiSfvs163jaYKvQ1ZXo12MUEQjz/8Ald/ZfBCML0ewZWtjGHE/4zhnABq6 mmn1bq64xCITn8dqgo64cjKVNiP4tG84rPR43hnkn9SRkeEY5NOtzrq1VrCV11j1gJZaz/lvp85r 8iDq46A5VMxG62HpjKIcRzNdWZLqio1dVrGRBhuKh3LH8xAM4jDUcXaolGPBtcgtZSwaxis1Ky9d +q6rXr22vUqIpZCGcYmf4WAZgS/U5nW0hW3SWa1djKoUcjj/AOC//9oACAEBAAEFALLEqr/evis/ evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/e vis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/ev is/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evi s/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evis/evisr+bfGLbJ3D2H8kA mcGH/A9v9/O4ew/jojOdPsexeaeza9EbR1HXY7JTZN3Ss1LP53b/AH87h7D+N2/tr7L63ZdahVUA OFaGviMsZ3HUp26HUo/83t/v53D2H8QAk9s7WHKKivY9hjlwKa8hvUBZuBwrHv2n6V383t/v53D2 H8OjVtuOj2lKhUmY/oUrX5q/TS2MjIqrYIbEeFQyb2quxRs0Pr2/zO3+/ncPYfwtbXa1+36iI17K sfFaLUtqkNYuDSqvY5NygDGbKwWccB3nSW6sgg/y+3+/ncPYfwACTRpM00dQc6sLbbhWspLg2N6d AatFf1L2tRQAjSxVcmrCMzEWqHG92ws2t2q+6ze7fbqN/J7f7+dw9h/A0tbkQvTXHpmov6nJ7bdi 7pRhKa7BZdaUrVaFsLIkWlgXFoL5zsFgNi9Elu5YSLG2Bt6HCv8Akdv9/O4ew/PWvN6UwoXilhRd d7FWgOFp10D0qDe3p1649AWsQQAlrPY1ixwwFuyeeza5Lq7E6jSkrU1lPrU7Wq9NmDEpseaulWo2 O0sIyMrVavMDSXF2uyfwO3+/ncPYfn0UzZUpJ10V2qXnXRWLVrp/7BA5Cusa5sTYublwVGtdmtxN y+ysbG3tNOoDAwo2PSOFRi1OtUdba1UddftWumtc2sErBaU12PX+u1sdjsK1C7t1tSWFMXIFYAmC mww02CFSPx9v9/O4ew/PoDpT5WrLKlXJqkLV10Zpq1OXqW2G20kLVrNyFlyibGylY2byzAMzNOMw SSuYqhZ/2Dm0uXoqOwj9ssKr2jbpmtotWtOqlde6KzUSizuWjY4GvY5p0OIXXjUjNurWRsUGo/h7 f7+dw9h+fQHSoA3VhWt0yitpnk1Teps3Mtb4VVTjdX5KksZEW+42Fl9Wx1ABYZygnHocAYnIBgS6 6PkGraRL7ObitKzu9zWpdnYayIMAL02dccq6wQcAmkKLgS2zVzrIwfwdv9/O4ew/PojygEBlxZVW C1Q424TWIpL2Wi26ckprazgLrmsNhIlMeemTFQCE5IGY06FqsMNarimuwCi9JfuqycmssyIFLxaw otrrMK+k6ULi/BmxnPRhspwt/B2/387h7D8+mv8ApRslHB2NdgdhH57Ll9iy+7igPpp0QXWtYXZh Hy7LWqVlOjeUMIRgHpHMC4mo6A1MWTjfjd2LETVey17bEUFsCgIiPuGw8Nky1bVlOyTWykizXLi2 tqm7gPP+Dt/v53D2H5+3kCr/AOlwA1nlsuUICwQB29R7Frl17OMtgIYnERnGWZ7DwPIYEBBh6xnA IOTr2rWdewBEsw3dS3qqy11q6LPU6Lz2XV0AQFj6WRsavE1Wo8avy7NIZN2klfwdv9/O4ew/NSnN 9bGFJwvVlGWVxya7kfVYRmzAnKWYEsXy+Zq66lhYZL5LZI8Y+FjNOYyj5Onc3E3qq2tzsazovnY8 XZXLGmkREEBGbqqnXbo6ptXoH2bWFtN1ks7VeJZTZUfu7f7+dw9h+bVOLdQ4cMCqgFScF3zEjE8g ORGASQz3MCBniHLLZYQqr0YxY7DLNmFolmDqtg2MMuVUIFK2WZIcAa6nNY6GzAq/qVBmyhEatSw1 xFr6ekMbehXfVdU1Nv29v9/O4ew/KBma1Xn1lwSMFGIK2FiMZXoOmVfooLOVCgKCqKrOuWBADOxj PgNccGyPbMsxrpczXJQ2Mqx7Fy97NGYrKQWNJxA/EUA2NX1LDEtUMHX07CBAJ4RiSneNfFn29v8A fzuHsPyAEmuqUj/chKWleVaZIXpAcwHCloEAgIQsMgjKoSICUsezrZZiWX5DWQB3NWkzSvXRQFCx yFaxxgsMs+ICSaMiIYrFzpInpjAZiMWdRspyFJDV4xOOY3Sdy1xbW6lW+zt/v53D2H4wCTXXiAGL UyG0EGhyUXpB49QhOYF52BOJs6PyCqbOKr6nHYf03s2BGcmKruU0zKtdUmMTOJnLMgaXVkHiMFZW mSg4xW5MoCrTfhVvpjW1sPWZWc5CEo4cZe3iBYTNpCF3042/Z2/387h7D8QGZWmAimCszYcK1jTX 6BIvic8VrzagHqKV4uQFawcKq/VO3coO24Z1TkU1syqlUAAH0zmPkRDgPcAC/IwLETAazJ1wFnJD FCE1+ngKty7Go0rcx2HpqQY1eC1bGJru82fj63nZ+O31K6MjfTt/v53D2H4q65VXkpUFljhA5YtU OUrHRPBB0Q8TV4KMT1AgvvAldT2RySPRXO6yZprPMAAchMwuBGtxCzMGOEZjzUQLESW2SlDgZMSp iErxK0MrUiMs26QISLV17xVYoS2emIvQsRi3BHfdQfXt/v53D2H4akya68mqvAYgAL6lmwcmleiA wGA9K2wKzhbNnBe4mUVPc7Dio5Y4gCwGzZuRa61vyEXlLrQAoOHdjYCY74FjAvWMhUlr8VrpLSus CLWIiAgIJVxEQAkribCy1SjGoOqGyorvNhNhWK2BlczuAD1MMGdv9/O4ew/AoyUTAprAAHS88VUo KgeboABX0K9FQ5juoRnMZXA19S3ZZ9cayKLGsyM2HKVrw2tyzkVQCMcLseUWO3BbXWIMqwOOJ50s ig2Aha4qgRYpwK7FAfYXNTnjVfXysZCHsDm9ZWCFavMNYE9CA7CD13E2nDLd/wCydv8AfzuHsPvA JNOuVIAVa1wFEv8APbsMFSpYsrBMDeWosFr1HIGsubVUzt961m+4WW7LcUr5kOfJcnm4qYUwMgre OSqeiojDXUFeEemLSYiBfoGAnqgQ2kwMxldbE11swrpcRkPHkUst6hcgLCgaenxnpx6szboYJZnn O3+/ncPYffp1AnHIivKhejHgoChXJsesYGQoUkLr1Nc1yJUtReynzBSStjapMqyiXZsGvVyV/T5W 0oVXCMjq4arAsrdmdGrsbOUYia9wsHSF1ENqz1YXMUO0SsYQSmvMqVRAAYyzcqyvPq+WWknCjowD AAglejpyHeNM0XTt/v53D2H3AZOuG4rWFUjK+AvsHGxulY69BCeoJzq3NWjmx2p5KrDpYgZeWEK5 gQQMyLcgYP5V2LvPrgqFtVk9EGXoVtZMHjxdE9OWPe0zbATMqYhQQForNEsINVxlVoErcNGMslmF s/qa1yFPSDrMDDoMdy1Bsa7oUbt/v53D2H3UjLUJ0K9VUctghVLF4fCsYGeoyTo6j7Nu5R6UFgZ3 8tTOcB2sSuolVHI2gq1avm4n0rLyQ2WK3cVqcEq02yMsvlsrBXVbmvERkjVGemRFVTAAorZ5W7A1 7FYCDXsHo8ArtLT02AM+IVwF5gwN0XxJhbIbDDvmoKdjt/v53D2H3a65lC4UkCJ5RsuXazFaqCT4 RFzKaizdt0Dq0bQXktSPtWNgOvJakJD1qiNWUFlVgZ8TYvKWtUXYa6GXKGtRSjIxxsqwbnyQE5ob hsTExOAMNQno9aajgUNhAwZa1iG1AdhmsJJFuM19FJGOa59WIXM4WRq7BDkTvdAu1e3+/ncPYfaB k6yZOAB0EezotYrDEs6jEC5KrOy9rUKwy/cK+K6rKGOSa6msPocJa1nNn5pbZk7F4QLSI1gMBMt9 1/8AYOkvUGtMYVgZjF48PoIIoEVYiQ1LyVCpqE26MhLXwxJgPFgpY10KWWpBFVRAYwyLaxjcGa9I Y7jO4ew+2sZOouCDkmwswC1y65rCqzj1rTJ1NUDY161SlfHuzLXr04hcFxsLW7CwPYRzZ/Td2BFV fN7wAqsRYSOKknZx/s6cSOa8SHevEc9a7gwzkI2YIIDiC1BE3K5VtBmyGKpLFyNmviejH08wk1Gs 4fEBiHMbqHORuvxGmc9yncPYfbUMDX/o7FplKQ7l4qwHEqRnOtrKiq6A63cmQbnd66KNy3d23oub CdWtHrrXstWbtgkmksDYCCfTfYPKisZJXEfybDZFgbIU9LwVfkCLNXIAsBSx1I2eLJs1kHaUD12a ItjSpfTAtfGsljlcqXGRf1irxMZQwIcMqWBqQxnLAVxLB07vZ6Y0PfzuHsPtQSs8VXyLyLngSeJn phZXZXj/ALo4jeBlvdCsou2L7fTuREsX1dpxmpLTXYzE6FINe84pp1i7reSa7X//AC11EVP/AF2c k5yFOYMS5AyZxKTzS2qL0PFHBrKStqyK6kJqqGBQGi6sFRUrbgeuCX6s5wUnGFQT/U0XJnkCCxz6 gI+R24s7f7+dw9h9ijLIMsihFw1pqqAVSOLMUBuLwPxJtUkkOa6gW0zVSbreaXMTarMllTWCWcRs 6NgA7m7WbeqoSbxAFjH0mOKbF8mwTilTZUnQgdScrdWVbWsw5UEPVgrkFW6Kq8xYyGm4yu0k1kCc cyyvKMAATmOclPHxhWYBD0xWdClvKFsTv78tvt/v53D2H2VjprjzMxYpR6dZPUccseUbWYLXSWNm kFBAEpTBUiWW8T6rc9LVCL3K7FdnWvSfgQfX3awJsKrTYIDqxeOM17SgL2/+llQJHlKjMsQMLFFb VNyTAMekGFGEUEhFAHpclR7KZTYCtREsZTLCFZ2CRcRBkDwgEYdHWEFZbf5N+027Xb/fzuHsPsr/ AK1dBRXiKz4s6ggklGwLnwlqK77HqTAERys5khnLyjXCjl/+QM+zddSClKMJrdLasFbrAotb1LQv CxV8m2hx29urCOMEhsJaGm0OulZitSCAMxqgYaWBQYNRIKmu5BVbrym0OH6LceQchmcAwLgf4BgE IjLmOvTu1xoqJye3+/ncPYfZUMiivJREJXBHEBWXjZa6g4VyFAUYgHqO/wDXWW2+z/qGu/kqLaSn bdCsCp1y2yvprUCrUjC7ec0Dlfs0BlotIm2Omj0tAyLFimPWDHRyK34xLeMrvWI6mKoaPq5FdbI1 SBipwGLUWeqHRj1GAwUlxnH+BBBCIyZnfaSdadv9/O4ew+zSTkQcDmZ6jmM9hDo4TgoNSjK+d7Aq ivkkvLGaLLqa2hWSdmoLfs2f/n0lPHwbuD9K0LFbMLsjlNNc7TDMspDQ5J0wFvEZcx0KxbCCRxnC q4NpEQrchFmDXsWgVdwURbKrmSvB4ArcAyVWlQ5jsSaeRJNiFbFMBnKL1+hE7lQLNdhg9v8AfzuH sPsovNRXbR4GUzXKopZRHsYoqVgOCkrAVLGBPEKa9cs4QNsaq5G+yk2qxHbmHDkeW82T26gHWf8A 1lgAvbEzslIQQdvK2ghranBEs8KgDFUBrKXpai3kAgaNWMIgQrWjyuhENWMMvlsQ4tp5Ec2PpgLU wIfiofWNhUbCkcsVMojWpgWjFmHTuVPo7nb/AH87h7D7af7I7I1bqjqUc7BTGQV5AuzNydgV1tex xTVwlAY7FFXpJsDlexmqDWrsFGx/su16xXR3BCA12ae1VgQ/2deu1QbAtbqarDK3BDqDDS/IKVKE EW0NQ1NxMSxZ6SNPRZSqFxxsqi2BkvbAY9RjJ8Hyksbmg6KF6JWI1KNG11BdOMR58hr47Xb/AH87 h7D7VbiQwlGGYDMdbGTmzwVDFjLjXo8tfCmg3knQThGs6bg9N+TA+l6dOw5/6/baTdsjw3lylmQ2 gRWo6wrmMuDfWK3tqBlVpxVarBVEerIClTYvIWVramvfyNTGIcwJg2litFhWy58Kxyc/RlBmWVw2 GzEI+hEdQQw4t8ibN3b/AH87h7D7qXwumuEdzAz2GulFawoFP+5xlQmsyJr9vqNVlQWul+Sbzln7 fQb7t5eMssLJ2xgtdZyuyvNdxHVtW3MpcGAy1TGrFikNRZdqBhUzIargDXhg9WYFYGkgS3To2K6O WtbWOmQRYOIvuCM1wdHPVR5VWcejpkcsODkI5BRgfoZsEBu8Xerudv8AfzuHsPuqGbFDMFrCwV8i eHF1aw6lCIalUbDryRHZDWzMaTh95/8Adoaw19buKngDxt1QoKS0Zm9rkjHpvTb1rcMCAQU4tt0e ompdiXatdweu6k1XMgq26yDWHX02WVEibumuwuhtcYCscibichTsFYmbWIiiAdWWW1K8pUqTXASI j5lh6b+wtS2ObH7f7+dw9h92hpNayVIpFKk8E4WKeVFBAp6EnG5U/IKeJpDBx5dgUG3uijy7ic0v pVhpWdKzyjLkOgYX1hbgfRal+qEGWpkATb13R9bYDThXYH7emFqNba7hYEDAV8SB036lVtba9RGY kbIEKLyqVVXpBB4tDDEsxGGYCwhcle73F1nb/fzuHsPtoqNttKKqt0ZGmMpR0sVsxP8A27KGu/XI JcYao5N+BZVcq7aDIuTK7OarGQU26zjAGRYoncKMFK/UStvTOvdmAcg9eIU5pbS+tdU/JVfoStit rsJpOtgPEkAAb1Zauqw02eoWFvMyywAU7WTWwK5EXrCIyxhD4q2IxwbrRXV3Bv8ATO3+/ncPYfb2 qjqPKbgMJE6oPLYp6Vnz7S8hqP0vHTXHEXMwu0V53VHIsGZ3OrFjj/sUal2Vofo6AjcpD1jKtbT6 iU2Guat4JKBgwKF6FuQo+lbU3IIIimbWuapr3eqnKXN02NcMa3sBYuTepK2VWVNqbIsUQGDqCIyx 0jDpdcQHuNx7mw4Tt/v53D2H2atPq2VKqKw8rDlXXKz5SeqHJQ+a7wpHG2w/608NsrFAqu1bMqRm dxpBro8lmwors1bslPMtlYm7Qa7Ne0sL9P1QjWVtq7QKsocYYNsULbSjPp2IwZUIYYDIS2rsizkt pJNvljA88dLUyHWsl6rNZ9fcR4rxTPGERljr032ZQnQdxs5WTt/v53D2H2dtTyV+BHkQ5VehQ+VR yFT9F6S//wBZwtoGUVMjcRoSbKdS4mVnkNmsOty8LWp9Sqh/TOpfyDryXYqDVvYVtpbkL6KrUQvS 9WzkY5ADE7lSrpoWGp1Kg+ooHcU5J2/ZBVmlzEt0AC5jrgdEiqLEs0AZRstXEtDRXwQQYY/9d/8A sx4psNytnb/fzuHsPs0K+OvX4hcpSZjDoOlX96f7Z629aXydfXbnWtZ9PYUhdQ+TWY1vqPyV+s7h pqz6hIGxr8louCyi0Woy4Pctdc6tpQqwMCJYDS2s2rZ5ioEuq9RNyqzWfU2PVpNglrKZbZ6WwuyH RXNlmAZWsdcyyvFp2D6yEGNrhydIAA2KVs4wOGDeG9/7Nx/T1ycmdv8AfzuHsPrrVG22lQqjo9Z6 L5bLOjpLV4W5xYuTFwy04ZNZir1nKbKjGu3p7FyETSvgHNNqrnW19ibVWLE29QpNS7jEuS1bag67 NLUvrXLcoijmq+pq312K0LATZpTYWi5dTYNmYzZGwrLdX6kp/oiwQy5MqtakU8lNZA+jIDHrIivx LNkb3W/uhxr/AE7f7+dw9h9ez0cn8HI81Q62DFzHIqORtDAf+yGVEEL5Lg3C3Us5LYoabVfGB+S0 OarNPYDCzw7rq4s0LyVpsXO3pek+q4C9HXe1hdVrOarvEVOJuItlettE2c+r2KB3DVFq6uziFsRj /vd2S+lywWD6POADcARkqUfMMbrLAUatjNhuV/dziv6dv9/O4ew+lGu1zadS0paON2MrXNxeLp1W k9bhyq6stLZnLrsDDuMpo3jKkNNusZp/oU5Lq3AGq0Om5QNit67Na+i31kosyHoFN2vYytYQp7lp FppbNmVtHJCMXWHV3Rb6is0LEm3XVyKcS7CV3M1jdus5KpwR1+jCERDg2wPxiWBgcY2B0NgAB5P3 d8t9O3+/ncPYTV1m2H16lqlfSbYwazlUm5k10mAYYAFf6sp4uuCHHKupwYuarda3ktyl0ttFV4wE 2EdJ2rcFiuTO4UKw1rLKLAcRlN1VezfTcbC4DknuiNr2VXC2pH6d3QtX2/dYqWJgIJB6ZDG1QyV1 My67HXuRxFImZjMdYvQ56WCwGt+q2ZmxcFllnqFsAbtvqX/Tt/v53D2E7ZWqVWqUtUy5TZTQ3RP7 FA6plH/8uR4sStnHmFD1tkT+lgBsr0rzgsCu7rKZrXc6a2PEM+rfr7K31bAPDZuNba2wLqaLyR3A tjT2wx55O5WNhNW469+VJtVbK2r9CJtKyV3cp1aBY6mWGyqy5Wzp7ZMVoGitkMMzj1YR8lS/U3it Lb7LmqBA2bOFbnLfTt/v53D2E7daCmynKpXDLU3Qr6dolbTYK+sD5FbI2BkVtgtkhLFZLvKaSRLF dDp7K2raodHVte9bIUFtWla1FrEMO49v5jT2W1LP+whCNzW5jrbIvUr6hm7qc5VfZxWzB2FU2VDN iKFKKYvg/hdUS7VEvbrkTVv5hWxFMBzCOrRziX7aiyy97YnSA4Hcr/L9e3+/ncPYTQt4PW4dMcHr fptIWSlwyqZsIvp1PkIcHCkDyty5AZrNi8lpdlSqwsgDal6Wo671eW1blYa78Tthqn1N1bqmszO5 VVq2lbyrrsM7oMnt9vOjlFPImlGL01k3UlbFPG6tTivpMxh0sBAs6ikclupep9fZ9RVYCBofBpcc KTm1VmMLfetaXWmx/r2/387h7CKxVtO4OmxX0Rojgg5otWzr0YEGu3lA8uULFMbGEc8ORrsAettl vLo2jjf56y3o7KOAXK2Vatxo2eZBvQXVnnrWLfkbKm2vWtNNvqCIcwsTAs2k5VPXwals1VtAYcw9 Y9eYp4OVDC3Was0bBYo/Ehoes3XC0lOQrU4uda02L2tf7O3+/ncPYfTt9xE1x6yuhrZWltYsStiI j9NgFlrfIDRvMqk4J8lZ5LnIpvswRzrpuNNq3dd6jLat3lqbA3spdTcLKlaXV+rDrW0lHZVJZLPI z1WdKuUHhaMrepqmg54oIBMxoZcCGptLQeYbGoCanJFVmQxwO42ZlYwVXM7tZj7u3+/ncPYfSp+D 9u2RW+0qXAnBrsE2UAiWRHzHBrsD9VaPlbFGQnlcQNxep2E2s89e71K3HqVNmq2qxMbtYeVMtLVv koPpsv6aNRy1aMlkVhK7DgHMcdNxMPVYUepuinIIJhHQiWoTCWrem1jB1mzVxYOQTcGrvcWWqDFb E37fU2Pt7f7+dw9h9dMi7XRLhDSzCxLaYtgcMj1mq6WAWKrZWqzItHJEsBF1nCUMHS+vEqtJG2vI aNwWVgsLdQWBdW+osHdHr81IYtWMKmTNyssj32U1a9ha3FgNTcwMiNN1IQJp3qQrkEHMAjiGbFcr cqde9GFpBVXX1Nnb9OusdBNzaWlGJJ+3t/v53D2H17bZh6wWiEwKrK+utbhUUXa3KVcxLKCZ5qmV 8y1ChzyXVsKgKtos1GU2BgqJ/sr2GRqrC0zmcOm10fSOFrBaVrgOoI7knStDWyZEqx9GlqBxbVxO JRYba6mOAYwzLOgCkrs5rZLgp2O4gVrcwlvSVDy7GwtKX2ta/wB3b/fzuHsPrU5R9W0MEGHUAS/B coCtoJWqv/YE4nYXzJWBYEGHVALRwNHNShyLKkZHp89INjVdBWpjDp3BCtunkCjGBMZncK44AmtZ kV4+h6w+GzVKwAx9Sh69pGldgYExvFug3vCwXBaP6qJfxAs2Eor2Nhrm+/t/v53D2H2dr2VAR/MX Alryk8lKDlagF6KeOwgKVBvVqUMGQAWV9UUypQYyZTa5VjTYsaRmKOhHTuCp6mpYP+xXkOnhN0Fh aFCarlGotAYEGGNmXr5HPB6ytqbOoqTWchTakPWWvLbTbbw5T0xKQDNzZVLLLWsP4O3+/ncPYfYC VNPcbazV3Ou0PfWRq7CBQ+Yxf16f6bK8lrYNfrqhOyoWWOyGnJSgHH+N/o2pn1aDgrif47oMrrsF dHDLWcjGZcuW26AhweVNoJocMohjjM26ip1rmWeW6uxbKVte0jQ23Zdy4Voo6ISIAJc9dVVrmx/w 9v8AfzuHsPuViprsVlU4K7d9bG0WDWOa7VJllfC7UA5X1cpdWi26r5qo6oRO5phq7ClleAyeB8N6 o2VHVczTfiKT0EsHmsrDraCjIfNRdwZOoMM215IqsjJXYYKMqXw2qlZHcLzbdXgqPp3PY5H8Xb/f zuHsPvDERb2nrzTvJXRfy2MVNikjUfzXZEuQ8tcgHVfkpGR3BCaiolDcqqjyX/DLkOnGI3Bq36qe lnj4Tcrw6+FTTS2A6sYZYRNrIOv3ETb7ufSFPqKjXentYFtbKiPuVA3dyOGYsfxdv9/O4ew/FpMA 2haJYRi1xjUPnsH+t1Zp/VtVgGUZXZr51+k5FVxpOncrgYIIIm0pD2AerQ7KNewOrgGYm7XyW1uB FglVnB1PNXJEY4G3cGKIssrBrpxn+o2dpWus2LHmT+Xt/v53D2H4kco2hfyDWkiywY1LB6gw1LmH qtD4atsq0uHGxUDPRjXvRhhgDNivnXaeLIxIotNb+Ix1vE3wykWAii4EaO1yWzHHc2hWlFpewDE8 VrBU9w2xj8/b/fzuHsPx6l3put4KvYCNK4G6l80ufMW42qSJrPyrPWbwAjkLcyi2rUtFlJjhptJ6 bVWxHM1rOdbLmWWebetRUUlWJcDVtCpdv4TbszXruoc7NSyu6patjfd4SSfz9v8AfzuHsPyLsOoN 7ma9zJdq7OKbLcm1/NW2Zo2HAORvKTXsNNW3I1LRXfgMHyF7koES4Bjblda11C2FlvVAvdNprLqW yiEYc8LuddabOy1zZMyZzYj+D2/387h7D8+ltZU2Zm3eqrrbSsNW9eSOZceS7qGqa+2vL/sgjS7l XYrPyHdrVrpF/K2jXseV3Gorv0qu/wByHG21ncbNgB2rSPWeNY7fxu3+/ncPYfnBInr2xmZojsh7 btl119gMrWqo71vpc2SJ6jzt22tGxd3mikb29bt2SjfsqG5vtsAOwLOzfy+3+/ncPYfw67HrZO67 Cy3uezYCSfsJJ/4Ht/v53D2H/N9v9/O4ew/5vt/v53D2H/N9v9/O4ew/l9t7btd02avjPdLbR2Lu J7fgzi0II/l9v9/O4ew/l/GLLarKtBatjb4vr/H9EbXbCuvRb8j4v/L7f7+dw9h/K7D8a2O+Jr/A u7a1ifCO+Vt+id49DV+I921O2n4L3kl//wCfdzsHfexXdkv/AJPb/fzcRrNP9M+Tz9M+Tz9M+Tz9 M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M +Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tz9M+Tyv4n8tqH6z8zn6z8zn6z8zn6z8zn6z8zn6z8zln xH5Zaf0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP 0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PP0z5PNP4f8AJK9z/n//2gAIAQIC Bj8A/wBKln4il3IeX1m86GWQ3bsi9iNvql4FDvN2NfxRL4wiZgkn6eCNyY7I9clxdxPLj/UmYSyJ cYrEkP6Nx8D4/wAYlmVuIvxFKVVDiBX8keynuz8XnsTLs9chRHsXZZkPrOj3asJTlmztNkXzwwPk lke3+S8aEKxKE1nqXFyXjr+UJrwhL5JeeKYIaW5P6GxZR5Liacoa+p84M8jOxmWz6jbzjE8MYJwr ksuX9elLzHihCbwWrJc1JVfX7F1HQl0irLkKiW5fDLwpqrT26U4G+KuXzdE+hLGOHlXMuPziSw9q WJLkFiKWwySTgnfCsPd5F9qJLXqW5fDE8PjDOHlyekpEvwWRe9qQqfAnRVsTBch9a57Nf+SElC2J yPZkv4E++GGZExJZFy1y5OBt9KKeqXzRcewhE1TRDpcsRiXd9KSxyf8AygjekkoZBcgsXpCy2E1k 6LAvGC5bDHy6OBDX9py7IseVS5ncvcyJUp0h0yLOqeGMFhsbebI3HyehO441pGC/3pcnVV8dFEKq G251p2VkQTXweyzWZ3JV6Pjyf4v9CH8FztWapYbUYxPtRtf20jfKkbnek6CfEh3PZfJc7qsYWtsb rBtKonrxJRGwuSO5DyId+LLZMn7oTWTyFBlSVVC5DeN0/Sk7Eo9XqPiz2R6vUlENXPU9GQ9D1ZfS smxai/69Jkj4jTI72Fy4n/z5/D3LZST/ACVPaLrMTWZ7LPUeDyTRMjtgnBNWqTue60PR5Mj7DTht IlaZi5JW5DTy5WILCkawRRSRv1PZEPNZF8nmWyZPHNHtHwJr+R6vKl8EqsCeSIG8EdDtyp5IefGn kjamdHXsyVRLuQR260kbVgnKXHSl6UbxKl8couqw8c0yHxIWON+g6/GOHmWEKVcgcdHOxKfRjHYu TR9OzIfVla0l2I3IViEX+jms0si6Jdki4mS+vasYYJZLyQ9hKCMl9NchYPWSP9i//9oACAEDAgY/ AP8ASpbhEcFHdjfs3HcS5cvbj3z+ru/gbbhbGd2JQ1u0Wfsj0f7uP9PqWNvUuvgW5blnuREwLlx0 Pb2S3J4uU/p4707kLMiJLJ0vdifG3HVfV2eGxlSeDy0Jf47pliOv9zyujNLUbRcU9drufHSmtyV5 NmQ/3Lqsjp30JqxpqSeCgS5q25K16bSE9H0LEuyJmskDqkJa8bdKEJLUvhkhFyYksTz10G1T1Raj q1ydieHJcuhBBH3wy6cuby4s/EhXGpcC7Fj04XerwMaZa45E988ck0b3wKS2So+G7GshrdETM5En rELerSww/wBRadHyQsUITPyzPbvSOXH25IygzwMa2rKI142wungno3yVjI8o78XFLXMseQpy5Wxw stWRRYfZk5QP/uNbo8HJN5nmlyKNodWQj4wQRp0IQ12P1OS7zTyLnx1zLPIiUmXdWOl6KPnDA0sl SU7H4ucLZO4/B6vVEMnYfB6ErC1ggfLZYYJgUEZSWyJoqpdz1fwce5JY9tzPoyiVnN8DSLoiC/6E 75CnUjAnucfNFvxdIWpdSj8XBmQ8MlyJOfD/ANlhai6yO6FfIUELAkQJvSnsiGSqOMtsDwZEoUap 4ZHyeugktTv0fJ6v4Ny9JWOGSPm9o++GFnyJkbzguLpQyzIdWTsTWGLir+zg/wAfBf2J8vOCWT8H gdIwxSHSUSs63runmj2434v9KyL/ACclMftQ+1sHl0aOXxjkgmmZJNGh1syUiGSjjy8sb3eB8F/F UT3RG9hPHKxsTetfBFGji9+P9cDS/cOf5SMT2sJkfPVZOY+Kz43RnWUQxcUrN3fYX+NdkvjA51E9 mSv5D47qi5LNEiZOKSG8yzLvK+D24/K2pNFaExeqFxX8cC5IkfB5q6EyVlyuPi9SCDzRPca1VJWT GlmqWGm9IL1sSvtTit2I/wCTyQ283gaGn+1nsiR8HpkSJ/JYlHHmvkfF5rIuSsnkRNh97EUjQl/y LUg70W3G9H9sT2zuQ1KLKz0PZU9X8ELPievKz0HxZts0TmTRJ5Niayik09XVclqNw75G/J5shfue OVoXExrdUV6pK0kUaSyon3G9iKNF7NakN5UUq7vS1+RL6GUMiS905uPsJrakdzj5E96cuPJxcikE qiZKeY7TBCX48buj5P48k9NjGfoTuJkLNEa0TomeSKL2tsQlnm2WXrLPxR+T+OrKOQ1sfrRo760T WhD1IMsj2jM9uSjitaJt/BL690NRmMTgh5MaPJDUMuSlZCSTS1bFwWSIalEcVC+lgb4xc9uTlrKi 5cvsLjxUJEf7Gf/aAAgBAQEGPwCW5MtCAMpG7ABzZeu+jvfbXrvo7321676O99teu+jvfbXrvo73 21676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99te u+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo 7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99 teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXr vo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O99teu+jvfbXrvo7321676O 99teu+jvfbXrvo7321HbhzrzmRGI+VvBySwvt4cz5W54T+aorH/AeW83b8Qw5nytzwn8w0Q5QlPu x7EDufqWTCAPYAj8uJj7FpkKZH8/y3m7fiGHM+VueE/lxqeMUJsX6yrMEIu5KBjcLUYs2SmAO+xI 7UYkMQfz3Lebt+IYcz5W54T+VYIbm+2ngox2Yj2KMIx7SiGC1FnTCoXesUQKPUL5sYgRnduP57lv N2/EMOZ8rc8J/KNEIbm6NXsQjGDDrTxiBLqAWo8F2LufojOSZOKEKW3uNWsTwKO3MW/O8t5u34hh zPlbnhP5MBqKMAKAVQjHsAQb2oTllZaYFhYphVk5iQFp/dwXaniWe60EPE2KE4e9GyY3H5zlvN2/ EMOZ8rc8J/IsFqnQcFGIFrr5fGqBN+KEplo8EBsxfJE7lzdOB3RmqlayA6Y0bMLumvFFxUIlmfJH c2c8lpkNI4lVrE2kK/muW83b8Qw5nytzwn8jrkKZIcFrGaO9OgAaKjTuRLlac8gnlSi0gvHNUAHU EJzitADcESZOmFYqqZd01CeJMexfLn3h11XzIBmuPzPLebt+IYcz5W54T+QEeK7FxJsowHvH+6ED dlEGjCq1yubI7bsAgIi9yhORcCypktRDALujU6eVCtMCC1zwR0ycG6bNPIgJtv4kQfeOakGJAN8H Aom3A5N0ZbJ1R4ZrTIMetOrqlR+Q5bzdvxDDmfK3PCfyGo2CA9pUntFS3DXTSKG5KrWTyPdjdfJh RkzuTcoUaHFClk5DRWlqoCBYmqEZFibMtLvxKu6YAVzTzLlDSox/e1ZKQI70c+pfP3dvUXo9k0IA F7AKgtdNAVJaqG5M6yboSiDHsK17Z+ZHMZhEH2hFrKisrKo/D5bzdvxDDmfK3PCfyHaUOJspgHvG 6+XDO6G3CpFEQazNSAjOdHyQhAZ1KqbBF6gYWqjImv8AkjuSzsMHNAuA4YBCAJQIoDdHbMzoGSOz t7Qk9pppQDG5H/4Wg3N0BcqUSQCjHbckZo723HvC4GaYhOQHX/2TUK7wXV+Fy3m7fiGHM+VueE/k AovYXU/9KnM0i7Bbm7+39qaNRmVEC5onAZxUog2GaaIotZDHJF0Ik0NfYFdkwDrjLgq3K605T260 G/qi3tXao7cbZrVuFuAWmIaRoOKb9cKrXEVzTrSBVayKlMaIjMJvweW83b8Qw5nytzwn8hEqBF5K O1GjiqOyMkNghgck8RRfNke6KhARLQKEIVK1blOAwYlSkzk0HYnl+ic52CrTrXdTpkyARJF05sEd VC7xKIjIGQzUt2ZfKH/uig36JpYf7JH9FqaiIGSc4SGWX4PLebt+IYcz5W54T+QBGa2yfdCO4bRD BS3TSNgvm/tiGCEQGiPeKG3thyzBCN5ZrXMubp8ssGkUDZ8kZy9iu8jZCN+KYUxEih3XVAOpERNC hVjG6k5aGaAjQBdq1TNbrTsDUf8AUbKs/YG/9l3u9FaCaiycVVQy0ytkUDxH4PLebt+IYcz5W54T +QgDYAlQAzKhEXN1CIsaFbem7hwmsg2aJlUokGi/zWqRftU53bNCRqTYKgYBVKJzTmwTyoMgqBAF VQbNVzQiP3FaYiuZRlMajkFrkacFqkTHbGXFaIABNZNKoWvbuLhaLHgrogjsK64/g8t5u34hhzPl bnhP44CjEZqtoFkJHgtR97JCcg5Fk/BAhEyvwQ4BCjpyaIgBo5layX4ItYIkphQIRjU5q7lcEwVE xNk71yXzJ3yHDCtsytI9wZrTGgHBPngw9q7twtUKTF0zuOBVQ6PdZ0SK9SacSOny3m7fiGHM+Vue E/jhs0OpSGZLhD/VZAcEwQKdElMuoIAVCIJYcE9gtMc08k0USCwFEUcGTqic34JytESwzZME7XwY KoqbrgiSOwrqIcKl0xTM6MDGuRUtuV4luly3m7fiGHM+VueE/jjibLtonWpakP6pxmvZh/dFapZZ IuH6kQciaKuSpQIiNszmmFAFUpgqVTpir4aYUimF8yghRH+ifLEgoA5W7EJZHGQb2o7wzv0uW83b 8Qw5nytzwn8Z1EWXYtQQe+Aw4JgXdMmCMURG6mLkGrYOT2BMEyoE80yYJ06uqYOnT5IHqwcpwqXF kAbi6onTcVIfojE5dHlvN2/EMOZ8rc8J/EYYWUZEVQlxTJky1ZAoR4pv2R/qtQsECiUTmU0PeNSe C0iVx3uspoqpTAJ5XVq9CqvRU6GkINcJpS01sqyc9hTCWWbhaSXw/wBpTZLrK61q/UJx+7o8t5u3 4hhzPlbnhP4j5rrQ61GAL8UGqj2J0+TowFytJNAA6YCgRCJN7BVWs0gP6oR26cSFExBAAY9eDnou nwri6aK1E1OFQ690OmkA4sQtW3KoRjKhTf1QjGpK4sqUTTKJO43CiMoSEwMqujGQYjHlvN2/EMOZ 8rc8J/DcoJ81xK1EUTkrsCJT8E5/0p/3TqUSqrrKDho8ShtQsMxZPIugAKigCBQ6DgIPR8NJxdaY r/NMMGOAw+ZEd4f1XDqQEhQUdaokEYhMvnwFf3Y8t5u34hhzPlbnhP4TnF8hmtRNMghEZYFuCDcE w7SjKVgLoSNGRZGUvYFqZ2QEi8jYCwQA/VdiOYdggY3CYhajZME8kBGyLnAEIEJymjdPJN0ytUbZ rVmU8SmmPaqFVwlE8ERww5bzdvxDDmfK3PCfwWQpfCi0latLFkScD2IE8FpjfNDbAvcpsgtRzsmi GGZKEYXRlK2SZMEBKxLrTGyATCyB613blNnxTvhVVTRunlU9C6aP6rUo6iTxZCUS8UcDE5FUTSTw oUzuF3gieKl24ct5u34hhzPlbnhP4DBd5darfAQBtdRhG2MiD7oWrJmCYC9SVrnQIE16laospiVA c0GsMkZcLBayU2agP3OiLlVL8EGTFMbhF/eQwfPp0cp5ZWTXH9E9upExoeHFGJzwvfGioqImP6KT 3fDlvN2/EMOZ8rc8J/A1mwRKc+zESN3qnw61oFHuowAoLoAf+iu9nwRBFY2TTtLNSMZdw1inmO/Z VQf3QtOfFVLlEFNmnCYJnfitQThaT7w6FFVUH6rvVKoGTnoao+8EzLTGhdMbp8XRC+ZEd2X98OW8 3b8Qw5nytzwnpstITcUIjjgOsphngAgqXR0wOo0ByQEr5oRb2olCRFlECwtgQhECi1WKdMM1qJTZ p0OtOv8AbJahdUoFVVV8KVVQrFMxTHH2KXXZdV0JZnBx0JRatx2oxNwWXLebt+IYcz5W54T03QQC AyCZdQ6IhEXv2Ibe2O5G5VRVAgMnNI5om0UZGwVMk0Q/FESJ1CwTm6MSWAUj+iAKHDAcVFEZiyY3 GFsapxIhlc+1WEkBOOlUZPCqaVMHGSYIP0GTFMvmRHdn/dct5u34hhzPlbnhP4AJXXwT5laRUlCG eeLlCMQ5OQQlINOd1J7I6T3Y58SgDUZBMVGAQ282qgIe9cr5hLngFE5lSB4rVYFORUKMLAWCI4YC RsuxdqIyfptgQQwQIXdLjgtJoetVsiMlILgOtBrKitRPknaiqjIVlCq5bzdvxDDmfK3PCemAgBkn zWmN0dyfvGyJNcRGNyhvzDtZRGSkQFKTEl6BapXTD2IafeFUJm61gVzUYijoAVlYBGe4HmalMKNh Fke1BF0y05hA8UOlRVNEABe+OuNJBaSqovZMbcU12VBgAmKdTjxBC5ccN6HiGHM+VueE9N+CMjbJ NFapVKvRdaZARFclGO5xDoRjZl7EZG+SJEWLVTGgQMLWdCQl3TVkBKyv3CjMZWWuVS64OiHQ4lB0 e1ApkQtUaEITFwgqJs+iwBJHBViQcnxIK1j2hPgx91CWRpi5TplLsK2Dx3oeIYcz5W54T0nXahCO apU5lVTql03FCRunN0ImoWuIecqRi+aEpknMRDsEYypIUZHUKjiiR3dOQQiXI61GMe9O7Ba9w1Wg BdSkcwEetAoHij1psNWSC1RK0/1RBBLJxE1urt1JxXDgFZMCy94H/wBdqYpwiiMsGktA91UketaS bJkycKfWFy3nQ8Qw5nytzwnpAIAXRMrldSoFpGSBl7VSpGSYZWVWCaBcoTl3iMu1CQpLrX/yBjYo DaLhENUobcRUVJRkfeJqiTQ5KU8wVZpOjxsjM9SHFA8FGXV0OxNwThMVUVCcBwUxFU4wYYPY8URL 3mojViq4HFzbiiXqVQrqTKMBchyuW83b8Qw5nytzwnohAJ5XVLC6L3CoK5old6ycLgmBTXQMk8fd KDVJUYkEyuwRlujQDYDgi1BZGIQ28hkm4oAZqMSakqEOKdFOLxTHBk4sUxN8HCKY1Tmi6urBsKIj MWToHLCueD4OKK6ZOgOAXLebt+IYcz5W54T0SU6AGaGfFFGrEB0xQN3WnNPdMBUIEByj3WOaaJoo kVkbL524HnKrlCINSaLvf8kaPxCkZZB0ZdZwtUJlAHKqZdaIT2KY4MyBFwUDxwouCY/qmvxKAjSX FNuRpxQllknJVMkxtJaXoU5Tnj0nC/upyd6sFy3m7fiGHM+VueE9J1rlc2CrZEgI8eCfMLvFRJVL Ikp0StIzQNyCtQyCqXEUaVZEHgycdbp1IyPYmGaANC1MCiMKp4/omlQpwg6fF8lWieNVo3A3WqDV DgqOqI8RZAkIAZodIgokfuoE/Fct5u34hhzPlbnhPRAQewXWutMc05spAVCbJV/ahLimFhUqUibW C0QqhEF5AV7VoI73FEjgv90z/RUyRJuU/FaTwRJQ6yqXC+XO4zRZSGD4GSp3hwQjY8CmKqqHB0xs mzREw4RkB3CqZ4SfhRd2ybpFEj9pfDlvN2/EMOZ8rc8J6J4BUFFRUVzWyANZSzR+YdPUqWBujD9r 1K7t0T+4lmQh+7NGbPuToFLcmHlIoPnVShkygBkP7ooDrTiwQpkqIAZVwLUPFaZqQPsxdEAOM0Jx NDdVFeKeEj2KsX7FnHtQMK8U25FihoVEexMa8EYZp1S6rRs1qJcHJNY4jHcjxBRHBct5u34hhzPl bnhPR6irsr3RFDImxQMrx/zRg7MRp7EddZIiP7kAboDIlkRGsv7LUS5dltbX7YVKMhZy3YoRFwUW Fgi/YimBeqMyKyRibFFSlwdHB1GQyucWRiaFaTYrXCsc8bOF3aDMKoqhKALi4XaiqhOKSCYhVuUx oQgTR81rhKuSaVQqpjLsCoQWVcNyOTuPauW83b8Qw5nytzwnpMtBrE2RMg5agCiZlg9QtYzqPYtU 6LUT2BVDAIdVuta5UCMjkUdAecqDqdaOAQBtktIq4QJsSU9kIRrqNFGAyFVqCkM0dwm6HWnTxuEQ O1sK4CUbqtTxWk1BXzNsvE3ig9OpMU7J4oB2knA7U/UrVXanw1RUX9qjpCrV1ZVCcUTmybJRl/qC 5bzdvxDDmfK3PCek6hMZKRJycIzlTgFGLM1gtJNlqs1kaVyCeXembLXOp/bFHVQnJDfNyW9icXNF CWZKP9PahE3unXzSO7Cz4F1pyK0nPoCYsbr5u3Q5hUPaExvhTCJu2XFattxuDIZLRu0lHNdSsh/d MLhGL04I9CuaEZWyQGR6PUiBZbY4RXLebt+IYcz5W54T0yEd2VBl2oahlTtTksLexUHtKJ4IaQ/W tAHes3WnnWR45KUpMZm3UtMcrJygOCB/bCpPWiRxR2xUoxZiL4MiwsmNxi6YppViV8zboStM6HrT SKcVGFbJwESIgT45o7G7b9pKBNeCYXRr1FAjI3Q053VFW/QAlROK9EKQFoUXLebt+IYcz5W54T0w OK0x91PKq1Ad0XWoX4IQH7jU9SpUCgKnKXvArUEwq6lCRcj/ADUoKMY1Jooj9xrLtRKeVjmnFXx1 AVCExl7yEwaG+DLqTi4Xyp5KnsXeGqPFUshqonFimFkEZikxZHl+YLSie6TmqKua0RLNV1olVs09 gEOrodaY0CeJV02eBkT7oJUpm5LrlvN2/EMOZ8rc8J6YnKkFpFk5qiGohGFSUZSHeNAm4KUciHRh wTqU5GskTYIOO7FimwlACyIJrGiBThEHNSH7c1/+uVupUwomK+bAUGDEJ4HSeCbdDvnktLvHJOKp 8NQiBwI4oC0hRXshwNCVZBqA9NinCcFVupxHujDlvN2/EMOZ8rc8J6UYDM1QjEWDYlE5/wCSdUso boRbNdRVck/EKH+4NgyY0EihMe7O/ao1VLHD5gzujGYotEj3hYpimVEYlfMAeOYQlHNOasmutW1c JiWI94JorrKkEQM7qmaYmiaVAEYu4yQPTYpkZG+SPEnDlvN2/EMOZ8rc8J6R3SOoYAhBHiu1DsR/ RAfoo/1XagEX9i+dM2NAnCdauKGn3oICVJAsQUAnRGeSplcJ2vYrROkhmmdUVk081mdtCUaxOeDP Qr52zRvfT01DhgxTxoVokGIVkzVK1RqM0B034LgRdX7oQGHLebt+IYcz5W54T0a2F0IxDAIHEoS4 SRbJOoHrUodbj2p80Ao/6gUwoJ1DcU2BlmEYm0lHdFImkugSLGq0SDEBOKHIrRPuyFjxQjK4ThMy NAS1E03MJFm4ISBQdESDg3RET3DkhIG6ZB80CzhdafhVcRJfM2/dNwmJr0ihEU1X9mGnhhy3m7fi GHM+VueE9Gc8W4oolT7XR/3IKJHEKEuIYrinzCEgKoTHvRqgcigjHNaf3RsmlWJFUdsmsbdYQBun RcOckHDNQlVsmPvCxWnce9JZIMXKpfNl1IS0/wBF8vcPcPuk/wBk4siBmtQvHNGBdxbAP0CJBwLF ASFEZbdCOC0botmu6VXEqCJROHLebt+IYcz5W54T0es1TIpiiEQpAojgV1BHqqtUbx7wQ606I/op DgVKD2sgU7ITNCbKWxue8LdiOUo1iUDmLpwyqvmRFD7yG1IANY4MarVGsDd1IZGyAC05rVeMq9iE osWuytTinmHjmF83aGmMTbiEJixyTswTO+IkfdzTgdyycG6qHC1bZMTwTTHtT5YxCkceW83b8Qw5 nytzwnoRgM0I8KYEIjgUDxXag1iEesOh/VNkQjCVg4K0f6SypVav1CnCQpKy+bG8bjqQAsU6INxY pyWFinuF87aHaOIQIPdzC7tVKBDiSoO9E0PUnDOLjrV6ownWJWg1gbccKppexS2i425f3VLJipA1 eoTQlTgUAQxzVcStOa0nGoVLLqw7E3Xjy3m7fiGHM+VueE9A7psKBEIHii6l+oQ4jCM+BUSOLLsT ZqcTY1CEhaVD2q/UjEjrC1gNKBdVqJBfLNrxPUtKoKFfMZhLgvluxFFomHBXz9kNA+9ELXG2YTi6 Okd+NUQI0PvdRTg+1CrrVH342IWg0yPamP6lEC6Eo0kA6+VuAiQVbISkHJDRCrSqFMugU4Tjo0zR ByUupRHE48t5u34hhzPlbnhOIAtmUIRT8UEAoyGaKYqQ/RdeDj2qG4D1H2otcVHsQ60JIkihRg9Y G3Uv9wrEoSzFJBOjD9CtQyPeAQmKBaSepUPcnY5OtBFLYHd2qcYr5W7Qj3XzQYUOSPBazWMkJxsV SgzVa9aErS4qtlKYoRZamoc02Y6TJx0H4VdOaBkZHMqMceW83b8Qw5nytzwnBhYXK0AWQUZ/riKW TYdqlHgUeBqE3FGIvxQdBvdlUIA3RFkCLe7JA8V87auPeHFCJuqBGWWbL5Zi23L3AnC+WfYetaNw WseIQmDdESqoygP9yjOIqQqlio7kTUXQ25Z2VT0CFLbyFXXU7FA5HpF1airZMEQ60i2eEjwpjy3m 7fiGHM+VueE4A5mpQPFDrXWMSDVMcqIFFlXNMDUVCBJcFUo6lEWNQmHvCoQBuqozGd0dp3lCnsRB Y9RXzIhoS4ITBRAq4XeJeBooyBcssuDITgASLhaC7ZDrTWRp3gKL5cj3DkcinyUovdaoT7wNAECT XNNFXwpZEbdTK4WqReXAIbc7i3TogAKoyJsESLE4SPUieOPLebt+IYcz5W54ThEcAyEheKiMwmKM cjUJ1VOLFA4OBUJ0R7QhxF1GeVitQXzNuxuFd5C4RjYlPYZhODRNxRi9HaQ/zVc0ZwNTcMvky93J 1qjFiiJVdHIO6jK7hXYZrXt+9dCEwRIKqJeiAyVLKmIMaHMpzXitcTUWZaZe8E3SIvJCNo4OtANT 0OW83b8Qw5nytzwnDSc7JjV0YnAbgvG+L/uFQtJsmKLogZWw1ixuEwzRashQhaZsQcwhuXib9i1R sUZ5G6ltm8bdiZ3C+bDO4QJPeF11IbgF79qaRrFOhPjRMfejRMF1JyMCQKFCrunGfQcXyReks0YH 9Vq23TSpIXwpiT1IyOZT4VKMj7Ohy3m7fiGHM+VueE4CQyQ6whuD24aZBwUYj3TUKiqiMsk6ZCQ9 uHUUAtWX7lfVCVQVEu/FSg9jTsRihKwdpKljUFGObLTL3ZUVLIxIrknHu/uQIVKtVEmx94Bao1By TigVLYFqEKM3coEHoVROOuFOpaJlkxODqR6mQa6YrVKyJfu5dHlvN2/EMOZ8rc8Jx0vayMLuEYSo RhT3hULSaEYagKhNgQusXwIGSY/qjAmgRX9MNZoCvlk96NlxRlwLqMsmTLSRfNabxyTMV8wxeLrV A0uwTcVXAovnZaCVTpM6YrVCkkYy94LSb4CAzKrhGA9vS5bzdvxDDmfK3PCcRJNMsCKFaonvBVoQ rr5kfaF1JkRkajHql/dFdWD5GmD2Ua94URBNckCcqFXuhI+1CD9w1CpIBO66k4vkjvP3rsjE3KDZ KobBlxUSbCjoHJU6BZOECU6+bAVzWuCJOV0WtGmBClwFB0uW83b8Qw5nytzwnoB7xoveonzyK1N3 StMs1T3ckxuqXCINCMHzFQv7oackCqIVqLp0ds3VLLrVKhETig9AENJePFMV1JlLa/aU5pwQlFVF cRJMV8udxZNljTDULpimeqOalEG1kYg942T3JqU6IB7xRJz6XLebt+IYcz5W54T0Jbb3qqIjgtEw 4PFM3dNkRMOMkZ7YYIPVaoBuK71jZCtE8fdKIKETkgtUB2ppBAxLFaJOMSiOC7E+DFNEV4qJzNCq HoMRhqhSQTg1CriWqiShVCQpxWmLueCJi7nMoSlWRzQRJujIns6fLebt+IYcz5W54T0BIZFRmLEI tYqoUEXDhaYhEHtVERKxRiDZMrVCjp/VOS6Y2KLjK6cBF7hda7you1Si1b9AHJULIZtROOg+SK1x HdN0GLHguvEoyetgE2osV3r9eABuVUueCc2/A5bzdvxDDmfK3PCej8qZYiyuqoEZFB0QVERo8U7O mtLJTdVRBCoKCqBaioKYGUclKScYxMywWke6XHQZAXlmiDYrScWC604QBC1xLKMjnQq6cW4o8ESf dBYYWRBNk1yE5P4PLebt+IYcz5W54T0XBYoai7ICVCgNSbUFQoGXWBg+YQehNEQiyDVe4UScwMSM nRiaOE2IKuxFQo7gzQx1gUKohxHQZOmKYm60Ag8GRNSvlzP6ol6mgxrdSnwCMjmfwuW83b8Qw5ny tzwnpumkapwShIFxmtucc8CyiTd6opkQahs0AcqIYCQUZHiuooYFslragzXyzbJNiQURwQllmmJo n49DNatWkBSkSTSpRiJUOS1mmlDT7sTTrQOPyomgv+Hy3m7fiGHM+VueE/gUTHDS9AaIxyTi6M5X XanCMkR7cXPHAHONCgcCMip7Z9ifOJQkLHGqci6MUYm4Wg3GJTxutMmojtbMbhnZanOtfLJpmyAG QTksqFadv9UZG5/D5bzdvxDDmfK3PCfw5AnKi7U6ZAcCnRpRRl7Cm44SjmpBrKoeJuu6aHET43XU UYHKo7Og4Fk2aErIThYoSVE5Xy4+9mVZOBVdRTmwRMQ4CZ6cFf8AF5bzdvxDDmfK3PCfw3CGFUfY n4IvmpRzBUDgylEUBRieKA/ZO3UcSBdPdkJjK6D2OLP7FUe3DRwstEhaxThSkbC3WparkvgQmOS+ VD2n8hy3m7fiGHM+VueE/iNkcOxaTdHsRJR61TKoUSqqM/Yqdqv3hUKJzFDg1gUQ9QUy0PasUH7F RNmEfmWRlEd02da4huKjISTCpOSlLcoTYISei94I7kpBgKBEQoCnP5DlvN2/EMOZ8rc8J/FbCMnz qql+CKBQKI4YFhZA5hVPUVKNoyqE+eSrda7g3TOxGSBBrkqoFGRoeK+W7xj/AFKBKqzJoSaJWqRc r/aLDHS9OH5LlvN2/EMOZ8rc8J/ICJJ1DJdavVAv2oEG9xg3FS1JnQk9RmhtyP8A8iqUSTRO7Ogd fdXy5mo45hMD7EWNEZJnTOf1V1Un8ty3m7fiGHM+VueE/kHCunKeJRhK4qgDdOSKdaG3tl2uVRXQ luViU8SJvYAp5UjkMAMgogBmzTvVVP5vlvN2/EMOZ8rc8J/KaoFiuKMTJgeCc3/wXlvN2/EMOZ8r c8J/xzlvN2/EMOZ8rc8J/wAc5bzdvxDDmfK3PCf8c5bzdvxDDmfK3PCfzn/i8oBLd0mXeOkNG9Vv 7MYw1csWn3qGRD6YnMqX/wDR0AbEHJBPfYHSZNwfCxTEMfzfLebt+IYcz5W54T+c5ue1yn/mn5Om W3q0nTIsWGmTqOzyMDGGzz23u7u2K/KEttyJdinzcIvyg5LfgZgd3Wdw0WobPzZjntmMjpc6CKjs W3sx5faMNyPNym8AX+We6PYuQ5nRGG5zHLRnuaBpBk5Dt+b5bzdvxDDmfK3PCfze7PZ3Y7Y2SAdT VftkF83Y52G3MU1Rb+a3Jw//AKEYy3qbhDd7t76PLf8AnR+QS526M/xrd5HY5qEJbu7Hc+aGBGkM 3voE89Fw7Gn7r/vzURPnISEBpi7UHD31t7G9uR3DuR1Ax7W4n81y3m7fiGG/twDzntzjEcSYkBeg n8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3 /Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Neg n8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/Negn8W3/NEbXKbu2DfTuQj/AGmv+Df/ AO2P3F/wb/8A2x+4v+Df/wC2P3F/wb//AGx+4v8Ag3/+2P3F/wAG/wD9sfuIHd5PdmRYy3IH+816 Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxb f816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816 Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf816Cfxbf81sbk+RmIQ3ISkdUKASBP7v/oD/2Q==">
</image>
</g>
diff --git a/silx/resources/gui/icons/image-select-erase.svg b/silx/resources/gui/icons/image-select-erase.svg
index 5cf5261..afb105b 100644
--- a/silx/resources/gui/icons/image-select-erase.svg
+++ b/silx/resources/gui/icons/image-select-erase.svg
@@ -16,6 +16,6 @@
<use fill="none" overflow="visible" stroke="#FFFFFF" stroke-miterlimit="10" stroke-width="1.5" xlink:href="#a"/>
<image transform="matrix(.24 0 0 .24 15.032 15.717)" width="84" height="84" opacity=".75" overflow="visible" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAABYCAYAAABxlTA0AAAACXBIWXMAAC4jAAAuIwF4pT92AAAA GXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAADINJREFUeNrsXYly4zgOBSX5StJJ pv//G2e2E8e3xG1XCdUvzwBJSXY2s2VVsZTDicEnEMTxQIvcr/t1v+7X/bpf/6dXuOH/jP+Secfv DPCYv4//AiWK/8s3D4nvQ0bY+EVgfxsZw8jXBvjeu6NweI/O764NrCdjcAC8iYzNQMFDwdDXscA4 uhssyyEyshLkxmgZwwjBK7jzCLTJMah67+j7qZqCMlYZOVMAd8aYJGNTILgKw4LWNPRnwRG8paET CDSBIZOwtDYlY00go4xtgYwdrc5JAONTZqHPfzejO04AgToLenJGC+/Twd+UTMJaWSwjytcQ0CkZ jyQjXoNAbgqXnA4VeG4MnARqsAqs49CPI0xESEtyIHvgIrAs36wfNaw0S8YDjaPx/t21NBgngEIv fo8ljEU/GtBiNQ0q+L4fO/i6hkm0NAEP5BS4M1CAhSHfAkAOhow7GGhOhFZXcTDVFGpvDYKfBX6g sYIJIMAtgHsWeguD7eHR0BIG2QOXV9YS5NK7yjh3ZET5NoaWx8LVVWwidKDNXfSCPv4eTzAeYQIz Ev4Awp8F/yCTUjn+KYMsBeAu6MGrbDqWhhKcehlVvjVt1kIeRiSZ4rUAxgmcBX/+PV76u05ENYQB Vs1Y0zKtHN80Ze88cJcE7FmuH/2wlEC1UFeYyscmBDfAbqg30WT8Yp7IEjT4PIFXABknYAG8AQ2a k732AA6w+ZWYrcceUHz4L/3PHvvXWADvYGXpJt3S5qcgs1LEMTYYl2FtLMGnXuiz8H/196f+dyok 2rdtPwHeaHIAt472WuA+Abiv8PBxlT3AZhxgg9vCzwXkPsCGfOh/fzJMVhzrRaC24M78APYXteQB bJwQwCvS3soxEXg/UCCif2Np7jOA+1c/Xh0NrgngJYF7oA1vRiuuKjUTJW4aOucM8iNseD9IQ4Qm sCRftDLcIOv9jwRwTavpER4ygosAP8Emh2ag68GsYcPbG17HrGBDHmUiguPALwDoFQxegmrj5gaw laO5lqeAAKsMaHMV3J8GuM+G/a3BM1CwT70tXhjA1pl8RhHAocAeY3zfgBBzEGpOrtrMETQUBhBq 9xRgNA1oc3+S9r7Q3rAk8xTh/55IzqZA3qvmIiSRCvRyAKoljeOSeTlafph7A+AV2X8F9SdscM+G e2aF8lVCtlTyazDAMZHGEyOasfKlDFCg8DJkJsIPbd4v22P/f2owDwow21zL7rLvHWGTEiNdydm0 1HwnJ9ytN/ayYx2lHkPCS0iF57oSFv1Ojhq8APOAG9srmQUOLDjTh/PhZNQxMbduCNCNA6iVyz1B WMn+IWbH5v3rMeEtlCL0Lg4ilj3AqMELw/6+FIBbU3qypezZzhkYaHRDtbgZoLknAHZnJG+WiQgt FNqvijyFVYGJQD+8BNyOwOU8yQbGnjS6NUzGJIAjhYx7iNtVoBXZuQYcefSl1QQ0BZ4KArw3AF6B i/aDkk4sS+XkfjHD99GPNYxN/7sdAcw1xTjFRKgGo2nArNOS/MaawMUrBTJqMJqHTf+enpuGwc5D BtzOAFdBff893mCsQZt38JBbAHmUBkd62h1p8K6f4Ifh9zYFLo8FshfUaGr0AJOqIG26hOAGE+te ZaWFSG0HK1BB/QVfv4MW7xIm4io2mDeELTjlM6PmlYt2GORgaDACfDQiOcxFcORVJ8pWauJ0BSK4 vwDkdzARe1hFV7PBkUDWNN3eCCZqB9jUhoYg146LNodlaSV7Zk490CtoHkhz3wHc//TjF5kINA9X 8yI4W89ehFW+x+9LL6wa1E6uFx1+cXIjjZH6jJQuRXDXpLUI7i8wD7zBdUO1t0SDWYtDIZkj544x sF4OunUCl4q4GPhwY0JzdUNjcHW895qr4B6maG9JJMdUpxK/NiS+tqI61uSKwlmelMXc4cQ3J8y3 4DEguP+A9r6DadgapqGTGwQazDFrHXBDRotzuYiaSjAB/N5oaLAYZZto1NBS4OJI2d12LLilGszF x1PB/w0Jc2KNKDa3TTK8CKtAqnY75TFYmxrb3aMB7lXTlRbQHsgpDc3xxCqK+FI02JCRrYWSzwFC XstjUIAV3J0DbpQJ5MTSbFooAFmcjagmboXlO9fENwgFuWlxUqkYFO0gDH4nX5c1dwsPpiW7K1+h wSmQPY2dQeRlUZmO/e87MBVjLg7rOZGj3gOONXkMaHPZe7k5ATsFsu7Y7KMisBrSqqY8UGzfDaiq eBOORn53T9VhHFvY0Dx3LMpEYngzQlOCEem1EO1hrngnn8l+zKr0qgZhoExW/vpocBswz4t57NYJ gye3N1Qjl6M4pRaLaI1uU+tMRiZOJiaATsnQOj7u1fpGKrlfN73GAJziL3jumJccytXqhsjkhdyW DI3hKlaF9cOb2uCQyeEiR8LyGuaS5kmEEZNK5TJy8uyNNCTvNUG+yIsoYZZzIhy5ucgAYjp/NcBb SMlXG/KsoMRkeQ5WlQI9pUkg1xPBRa1dySXz8pXGC9TPtJanYAymJWWSU61xt/gOXSKxVOIyTgZ4 KLhMxFNKk7JtfoBGz+Uzpb9KhMOxEFwxNLBzao3s0+c8mnArgFPgLg1wFVgEl3m6XOa3aPvRcZ9i YvKe/bQeksVcumqLb30DcF8HgsuVkGgs4RyFyfo+GPdUFHgTkJsBpoEbYizavsdyLNFcr+12SMJd KHG0zERmuUbwmIgwJ1eVJeGKca/GC4H6Uy65Ygguc8Us8l03smTEKzM6EWgJ0NaDGZQbLukyCmQa FoZpsDY0ZjladCaPg3EyMlsi5UVPMaohsWDzTK0gS5MnNSJaE7KaTtAd86j7CG6KFIKpxoMMK9tH +Vy2DwP9/C6xgrw9YHSPRqn2vohNIX0uABdTjJz54mAgRTw59f8/GiYiBXJ0XDdOEHnd90Emkv84 nkefF4l3SB1VP1dtbg7ck1GB0NwtphU96tQxkRzPgWwBy43rPBDoSY2IJZsb00dfAPQHCCRS4GIT NjI2kUaaIv8hpUkBWxRociqHzPxnTsjXctniG4faYI9OaoXETCFFzZ0PAHdNpR0l36XoqwdDgz1f 3wMZqyCYmEfu804uec9X8YNDpgT0CLaWu+4t2j6DuzVqZkjA+xCfgL1LlHlSAVXteC57YyUhHRZ7 mCe10rINZi8C036YIfPOjbC4Yha4SApRkLUoabUQ7OWSu5DLfbMLp+0OB5rLCuY4l0vmfrEWj21E nFOOd+6kIIeAqzQmZNsowNwEswX7WwKuGC4cbuA4Jz4lxWtEvFo+2COPNMZgATwiHoKrgP4DQzV4 45gIi1KaCyZm8pmOhZpdFVRfPJJjcTN4SGiyla70KhCR3JiYABdJeH+DFr8BwFYj4qHA9loR2CyT XfPKT6NLRznyX4ljbvXQYYc87tAI7htpLWvvR8JNs0r+kskn6Gv5OBmr0tzKlcr3qU7PlDNuhbUH +XPQRQuTQJbNB3gLaBb+lkum4wYCDYzkTuLzdWOiuvEgf3qS+bgFi7dxFLvBMg4pBJQ2Ilq9Gkjk 2MiffotWLs9j2A+wu9gfYYXKp4IkvMfVOMjn8yz0OIOt4ffuwTylVswkE2HxbdFXXMvnAy5aYwJH ev2b4TUwuBu5JOIpwG1Gc1INlN6BHBjoYCSJmj0K5CFdRqi1CtZcPp8Ushf/xJMPCiawLwIJ0NjZ w+lKJAmmBhIBeYNdgMfTkXz68FONiJO7jDxBdalvKGmO4G7FP7NnAwC/kdbihPaGj9sNKDpa/X0q 24MD8A7kw2YYr9No9Ml/XiMiblTYdCgk5DoBsEUjtToqreXo7Q+5VcdNMCsH4IN8bpLBUH3r5Kbj 2E1OjHytmgiu/iK4H3J5ZEubyJZhxgzZjiW2ziOBRyNyxD6N3MF0qARrssNX7fRkM4GNiMFIlm/F PrKlk0sy9JZyvl5HuxWhpUjgqeMXUAG8oxU9LvFWrtxKi2aCSdZWJWIv9sGbYthvPhzU4+h2CffL AzlmNJgTUdwkzq7n3lhZgym3QxsRvfwCt7N6SR7veFur9pXKLVgge1qsIJceb8vB06R2rqZwRxbS FHaBuBncejjeAc2dDCdkWyAzaY8BTsnY0uu9yvZV++QsU2FFd94R46ztHgGvk3Fsd6uq2zmrrFRG lm/Iykqyd0pek2ouDFJ2AP1XHJLvHZBfKmOKsjVYxjBiAhbYqbSeF2ld+/M0QgbsITJ6oN7kYx5y k5CCnGlK2Gt/Gsy3kvHaH7UjkibIfYeP2vlSGe8fFvU9ZLxf9+t+3a/7dYPrvwIMANSo1vPGZSLv AAAAAElFTkSuQmCC">
</image>
- <path d="m30.146 28.578l-3.846-3.828 3.827-3.845c0.614-0.618 0.611-1.614-5e-3 -2.229-0.616-0.613-1.615-0.611-2.229 5e-3l-3.828 3.846-3.844-3.825c-0.617-0.614-1.615-0.613-2.229 4e-3 -0.613 0.616-0.612 1.616 5e-3 2.23l3.845 3.825-3.828 3.847c-0.613 0.615-0.61 1.613 6e-3 2.229 0.617 0.613 1.615 0.611 2.229-4e-3l3.828-3.847 3.847 3.827c0.616 0.615 1.615 0.611 2.229-4e-3 0.613-0.618 0.61-1.616-7e-3 -2.231z" fill="#ED1C24"/>
- <path d="m30.146 28.578l-3.846-3.828 3.827-3.845c0.614-0.618 0.611-1.614-5e-3 -2.229-0.616-0.613-1.615-0.611-2.229 5e-3l-3.828 3.846-3.844-3.825c-0.617-0.614-1.615-0.613-2.229 4e-3 -0.613 0.616-0.612 1.616 5e-3 2.23l3.845 3.825-3.828 3.847c-0.613 0.615-0.61 1.613 6e-3 2.229 0.617 0.613 1.615 0.611 2.229-4e-3l3.828-3.847 3.847 3.827c0.616 0.615 1.615 0.611 2.229-4e-3 0.613-0.618 0.61-1.616-7e-3 -2.231z" fill="none" stroke="#ED1C24" stroke-miterlimit="10"/>
+ <path d="m30.146 28.578-3.846-3.828 3.827-3.845c0.614-0.618 0.611-1.614-5e-3 -2.229-0.616-0.613-1.615-0.611-2.229 5e-3l-3.828 3.846-3.844-3.825c-0.617-0.614-1.615-0.613-2.229 4e-3 -0.613 0.616-0.612 1.616 5e-3 2.23l3.845 3.825-3.828 3.847c-0.613 0.615-0.61 1.613 6e-3 2.229 0.617 0.613 1.615 0.611 2.229-4e-3l3.828-3.847 3.847 3.827c0.616 0.615 1.615 0.611 2.229-4e-3 0.613-0.618 0.61-1.616-7e-3 -2.231z" fill="#ED1C24"/>
+ <path d="m30.146 28.578-3.846-3.828 3.827-3.845c0.614-0.618 0.611-1.614-5e-3 -2.229-0.616-0.613-1.615-0.611-2.229 5e-3l-3.828 3.846-3.844-3.825c-0.617-0.614-1.615-0.613-2.229 4e-3 -0.613 0.616-0.612 1.616 5e-3 2.23l3.845 3.825-3.828 3.847c-0.613 0.615-0.61 1.613 6e-3 2.229 0.617 0.613 1.615 0.611 2.229-4e-3l3.828-3.847 3.847 3.827c0.616 0.615 1.615 0.611 2.229-4e-3 0.613-0.618 0.61-1.616-7e-3 -2.231z" fill="none" stroke="#ED1C24" stroke-miterlimit="10"/>
</svg>
diff --git a/silx/resources/gui/icons/item-0dim.svg b/silx/resources/gui/icons/item-0dim.svg
index 9a86c3a..115c4f9 100644
--- a/silx/resources/gui/icons/item-0dim.svg
+++ b/silx/resources/gui/icons/item-0dim.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <path d="m20.984 16c0 2.7539-2.2305 4.9844-4.9844 4.9844s-4.9844-2.2305-4.9844-4.9844 2.2305-4.9844 4.9844-4.9844 4.9844 2.2305 4.9844 4.9844z" fill="#0034ff"/>
+<path d="m20.984 16c0 2.7539-2.2305 4.9844-4.9844 4.9844s-4.9844-2.2305-4.9844-4.9844 2.2305-4.9844 4.9844-4.9844 4.9844 2.2305 4.9844 4.9844z" fill="#0034ff"/>
</svg>
diff --git a/silx/resources/gui/icons/item-1dim.svg b/silx/resources/gui/icons/item-1dim.svg
index a422e31..784537e 100644
--- a/silx/resources/gui/icons/item-1dim.svg
+++ b/silx/resources/gui/icons/item-1dim.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <path transform="scale(.66667)" d="m4.7051 29.947c1.4414-1.6055 9.2402-12.574 15.721-7.9395 7.8984 5.6426 11.443 23.842 23.449-0.21094" fill="none" stroke="#0034ff" stroke-linecap="round" stroke-width="5"/>
+<path transform="scale(.66667)" d="m4.7051 29.947c1.4414-1.6055 9.2402-12.574 15.721-7.9395 7.8984 5.6426 11.443 23.842 23.449-0.21094" fill="none" stroke="#0034ff" stroke-linecap="round" stroke-width="5"/>
</svg>
diff --git a/silx/resources/gui/icons/item-2dim.svg b/silx/resources/gui/icons/item-2dim.svg
index 8e80fd0..ef2bfd5 100644
--- a/silx/resources/gui/icons/item-2dim.svg
+++ b/silx/resources/gui/icons/item-2dim.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <path d="m6.5703 6.5703h18.859v18.859h-18.859z" fill="#0034ff"/>
+<path d="m6.5703 6.5703h18.859v18.859h-18.859z" fill="#0034ff"/>
</svg>
diff --git a/silx/resources/gui/icons/item-3dim.svg b/silx/resources/gui/icons/item-3dim.svg
index 9c3c23d..54b2f54 100644
--- a/silx/resources/gui/icons/item-3dim.svg
+++ b/silx/resources/gui/icons/item-3dim.svg
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <g fill-rule="evenodd">
- <path d="m2.4219 7.9062l13.625 4.543 13.531-4.5117-13.625-4.543z" fill="#00f"/>
- <path d="m16.047 12.449v16.156l13.531-4.5117v-16.156z" fill="#0063ff"/>
- <path d="m2.4219 7.9062l13.625 4.543v16.156l-13.625-4.543z" fill="#0034ff"/>
- </g>
+<g fill-rule="evenodd">
+<path d="m2.4219 7.9062 13.625 4.543 13.531-4.5117-13.625-4.543z" fill="#00f"/>
+<path d="m16.047 12.449v16.156l13.531-4.5117v-16.156z" fill="#0063ff"/>
+<path d="m2.4219 7.9062 13.625 4.543v16.156l-13.625-4.543z" fill="#0034ff"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/item-ndim.svg b/silx/resources/gui/icons/item-ndim.svg
index 7de2aed..40bc244 100644
--- a/silx/resources/gui/icons/item-ndim.svg
+++ b/silx/resources/gui/icons/item-ndim.svg
@@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <g fill-rule="evenodd">
- <path d="m16.031 9.7188l6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
- <path d="m22.871 12v8.1094l6.793-2.2656v-8.1094z" fill="#0063ff"/>
- <path d="m16.031 9.7188l6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
- <path d="m2.3359 9.7188l6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
- <path d="m9.1758 12v8.1094l6.793-2.2656v-8.1094z" fill="#0063ff"/>
- <path d="m2.3359 9.7188l6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
- <path d="m9.1406 20.043l6.8398 2.2773 6.793-2.2617-6.8398-2.2812z" fill="#00f"/>
- <path d="m15.98 22.32v8.1133l6.7891-2.2656v-8.1094z" fill="#0063ff"/>
- <path d="m9.1406 20.043l6.8398 2.2773v8.1133l-6.8398-2.2812z" fill="#0034ff"/>
- <path d="m9.1406 11.938l6.8398 2.2773 6.793-2.2617-6.8398-2.2812z" fill="#00f"/>
- <path d="m15.98 14.215v8.1133l6.7891-2.2656v-8.1094z" fill="#0063ff"/>
- <path d="m9.1406 11.938l6.8398 2.2773v8.1133l-6.8398-2.2812z" fill="#0034ff"/>
- <path d="m9.1406 3.832l6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
- <path d="m15.98 6.1133v8.1094l6.7891-2.2617v-8.1133z" fill="#0063ff"/>
- <path d="m9.1406 3.832l6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
- <path d="m16.031 14.242l6.8398 2.2812 6.793-2.2656-6.8398-2.2773z" fill="#00f"/>
- <path d="m22.871 16.523v8.1094l6.793-2.2617v-8.1094z" fill="#0063ff"/>
- <path d="m16.031 14.242l6.8398 2.2812v8.1094l-6.8398-2.2773z" fill="#0034ff"/>
- <path d="m2.3359 14.242l6.8398 2.2812 6.793-2.2656-6.8398-2.2773z" fill="#00f"/>
- <path d="m9.1758 16.523v8.1094l6.793-2.2617v-8.1094z" fill="#0063ff"/>
- <path d="m2.3359 14.242l6.8398 2.2812v8.1094l-6.8398-2.2773z" fill="#0034ff"/>
- </g>
+<g fill-rule="evenodd">
+<path d="m16.031 9.7188 6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
+<path d="m22.871 12v8.1094l6.793-2.2656v-8.1094z" fill="#0063ff"/>
+<path d="m16.031 9.7188 6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
+<path d="m2.3359 9.7188 6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
+<path d="m9.1758 12v8.1094l6.793-2.2656v-8.1094z" fill="#0063ff"/>
+<path d="m2.3359 9.7188 6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
+<path d="m9.1406 20.043 6.8398 2.2773 6.793-2.2617-6.8398-2.2812z" fill="#00f"/>
+<path d="m15.98 22.32v8.1133l6.7891-2.2656v-8.1094z" fill="#0063ff"/>
+<path d="m9.1406 20.043 6.8398 2.2773v8.1133l-6.8398-2.2812z" fill="#0034ff"/>
+<path d="m9.1406 11.938 6.8398 2.2773 6.793-2.2617-6.8398-2.2812z" fill="#00f"/>
+<path d="m15.98 14.215v8.1133l6.7891-2.2656v-8.1094z" fill="#0063ff"/>
+<path d="m9.1406 11.938 6.8398 2.2773v8.1133l-6.8398-2.2812z" fill="#0034ff"/>
+<path d="m9.1406 3.832 6.8398 2.2812 6.793-2.2656-6.8398-2.2812z" fill="#00f"/>
+<path d="m15.98 6.1133v8.1094l6.7891-2.2617v-8.1133z" fill="#0063ff"/>
+<path d="m9.1406 3.832 6.8398 2.2812v8.1094l-6.8398-2.2812z" fill="#0034ff"/>
+<path d="m16.031 14.242 6.8398 2.2812 6.793-2.2656-6.8398-2.2773z" fill="#00f"/>
+<path d="m22.871 16.523v8.1094l6.793-2.2617v-8.1094z" fill="#0063ff"/>
+<path d="m16.031 14.242 6.8398 2.2812v8.1094l-6.8398-2.2773z" fill="#0034ff"/>
+<path d="m2.3359 14.242 6.8398 2.2812 6.793-2.2656-6.8398-2.2773z" fill="#00f"/>
+<path d="m9.1758 16.523v8.1094l6.793-2.2617v-8.1094z" fill="#0063ff"/>
+<path d="m2.3359 14.242 6.8398 2.2812v8.1094l-6.8398-2.2773z" fill="#0034ff"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/item-none.png b/silx/resources/gui/icons/item-none.png
new file mode 100644
index 0000000..42f7f88
--- /dev/null
+++ b/silx/resources/gui/icons/item-none.png
Binary files differ
diff --git a/silx/resources/gui/icons/item-none.svg b/silx/resources/gui/icons/item-none.svg
new file mode 100644
index 0000000..2590b78
--- /dev/null
+++ b/silx/resources/gui/icons/item-none.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<path d="m22.628 16c0 3.6621-2.9661 6.6282-6.6282 6.6282s-6.6282-2.9661-6.6282-6.6282 2.9661-6.6282 6.6282-6.6282 6.6282 2.9661 6.6282 6.6282z" fill="none" stroke="#0034ff" stroke-width="3"/>
+<path d="m7.7549 24.245 16.49-16.49" fill="none" stroke="#0034ff" stroke-width="3"/>
+</svg>
diff --git a/silx/resources/gui/icons/item-object.svg b/silx/resources/gui/icons/item-object.svg
index 69d1267..2c4dc15 100644
--- a/silx/resources/gui/icons/item-object.svg
+++ b/silx/resources/gui/icons/item-object.svg
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
- <g fill="#0034ff">
- <path d="m13.617 8.7812l0.67969-4.0391 4.0039 0.039062 0.47656 3.9609z"/>
- <path d="m9.2266 12.59l-2.375-3.3359 2.8555-2.8008 3.1406 2.4609z"/>
- <path d="m8.7852 18.41l-4.043-0.67969 0.042968-4 3.957-0.48047z"/>
- <path d="m12.594 22.801l-3.3398 2.375-2.8008-2.8555 2.4609-3.1406z"/>
- <path d="m18.383 23.227l-0.67969 4.0391-4-0.039063-0.48047-3.9609z"/>
- <path d="m22.773 19.418l2.375 3.3359-2.8555 2.8008-3.1406-2.4609z"/>
- <path d="m23.219 13.598l4.0391 0.67969-0.039062 4-3.9609 0.48047z"/>
- <path d="m19.41 9.207l3.3359-2.375 2.8008 2.8555-2.4609 3.1406z"/>
- <path d="m16 7.9609c-4.4375 0-8.0391 3.6016-8.0391 8.0391s3.6016 8.0391 8.0391 8.0391 8.0391-3.6016 8.0391-8.0391-3.6016-8.0391-8.0391-8.0391zm0 5.168c1.5859 0 2.8711 1.2852 2.8711 2.8711s-1.2852 2.8672-2.8711 2.8672-2.8711-1.2812-2.8711-2.8672 1.2852-2.8711 2.8711-2.8711z"/>
- </g>
+<g fill="#0034ff">
+<path d="m13.617 8.7812 0.67969-4.0391 4.0039 0.039062 0.47656 3.9609z"/>
+<path d="m9.2266 12.59-2.375-3.3359 2.8555-2.8008 3.1406 2.4609z"/>
+<path d="m8.7852 18.41-4.043-0.67969 0.042968-4 3.957-0.48047z"/>
+<path d="m12.594 22.801-3.3398 2.375-2.8008-2.8555 2.4609-3.1406z"/>
+<path d="m18.383 23.227-0.67969 4.0391-4-0.039063-0.48047-3.9609z"/>
+<path d="m22.773 19.418 2.375 3.3359-2.8555 2.8008-3.1406-2.4609z"/>
+<path d="m23.219 13.598 4.0391 0.67969-0.039062 4-3.9609 0.48047z"/>
+<path d="m19.41 9.207 3.3359-2.375 2.8008 2.8555-2.4609 3.1406z"/>
+<path d="m16 7.9609c-4.4375 0-8.0391 3.6016-8.0391 8.0391s3.6016 8.0391 8.0391 8.0391 8.0391-3.6016 8.0391-8.0391-3.6016-8.0391-8.0391-8.0391zm0 5.168c1.5859 0 2.8711 1.2852 2.8711 2.8711s-1.2852 2.8672-2.8711 2.8672-2.8711-1.2812-2.8711-2.8672 1.2852-2.8711 2.8711-2.8711z"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/last.svg b/silx/resources/gui/icons/last.svg
index 598c48d..4e904d7 100644
--- a/silx/resources/gui/icons/last.svg
+++ b/silx/resources/gui/icons/last.svg
@@ -1,26 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <linearGradient id="b" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="translate(-.81925)" gradientUnits="userSpaceOnUse">
- <stop stop-color="#002839" offset="0"/>
- <stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
- </linearGradient>
- <linearGradient id="a" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="translate(-.81925)" gradientUnits="userSpaceOnUse">
- <stop offset="0"/>
- <stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
- </linearGradient>
- </defs>
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g>
- <path d="m6.2357 4.9951c6.6141 3.9114 12.473 7.571 18.396 11.252l-18.307 10.806z" fill="url(#b)" stroke="url(#a)" stroke-linejoin="round" stroke-width=".4"/>
- <path d="m25.151 6.2992v9.9456 9.9456" fill="none" stroke="#00006a"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<linearGradient id="c" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="translate(-.81925)" gradientUnits="userSpaceOnUse">
+<stop stop-color="#002839" offset="0"/>
+<stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
+</linearGradient>
+<linearGradient id="d" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="translate(-.81925)" gradientUnits="userSpaceOnUse">
+<stop offset="0"/>
+<stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
+</linearGradient>
+</defs>
+<path d="m6.2357 4.9951c6.6141 3.9114 12.473 7.571 18.396 11.252l-18.307 10.806z" fill="url(#c)" stroke="url(#d)" stroke-linejoin="round" stroke-width=".4"/>
+<path d="m25.151 6.2992v19.891" fill="none" stroke="#00006a"/>
</svg>
diff --git a/silx/resources/gui/icons/math-amplitude.png b/silx/resources/gui/icons/math-amplitude.png
new file mode 100644
index 0000000..ae31474
--- /dev/null
+++ b/silx/resources/gui/icons/math-amplitude.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-amplitude.svg b/silx/resources/gui/icons/math-amplitude.svg
new file mode 100644
index 0000000..497f62e
--- /dev/null
+++ b/silx/resources/gui/icons/math-amplitude.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+<g transform="translate(-4.9319e-5)"><path d="m16 9.584-3.2109 8.707h6.4336l-3.2227-8.707m-1.3359-2.332h2.6836l6.668 17.496h-2.4609l-1.5938-4.4883h-7.8867l-1.5938 4.4883h-2.4961l6.6797-17.496"/></g><path d="m25.356 24.881v-17.763" fill="none" stroke="#000" stroke-width="1px"/><path d="m6.6441 24.881v-17.763" fill="none" stroke="#000" stroke-width="1px"/></svg>
diff --git a/silx/resources/gui/icons/math-derive.svg b/silx/resources/gui/icons/math-derive.svg
index 65d41a3..7c77457 100644
--- a/silx/resources/gui/icons/math-derive.svg
+++ b/silx/resources/gui/icons/math-derive.svg
@@ -5,6 +5,6 @@
<path d="m6.655 25.043v-10.306h-1.189v-2.4h1.188v-0.548c0-1.644 0.306-3.288 1.063-4.332 0.648-0.887 1.53-1.226 2.287-1.226 0.594 0 1.062 0.13 1.422 0.313l-0.162 2.479c-0.234-0.13-0.54-0.235-0.937-0.235-1.098 0-1.476 1.331-1.476 2.896v0.652h1.926v2.4h-1.907v10.306h-2.215z"/>
<path d="m15.385 7.17c-0.486 2.375-1.261 5.062-1.945 6.68l-1.35 0.183c0.468-1.905 0.937-4.514 1.153-6.627l2.142-0.236z"/>
<path d="m18.32 12.025c-0.627 1.467-1.111 3.604-1.111 6.457 0 2.807 0.496 4.928 1.111 6.41h-1.166c-0.594-1.227-1.254-3.348-1.254-6.426 0.011-3.093 0.66-5.198 1.254-6.441h1.166z"/>
- <path d="m20.686 15.246l0.527 1.292c0.154 0.399 0.297 0.797 0.439 1.164h0.023c0.143-0.414 0.275-0.813 0.418-1.195l0.473-1.26h1.814l-1.77 3.715 1.793 4.082h-1.893l-0.539-1.402c-0.154-0.383-0.287-0.781-0.418-1.18h-0.033c-0.133 0.414-0.275 0.797-0.408 1.18l-0.506 1.402h-1.836l1.826-3.97-1.783-3.827h1.873z"/>
+ <path d="m20.686 15.246 0.527 1.292c0.154 0.399 0.297 0.797 0.439 1.164h0.023c0.143-0.414 0.275-0.813 0.418-1.195l0.473-1.26h1.814l-1.77 3.715 1.793 4.082h-1.893l-0.539-1.402c-0.154-0.383-0.287-0.781-0.418-1.18h-0.033c-0.133 0.414-0.275 0.797-0.408 1.18l-0.506 1.402h-1.836l1.826-3.97-1.783-3.827h1.873z"/>
<path d="m24.875 24.893c0.605-1.467 1.111-3.619 1.111-6.441s-0.494-4.943-1.111-6.426h1.166c0.584 1.228 1.256 3.316 1.256 6.426-0.012 3.109-0.672 5.198-1.256 6.441h-1.166z"/>
</svg>
diff --git a/silx/resources/gui/icons/math-fit.svg b/silx/resources/gui/icons/math-fit.svg
index f307b17..dbb2716 100644
--- a/silx/resources/gui/icons/math-fit.svg
+++ b/silx/resources/gui/icons/math-fit.svg
@@ -1,33 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><path
- d="m 5.389,25.291 c 1.58,-0.508 1.812,-2.553 2.157,-3.945 0.386,-1.556 1.273,-1.214 2.263,-2.038 0.688,-0.573 0.899,-1.425 0.95,-2.313 0.042,-0.741 -0.152,-3.181 0.782,-3.454 0.318,-0.092 0.664,-0.102 0.965,-0.255 0.843,-0.43 1.344,-1.121 1.679,-2.019 0.255,-0.686 0.463,-1.369 0.655,-2.074 0.03,-0.11 1.031,-3.262 1.374,-2.735 1.012,1.557 1.44,3.84 1.949,5.601 0.467,1.616 0.819,3.259 1.312,4.869 0.223,0.728 0.394,1.828 1.124,2.255 1.383,0.811 1.77,-1.7 1.924,-2.377 0.246,-1.075 0.345,-1.811 0.732,-0.343 0.3,1.136 0.448,2.319 0.637,3.477 0.226,1.388 0.626,3.463 1.515,4.559 0.089,0.11 0.305,0.171 0.438,0.116 0.787,-0.324 0.642,-2.325 1.354,-0.873 0.313,0.641 0.516,1.625 1.247,1.912 0.54,0.213 0.772,-0.658 0.238,-0.867 -0.869,-0.342 -0.671,-3.279 -2.23,-2.851 -0.671,0.185 -0.841,1.305 -0.97,1.82 0.32,-1.277 -0.408,-2.326 -0.656,-3.659 -0.226,-1.215 -0.218,-5.231 -1.676,-5.757 -0.453,-0.164 -0.721,0.077 -0.967,0.44 -0.239,0.353 -0.314,0.894 -0.416,1.295 -0.056,0.224 -0.622,3.16 -1.157,1.405 -1.157,-3.8 -1.675,-8.486 -3.87,-11.864 -1.414,-2.176 -2.873,3.723 -2.96,4.045 -0.374,1.378 -0.894,2.683 -2.477,3.011 -0.307,0.063 -0.67,0.193 -0.897,0.421 -1.402,1.402 0.693,4.751 -1.486,5.647 -0.974,0.4 -1.453,0.299 -1.934,1.379 -0.503,1.128 -0.444,3.855 -1.834,4.303 -0.554,0.179 -0.319,1.048 0.235,0.869 z"
- inkscape:connector-curvature="0"
- id="path4"
- style="fill:#ed1c24" /><path
- d="m 8.904,16.8 h 4.941 v 1.5 h -3.106 v 1.847 h 2.903 v 1.487 h -2.903 v 3.25 H 8.904 V 16.8 z"
- inkscape:connector-curvature="0"
- id="path6" /><path
- d="m 17.063,16.8 v 8.083 H 15.228 V 16.8 h 1.835 z"
- inkscape:connector-curvature="0"
- id="path8" /><path
- d="M 20.207,18.336 H 18.036 V 16.8 h 6.213 v 1.536 h -2.207 v 6.548 h -1.835 v -6.548 z"
- inkscape:connector-curvature="0"
- id="path10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m5.389 25.291c1.58-0.508 1.812-2.553 2.157-3.945 0.386-1.556 1.273-1.214 2.263-2.038 0.688-0.573 0.899-1.425 0.95-2.313 0.042-0.741-0.152-3.181 0.782-3.454 0.318-0.092 0.664-0.102 0.965-0.255 0.843-0.43 1.344-1.121 1.679-2.019 0.255-0.686 0.463-1.369 0.655-2.074 0.03-0.11 1.031-3.262 1.374-2.735 1.012 1.557 1.44 3.84 1.949 5.601 0.467 1.616 0.819 3.259 1.312 4.869 0.223 0.728 0.394 1.828 1.124 2.255 1.383 0.811 1.77-1.7 1.924-2.377 0.246-1.075 0.345-1.811 0.732-0.343 0.3 1.136 0.448 2.319 0.637 3.477 0.226 1.388 0.626 3.463 1.515 4.559 0.089 0.11 0.305 0.171 0.438 0.116 0.787-0.324 0.642-2.325 1.354-0.873 0.313 0.641 0.516 1.625 1.247 1.912 0.54 0.213 0.772-0.658 0.238-0.867-0.869-0.342-0.671-3.279-2.23-2.851-0.671 0.185-0.841 1.305-0.97 1.82 0.32-1.277-0.408-2.326-0.656-3.659-0.226-1.215-0.218-5.231-1.676-5.757-0.453-0.164-0.721 0.077-0.967 0.44-0.239 0.353-0.314 0.894-0.416 1.295-0.056 0.224-0.622 3.16-1.157 1.405-1.157-3.8-1.675-8.486-3.87-11.864-1.414-2.176-2.873 3.723-2.96 4.045-0.374 1.378-0.894 2.683-2.477 3.011-0.307 0.063-0.67 0.193-0.897 0.421-1.402 1.402 0.693 4.751-1.486 5.647-0.974 0.4-1.453 0.299-1.934 1.379-0.503 1.128-0.444 3.855-1.834 4.303-0.554 0.179-0.319 1.048 0.235 0.869z" fill="#ed1c24"/><path d="m8.904 16.8h4.941v1.5h-3.106v1.847h2.903v1.487h-2.903v3.25h-1.835v-8.084z"/><path d="m17.063 16.8v8.083h-1.835v-8.083h1.835z"/><path d="m20.207 18.336h-2.171v-1.536h6.213v1.536h-2.207v6.548h-1.835v-6.548z"/></svg>
diff --git a/silx/resources/gui/icons/math-imaginary.png b/silx/resources/gui/icons/math-imaginary.png
new file mode 100644
index 0000000..6327beb
--- /dev/null
+++ b/silx/resources/gui/icons/math-imaginary.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-imaginary.svg b/silx/resources/gui/icons/math-imaginary.svg
new file mode 100644
index 0000000..c60a636
--- /dev/null
+++ b/silx/resources/gui/icons/math-imaginary.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" line-height="125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+<g font-family="Sans" font-size="40px" line-height="125%"><path d="m4.0857 22.756c1.56-0.024 1.56-0.024 1.896-0.024l3.744 0.024 0.864-0.6-2.232-0.168c0.4557-2.112 1.968-8.112 3.096-12.24l1.392-0.144 0.84-0.6h-0.816c-2.448 0.024-2.448 0.024-2.856 0.024-0.384 0-0.48 0-1.848-0.024l-0.84 0.6 2.16 0.144c-0.192 0.888-0.336 1.488-0.36 1.608l-0.504 1.968c-1.512 5.928-1.776 6.984-1.896 7.392-0.048 0.144-0.192 0.696-0.36 1.272l-1.416 0.168-0.864 0.6"/><path d="m15.194 22.348 1.536-5.832c1.608-1.08 2.592-1.656 2.904-1.656 0.192 0 0.312 0.216 0.312 0.528 0 0.72-0.912 4.368-1.92 7.608l1.824-0.648 1.488-6c1.392-0.888 2.688-1.608 2.976-1.608 0.192 0 0.312 0.168 0.312 0.456 0 0.528-0.216 1.512-0.864 4.08-0.384 1.488-0.504 2.088-0.504 2.64 0 0.504 0.144 0.768 0.576 1.08 1.416-0.696 2.616-1.464 4.08-2.616v-0.552c-0.24 0.12-0.504 0.288-0.816 0.504-0.864 0.552-1.272 0.744-1.56 0.744-0.264 0-0.432-0.24-0.432-0.648 0-0.528 0.312-1.896 0.792-3.576 0.72-2.472 0.912-3.24 0.912-3.6 0-0.24-0.144-0.36-0.384-0.36-0.432 0-1.92 0.768-4.848 2.496 0.072-0.264 0.096-0.456 0.12-0.552 0.288-1.2 0.36-1.536 0.36-1.68 0-0.168-0.12-0.264-0.312-0.264-0.36 0-1.608 0.672-4.008 2.208l-0.768 0.48c0.432-1.752 0.528-2.184 0.528-2.352 0-0.192-0.144-0.336-0.36-0.336-0.288 0-2.184 1.032-3.744 2.016l-0.168 0.672c1.32-0.648 1.512-0.72 1.776-0.72 0.216 0 0.36 0.192 0.36 0.456 0 0.384-0.864 3.936-1.872 7.68l1.704-0.648"/></g></svg>
diff --git a/silx/resources/gui/icons/math-normalize.svg b/silx/resources/gui/icons/math-normalize.svg
index c878a70..f6c0465 100644
--- a/silx/resources/gui/icons/math-normalize.svg
+++ b/silx/resources/gui/icons/math-normalize.svg
@@ -1,44 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata20"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs18" /><line
- x1="8.1370001"
- x2="25.667999"
- y1="16.749001"
- y2="16.749001"
- fill="#F7941E"
- stroke="#F7941E"
- stroke-miterlimit="10"
- stroke-width="2"
- id="line4"
- style="fill:#f7941e;stroke:#f7941e;stroke-width:2;stroke-miterlimit:10" /><path
- d="M 12.09,29.497 V 19.84 h 2.565 l 3.188,4.141 c 0.825,1.075 1.54,2.192 2.107,3.238 h 0.037 C 19.841,25.93 19.785,24.683 19.785,23.207 V 19.84 h 2.09 v 9.657 H 19.547 L 16.322,25.256 C 15.534,24.195 14.71,23.007 14.105,21.918 l -0.055,0.014 c 0.091,1.247 0.11,2.522 0.11,4.112 v 3.453 h -2.07 z"
- inkscape:connector-curvature="0"
- id="path6" /><path
- d="m 16.552,7.344 c -0.432,0.783 -0.762,1.87 -0.762,3.354 0,1.458 0.337,2.538 0.762,3.329 h -0.607 c -0.385,-0.659 -0.816,-1.73 -0.816,-3.329 0.007,-1.607 0.432,-2.687 0.816,-3.354 h 0.607 z"
- inkscape:connector-curvature="0"
- id="path8" /><path
- d="m 19.319,7.916 0.587,1.137 c 0.162,0.321 0.304,0.618 0.445,0.927 h 0.03 c 0.142,-0.333 0.283,-0.643 0.425,-0.952 l 0.546,-1.112 h 1.356 l -1.649,2.892 1.68,3.127 h -1.406 l -0.607,-1.199 c -0.162,-0.321 -0.304,-0.643 -0.445,-0.977 h -0.02 c -0.142,0.346 -0.283,0.643 -0.445,0.977 l -0.566,1.199 h -1.376 l 1.71,-3.065 -1.649,-2.954 h 1.384 z"
- inkscape:connector-curvature="0"
- id="path10" /><path
- d="m 24.166,14.026 c 0.425,-0.783 0.756,-1.878 0.756,-3.345 0,-1.467 -0.331,-2.546 -0.756,-3.337 h 0.601 c 0.392,0.659 0.823,1.73 0.823,3.345 -0.007,1.607 -0.432,2.669 -0.823,3.337 h -0.601 z"
- inkscape:connector-curvature="0"
- id="path12" /><polygon
- points="9.052,4.063 9.052,12.68 8.367,12.68 8.367,14.091 11.862,14.091 11.862,12.68 11.18,12.68 11.18,4.063 11.862,4.063 11.862,2.651 8.367,2.651 8.367,4.063 "
- id="polygon14" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="8.137" x2="25.668" y1="16.749" y2="16.749" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2"/><path d="m12.09 29.497v-9.657h2.565l3.188 4.141c0.825 1.075 1.54 2.192 2.107 3.238h0.037c-0.146-1.289-0.202-2.536-0.202-4.012v-3.367h2.09v9.657h-2.328l-3.225-4.241c-0.788-1.061-1.612-2.249-2.217-3.338l-0.055 0.014c0.091 1.247 0.11 2.522 0.11 4.112v3.453h-2.07z"/><path d="m16.552 7.344c-0.432 0.783-0.762 1.87-0.762 3.354 0 1.458 0.337 2.538 0.762 3.329h-0.607c-0.385-0.659-0.816-1.73-0.816-3.329 7e-3 -1.607 0.432-2.687 0.816-3.354h0.607z"/><path d="m19.319 7.916 0.587 1.137c0.162 0.321 0.304 0.618 0.445 0.927h0.03c0.142-0.333 0.283-0.643 0.425-0.952l0.546-1.112h1.356l-1.649 2.892 1.68 3.127h-1.406l-0.607-1.199c-0.162-0.321-0.304-0.643-0.445-0.977h-0.02c-0.142 0.346-0.283 0.643-0.445 0.977l-0.566 1.199h-1.376l1.71-3.065-1.649-2.954h1.384z"/><path d="m24.166 14.026c0.425-0.783 0.756-1.878 0.756-3.345s-0.331-2.546-0.756-3.337h0.601c0.392 0.659 0.823 1.73 0.823 3.345-7e-3 1.607-0.432 2.669-0.823 3.337h-0.601z"/><polygon points="9.052 4.063 9.052 12.68 8.367 12.68 8.367 14.091 11.862 14.091 11.862 12.68 11.18 12.68 11.18 4.063 11.862 4.063 11.862 2.651 8.367 2.651 8.367 4.063"/></svg>
diff --git a/silx/resources/gui/icons/math-peak-reset.svg b/silx/resources/gui/icons/math-peak-reset.svg
index e35c13b..7185046 100644
--- a/silx/resources/gui/icons/math-peak-reset.svg
+++ b/silx/resources/gui/icons/math-peak-reset.svg
@@ -1,55 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3119"
- xml:space="preserve"><metadata
- id="metadata3143"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3141"><filter
- x="-0.13669565"
- y="-0.15212902"
- width="1.2733912"
- height="1.3042581"
- color-interpolation-filters="sRGB"
- id="filter6093"><feGaussianBlur
- id="feGaussianBlur6095"
- stdDeviation="0.85968749" /></filter></defs><path
- d="m 5.389,25.291 c 1.58,-0.508 1.812,-2.553 2.157,-3.945 0.386,-1.556 1.273,-1.214 2.263,-2.038 0.688,-0.573 0.899,-1.425 0.95,-2.313 0.042,-0.741 -0.152,-3.181 0.782,-3.454 0.318,-0.092 0.664,-0.102 0.965,-0.255 0.843,-0.43 1.344,-1.121 1.679,-2.019 0.255,-0.686 0.463,-1.369 0.655,-2.074 0.03,-0.11 1.031,-3.262 1.374,-2.735 1.012,1.557 1.44,3.84 1.949,5.601 0.467,1.616 0.819,3.259 1.312,4.869 0.223,0.728 0.394,1.828 1.124,2.255 1.383,0.811 1.77,-1.7 1.924,-2.377 0.246,-1.075 0.345,-1.811 0.732,-0.343 0.3,1.136 0.448,2.319 0.637,3.477 0.226,1.388 0.626,3.463 1.515,4.559 0.089,0.11 0.305,0.171 0.438,0.116 0.787,-0.324 0.642,-2.325 1.354,-0.873 0.313,0.641 0.516,1.625 1.247,1.912 0.54,0.213 0.772,-0.658 0.238,-0.867 -0.869,-0.342 -0.671,-3.279 -2.23,-2.851 -0.671,0.185 -0.841,1.305 -0.97,1.82 0.32,-1.277 -0.408,-2.326 -0.656,-3.659 -0.226,-1.215 -0.218,-5.231 -1.676,-5.757 -0.453,-0.164 -0.721,0.077 -0.967,0.44 -0.239,0.353 -0.314,0.894 -0.416,1.295 -0.056,0.224 -0.622,3.16 -1.157,1.405 -1.157,-3.8 -1.675,-8.486 -3.87,-11.864 -1.414,-2.176 -2.873,3.723 -2.96,4.045 -0.374,1.378 -0.894,2.683 -2.477,3.011 -0.307,0.063 -0.67,0.193 -0.897,0.421 -1.402,1.402 0.693,4.751 -1.486,5.647 -0.974,0.4 -1.453,0.299 -1.934,1.379 -0.503,1.128 -0.444,3.855 -1.834,4.303 -0.554,0.179 -0.319,1.048 0.235,0.869 z"
- id="path3121" /><g
- id="g3123"
- style="fill:#00a651;stroke:#00a651;stroke-width:1.10000002;stroke-miterlimit:10"><line
- x1="16.027"
- x2="16.016001"
- y1="23.438"
- y2="10.753"
- id="line3125" /><polygon
- points="13.807,23.451 18.248,23.438 16.045,27.269 "
- id="polygon3127" /><polygon
- points="18.236,10.247 13.795,10.228 16.022,6.413 "
- id="polygon3129" /></g><path
- d="m 9.7696852,14.337521 -1.28125,1.40625 5.9999998,5.34375 -6.1249998,5.28125 1.25,1.4375 6.2812498,-5.4375 6.1875,5.53125 1.25,-1.40625 -5.96875,-5.375 6.09375,-5.25 -1.25,-1.4375 -6.28125,5.40625 -6.1562498,-5.5 z"
- id="line3135-6"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.89999998;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter6093);enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /><g
- id="g3133"
- style="fill:none;stroke:#ed1c24;stroke-width:1.89999998;stroke-miterlimit:10"><line
- x1="9.2329998"
- x2="22.822001"
- y1="14.099"
- y2="26.26"
- id="line3135" /><line
- x1="22.948999"
- x2="9.1049995"
- y1="14.211"
- y2="26.146999"
- id="line3137" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.1367" y="-.15213" width="1.2734" height="1.3043" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.85968749"/></filter></defs><path d="m5.389 25.291c1.58-0.508 1.812-2.553 2.157-3.945 0.386-1.556 1.273-1.214 2.263-2.038 0.688-0.573 0.899-1.425 0.95-2.313 0.042-0.741-0.152-3.181 0.782-3.454 0.318-0.092 0.664-0.102 0.965-0.255 0.843-0.43 1.344-1.121 1.679-2.019 0.255-0.686 0.463-1.369 0.655-2.074 0.03-0.11 1.031-3.262 1.374-2.735 1.012 1.557 1.44 3.84 1.949 5.601 0.467 1.616 0.819 3.259 1.312 4.869 0.223 0.728 0.394 1.828 1.124 2.255 1.383 0.811 1.77-1.7 1.924-2.377 0.246-1.075 0.345-1.811 0.732-0.343 0.3 1.136 0.448 2.319 0.637 3.477 0.226 1.388 0.626 3.463 1.515 4.559 0.089 0.11 0.305 0.171 0.438 0.116 0.787-0.324 0.642-2.325 1.354-0.873 0.313 0.641 0.516 1.625 1.247 1.912 0.54 0.213 0.772-0.658 0.238-0.867-0.869-0.342-0.671-3.279-2.23-2.851-0.671 0.185-0.841 1.305-0.97 1.82 0.32-1.277-0.408-2.326-0.656-3.659-0.226-1.215-0.218-5.231-1.676-5.757-0.453-0.164-0.721 0.077-0.967 0.44-0.239 0.353-0.314 0.894-0.416 1.295-0.056 0.224-0.622 3.16-1.157 1.405-1.157-3.8-1.675-8.486-3.87-11.864-1.414-2.176-2.873 3.723-2.96 4.045-0.374 1.378-0.894 2.683-2.477 3.011-0.307 0.063-0.67 0.193-0.897 0.421-1.402 1.402 0.693 4.751-1.486 5.647-0.974 0.4-1.453 0.299-1.934 1.379-0.503 1.128-0.444 3.855-1.834 4.303-0.554 0.179-0.319 1.048 0.235 0.869z"/><g fill="#00a651" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.1"><line x1="16.027" x2="16.016" y1="23.438" y2="10.753"/><polygon points="13.807 23.451 18.248 23.438 16.045 27.269"/><polygon points="18.236 10.247 13.795 10.228 16.022 6.413"/></g><path d="m9.7697 14.338-1.2812 1.4062 6 5.3438-6.125 5.2812 1.25 1.4375 6.2812-5.4375 6.1875 5.5312 1.25-1.4062-5.9688-5.375 6.0938-5.25-1.25-1.4375-6.2812 5.4062-6.1562-5.5z" color="#000000" filter="url(#a)" style="block-progression:tb;text-indent:0;text-transform:none"/><g fill="none" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="1.9"><line x1="9.233" x2="22.822" y1="14.099" y2="26.26"/><line x1="22.949" x2="9.105" y1="14.211" y2="26.147"/></g></svg>
diff --git a/silx/resources/gui/icons/math-peak-search.svg b/silx/resources/gui/icons/math-peak-search.svg
index 47164ac..0d86ad0 100644
--- a/silx/resources/gui/icons/math-peak-search.svg
+++ b/silx/resources/gui/icons/math-peak-search.svg
@@ -1,56 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3093"
- xml:space="preserve"><metadata
- id="metadata3117"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3115"><filter
- color-interpolation-filters="sRGB"
- id="filter5562"><feGaussianBlur
- id="feGaussianBlur5564"
- stdDeviation="1.2128746" /></filter></defs><path
- d="m 4.356,26.781 c 0.66,-0.935 1.841,-0.809 2.729,-1.399 0.703,-0.467 0.856,-1.623 0.992,-2.349 0.218,-1.165 -0.362,-4.839 1.218,-5.27 1.004,-0.274 1.677,-0.422 2.422,-1.176 1.721,-1.742 1.883,-4.988 2.669,-7.182 0.504,-1.407 1.142,-1.524 1.711,-0.079 0.35,0.886 0.697,1.771 1.017,2.668 0.689,1.934 1.256,3.931 1.737,5.926 0.45,1.865 0.957,3.707 1.576,5.523 0.279,0.821 0.38,1.479 1.177,1.893 1.154,0.598 1.675,-0.925 1.896,-1.673 0.278,-0.937 0.439,-1.908 0.69,-2.854 0.455,-1.711 0.864,0.714 1.019,1.371 0.442,1.884 0.466,3.932 1.071,5.769 0.181,0.549 1.05,0.314 0.867,-0.238 -0.398,-1.209 -0.782,-9.396 -2.967,-8.609 -1.242,0.448 -1.363,3.699 -1.672,4.738 -0.364,1.226 -1.034,-0.032 -1.215,-0.635 -0.366,-1.225 -0.775,-2.429 -1.108,-3.664 -0.629,-2.33 -1.193,-4.659 -1.927,-6.96 -0.276,-0.867 -1.45,-6 -3.046,-5.583 -2.015,0.528 -2.388,4.501 -2.846,6.112 -0.615,2.163 -1.571,3.309 -3.726,3.896 -0.864,0.236 -1.143,0.979 -1.28,1.771 -0.3,1.735 0.738,5.357 -1.488,6.215 -1.107,0.426 -1.578,0.317 -2.295,1.332 -0.334,0.478 0.447,0.927 0.779,0.457 z"
- id="path3095" /><g
- transform="translate(1.6271186,0.13559322)"
- id="g6629"
- style="filter:url(#filter5562)"><path
- d="m 2.1425431,16.187422 c -0.417,0.236 -1.12,0.115 -1.55699999,-0.271 -0.442,-0.39 -0.455,-0.906 -0.039,-1.147 l 7.32999999,-4.184 c 0.422,-0.242 1.121,-0.119 1.56,0.27 0.44,0.392 0.457,0.901 0.035,1.146 l -7.329,4.186 z"
- id="path3101-3"
- style="fill:#000000;stroke:#00a651;stroke-width:0.1;stroke-miterlimit:10" /><path
- d="m 14.176377,2.8135593 c -1.840801,-0.221807 -3.710615,0.0891 -5.2499999,0.96875 -1.53907,0.881724 -2.455231,2.258419 -2.5625,3.75 -0.107269,1.4915809 0.571478,3.0356967 1.9375,4.2499997 2.7388449,2.425517 7.2029939,2.980654 10.2812499,1.21875 1.539106,-0.879247 2.454634,-2.258711 2.5625,-3.7499997 0.107866,-1.4912883 -0.5729,-3.035478 -1.9375,-4.25 -1.3708,-1.214169 -3.190449,-1.965693 -5.03125,-2.1875 z m -0.15625,1.5625 c 1.561699,0.187693 3.0903,0.778169 4.1875,1.75 1.0904,0.9704781 1.507134,2.0372883 1.4375,3 -0.06963,0.9627117 -0.622606,1.8827477 -1.8125,2.5624997 -2.379744,1.362096 -6.340095,0.909234 -8.5312499,-1.03125 -1.091978,-0.9706963 -1.506731,-2.0685806 -1.4375,-3.0312497 0.06923,-0.962669 0.62157,-1.848974 1.8125,-2.53125 1.1906149,-0.680351 2.7820509,-0.906443 4.3437499,-0.71875 z"
- id="path3103-6"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /><path
- d="m 30.571543,31.718422 c 0.247,0.361 0.019,0.865 -0.506,1.109 -0.531,0.246 -1.174,0.141 -1.42,-0.221 l -4.346,-6.416 c -0.255,-0.369 -0.025,-0.869 0.502,-1.111 0.533,-0.244 1.163,-0.146 1.422,0.227 l 4.348,6.412 z"
- id="path3109-6"
- style="fill:#000000;stroke:#00a651;stroke-width:0.1;stroke-miterlimit:10" /><path
- d="m 21.551377,15.594809 c -0.874914,0.08975 -1.739271,0.308145 -2.5625,0.6875 -1.644381,0.761544 -2.826791,2.026822 -3.34375,3.46875 -0.516959,1.441929 -0.342017,3.054671 0.59375,4.4375 l 0,0.03125 c 1.880796,2.76166 5.959716,3.614814 9.25,2.09375 1.646103,-0.760464 2.826654,-2.026732 3.34375,-3.46875 0.517096,-1.442017 0.345253,-3.056476 -0.59375,-4.4375 -1.404856,-2.074744 -4.062758,-3.08175 -6.6875,-2.8125 z m 0.15625,1.5 c 2.128008,-0.198468 4.257606,0.644495 5.28125,2.15625 0.683997,1.005977 0.772904,2.071268 0.40625,3.09375 -0.366654,1.022483 -1.205353,1.981214 -2.53125,2.59375 -2.649716,1.224937 -6.001796,0.45384 -7.375,-1.5625 -0.682233,-1.00817 -0.804291,-2.101928 -0.4375,-3.125 0.366791,-1.023071 1.237881,-1.980293 2.5625,-2.59375 0.663271,-0.305644 1.384414,-0.496344 2.09375,-0.5625 z"
- id="path3111-2"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /></g><g
- id="g3099"
- style="stroke:#00a651;stroke-miterlimit:10"><path
- d="M 3.222,15.385 C 2.805,15.621 2.102,15.5 1.665,15.114 1.223,14.724 1.21,14.208 1.626,13.967 l 7.33,-4.184 c 0.422,-0.242 1.121,-0.119 1.56,0.27 0.44,0.392 0.457,0.901 0.035,1.146 l -7.329,4.186 z"
- id="path3101"
- style="fill:#00a651;stroke-width:0.1" /><path
- d="M 19.291,11.538 C 16.562,13.1 12.355,12.592 9.89,10.409 7.432,8.224 7.649,5.19 10.379,3.626 c 2.73,-1.56 6.936,-1.054 9.404,1.132 2.455,2.185 2.237,5.221 -0.492,6.78 z"
- id="path3103"
- style="fill:none;stroke-width:1.5" /></g><g
- id="g3107"
- style="stroke:#00a651;stroke-miterlimit:10"><path
- d="m 31.651,30.916 c 0.247,0.361 0.019,0.865 -0.506,1.109 -0.531,0.246 -1.174,0.141 -1.42,-0.221 l -4.346,-6.416 c -0.255,-0.369 -0.025,-0.869 0.502,-1.111 0.533,-0.244 1.163,-0.146 1.422,0.227 l 4.348,6.412 z"
- id="path3109"
- style="fill:#00a651;stroke-width:0.1" /><path
- d="m 28.693,18.014 c 1.623,2.387 0.53,5.436 -2.442,6.809 -2.97,1.373 -6.686,0.547 -8.313,-1.842 -1.618,-2.391 -0.526,-5.438 2.443,-6.813 2.973,-1.37 6.693,-0.545 8.312,1.846 z"
- id="path3111"
- style="fill:none;stroke-width:1.5" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.2128746"/></filter></defs><path d="m4.356 26.781c0.66-0.935 1.841-0.809 2.729-1.399 0.703-0.467 0.856-1.623 0.992-2.349 0.218-1.165-0.362-4.839 1.218-5.27 1.004-0.274 1.677-0.422 2.422-1.176 1.721-1.742 1.883-4.988 2.669-7.182 0.504-1.407 1.142-1.524 1.711-0.079 0.35 0.886 0.697 1.771 1.017 2.668 0.689 1.934 1.256 3.931 1.737 5.926 0.45 1.865 0.957 3.707 1.576 5.523 0.279 0.821 0.38 1.479 1.177 1.893 1.154 0.598 1.675-0.925 1.896-1.673 0.278-0.937 0.439-1.908 0.69-2.854 0.455-1.711 0.864 0.714 1.019 1.371 0.442 1.884 0.466 3.932 1.071 5.769 0.181 0.549 1.05 0.314 0.867-0.238-0.398-1.209-0.782-9.396-2.967-8.609-1.242 0.448-1.363 3.699-1.672 4.738-0.364 1.226-1.034-0.032-1.215-0.635-0.366-1.225-0.775-2.429-1.108-3.664-0.629-2.33-1.193-4.659-1.927-6.96-0.276-0.867-1.45-6-3.046-5.583-2.015 0.528-2.388 4.501-2.846 6.112-0.615 2.163-1.571 3.309-3.726 3.896-0.864 0.236-1.143 0.979-1.28 1.771-0.3 1.735 0.738 5.357-1.488 6.215-1.107 0.426-1.578 0.317-2.295 1.332-0.334 0.478 0.447 0.927 0.779 0.457z"/><g transform="translate(1.6271 .13559)" filter="url(#a)"><path d="m2.1425 16.187c-0.417 0.236-1.12 0.115-1.557-0.271-0.442-0.39-0.455-0.906-0.039-1.147l7.33-4.184c0.422-0.242 1.121-0.119 1.56 0.27 0.44 0.392 0.457 0.901 0.035 1.146l-7.329 4.186z" stroke="#00a651" stroke-miterlimit="10" stroke-width=".1"/><path d="m14.176 2.8136c-1.8408-0.22181-3.7106 0.0891-5.25 0.96875-1.5391 0.88172-2.4552 2.2584-2.5625 3.75-0.10727 1.4916 0.57148 3.0357 1.9375 4.25 2.7388 2.4255 7.203 2.9807 10.281 1.2188 1.5391-0.87925 2.4546-2.2587 2.5625-3.75 0.10787-1.4913-0.5729-3.0355-1.9375-4.25-1.3708-1.2142-3.1904-1.9657-5.0312-2.1875zm-0.15625 1.5625c1.5617 0.18769 3.0903 0.77817 4.1875 1.75 1.0904 0.97048 1.5071 2.0373 1.4375 3-0.06963 0.96271-0.62261 1.8827-1.8125 2.5625-2.3797 1.3621-6.3401 0.90923-8.5312-1.0312-1.092-0.9707-1.5067-2.0686-1.4375-3.0312 0.06923-0.96267 0.62157-1.849 1.8125-2.5312 1.1906-0.68035 2.7821-0.90644 4.3437-0.71875z" color="#000000" style="block-progression:tb;text-indent:0;text-transform:none"/><path d="m30.572 31.718c0.247 0.361 0.019 0.865-0.506 1.109-0.531 0.246-1.174 0.141-1.42-0.221l-4.346-6.416c-0.255-0.369-0.025-0.869 0.502-1.111 0.533-0.244 1.163-0.146 1.422 0.227l4.348 6.412z" stroke="#00a651" stroke-miterlimit="10" stroke-width=".1"/><path d="m21.551 15.595c-0.87491 0.08975-1.7393 0.30814-2.5625 0.6875-1.6444 0.76154-2.8268 2.0268-3.3438 3.4688-0.51696 1.4419-0.34202 3.0547 0.59375 4.4375v0.03125c1.8808 2.7617 5.9597 3.6148 9.25 2.0938 1.6461-0.76046 2.8267-2.0267 3.3438-3.4688 0.5171-1.442 0.34525-3.0565-0.59375-4.4375-1.4049-2.0747-4.0628-3.0818-6.6875-2.8125zm0.15625 1.5c2.128-0.19847 4.2576 0.6445 5.2812 2.1562 0.684 1.006 0.7729 2.0713 0.40625 3.0938-0.36665 1.0225-1.2054 1.9812-2.5312 2.5938-2.6497 1.2249-6.0018 0.45384-7.375-1.5625-0.68223-1.0082-0.80429-2.1019-0.4375-3.125 0.36679-1.0231 1.2379-1.9803 2.5625-2.5938 0.66327-0.30564 1.3844-0.49634 2.0938-0.5625z" color="#000000" style="block-progression:tb;text-indent:0;text-transform:none"/></g><g stroke="#00a651" stroke-miterlimit="10"><path d="m3.222 15.385c-0.417 0.236-1.12 0.115-1.557-0.271-0.442-0.39-0.455-0.906-0.039-1.147l7.33-4.184c0.422-0.242 1.121-0.119 1.56 0.27 0.44 0.392 0.457 0.901 0.035 1.146l-7.329 4.186z" fill="#00a651" stroke-width=".1"/><path d="m19.291 11.538c-2.729 1.562-6.936 1.054-9.401-1.129-2.458-2.185-2.241-5.219 0.489-6.783 2.73-1.56 6.936-1.054 9.404 1.132 2.455 2.185 2.237 5.221-0.492 6.78z" fill="none" stroke-width="1.5"/></g><g stroke="#00a651" stroke-miterlimit="10"><path d="m31.651 30.916c0.247 0.361 0.019 0.865-0.506 1.109-0.531 0.246-1.174 0.141-1.42-0.221l-4.346-6.416c-0.255-0.369-0.025-0.869 0.502-1.111 0.533-0.244 1.163-0.146 1.422 0.227l4.348 6.412z" fill="#00a651" stroke-width=".1"/><path d="m28.693 18.014c1.623 2.387 0.53 5.436-2.442 6.809-2.97 1.373-6.686 0.547-8.313-1.842-1.618-2.391-0.526-5.438 2.443-6.813 2.973-1.37 6.693-0.545 8.312 1.846z" fill="none" stroke-width="1.5"/></g></svg>
diff --git a/silx/resources/gui/icons/math-peak.svg b/silx/resources/gui/icons/math-peak.svg
index eb78383..94a7b1d 100644
--- a/silx/resources/gui/icons/math-peak.svg
+++ b/silx/resources/gui/icons/math-peak.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><path
- d="m 5.389,25.291 c 1.58,-0.508 1.812,-2.553 2.157,-3.945 0.386,-1.556 1.273,-1.214 2.263,-2.038 0.688,-0.573 0.899,-1.425 0.95,-2.313 0.042,-0.741 -0.152,-3.181 0.782,-3.454 0.318,-0.092 0.664,-0.102 0.965,-0.255 0.843,-0.43 1.344,-1.121 1.679,-2.019 0.255,-0.686 0.463,-1.369 0.655,-2.074 0.03,-0.11 1.031,-3.262 1.374,-2.735 1.012,1.557 1.44,3.84 1.949,5.601 0.467,1.616 0.819,3.259 1.312,4.869 0.223,0.728 0.394,1.828 1.124,2.255 1.383,0.811 1.77,-1.7 1.924,-2.377 0.246,-1.075 0.345,-1.811 0.732,-0.343 0.3,1.136 0.448,2.319 0.637,3.477 0.226,1.388 0.626,3.463 1.515,4.559 0.089,0.11 0.305,0.171 0.438,0.116 0.787,-0.324 0.642,-2.325 1.354,-0.873 0.313,0.641 0.516,1.625 1.247,1.912 0.54,0.213 0.772,-0.658 0.238,-0.867 -0.869,-0.342 -0.671,-3.279 -2.23,-2.851 -0.671,0.185 -0.841,1.305 -0.97,1.82 0.32,-1.277 -0.408,-2.326 -0.656,-3.659 -0.226,-1.215 -0.218,-5.231 -1.676,-5.757 -0.453,-0.164 -0.721,0.077 -0.967,0.44 -0.239,0.353 -0.314,0.894 -0.416,1.295 -0.056,0.224 -0.622,3.16 -1.157,1.405 -1.157,-3.8 -1.675,-8.486 -3.87,-11.864 -1.414,-2.176 -2.873,3.723 -2.96,4.045 -0.374,1.378 -0.894,2.683 -2.477,3.011 -0.307,0.063 -0.67,0.193 -0.897,0.421 -1.402,1.402 0.693,4.751 -1.486,5.647 -0.974,0.4 -1.453,0.299 -1.934,1.379 -0.503,1.128 -0.444,3.855 -1.834,4.303 -0.554,0.179 -0.319,1.048 0.235,0.869 z"
- inkscape:connector-curvature="0"
- id="path4" /><line
- x1="16.027"
- x2="16.016001"
- y1="21.652"
- y2="10.477"
- fill="none"
- stroke="#00A651"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line6"
- style="fill:none;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="13.807,21.666 18.248,21.652 16.045,25.029 "
- id="polygon8"
- style="fill:#009444;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="18.236,10.031 13.795,10.014 16.022,6.652 "
- id="polygon10"
- style="fill:#00a651;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m5.389 25.291c1.58-0.508 1.812-2.553 2.157-3.945 0.386-1.556 1.273-1.214 2.263-2.038 0.688-0.573 0.899-1.425 0.95-2.313 0.042-0.741-0.152-3.181 0.782-3.454 0.318-0.092 0.664-0.102 0.965-0.255 0.843-0.43 1.344-1.121 1.679-2.019 0.255-0.686 0.463-1.369 0.655-2.074 0.03-0.11 1.031-3.262 1.374-2.735 1.012 1.557 1.44 3.84 1.949 5.601 0.467 1.616 0.819 3.259 1.312 4.869 0.223 0.728 0.394 1.828 1.124 2.255 1.383 0.811 1.77-1.7 1.924-2.377 0.246-1.075 0.345-1.811 0.732-0.343 0.3 1.136 0.448 2.319 0.637 3.477 0.226 1.388 0.626 3.463 1.515 4.559 0.089 0.11 0.305 0.171 0.438 0.116 0.787-0.324 0.642-2.325 1.354-0.873 0.313 0.641 0.516 1.625 1.247 1.912 0.54 0.213 0.772-0.658 0.238-0.867-0.869-0.342-0.671-3.279-2.23-2.851-0.671 0.185-0.841 1.305-0.97 1.82 0.32-1.277-0.408-2.326-0.656-3.659-0.226-1.215-0.218-5.231-1.676-5.757-0.453-0.164-0.721 0.077-0.967 0.44-0.239 0.353-0.314 0.894-0.416 1.295-0.056 0.224-0.622 3.16-1.157 1.405-1.157-3.8-1.675-8.486-3.87-11.864-1.414-2.176-2.873 3.723-2.96 4.045-0.374 1.378-0.894 2.683-2.477 3.011-0.307 0.063-0.67 0.193-0.897 0.421-1.402 1.402 0.693 4.751-1.486 5.647-0.974 0.4-1.453 0.299-1.934 1.379-0.503 1.128-0.444 3.855-1.834 4.303-0.554 0.179-0.319 1.048 0.235 0.869z"/><line x1="16.027" x2="16.016" y1="21.652" y2="10.477" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="13.807 21.666 18.248 21.652 16.045 25.029" fill="#009444" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="18.236 10.031 13.795 10.014 16.022 6.652" fill="#00a651" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/></svg>
diff --git a/silx/resources/gui/icons/math-phase-color-log.png b/silx/resources/gui/icons/math-phase-color-log.png
new file mode 100644
index 0000000..647d634
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase-color-log.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-phase-color-log.svg b/silx/resources/gui/icons/math-phase-color-log.svg
new file mode 100644
index 0000000..803bebf
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase-color-log.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><radialGradient id="b" cx="-16.701" cy="15.943" r="7.9219" gradientTransform="matrix(1 0 0 1.1509 0 -2.4056)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop stop-color="#c0c0c0" offset="1"/></radialGradient></defs><g transform="matrix(.062683 0 0 -.062683 15.338 21.436)"><path d="m17.834 8.7344c-0.50782 1.14e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54688-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.33e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547 0-2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1.3e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-3e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-6e-6 -2.3594 0.96874-3.539 2.9062-3.5391"/><g fill="url(#b)"><path d="m-14.111 6.8256c1.1797 1.32e-5 2.3164 0.50001 3.4102 1.5 1.2812 1.1641 1.9219 2.8945 1.9219 5.1914-1.74e-5 3.8672-1.9453 6.0508-5.8359 6.5508v4.9922h-4.1719v-4.9922c-3.8906-0.5-5.8359-2.6836-5.8359-6.5508-1e-6 -2.1562 0.64062-3.8437 1.9219-5.0625 1.0547-1.0078 2.2383-1.5117 3.5508-1.5117v2.6836c-0.17969 0.015635-0.43751 0.35548-0.77344 1.0195-0.32813 0.65626-0.49219 1.4727-0.49219 2.4492-5e-6 1.8672 0.54296 3.1914 1.6289 3.9727v-4.5938c-8e-6 -3.7656 1.5586-5.6484 4.6758-5.6484m0.12891 3.1172c-0.42189 0.046885-0.63282 0.89063-0.63281 2.5313v4.5938c1.0469-0.75781 1.5898-2.082 1.6289-3.9727 0.02342-1.0469-0.06251-1.8398-0.25781-2.3789-0.19532-0.54686-0.44142-0.80468-0.73828-0.77344" fill="url(#b)"/></g><path id="a" d="m210.56 70.719-200 16 200 16z" opacity=".99"/><use width="32" height="32" fill="#ff0000" stroke="#ff0000" xlink:href="#a"/><use transform="matrix(.98769 .15643 -.15643 .98769 13.696 -.58469)" width="32" height="32" fill="#ff2600" stroke="#ff2600" xlink:href="#a"/><use transform="matrix(.95106 .30902 -.30902 .95106 27.315 .98033)" width="32" height="32" fill="#ff4d00" stroke="#ff4d00" xlink:href="#a"/><use transform="matrix(.89101 .45399 -.45399 .89101 40.521 4.6565)" width="32" height="32" fill="#ff7300" stroke="#ff7300" xlink:href="#a"/><use transform="matrix(.80902 .58779 -.58779 .80902 52.989 10.353)" width="32" height="32" fill="#ff9900" stroke="#ff9900" xlink:href="#a"/><use transform="matrix(.70711 .70711 -.70711 .70711 64.413 17.931)" width="32" height="32" fill="#ffbf00" stroke="#ffbf00" xlink:href="#a"/><use transform="matrix(.58779 .80902 -.80902 .58779 74.511 27.202)" width="32" height="32" fill="#ffe600" stroke="#ffe600" xlink:href="#a"/><use transform="matrix(.45399 .89101 -.89101 .45399 83.034 37.938)" width="32" height="32" fill="#f2ff00" stroke="#f2ff00" xlink:href="#a"/><use transform="matrix(.30902 .95106 -.95106 .30902 89.773 49.876)" width="32" height="32" fill="#ccff00" stroke="#ccff00" xlink:href="#a"/><use transform="matrix(.15643 .98769 -.98769 .15643 94.561 62.72)" width="32" height="32" fill="#a6ff00" stroke="#a6ff00" xlink:href="#a"/><use transform="matrix(0 1 -1 0 97.281 76.156)" width="32" height="32" fill="#80ff00" stroke="#80ff00" xlink:href="#a"/><use transform="matrix(-.15643 .98769 -.98769 -.15643 97.866 89.852)" width="32" height="32" fill="#59ff00" stroke="#59ff00" xlink:href="#a"/><use transform="matrix(-.30902 .95106 -.95106 -.30902 96.301 103.47)" width="32" height="32" fill="#33ff00" stroke="#33ff00" xlink:href="#a"/><use transform="matrix(-.45399 .89101 -.89101 -.45399 92.625 116.68)" width="32" height="32" fill="#0dff00" stroke="#0dff00" xlink:href="#a"/><use transform="matrix(-.58779 .80902 -.80902 -.58779 86.928 129.15)" width="32" height="32" fill="#00ff19" stroke="#00ff19" xlink:href="#a"/><use transform="matrix(-.70711 .70711 -.70711 -.70711 79.351 140.57)" width="32" height="32" fill="#00ff40" stroke="#00ff40" xlink:href="#a"/><use transform="matrix(-.80902 .58779 -.58779 -.80902 70.08 150.67)" width="32" height="32" fill="#00ff66" stroke="#00ff66" xlink:href="#a"/><use transform="matrix(-.89101 .45399 -.45399 -.89101 59.343 159.19)" width="32" height="32" fill="#00ff8c" stroke="#00ff8c" xlink:href="#a"/><use transform="matrix(-.95106 .30902 -.30902 -.95106 47.406 165.93)" width="32" height="32" fill="#00ffb2" stroke="#00ffb2" xlink:href="#a"/><use transform="matrix(-.98769 .15643 -.15643 -.98769 34.561 170.72)" width="32" height="32" fill="#00ffd9" stroke="#00ffd9" xlink:href="#a"/><use transform="matrix(-1 0 0 -1 21.125 173.44)" width="32" height="32" fill="#00ffff" stroke="#00ffff" xlink:href="#a"/><use transform="matrix(-.98769 -.15643 .15643 -.98769 7.4292 174.02)" width="32" height="32" fill="#00d9ff" stroke="#00d9ff" xlink:href="#a"/><use transform="matrix(-.95106 -.30902 .30902 -.95106 -6.1895 172.46)" width="32" height="32" fill="#00b2ff" stroke="#00b2ff" xlink:href="#a"/><use transform="matrix(-.89101 -.45399 .45399 -.89101 -19.396 168.78)" width="32" height="32" fill="#008cff" stroke="#008cff" xlink:href="#a"/><use transform="matrix(-.80902 -.58779 .58779 -.80902 -31.864 163.08)" width="32" height="32" fill="#0066ff" stroke="#0066ff" xlink:href="#a"/><use transform="matrix(-.70711 -.70711 .70711 -.70711 -43.288 155.51)" width="32" height="32" fill="#0040ff" stroke="#0040ff" xlink:href="#a"/><use transform="matrix(-.58779 -.80902 .80902 -.58779 -53.386 146.24)" width="32" height="32" fill="#001aff" stroke="#001aff" xlink:href="#a"/><use transform="matrix(-.45399 -.89101 .89101 -.45399 -61.909 135.5)" width="32" height="32" fill="#0d00ff" stroke="#0d00ff" xlink:href="#a"/><use transform="matrix(-.30902 -.95106 .95106 -.30902 -68.648 123.56)" width="32" height="32" fill="#3300ff" stroke="#3300ff" xlink:href="#a"/><use transform="matrix(-.15643 -.98769 .98769 -.15643 -73.436 110.72)" width="32" height="32" fill="#5900ff" stroke="#5900ff" xlink:href="#a"/><use transform="matrix(0 -1 1 0 -76.156 97.281)" width="32" height="32" fill="#8000ff" stroke="#8000ff" xlink:href="#a"/><use transform="matrix(.15643 -.98769 .98769 .15643 -76.741 83.585)" width="32" height="32" fill="#a600ff" stroke="#a600ff" xlink:href="#a"/><use transform="matrix(.30902 -.95106 .95106 .30902 -75.176 69.967)" width="32" height="32" fill="#cc00ff" stroke="#cc00ff" xlink:href="#a"/><use transform="matrix(.45399 -.89101 .89101 .45399 -71.5 56.761)" width="32" height="32" fill="#f200ff" stroke="#f200ff" xlink:href="#a"/><use transform="matrix(.58779 -.80902 .80902 .58779 -65.803 44.292)" width="32" height="32" fill="#ff00e5" stroke="#ff00e5" xlink:href="#a"/><use transform="matrix(.70711 -.70711 .70711 .70711 -58.226 32.868)" width="32" height="32" fill="#ff00bf" stroke="#ff00bf" xlink:href="#a"/><use transform="matrix(.80902 -.58779 .58779 .80902 -48.955 22.77)" width="32" height="32" fill="#ff0099" stroke="#ff0099" xlink:href="#a"/><use transform="matrix(.89101 -.45399 .45399 .89101 -38.218 14.247)" width="32" height="32" fill="#ff0073" stroke="#ff0073" xlink:href="#a"/><use transform="matrix(.95106 -.30902 .30902 .95106 -26.281 7.5083)" width="32" height="32" fill="#ff004d" stroke="#ff004d" xlink:href="#a"/><use transform="matrix(.98769 -.15643 .15643 .98769 -13.436 2.72)" width="32" height="32" fill="#ff0026" stroke="#ff0026" xlink:href="#a"/></g><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" line-height="125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+<g transform="translate(14.134 -.53585)" font-family="Sans" font-size="24px" line-height="125%"><path d="m9.1004 3.6179-3.2109 8.707h6.4336l-3.2227-8.707m-1.3359-2.332h2.6836l6.668 17.496h-2.4609l-1.5938-4.4883h-7.8867l-1.5938 4.4883h-2.4961l6.6797-17.496"/></g><g transform="translate(.051792 .26405)" font-family="Sans" font-size="40px"><g transform="translate(-17.638 -.085622)" fill="#FFF" stroke="#FFF" stroke-width="1.5" line-height="125%"><path d="m26.739 14.7c-0.50782 1.1e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54689-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.3e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547-1e-6 -2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-4e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-7e-6 -2.3594 0.96874-3.539 2.9062-3.5391" fill="#FFF" stroke="#FFF" stroke-width="1.5"/></g><g transform="translate(-17.638 -.085622)" line-height="125%"><path d="m26.739 14.7c-0.50782 1.1e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54689-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.3e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547-1e-6 -2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-4e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-7e-6 -2.3594 0.96874-3.539 2.9062-3.5391"/></g></g><g transform="translate(.30412 .38576)" font-family="Sans" font-size="20px" line-height="125%"><path d="m0.44588 0.36424h1.0781v9.1172h-1.0781v-9.1172"/><path d="m6.317 3.6748c-0.5782 0-1.0352 0.2266-1.3711 0.6797-0.336 0.4492-0.5039 1.0664-0.5039 1.8515 0 0.7852 0.166 1.4043 0.498 1.8575 0.336 0.4492 0.7949 0.6738 1.377 0.6738 0.5742 0 1.0293-0.2266 1.3652-0.6797s0.5039-1.0703 0.5039-1.8516c0-0.7773-0.168-1.3925-0.5039-1.8457-0.3359-0.457-0.791-0.6855-1.3652-0.6855m0-0.91406c0.9375 0 1.6738 0.3047 2.209 0.9141s0.8027 1.4531 0.8027 2.5312c0 1.0742-0.2675 1.918-0.8027 2.5312-0.5352 0.6095-1.2715 0.9141-2.209 0.9141-0.9414 0-1.6797-0.3046-2.2149-0.914-0.5312-0.6133-0.7968-1.457-0.7968-2.5313 0-1.0781 0.2656-1.9218 0.7968-2.5312 0.5352-0.6094 1.2735-0.9141 2.2149-0.9141"/><path d="m15.428 6.124c0-0.7812-0.162-1.3867-0.486-1.8164-0.32-0.4297-0.772-0.6445-1.354-0.6445-0.57813 5.8e-6 -1.0293 0.21485-1.3535 0.64453-0.32032 0.42969-0.48047 1.0352-0.48047 1.8164-2e-6 0.77735 0.16015 1.3809 0.48047 1.8105 0.32422 0.42969 0.77539 0.64453 1.3535 0.64453 0.58203 9e-7 1.0332-0.21484 1.3535-0.64453 0.324-0.4296 0.486-1.0332 0.486-1.8105m1.0781 2.543c-6e-6 1.1172-0.24805 1.9473-0.74414 2.4902-0.4961 0.54687-1.2559 0.82031-2.2793 0.82031-0.37891-2e-6 -0.73633-0.0293-1.0723-0.08789-0.33594-0.05469-0.66211-0.14063-0.97852-0.25781v-1.0488c0.3164 0.17187 0.6289 0.29883 0.9375 0.38086 0.30859 0.08203 0.62304 0.12305 0.94336 0.12305 0.70703-1e-6 1.2363-0.18555 1.5879-0.55664 0.35156-0.36719 0.52734-0.92383 0.52734-1.6699v-0.5332c-0.22266 0.38672-0.50782 0.67578-0.85547 0.86719-0.34766 0.19141-0.76368 0.28711-1.248 0.28711-0.80469 0-1.4531-0.30664-1.9453-0.91992-0.49219-0.61328-0.73828-1.4258-0.73828-2.4375-1e-6 -1.0156 0.24609-1.8301 0.73828-2.4434 0.49219-0.61327 1.1406-0.91992 1.9453-0.91992 0.48437 6.7e-6 0.90039 0.09571 1.248 0.28711 0.34765 0.19141 0.63281 0.48047 0.85547 0.86719v-0.99482h1.0781v5.748"/></g></svg>
diff --git a/silx/resources/gui/icons/math-phase-color.png b/silx/resources/gui/icons/math-phase-color.png
new file mode 100644
index 0000000..d24d335
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase-color.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-phase-color.svg b/silx/resources/gui/icons/math-phase-color.svg
new file mode 100644
index 0000000..65bd287
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase-color.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><radialGradient id="b" cx="-16.701" cy="15.943" r="7.9219" gradientTransform="matrix(1 0 0 1.1509 0 -2.4056)" gradientUnits="userSpaceOnUse"><stop offset="0"/><stop stop-color="#c0c0c0" offset="1"/></radialGradient></defs><g transform="matrix(.062683 0 0 -.062683 15.338 21.436)"><path d="m17.834 8.7344c-0.50782 1.14e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54688-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.33e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547 0-2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1.3e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-3e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-6e-6 -2.3594 0.96874-3.539 2.9062-3.5391"/><g fill="url(#b)"><path d="m-14.111 6.8256c1.1797 1.32e-5 2.3164 0.50001 3.4102 1.5 1.2812 1.1641 1.9219 2.8945 1.9219 5.1914-1.74e-5 3.8672-1.9453 6.0508-5.8359 6.5508v4.9922h-4.1719v-4.9922c-3.8906-0.5-5.8359-2.6836-5.8359-6.5508-1e-6 -2.1562 0.64062-3.8437 1.9219-5.0625 1.0547-1.0078 2.2383-1.5117 3.5508-1.5117v2.6836c-0.17969 0.015635-0.43751 0.35548-0.77344 1.0195-0.32813 0.65626-0.49219 1.4727-0.49219 2.4492-5e-6 1.8672 0.54296 3.1914 1.6289 3.9727v-4.5938c-8e-6 -3.7656 1.5586-5.6484 4.6758-5.6484m0.12891 3.1172c-0.42189 0.046885-0.63282 0.89063-0.63281 2.5313v4.5938c1.0469-0.75781 1.5898-2.082 1.6289-3.9727 0.02342-1.0469-0.06251-1.8398-0.25781-2.3789-0.19532-0.54686-0.44142-0.80468-0.73828-0.77344" fill="url(#b)"/></g><path id="a" d="m210.56 70.719-200 16 200 16z" opacity=".99"/><use width="32" height="32" fill="#ff0000" stroke="#ff0000" xlink:href="#a"/><use transform="matrix(.98769 .15643 -.15643 .98769 13.696 -.58469)" width="32" height="32" fill="#ff2600" stroke="#ff2600" xlink:href="#a"/><use transform="matrix(.95106 .30902 -.30902 .95106 27.315 .98033)" width="32" height="32" fill="#ff4d00" stroke="#ff4d00" xlink:href="#a"/><use transform="matrix(.89101 .45399 -.45399 .89101 40.521 4.6565)" width="32" height="32" fill="#ff7300" stroke="#ff7300" xlink:href="#a"/><use transform="matrix(.80902 .58779 -.58779 .80902 52.989 10.353)" width="32" height="32" fill="#ff9900" stroke="#ff9900" xlink:href="#a"/><use transform="matrix(.70711 .70711 -.70711 .70711 64.413 17.931)" width="32" height="32" fill="#ffbf00" stroke="#ffbf00" xlink:href="#a"/><use transform="matrix(.58779 .80902 -.80902 .58779 74.511 27.202)" width="32" height="32" fill="#ffe600" stroke="#ffe600" xlink:href="#a"/><use transform="matrix(.45399 .89101 -.89101 .45399 83.034 37.938)" width="32" height="32" fill="#f2ff00" stroke="#f2ff00" xlink:href="#a"/><use transform="matrix(.30902 .95106 -.95106 .30902 89.773 49.876)" width="32" height="32" fill="#ccff00" stroke="#ccff00" xlink:href="#a"/><use transform="matrix(.15643 .98769 -.98769 .15643 94.561 62.72)" width="32" height="32" fill="#a6ff00" stroke="#a6ff00" xlink:href="#a"/><use transform="matrix(0 1 -1 0 97.281 76.156)" width="32" height="32" fill="#80ff00" stroke="#80ff00" xlink:href="#a"/><use transform="matrix(-.15643 .98769 -.98769 -.15643 97.866 89.852)" width="32" height="32" fill="#59ff00" stroke="#59ff00" xlink:href="#a"/><use transform="matrix(-.30902 .95106 -.95106 -.30902 96.301 103.47)" width="32" height="32" fill="#33ff00" stroke="#33ff00" xlink:href="#a"/><use transform="matrix(-.45399 .89101 -.89101 -.45399 92.625 116.68)" width="32" height="32" fill="#0dff00" stroke="#0dff00" xlink:href="#a"/><use transform="matrix(-.58779 .80902 -.80902 -.58779 86.928 129.15)" width="32" height="32" fill="#00ff19" stroke="#00ff19" xlink:href="#a"/><use transform="matrix(-.70711 .70711 -.70711 -.70711 79.351 140.57)" width="32" height="32" fill="#00ff40" stroke="#00ff40" xlink:href="#a"/><use transform="matrix(-.80902 .58779 -.58779 -.80902 70.08 150.67)" width="32" height="32" fill="#00ff66" stroke="#00ff66" xlink:href="#a"/><use transform="matrix(-.89101 .45399 -.45399 -.89101 59.343 159.19)" width="32" height="32" fill="#00ff8c" stroke="#00ff8c" xlink:href="#a"/><use transform="matrix(-.95106 .30902 -.30902 -.95106 47.406 165.93)" width="32" height="32" fill="#00ffb2" stroke="#00ffb2" xlink:href="#a"/><use transform="matrix(-.98769 .15643 -.15643 -.98769 34.561 170.72)" width="32" height="32" fill="#00ffd9" stroke="#00ffd9" xlink:href="#a"/><use transform="matrix(-1 0 0 -1 21.125 173.44)" width="32" height="32" fill="#00ffff" stroke="#00ffff" xlink:href="#a"/><use transform="matrix(-.98769 -.15643 .15643 -.98769 7.4292 174.02)" width="32" height="32" fill="#00d9ff" stroke="#00d9ff" xlink:href="#a"/><use transform="matrix(-.95106 -.30902 .30902 -.95106 -6.1895 172.46)" width="32" height="32" fill="#00b2ff" stroke="#00b2ff" xlink:href="#a"/><use transform="matrix(-.89101 -.45399 .45399 -.89101 -19.396 168.78)" width="32" height="32" fill="#008cff" stroke="#008cff" xlink:href="#a"/><use transform="matrix(-.80902 -.58779 .58779 -.80902 -31.864 163.08)" width="32" height="32" fill="#0066ff" stroke="#0066ff" xlink:href="#a"/><use transform="matrix(-.70711 -.70711 .70711 -.70711 -43.288 155.51)" width="32" height="32" fill="#0040ff" stroke="#0040ff" xlink:href="#a"/><use transform="matrix(-.58779 -.80902 .80902 -.58779 -53.386 146.24)" width="32" height="32" fill="#001aff" stroke="#001aff" xlink:href="#a"/><use transform="matrix(-.45399 -.89101 .89101 -.45399 -61.909 135.5)" width="32" height="32" fill="#0d00ff" stroke="#0d00ff" xlink:href="#a"/><use transform="matrix(-.30902 -.95106 .95106 -.30902 -68.648 123.56)" width="32" height="32" fill="#3300ff" stroke="#3300ff" xlink:href="#a"/><use transform="matrix(-.15643 -.98769 .98769 -.15643 -73.436 110.72)" width="32" height="32" fill="#5900ff" stroke="#5900ff" xlink:href="#a"/><use transform="matrix(0 -1 1 0 -76.156 97.281)" width="32" height="32" fill="#8000ff" stroke="#8000ff" xlink:href="#a"/><use transform="matrix(.15643 -.98769 .98769 .15643 -76.741 83.585)" width="32" height="32" fill="#a600ff" stroke="#a600ff" xlink:href="#a"/><use transform="matrix(.30902 -.95106 .95106 .30902 -75.176 69.967)" width="32" height="32" fill="#cc00ff" stroke="#cc00ff" xlink:href="#a"/><use transform="matrix(.45399 -.89101 .89101 .45399 -71.5 56.761)" width="32" height="32" fill="#f200ff" stroke="#f200ff" xlink:href="#a"/><use transform="matrix(.58779 -.80902 .80902 .58779 -65.803 44.292)" width="32" height="32" fill="#ff00e5" stroke="#ff00e5" xlink:href="#a"/><use transform="matrix(.70711 -.70711 .70711 .70711 -58.226 32.868)" width="32" height="32" fill="#ff00bf" stroke="#ff00bf" xlink:href="#a"/><use transform="matrix(.80902 -.58779 .58779 .80902 -48.955 22.77)" width="32" height="32" fill="#ff0099" stroke="#ff0099" xlink:href="#a"/><use transform="matrix(.89101 -.45399 .45399 .89101 -38.218 14.247)" width="32" height="32" fill="#ff0073" stroke="#ff0073" xlink:href="#a"/><use transform="matrix(.95106 -.30902 .30902 .95106 -26.281 7.5083)" width="32" height="32" fill="#ff004d" stroke="#ff004d" xlink:href="#a"/><use transform="matrix(.98769 -.15643 .15643 .98769 -13.436 2.72)" width="32" height="32" fill="#ff0026" stroke="#ff0026" xlink:href="#a"/></g><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" line-height="125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+<g transform="translate(14.134 -.53585)" font-family="Sans" font-size="24px" line-height="125%"><path d="m9.1004 3.6179-3.2109 8.707h6.4336l-3.2227-8.707m-1.3359-2.332h2.6836l6.668 17.496h-2.4609l-1.5938-4.4883h-7.8867l-1.5938 4.4883h-2.4961l6.6797-17.496"/></g><g transform="translate(.051792 .26405)" font-family="Sans" font-size="40px"><g transform="translate(-17.638 -.085622)" fill="#FFF" stroke="#FFF" stroke-width="1.5" line-height="125%"><path d="m26.739 14.7c-0.50782 1.1e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54689-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.3e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547-1e-6 -2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-4e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-7e-6 -2.3594 0.96874-3.539 2.9062-3.5391" fill="#FFF" stroke="#FFF" stroke-width="1.5"/></g><g transform="translate(-17.638 -.085622)" line-height="125%"><path d="m26.739 14.7c-0.50782 1.1e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54689-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.3e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547-1e-6 -2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-4e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-7e-6 -2.3594 0.96874-3.539 2.9062-3.5391"/></g></g></svg>
diff --git a/silx/resources/gui/icons/math-phase.png b/silx/resources/gui/icons/math-phase.png
new file mode 100644
index 0000000..ee5800f
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-phase.svg b/silx/resources/gui/icons/math-phase.svg
new file mode 100644
index 0000000..3bd1671
--- /dev/null
+++ b/silx/resources/gui/icons/math-phase.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><g><path d="m17.834 8.7344c-0.50782 1.14e-5 -0.76173 0.56642-0.76172 1.6992v8.0391c0.74218 2e-6 1.4844-0.40625 2.2266-1.2188 0.66405-0.72656 0.99608-1.9609 0.99609-3.7031-1.2e-5 -1.625-0.33595-2.875-1.0078-3.75-0.54688-0.71093-1.0313-1.0664-1.4531-1.0664m0-1.8398c1.0937 1.33e-5 2.1367 0.51564 3.1289 1.5469 1.0703 1.1016 1.6055 2.8047 1.6055 5.1094-1.4e-5 2.1172-0.53517 3.8047-1.6055 5.0625-1.0078 1.1875-2.3047 1.7812-3.8906 1.7812v4.7109h-2.1445v-4.6992c-1.5547 0-2.8555-0.59766-3.9023-1.793-1.0625-1.2187-1.5938-2.9023-1.5938-5.0508-1.3e-6 -2.2344 0.53125-3.9219 1.5938-5.0625 0.79687-0.85155 1.8437-1.3867 3.1406-1.6055v1.9102c-0.51563 0.1797-1 0.57423-1.4531 1.1836-0.67188 0.89845-1.0078 2.0899-1.0078 3.5742-3e-6 1.5781 0.33593 2.8164 1.0078 3.7148 0.60156 0.80469 1.3398 1.207 2.2148 1.207v-8.0508c-6e-6 -2.3594 0.96874-3.539 2.9062-3.5391"/></g><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+</svg>
diff --git a/silx/resources/gui/icons/math-real.png b/silx/resources/gui/icons/math-real.png
new file mode 100644
index 0000000..fbe4868
--- /dev/null
+++ b/silx/resources/gui/icons/math-real.png
Binary files differ
diff --git a/silx/resources/gui/icons/math-real.svg b/silx/resources/gui/icons/math-real.svg
new file mode 100644
index 0000000..2f0d6d8
--- /dev/null
+++ b/silx/resources/gui/icons/math-real.svg
@@ -0,0 +1,3 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><text x="0.49070829" y="48.29847" fill="#f7941e" font-family="Accanthis ADF Std" font-size="40px" letter-spacing="0px" word-spacing="0px" line-height="125%" xml:space="preserve"><tspan x="0.49070829" y="48.29847" fill="#f7941e" font-family="Sans" font-size="24px"/></text>
+<g font-family="Sans" font-size="40px" line-height="125%"><path d="m4.7007 21.436c1.272 0.024 1.272 0.024 1.416 0.024 1.248 0 3.408-0.048 4.128-0.096l1.776-0.912c-0.888-0.024-1.104-0.024-3.168-0.072 2.712-2.712 2.856-2.928 3.624-5.976 0.024-0.024 0.048-0.024 0.048-0.024 0.264-0.024 0.408 0.192 0.552 0.792 0.912 4.008 1.704 6.288 2.688 7.752 1.032 1.536 2.448 2.28 4.344 2.28 1.344 0 2.16-0.288 3.504-1.272l-1.176-1.464c-0.768 1.416-1.44 1.968-2.376 1.968-1.128 0-2.208-1.2-3.192-3.576-0.624-1.488-1.368-3.72-2.352-6.84 1.368-0.432 1.92-0.696 2.664-1.176 1.128-0.768 1.776-1.872 1.776-3.024 0-1.488-1.2-2.304-3.384-2.304-0.288 0-0.888 0.024-1.392 0.048l0.192-0.768-2.184 1.032c-3.9363 0.672-6.0243 2.496-6.0243 5.304 0 0.624 0.072 1.032 0.336 1.92l2.016-1.032c-0.192-0.816-0.264-1.224-0.264-1.776 0-1.152 0.36-2.064 1.104-2.76 0.672-0.6 1.344-0.864 2.88-1.056l-0.216 0.864c-0.096 0.384-0.24 0.936-0.408 1.68l-1.2 4.752c-1.008 4.056-1.656 4.68-4.776 4.656l-0.936 1.056m9.312-13.2h0.744c1.488 0 2.112 0.552 2.112 1.872 0 1.2-0.648 2.352-1.656 2.976-0.72 0.432-1.296 0.6-2.592 0.768l1.392-5.616"/><path d="m27.299 18.172c-1.8 1.56-2.952 2.232-3.864 2.232-0.6 0-1.104-0.408-1.272-1.032-0.096-0.384-0.12-0.648-0.12-1.344 1.08-0.672 1.8-1.176 3.216-2.232 1.296-0.984 1.8-1.776 1.8-2.856 0-0.84-0.528-1.344-1.368-1.344-0.528 0-0.912 0.12-1.464 0.432-0.912 0.528-1.728 1.176-2.232 1.752-0.912 1.104-1.728 3.744-1.728 5.688 0 1.416 0.744 2.304 1.968 2.304 1.416 0 3.168-1.008 5.064-2.904v-0.696m-5.184-1.008c0.408-2.568 1.512-4.56 2.544-4.56 0.408 0 0.672 0.408 0.672 0.984 0 1.2-0.648 1.92-3.216 3.576"/></g></svg>
diff --git a/silx/resources/gui/icons/math-sigma.svg b/silx/resources/gui/icons/math-sigma.svg
index 9b7e022..bbe8347 100644
--- a/silx/resources/gui/icons/math-sigma.svg
+++ b/silx/resources/gui/icons/math-sigma.svg
@@ -1,91 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata39"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs37" /><linearGradient
- x1="7"
- y1="16.334"
- x2="26.5"
- y2="16.334"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#fdfdfd;stop-opacity:0.9623"
- offset="0.37689999" /><stop
- id="stop9"
- style="stop-color:#f6f6f6;stop-opacity:0.94870001"
- offset="0.51270002" /><stop
- id="stop11"
- style="stop-color:#ebebeb;stop-opacity:0.93910003"
- offset="0.60939997" /><stop
- id="stop13"
- style="stop-color:#dadada;stop-opacity:0.93120003"
- offset="0.68769997" /><stop
- id="stop15"
- style="stop-color:#c4c4c4;stop-opacity:0.92449999"
- offset="0.75480002" /><stop
- id="stop17"
- style="stop-color:#a8a8a8;stop-opacity:0.91860002"
- offset="0.81419998" /><stop
- id="stop19"
- style="stop-color:#888888;stop-opacity:0.91320002"
- offset="0.86790001" /><stop
- id="stop21"
- style="stop-color:#626262;stop-opacity:0.90829998"
- offset="0.91720003" /><stop
- id="stop23"
- style="stop-color:#393939;stop-opacity:0.90390003"
- offset="0.9612" /><stop
- id="stop25"
- style="stop-color:#0e0e0e;stop-opacity:0.89999998"
- offset="1" /></linearGradient><rect
- width="18.5"
- height="18.499001"
- x="7.5"
- y="7.0840001"
- id="rect27"
- style="fill:none;stroke:url(#a);stroke-miterlimit:10" /><line
- x1="19.367001"
- x2="6.0799999"
- y1="7.0840001"
- y2="7.0840001"
- fill="none"
- stroke="#F7941E"
- stroke-miterlimit="10"
- stroke-width="2.8"
- id="line29"
- style="fill:none;stroke:#f7941e;stroke-width:2.79999995;stroke-miterlimit:10" /><polyline
- points="7.3 7.418 14.349 14.71 7.3 25.159"
- fill="none"
- stroke="#F7941E"
- stroke-miterlimit="10"
- stroke-width="2.8"
- id="polyline31"
- style="fill:none;stroke:#f7941e;stroke-width:2.79999995;stroke-miterlimit:10" /><line
- x1="6.1859999"
- x2="19.473"
- y1="25.583"
- y2="25.583"
- fill="none"
- stroke="#F7941E"
- stroke-miterlimit="10"
- stroke-width="2.8"
- id="line33"
- style="fill:none;stroke:#f7941e;stroke-width:2.79999995;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="a" x1="7" x2="26.5" y1="16.334" y2="16.334" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop stop-color="#fdfdfd" stop-opacity=".9623" offset=".3769"/><stop stop-color="#f6f6f6" stop-opacity=".9487" offset=".5127"/><stop stop-color="#ebebeb" stop-opacity=".9391" offset=".6094"/><stop stop-color="#dadada" stop-opacity=".9312" offset=".6877"/><stop stop-color="#c4c4c4" stop-opacity=".9245" offset=".7548"/><stop stop-color="#a8a8a8" stop-opacity=".9186" offset=".8142"/><stop stop-color="#888" stop-opacity=".9132" offset=".8679"/><stop stop-color="#626262" stop-opacity=".9083" offset=".9172"/><stop stop-color="#393939" stop-opacity=".9039" offset=".9612"/><stop stop-color="#0e0e0e" stop-opacity=".9" offset="1"/></linearGradient><rect x="7.5" y="7.084" width="18.5" height="18.499" fill="none" stroke="url(#a)" stroke-miterlimit="10"/><line x1="19.367" x2="6.08" y1="7.084" y2="7.084" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.8"/><polyline points="7.3 7.418 14.349 14.71 7.3 25.159" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.8"/><line x1="6.186" x2="19.473" y1="25.583" y2="25.583" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.8"/></svg>
diff --git a/silx/resources/gui/icons/math-smooth.svg b/silx/resources/gui/icons/math-smooth.svg
index 388bb63..21a90f2 100644
--- a/silx/resources/gui/icons/math-smooth.svg
+++ b/silx/resources/gui/icons/math-smooth.svg
@@ -1,27 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata12"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs10" /><path
- d="m 4.418,32.184 c 0.2,-1.021 0.117,-1.992 0.491,-2.975 0.402,-1.06 0.737,-2.134 1.026,-3.229 -0.278,0.073 -0.557,0.147 -0.835,0.22 0.596,0.553 1.127,1.153 1.709,1.721 0.282,0.274 0.714,0.132 0.835,-0.221 0.512,-1.481 0.99,-2.95 1.544,-4.419 -0.304,0.04 -0.609,0.08 -0.914,0.119 0.563,0.816 0.943,1.702 1.556,2.484 0.304,0.388 0.811,0.018 0.854,-0.354 0.467,-4.027 2.292,-7.606 2.975,-11.567 h -0.964 c 0.947,2.809 2.17,5.516 3.31,8.252 0.162,0.391 0.884,0.555 0.964,0 0.525,-3.624 1.333,-7.173 1.74,-10.826 0.334,-2.994 0.411,-6.013 0.8,-9.002 -0.311,0.084 -0.621,0.168 -0.932,0.252 0.628,1.238 0.684,2.911 0.908,4.259 0.312,1.862 0.695,3.725 1.131,5.56 0.126,0.528 0.795,0.422 0.965,0 1.127,-2.805 1.088,-5.958 1.494,-8.904 h -0.964 c 1.152,6.973 0.797,14.117 1.969,21.087 0.083,0.489 0.866,0.469 0.965,0 0.64,-3.043 1.899,-6.224 1.979,-9.339 -0.327,0.044 -0.654,0.088 -0.982,0.133 0.449,3.083 0.943,6.189 1.532,9.249 0.304,1.582 0.607,3.018 0.567,4.64 -0.024,0.99 0.01,1.907 0.276,2.858 0.174,0.62 1.139,0.356 0.965,-0.266 -0.379,-1.349 -0.22,-2.722 -0.225,-4.102 -0.004,-1.153 -0.379,-2.28 -0.62,-3.396 -0.655,-3.034 -1.084,-6.178 -1.531,-9.249 -0.084,-0.577 -0.969,-0.409 -0.982,0.133 -0.077,3.006 -1.326,6.135 -1.944,9.074 h 0.965 c -1.173,-6.969 -0.816,-14.114 -1.97,-21.087 -0.078,-0.474 -0.897,-0.485 -0.964,0 -0.405,2.938 -0.374,6.116 -1.495,8.904 h 0.965 C 21.098,10.16 20.695,8.099 20.351,6.038 20.138,4.76 20.036,3.307 19.441,2.135 19.19,1.64 18.567,1.947 18.509,2.387 c -0.361,2.781 -0.481,5.589 -0.737,8.38 -0.346,3.774 -1.225,7.443 -1.766,11.182 h 0.964 c -1.131,-2.719 -2.371,-5.469 -3.31,-8.252 -0.144,-0.428 -0.874,-0.524 -0.964,0 -0.698,4.047 -2.533,7.719 -3.011,11.833 0.285,-0.118 0.569,-0.235 0.854,-0.354 C 9.986,24.47 9.647,23.63 9.139,22.895 8.883,22.523 8.381,22.6 8.225,23.014 7.669,24.486 7.194,25.948 6.681,27.433 6.959,27.36 7.238,27.286 7.516,27.212 6.934,26.645 6.403,26.044 5.807,25.491 5.536,25.24 5.071,25.337 4.972,25.712 c -0.29,1.098 -0.639,2.162 -1.027,3.229 -0.403,1.107 -0.268,1.837 -0.49,2.976 -0.124,0.631 0.839,0.899 0.963,0.267 z"
- inkscape:connector-curvature="0"
- id="path4" /><path
- d="m 4.684,31.103 c 2.359,-0.676 3.119,-2.497 3.404,-4.851 0.184,-1.516 -0.359,-5.724 1.418,-6.241 1.085,-0.316 2.144,-0.343 3.2,-0.805 2.411,-1.056 3.432,-4.736 4.18,-6.97 0.803,-2.399 1.699,-4.674 2.307,-7.13 C 19.31,4.633 19.447,4.167 19.591,3.701 19.683,3.396 19.806,3.104 19.96,2.825 19.446,2.46 19.317,2.491 19.574,2.918 c 0.383,1.057 0.544,2.221 0.758,3.32 0.531,2.725 1.413,5.188 2.235,7.844 1.28,4.137 2.059,8.395 3.272,12.548 0.6,2.052 0.949,5.032 3.668,4.78 1.146,-0.106 1.156,-1.907 0,-1.801 C 27.376,29.807 25.951,19.581 25.518,17.927 24.663,14.668 23.287,11.498 22.552,8.226 22.369,7.411 21.064,-1.957 18.573,1.67 c -1.098,1.599 -1.262,3.777 -1.785,5.604 -0.834,2.914 -1.991,6.316 -3.551,8.903 -1.502,2.491 -4.539,1.265 -6.162,3.438 -1.916,2.564 1.174,8.592 -2.873,9.75 -1.111,0.321 -0.637,2.057 0.482,1.738 z"
- inkscape:connector-curvature="0"
- id="path6"
- style="fill:#ed1c24" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m4.418 32.184c0.2-1.021 0.117-1.992 0.491-2.975 0.402-1.06 0.737-2.134 1.026-3.229-0.278 0.073-0.557 0.147-0.835 0.22 0.596 0.553 1.127 1.153 1.709 1.721 0.282 0.274 0.714 0.132 0.835-0.221 0.512-1.481 0.99-2.95 1.544-4.419-0.304 0.04-0.609 0.08-0.914 0.119 0.563 0.816 0.943 1.702 1.556 2.484 0.304 0.388 0.811 0.018 0.854-0.354 0.467-4.027 2.292-7.606 2.975-11.567h-0.964c0.947 2.809 2.17 5.516 3.31 8.252 0.162 0.391 0.884 0.555 0.964 0 0.525-3.624 1.333-7.173 1.74-10.826 0.334-2.994 0.411-6.013 0.8-9.002-0.311 0.084-0.621 0.168-0.932 0.252 0.628 1.238 0.684 2.911 0.908 4.259 0.312 1.862 0.695 3.725 1.131 5.56 0.126 0.528 0.795 0.422 0.965 0 1.127-2.805 1.088-5.958 1.494-8.904h-0.964c1.152 6.973 0.797 14.117 1.969 21.087 0.083 0.489 0.866 0.469 0.965 0 0.64-3.043 1.899-6.224 1.979-9.339-0.327 0.044-0.654 0.088-0.982 0.133 0.449 3.083 0.943 6.189 1.532 9.249 0.304 1.582 0.607 3.018 0.567 4.64-0.024 0.99 0.01 1.907 0.276 2.858 0.174 0.62 1.139 0.356 0.965-0.266-0.379-1.349-0.22-2.722-0.225-4.102-4e-3 -1.153-0.379-2.28-0.62-3.396-0.655-3.034-1.084-6.178-1.531-9.249-0.084-0.577-0.969-0.409-0.982 0.133-0.077 3.006-1.326 6.135-1.944 9.074h0.965c-1.173-6.969-0.816-14.114-1.97-21.087-0.078-0.474-0.897-0.485-0.964 0-0.405 2.938-0.374 6.116-1.495 8.904h0.965c-0.483-2.033-0.886-4.094-1.23-6.155-0.213-1.278-0.315-2.731-0.91-3.903-0.251-0.495-0.874-0.188-0.932 0.252-0.361 2.781-0.481 5.589-0.737 8.38-0.346 3.774-1.225 7.443-1.766 11.182h0.964c-1.131-2.719-2.371-5.469-3.31-8.252-0.144-0.428-0.874-0.524-0.964 0-0.698 4.047-2.533 7.719-3.011 11.833 0.285-0.118 0.569-0.235 0.854-0.354-0.553-0.706-0.892-1.546-1.4-2.281-0.256-0.372-0.758-0.295-0.914 0.119-0.556 1.472-1.031 2.934-1.544 4.419 0.278-0.073 0.557-0.147 0.835-0.221-0.582-0.567-1.113-1.168-1.709-1.721-0.271-0.251-0.736-0.154-0.835 0.221-0.29 1.098-0.639 2.162-1.027 3.229-0.403 1.107-0.268 1.837-0.49 2.976-0.124 0.631 0.839 0.899 0.963 0.267z"/><path d="m4.684 31.103c2.359-0.676 3.119-2.497 3.404-4.851 0.184-1.516-0.359-5.724 1.418-6.241 1.085-0.316 2.144-0.343 3.2-0.805 2.411-1.056 3.432-4.736 4.18-6.97 0.803-2.399 1.699-4.674 2.307-7.13 0.117-0.473 0.254-0.939 0.398-1.405 0.092-0.305 0.215-0.597 0.369-0.876-0.514-0.365-0.643-0.334-0.386 0.093 0.383 1.057 0.544 2.221 0.758 3.32 0.531 2.725 1.413 5.188 2.235 7.844 1.28 4.137 2.059 8.395 3.272 12.548 0.6 2.052 0.949 5.032 3.668 4.78 1.146-0.106 1.156-1.907 0-1.801-2.131 0.198-3.556-10.028-3.989-11.682-0.855-3.259-2.231-6.429-2.966-9.701-0.183-0.815-1.488-10.183-3.979-6.556-1.098 1.599-1.262 3.777-1.785 5.604-0.834 2.914-1.991 6.316-3.551 8.903-1.502 2.491-4.539 1.265-6.162 3.438-1.916 2.564 1.174 8.592-2.873 9.75-1.111 0.321-0.637 2.057 0.482 1.738z" fill="#ed1c24"/></svg>
diff --git a/silx/resources/gui/icons/math-substract.svg b/silx/resources/gui/icons/math-substract.svg
index 498d36d..620b439 100644
--- a/silx/resources/gui/icons/math-substract.svg
+++ b/silx/resources/gui/icons/math-substract.svg
@@ -1,54 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata25"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs23" /><linearGradient
- x1="4.5137"
- y1="16.049999"
- x2="28.514"
- y2="16.049999"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#f4f4f4;stop-opacity:0.991"
- offset="0.0905" /><stop
- id="stop9"
- style="stop-color:#d6d6d6;stop-opacity:0.97490001"
- offset="0.25080001" /><stop
- id="stop11"
- style="stop-color:#a5a5a5;stop-opacity:0.95380002"
- offset="0.4623" /><stop
- id="stop13"
- style="stop-color:#616161;stop-opacity:0.92830002"
- offset="0.71689999" /><stop
- id="stop15"
- style="stop-color:#0e0e0e;stop-opacity:0.89999998"
- offset="1" /></linearGradient><rect
- width="23"
- height="23"
- x="5.0139999"
- y="4.5500002"
- id="rect17"
- style="fill:none;stroke:url(#a);stroke-miterlimit:10" /><path
- d="m 6.165,7.499 h 10.208 c 0,0 3.043,-0.055 3.093,3.311 0.056,3.367 -2.821,3.583 -2.821,3.583 H 6.165 m 0,10.211 h 10.48 c 0,0 3.964,-0.49 4.02,-5.432 0.051,-4.94 -4.02,-4.779 -4.02,-4.779 M 6.708,6.373 v 19.355"
- inkscape:connector-curvature="0"
- id="path19"
- style="fill:none;stroke:#f7941e;stroke-width:2.79999995;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="a" x1="4.5137" x2="28.514" y1="16.05" y2="16.05" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop stop-color="#f4f4f4" stop-opacity=".991" offset=".0905"/><stop stop-color="#d6d6d6" stop-opacity=".9749" offset=".2508"/><stop stop-color="#a5a5a5" stop-opacity=".9538" offset=".4623"/><stop stop-color="#616161" stop-opacity=".9283" offset=".7169"/><stop stop-color="#0e0e0e" stop-opacity=".9" offset="1"/></linearGradient><rect x="5.014" y="4.55" width="23" height="23" fill="none" stroke="url(#a)" stroke-miterlimit="10"/><path d="m6.165 7.499h10.208s3.043-0.055 3.093 3.311c0.056 3.367-2.821 3.583-2.821 3.583h-10.48m0 10.211h10.48s3.964-0.49 4.02-5.432c0.051-4.94-4.02-4.779-4.02-4.779m-9.937-8.02v19.355" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.8"/></svg>
diff --git a/silx/resources/gui/icons/math-swap-sign.svg b/silx/resources/gui/icons/math-swap-sign.svg
index 5d80c1f..55fb7aa 100644
--- a/silx/resources/gui/icons/math-swap-sign.svg
+++ b/silx/resources/gui/icons/math-swap-sign.svg
@@ -1,57 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata26"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs24" /><path
- d="m 10.411,24.871 0.289,0.776 c 0.097,0.26 0.174,0.519 0.231,0.732 h 0.02 c 0.067,-0.224 0.145,-0.491 0.222,-0.732 l 0.28,-0.776 h 1.273 l -1.07,2.143 1.089,2.223 H 11.366 L 11.048,28.416 C 10.962,28.193 10.884,27.97 10.817,27.747 h -0.019 c -0.058,0.223 -0.145,0.446 -0.212,0.669 l -0.289,0.821 H 9.032 l 1.051,-2.169 -1.042,-2.196 h 1.37 z"
- inkscape:connector-curvature="0"
- id="path4" /><path
- d="m 18.296,20.802 c -0.559,0.812 -1.021,1.973 -1.021,3.642 0,1.616 0.463,2.768 1.021,3.606 H 17.39 C 16.85,27.38 16.281,26.157 16.281,24.435 16.32,22.694 16.85,21.48 17.39,20.802 h 0.906 z"
- inkscape:connector-curvature="0"
- id="path6" /><path
- d="m 21.649,25.116 v 1.199 h -2.738 v -1.199 h 2.738 z"
- inkscape:connector-curvature="0"
- id="path8" /><path
- d="M 24.091,22.728 H 24.07 l -1.212,0.582 -0.242,-1.052 1.642,-0.786 h 1.267 v 6.636 h -1.433 v -5.38 z"
- inkscape:connector-curvature="0"
- id="path10" /><path
- d="m 27.021,28.05 c 0.56,-0.821 1.022,-2.018 1.022,-3.642 0,-1.625 -0.463,-2.785 -1.022,-3.606 h 0.906 c 0.54,0.651 1.109,1.839 1.109,3.606 -0.039,1.767 -0.569,2.945 -1.109,3.642 h -0.906 z"
- inkscape:connector-curvature="0"
- id="path12" /><line
- x1="1.224"
- x2="27.546"
- y1="12.123"
- y2="12.123"
- fill="none"
- stroke="#000"
- stroke-miterlimit="10"
- stroke-width=".8"
- id="line14"
- style="fill:none;stroke:#000000;stroke-width:0.80000001;stroke-miterlimit:10" /><path
- d="M 2.491,11.448"
- inkscape:connector-curvature="0"
- id="path16"
- style="fill:none;stroke:#00a651;stroke-miterlimit:10" /><path
- d="m 26.441,10.765 c 0,0 -2.07,0.308 -3.128,0 -1.057,-0.309 -2.687,-2.774 -2.995,-3.436 -0.308,-0.662 -1.938,-3.083 -3.876,0 -1.938,3.083 -4.405,-2.828 -4.405,-2.828 0,0 -2.51,-6.07 -4.314,0.229 -1.806,6.299 -4.935,6.21 -4.935,6.21"
- inkscape:connector-curvature="0"
- id="path18"
- style="fill:none;stroke:#00a651;stroke-width:1.10000002;stroke-miterlimit:10" /><path
- d="m 26.441,13.33 c 0,0 -2.07,-0.309 -3.127,0 -1.057,0.308 -2.688,2.774 -2.995,3.435 -0.308,0.662 -1.938,3.083 -3.876,0 -1.938,-3.083 -4.406,2.828 -4.406,2.828 0,0 -2.51,6.07 -4.314,-0.229 -1.807,-6.299 -4.936,-6.21 -4.936,-6.21"
- inkscape:connector-curvature="0"
- id="path20"
- style="fill:none;stroke:#ed1c24;stroke-width:1.10000002;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m10.411 24.871 0.289 0.776c0.097 0.26 0.174 0.519 0.231 0.732h0.02c0.067-0.224 0.145-0.491 0.222-0.732l0.28-0.776h1.273l-1.07 2.143 1.089 2.223h-1.379l-0.318-0.821c-0.086-0.223-0.164-0.446-0.231-0.669h-0.019c-0.058 0.223-0.145 0.446-0.212 0.669l-0.289 0.821h-1.265l1.051-2.169-1.042-2.196h1.37z"/><path d="m18.296 20.802c-0.559 0.812-1.021 1.973-1.021 3.642 0 1.616 0.463 2.768 1.021 3.606h-0.906c-0.54-0.67-1.109-1.893-1.109-3.615 0.039-1.741 0.569-2.955 1.109-3.633h0.906z"/><path d="m21.649 25.116v1.199h-2.738v-1.199h2.738z"/><path d="m24.091 22.728h-0.021l-1.212 0.582-0.242-1.052 1.642-0.786h1.267v6.636h-1.433v-5.38z"/><path d="m27.021 28.05c0.56-0.821 1.022-2.018 1.022-3.642 0-1.625-0.463-2.785-1.022-3.606h0.906c0.54 0.651 1.109 1.839 1.109 3.606-0.039 1.767-0.569 2.945-1.109 3.642h-0.906z"/><line x1="1.224" x2="27.546" y1="12.123" y2="12.123" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".8"/><path d="m2.491 11.448" fill="none" stroke="#00a651" stroke-miterlimit="10"/><path d="m26.441 10.765s-2.07 0.308-3.128 0c-1.057-0.309-2.687-2.774-2.995-3.436s-1.938-3.083-3.876 0-4.405-2.828-4.405-2.828-2.51-6.07-4.314 0.229c-1.806 6.299-4.935 6.21-4.935 6.21" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.1"/><path d="m26.441 13.33s-2.07-0.309-3.127 0c-1.057 0.308-2.688 2.774-2.995 3.435-0.308 0.662-1.938 3.083-3.876 0s-4.406 2.828-4.406 2.828-2.51 6.07-4.314-0.229c-1.807-6.299-4.936-6.21-4.936-6.21" fill="none" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="1.1"/></svg>
diff --git a/silx/resources/gui/icons/math-ymin-to-zero.svg b/silx/resources/gui/icons/math-ymin-to-zero.svg
index 084b879..ca218d1 100644
--- a/silx/resources/gui/icons/math-ymin-to-zero.svg
+++ b/silx/resources/gui/icons/math-ymin-to-zero.svg
@@ -1,40 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><line
- x1="4.9790001"
- x2="31.028"
- y1="17.829"
- y2="17.829"
- fill="none"
- stroke="#000"
- stroke-miterlimit="10"
- id="line4"
- style="fill:none;stroke:#000000;stroke-miterlimit:10" /><path
- d="M 2.491,11.448"
- inkscape:connector-curvature="0"
- id="path6"
- style="fill:none;stroke:#00a651;stroke-miterlimit:10" /><path
- d="m 4.703,18.357 c 0,0 -0.047,-1.082 1.587,-4.552 1.634,-3.469 3.268,-3.283 3.268,-3.283 0,0 1.541,-0.374 2.661,3.035 1.12,3.409 2.334,2.007 3.642,0 1.308,-2.007 2.334,-1.96 2.334,-1.96 0,0 1.027,-0.654 3.035,2.567 2.008,3.22 5.369,-2.591 6.068,-3.653"
- inkscape:connector-curvature="0"
- id="path8"
- style="fill:none;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /><path
- d="m 8.361,23.684 c 0,2.371 -0.934,3.42 -2.088,3.42 -1.56,0 -2.087,-1.659 -2.087,-3.359 0,-1.902 0.659,-3.419 2.142,-3.419 1.649,-0.001 2.033,1.779 2.033,3.358 z m -2.724,0.031 c -0.022,1.547 0.187,2.248 0.67,2.248 0.45,0 0.604,-0.732 0.604,-2.248 0,-1.416 -0.143,-2.25 -0.604,-2.25 -0.451,0 -0.682,0.713 -0.67,2.25 z"
- inkscape:connector-curvature="0"
- id="path10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="4.979" x2="31.028" y1="17.829" y2="17.829" fill="none" stroke="#000" stroke-miterlimit="10"/><path d="m2.491 11.448" fill="none" stroke="#00a651" stroke-miterlimit="10"/><path d="m4.703 18.357s-0.047-1.082 1.587-4.552c1.634-3.469 3.268-3.283 3.268-3.283s1.541-0.374 2.661 3.035 2.334 2.007 3.642 0 2.334-1.96 2.334-1.96 1.027-0.654 3.035 2.567c2.008 3.22 5.369-2.591 6.068-3.653" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/><path d="m8.361 23.684c0 2.371-0.934 3.42-2.088 3.42-1.56 0-2.087-1.659-2.087-3.359 0-1.902 0.659-3.419 2.142-3.419 1.649-1e-3 2.033 1.779 2.033 3.358zm-2.724 0.031c-0.022 1.547 0.187 2.248 0.67 2.248 0.45 0 0.604-0.732 0.604-2.248 0-1.416-0.143-2.25-0.604-2.25-0.451 0-0.682 0.713-0.67 2.25z"/></svg>
diff --git a/silx/resources/gui/icons/median-filter.svg b/silx/resources/gui/icons/median-filter.svg
index 179a36b..bb1a972 100644
--- a/silx/resources/gui/icons/median-filter.svg
+++ b/silx/resources/gui/icons/median-filter.svg
@@ -1,70 +1,8 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="32"
- height="32"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.5 r10040"
- sodipodi:docname="median-filter.svg">
- <defs
- id="defs4" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="7.9195959"
- inkscape:cx="5.3998064"
- inkscape:cy="0.5973639"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- showborder="true"
- inkscape:showpageshadow="false"
- inkscape:window-width="1920"
- inkscape:window-height="1098"
- inkscape:window-x="0"
- inkscape:window-y="31"
- inkscape:window-maximized="1" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(0,-1020.3622)">
- <g
- transform="scale(0.99689828,1.0031114)"
- style="font-size:13.08228397px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
- id="text2985">
- <path
- sodipodi:type="inkscape:offset"
- inkscape:radius="0"
- inkscape:original="M 16.28125 1025.7188 L 16.28125 1027.9062 C 16.100583 1027.667 15.907224 1027.4874 15.6875 1027.375 C 15.470213 1027.2599 15.220701 1027.2188 14.9375 1027.2188 C 14.432127 1027.2188 14.012206 1027.4096 13.6875 1027.8125 C 13.362792 1028.2129 13.1875 1028.7427 13.1875 1029.375 C 13.1875 1030.0074 13.362792 1030.5033 13.6875 1030.9062 C 14.012206 1031.3067 14.432127 1031.5312 14.9375 1031.5312 C 15.223142 1031.5312 15.470213 1031.4561 15.6875 1031.3438 C 15.904783 1031.2315 16.100583 1031.0542 16.28125 1030.8125 L 16.28125 1031.4062 L 17.59375 1031.4062 L 17.59375 1025.7188 L 16.28125 1025.7188 z M 18.875 1025.7188 L 18.875 1026.7812 L 20.1875 1026.7812 L 20.1875 1025.7188 L 18.875 1025.7188 z M 1 1025.9375 L 1 1031.4062 L 2.34375 1031.4062 L 2.34375 1027.4062 L 3.59375 1030.375 L 4.5 1030.375 L 5.75 1027.4062 L 5.75 1031.4062 L 7.09375 1031.4062 L 7.09375 1025.9375 L 5.28125 1025.9375 L 4.03125 1028.875 L 2.78125 1025.9375 L 1 1025.9375 z M 10.375 1027.2188 C 9.6669902 1027.2187 9.1240221 1027.398 8.71875 1027.7812 C 8.3159174 1028.1646 8.0937497 1028.7061 8.09375 1029.375 C 8.0937497 1030.0562 8.3085932 1030.5903 8.71875 1030.9688 C 9.1313463 1031.3448 9.6953106 1031.5312 10.4375 1031.5312 C 10.747556 1031.5312 11.064938 1031.4985 11.375 1031.4375 C 11.685055 1031.3789 12.002437 1031.2734 12.3125 1031.1562 L 12.3125 1030.1562 C 12.00732 1030.3223 11.696773 1030.4482 11.40625 1030.5312 C 11.118161 1030.6121 10.838376 1030.6562 10.5625 1030.6562 C 10.2207 1030.6562 9.9716775 1030.5601 9.78125 1030.4062 C 9.5908185 1030.2524 9.469237 1030.0265 9.4375 1029.7188 L 12.5 1029.7188 L 12.5 1029.3438 C 12.499996 1028.6943 12.325679 1028.1695 11.9375 1027.7812 C 11.551754 1027.3931 11.019528 1027.2188 10.375 1027.2188 z M 23.1875 1027.2188 C 22.904294 1027.2188 22.626952 1027.2442 22.34375 1027.2812 C 22.060546 1027.3153 21.780761 1027.3383 21.5 1027.4062 L 21.5 1028.4062 C 21.707519 1028.2939 21.9458 1028.2123 22.1875 1028.1562 C 22.429198 1028.1002 22.687986 1028.0938 22.96875 1028.0938 C 23.315427 1028.0938 23.555173 1028.1208 23.71875 1028.2188 C 23.882322 1028.3139 23.968747 1028.48 23.96875 1028.6875 L 23.96875 1028.7812 L 23.1875 1028.7812 C 22.47949 1028.7812 21.95703 1028.9004 21.625 1029.125 C 21.29541 1029.3497 21.15625 1029.7065 21.15625 1030.1875 C 21.15625 1030.583 21.267578 1030.9072 21.53125 1031.1562 C 21.797362 1031.4028 22.137694 1031.5312 22.5625 1031.5312 C 22.877439 1031.5313 23.155271 1031.4561 23.375 1031.3438 C 23.594724 1031.2291 23.792966 1031.0615 23.96875 1030.8125 L 23.96875 1031.4062 L 25.28125 1031.4062 L 25.28125 1029.0625 C 25.281246 1028.4057 25.110836 1027.9468 24.78125 1027.6562 C 24.454098 1027.3633 23.927243 1027.2188 23.1875 1027.2188 z M 29.1875 1027.2188 C 28.918942 1027.2187 28.690915 1027.2603 28.46875 1027.375 C 28.24658 1027.4874 28.041502 1027.667 27.84375 1027.9062 L 27.84375 1027.3125 L 26.53125 1027.3125 L 26.53125 1031.4062 L 27.84375 1031.4062 L 27.84375 1029.4062 C 27.843748 1029.0328 27.906248 1028.7413 28.0625 1028.5312 C 28.218748 1028.3188 28.44531 1028.1875 28.71875 1028.1875 C 28.831052 1028.1875 28.91211 1028.2323 29 1028.2812 C 29.087888 1028.3276 29.16748 1028.3837 29.21875 1028.4688 C 29.25781 1028.5322 29.29785 1028.647 29.3125 1028.7812 C 29.32963 1028.9155 29.312496 1029.146 29.3125 1029.5 L 29.3125 1031 L 29.3125 1031.4062 L 30.65625 1031.4062 L 30.65625 1028.9062 C 30.656245 1028.352 30.527827 1027.9468 30.28125 1027.6562 C 30.037105 1027.3657 29.661129 1027.2188 29.1875 1027.2188 z M 18.875 1027.3125 L 18.875 1031.4062 L 20.1875 1031.4062 L 20.1875 1027.3125 L 18.875 1027.3125 z M 10.375 1028.0938 C 10.609372 1028.0938 10.793454 1028.1587 10.9375 1028.3125 C 11.083976 1028.4639 11.156247 1028.6572 11.15625 1028.9062 L 9.46875 1028.9062 C 9.5078108 1028.6377 9.5913067 1028.4541 9.75 1028.3125 C 9.9086892 1028.1684 10.121091 1028.0938 10.375 1028.0938 z M 15.40625 1028.1562 C 15.687009 1028.1562 15.916012 1028.2637 16.0625 1028.4688 C 16.211418 1028.6739 16.281247 1028.9844 16.28125 1029.375 C 16.281247 1029.7657 16.211422 1030.0449 16.0625 1030.25 C 15.916012 1030.4551 15.687009 1030.5625 15.40625 1030.5625 C 15.127928 1030.5625 14.930174 1030.4551 14.78125 1030.25 C 14.634764 1030.0449 14.562498 1029.7657 14.5625 1029.375 C 14.562498 1028.9844 14.634764 1028.6738 14.78125 1028.4688 C 14.930174 1028.2636 15.127928 1028.1562 15.40625 1028.1562 z M 23.28125 1029.5625 L 23.96875 1029.5625 L 23.96875 1029.7188 C 23.968747 1029.9848 23.887204 1030.1968 23.71875 1030.375 C 23.55029 1030.5507 23.340329 1030.6562 23.09375 1030.6562 C 22.895994 1030.6562 22.737302 1030.593 22.625 1030.5 C 22.515135 1030.4048 22.468748 1030.291 22.46875 1030.125 C 22.468748 1029.9443 22.519529 1029.8118 22.65625 1029.7188 C 22.795408 1029.6256 23.007811 1029.5625 23.28125 1029.5625 z M 6.0625 1035.0938 L 6.0625 1036.1562 L 7.375 1036.1562 L 7.375 1035.0938 L 6.0625 1035.0938 z M 8.65625 1035.0938 L 8.65625 1040.7812 L 9.96875 1040.7812 L 9.96875 1035.0938 L 8.65625 1035.0938 z M 1 1035.3125 L 1 1040.7812 L 2.40625 1040.7812 L 2.40625 1038.4688 L 4.65625 1038.4688 L 4.65625 1037.4062 L 2.40625 1037.4062 L 2.40625 1036.375 L 4.8125 1036.375 L 4.8125 1035.3125 L 1 1035.3125 z M 11.34375 1035.5312 L 11.34375 1036.6875 L 10.6875 1036.6875 L 10.6875 1037.625 L 11.34375 1037.625 L 11.34375 1039.375 C 11.343749 1039.8926 11.441406 1040.2514 11.65625 1040.4688 C 11.873534 1040.6836 12.263671 1040.7812 12.78125 1040.7812 L 13.90625 1040.7812 L 13.90625 1039.8438 L 13.21875 1039.8438 C 12.994138 1039.8438 12.85693 1039.816 12.78125 1039.75 C 12.705565 1039.6816 12.656248 1039.5654 12.65625 1039.375 L 12.65625 1037.625 L 14 1037.625 L 14 1036.6875 L 12.65625 1036.6875 L 12.65625 1035.5312 L 11.34375 1035.5312 z M 16.78125 1036.5938 C 16.07324 1036.5938 15.530272 1036.773 15.125 1037.1562 C 14.722168 1037.5395 14.5 1038.0811 14.5 1038.75 C 14.5 1039.4312 14.714843 1039.9653 15.125 1040.3438 C 15.537596 1040.7198 16.101561 1040.9062 16.84375 1040.9062 C 17.153806 1040.9062 17.471188 1040.8735 17.78125 1040.8125 C 18.091305 1040.7539 18.408687 1040.6484 18.71875 1040.5312 L 18.71875 1039.5312 C 18.41357 1039.6973 18.103024 1039.8232 17.8125 1039.9062 C 17.524411 1039.9871 17.244626 1040.0312 16.96875 1040.0312 C 16.626951 1040.0312 16.377928 1039.9351 16.1875 1039.7812 C 15.997069 1039.6274 15.87549 1039.4015 15.84375 1039.0938 L 18.90625 1039.0938 L 18.90625 1038.7188 C 18.906245 1038.0694 18.700679 1037.5445 18.3125 1037.1562 C 17.926754 1036.768 17.425778 1036.5938 16.78125 1036.5938 z M 22.5625 1036.5938 C 22.257321 1036.5938 22.000973 1036.6568 21.78125 1036.7812 C 21.563962 1036.9034 21.387205 1037.1065 21.21875 1037.375 L 21.21875 1036.6875 L 19.90625 1036.6875 L 19.90625 1040.7812 L 21.21875 1040.7812 L 21.21875 1038.9062 C 21.218748 1038.5035 21.288084 1038.1835 21.46875 1037.9688 C 21.651853 1037.7514 21.913083 1037.6562 22.25 1037.6562 C 22.364743 1037.6562 22.481442 1037.6605 22.59375 1037.6875 C 22.708493 1037.7116 22.82275 1037.7585 22.9375 1037.8125 L 22.9375 1036.625 C 22.83984 1036.613 22.77002 1036.5938 22.71875 1036.5938 C 22.667478 1036.5837 22.60644 1036.5938 22.5625 1036.5938 z M 6.0625 1036.6875 L 6.0625 1040.7812 L 7.375 1040.7812 L 7.375 1036.6875 L 6.0625 1036.6875 z M 16.78125 1037.4688 C 17.015622 1037.4688 17.199704 1037.5337 17.34375 1037.6875 C 17.490226 1037.8389 17.562497 1038.0322 17.5625 1038.2812 L 15.84375 1038.2812 C 15.882811 1038.0127 15.997557 1037.8291 16.15625 1037.6875 C 16.31494 1037.5434 16.527341 1037.4688 16.78125 1037.4688 z "
- style="font-size:7.5px;font-weight:bold"
- id="path3029"
- d="m 16.28125,1025.7188 0,2.1874 c -0.180667,-0.2392 -0.374026,-0.4188 -0.59375,-0.5312 -0.217287,-0.1151 -0.466799,-0.1562 -0.75,-0.1562 -0.505373,0 -0.925294,0.1908 -1.25,0.5937 -0.324708,0.4004 -0.5,0.9302 -0.5,1.5625 0,0.6324 0.175292,1.1283 0.5,1.5312 0.324706,0.4005 0.744627,0.625 1.25,0.625 0.285642,0 0.532713,-0.075 0.75,-0.1874 0.217283,-0.1123 0.413083,-0.2896 0.59375,-0.5313 l 0,0.5937 1.3125,0 0,-5.6874 -1.3125,0 z m 2.59375,0 0,1.0624 1.3125,0 0,-1.0624 -1.3125,0 z M 1,1025.9375 l 0,5.4687 1.34375,0 0,-4 1.25,2.9688 0.90625,0 1.25,-2.9688 0,4 1.34375,0 0,-5.4687 -1.8125,0 -1.25,2.9375 -1.25,-2.9375 -1.78125,0 z m 9.375,1.2813 c -0.7080098,-1e-4 -1.2509779,0.1792 -1.65625,0.5624 -0.4028326,0.3834 -0.6250003,0.9249 -0.625,1.5938 -3e-7,0.6812 0.2148432,1.2153 0.625,1.5938 0.4125963,0.376 0.9765606,0.5624 1.71875,0.5624 0.310056,0 0.627438,-0.033 0.9375,-0.094 0.310055,-0.059 0.627437,-0.1641 0.9375,-0.2813 l 0,-1 c -0.30518,0.1661 -0.615727,0.292 -0.90625,0.375 -0.288089,0.081 -0.567874,0.125 -0.84375,0.125 -0.3418,0 -0.5908225,-0.096 -0.78125,-0.25 -0.1904315,-0.1538 -0.312013,-0.3797 -0.34375,-0.6874 l 3.0625,0 0,-0.375 c -4e-6,-0.6495 -0.174321,-1.1743 -0.5625,-1.5626 -0.385746,-0.3881 -0.917972,-0.5624 -1.5625,-0.5624 z m 12.8125,0 c -0.283206,0 -0.560548,0.025 -0.84375,0.062 -0.283204,0.034 -0.562989,0.057 -0.84375,0.125 l 0,1 c 0.207519,-0.1123 0.4458,-0.1939 0.6875,-0.25 0.241698,-0.056 0.500486,-0.062 0.78125,-0.062 0.346677,0 0.586423,0.027 0.75,0.125 0.163572,0.095 0.249997,0.2612 0.25,0.4687 l 0,0.094 -0.78125,0 c -0.70801,0 -1.23047,0.1192 -1.5625,0.3438 -0.32959,0.2247 -0.46875,0.5815 -0.46875,1.0625 0,0.3955 0.111328,0.7197 0.375,0.9687 0.266112,0.2466 0.606444,0.375 1.03125,0.375 0.314939,1e-4 0.592771,-0.075 0.8125,-0.1874 0.219724,-0.1147 0.417966,-0.2823 0.59375,-0.5313 l 0,0.5937 1.3125,0 0,-2.3437 c -4e-6,-0.6568 -0.170414,-1.1157 -0.5,-1.4063 -0.327152,-0.2929 -0.854007,-0.4374 -1.59375,-0.4374 z m 6,0 c -0.268558,-1e-4 -0.496585,0.041 -0.71875,0.1562 -0.22217,0.1124 -0.427248,0.292 -0.625,0.5312 l 0,-0.5937 -1.3125,0 0,4.0937 1.3125,0 0,-2 c -2e-6,-0.3734 0.0625,-0.6649 0.21875,-0.875 0.156248,-0.2124 0.38281,-0.3437 0.65625,-0.3437 0.112302,0 0.19336,0.045 0.28125,0.094 0.08789,0.046 0.16748,0.1025 0.21875,0.1876 0.03906,0.063 0.0791,0.1782 0.09375,0.3124 0.01713,0.1343 -4e-6,0.3648 0,0.7188 l 0,1.5 0,0.4062 1.34375,0 0,-2.5 c -5e-6,-0.5542 -0.128423,-0.9594 -0.375,-1.25 -0.244145,-0.2905 -0.620121,-0.4374 -1.09375,-0.4374 z m -10.3125,0.094 0,4.0937 1.3125,0 0,-4.0937 -1.3125,0 z m -8.5,0.7813 c 0.234372,0 0.418454,0.065 0.5625,0.2187 0.146476,0.1514 0.218747,0.3447 0.21875,0.5937 l -1.6875,0 c 0.039061,-0.2685 0.1225567,-0.4521 0.28125,-0.5937 0.1586892,-0.1441 0.371091,-0.2187 0.625,-0.2187 z m 5.03125,0.062 c 0.280759,0 0.509762,0.1075 0.65625,0.3126 0.148918,0.2051 0.218747,0.5156 0.21875,0.9062 -3e-6,0.3907 -0.06983,0.6699 -0.21875,0.875 -0.146488,0.2051 -0.375491,0.3125 -0.65625,0.3125 -0.278322,0 -0.476076,-0.1074 -0.625,-0.3125 -0.146486,-0.2051 -0.218752,-0.4843 -0.21875,-0.875 -2e-6,-0.3906 0.07226,-0.7012 0.21875,-0.9062 0.148924,-0.2052 0.346678,-0.3126 0.625,-0.3126 z m 7.875,1.4063 0.6875,0 0,0.1563 c -3e-6,0.266 -0.08155,0.478 -0.25,0.6562 -0.16846,0.1757 -0.378421,0.2812 -0.625,0.2812 -0.197756,0 -0.356448,-0.063 -0.46875,-0.1562 -0.109865,-0.095 -0.156252,-0.209 -0.15625,-0.375 -2e-6,-0.1807 0.05078,-0.3132 0.1875,-0.4062 0.139158,-0.093 0.351561,-0.1563 0.625,-0.1563 z m -17.21875,5.5313 0,1.0624 1.3125,0 0,-1.0624 -1.3125,0 z m 2.59375,0 0,5.6874 1.3125,0 0,-5.6874 -1.3125,0 z M 1,1035.3125 l 0,5.4687 1.40625,0 0,-2.3124 2.25,0 0,-1.0626 -2.25,0 0,-1.0312 2.40625,0 0,-1.0625 -3.8125,0 z m 10.34375,0.2187 0,1.1563 -0.65625,0 0,0.9375 0.65625,0 0,1.75 c -10e-7,0.5176 0.09766,0.8764 0.3125,1.0938 0.217284,0.2148 0.607421,0.3124 1.125,0.3124 l 1.125,0 0,-0.9374 -0.6875,0 c -0.224612,0 -0.36182,-0.028 -0.4375,-0.094 -0.07569,-0.068 -0.125002,-0.1846 -0.125,-0.375 l 0,-1.75 1.34375,0 0,-0.9375 -1.34375,0 0,-1.1563 -1.3125,0 z m 5.4375,1.0626 c -0.70801,0 -1.250978,0.1792 -1.65625,0.5624 -0.402832,0.3833 -0.625,0.9249 -0.625,1.5938 0,0.6812 0.214843,1.2153 0.625,1.5938 0.412596,0.376 0.976561,0.5624 1.71875,0.5624 0.310056,0 0.627438,-0.033 0.9375,-0.094 0.310055,-0.059 0.627437,-0.1641 0.9375,-0.2813 l 0,-1 c -0.30518,0.1661 -0.615726,0.292 -0.90625,0.375 -0.288089,0.081 -0.567874,0.125 -0.84375,0.125 -0.341799,0 -0.590822,-0.096 -0.78125,-0.25 -0.190431,-0.1538 -0.31201,-0.3797 -0.34375,-0.6874 l 3.0625,0 0,-0.375 c -5e-6,-0.6494 -0.205571,-1.1743 -0.59375,-1.5626 -0.385746,-0.3882 -0.886722,-0.5624 -1.53125,-0.5624 z m 5.78125,0 c -0.305179,0 -0.561527,0.063 -0.78125,0.1874 -0.217288,0.1222 -0.394045,0.3253 -0.5625,0.5938 l 0,-0.6875 -1.3125,0 0,4.0937 1.3125,0 0,-1.875 c -2e-6,-0.4027 0.06933,-0.7227 0.25,-0.9374 0.183103,-0.2174 0.444333,-0.3126 0.78125,-0.3126 0.114743,0 0.231442,0 0.34375,0.031 0.114743,0.024 0.229,0.071 0.34375,0.125 l 0,-1.1875 c -0.09766,-0.012 -0.16748,-0.031 -0.21875,-0.031 -0.05127,-0.01 -0.11231,0 -0.15625,0 z m -16.5,0.094 0,4.0937 1.3125,0 0,-4.0937 -1.3125,0 z m 10.71875,0.7813 c 0.234372,0 0.418454,0.065 0.5625,0.2187 0.146476,0.1514 0.218747,0.3447 0.21875,0.5937 l -1.71875,0 c 0.03906,-0.2685 0.153807,-0.4521 0.3125,-0.5937 0.15869,-0.1441 0.371091,-0.2187 0.625,-0.2187 z" />
- </g>
- </g>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(0 -1020.4)">
+<g transform="scale(.9969 1.0031)">
+<path d="m16.281 1025.7v2.1874c-0.18067-0.2392-0.37403-0.4188-0.59375-0.5312-0.21729-0.1151-0.4668-0.1562-0.75-0.1562-0.50537 0-0.92529 0.1908-1.25 0.5937-0.32471 0.4004-0.5 0.9302-0.5 1.5625 0 0.6324 0.17529 1.1283 0.5 1.5312 0.32471 0.4005 0.74463 0.625 1.25 0.625 0.28564 0 0.53271-0.075 0.75-0.1874 0.21728-0.1123 0.41308-0.2896 0.59375-0.5313v0.5937h1.3125v-5.6874h-1.3125zm2.5938 0v1.0624h1.3125v-1.0624h-1.3125zm-17.875 0.2187v5.4687h1.3438v-4l1.25 2.9688h0.90625l1.25-2.9688v4h1.3438v-5.4687h-1.8125l-1.25 2.9375-1.25-2.9375h-1.7812zm9.375 1.2813c-0.70801-1e-4 -1.251 0.1792-1.6562 0.5624-0.40283 0.3834-0.625 0.9249-0.625 1.5938-3e-7 0.6812 0.21484 1.2153 0.625 1.5938 0.4126 0.376 0.97656 0.5624 1.7188 0.5624 0.31006 0 0.62744-0.033 0.9375-0.094 0.31006-0.059 0.62744-0.1641 0.9375-0.2813v-1c-0.30518 0.1661-0.61573 0.292-0.90625 0.375-0.28809 0.081-0.56787 0.125-0.84375 0.125-0.3418 0-0.59082-0.096-0.78125-0.25-0.19043-0.1538-0.31201-0.3797-0.34375-0.6874h3.0625v-0.375c-4e-6 -0.6495-0.17432-1.1743-0.5625-1.5626-0.38575-0.3881-0.91797-0.5624-1.5625-0.5624zm12.812 0c-0.28321 0-0.56055 0.025-0.84375 0.062-0.2832 0.034-0.56299 0.057-0.84375 0.125v1c0.20752-0.1123 0.4458-0.1939 0.6875-0.25 0.2417-0.056 0.50049-0.062 0.78125-0.062 0.34668 0 0.58642 0.027 0.75 0.125 0.16357 0.095 0.25 0.2612 0.25 0.4687v0.094h-0.78125c-0.70801 0-1.2305 0.1192-1.5625 0.3438-0.32959 0.2247-0.46875 0.5815-0.46875 1.0625 0 0.3955 0.11133 0.7197 0.375 0.9687 0.26611 0.2466 0.60644 0.375 1.0312 0.375 0.31494 1e-4 0.59277-0.075 0.8125-0.1874 0.21972-0.1147 0.41797-0.2823 0.59375-0.5313v0.5937h1.3125v-2.3437c-4e-6 -0.6568-0.17041-1.1157-0.5-1.4063-0.32715-0.2929-0.85401-0.4374-1.5938-0.4374zm6 0c-0.26856-1e-4 -0.49658 0.041-0.71875 0.1562-0.22217 0.1124-0.42725 0.292-0.625 0.5312v-0.5937h-1.3125v4.0937h1.3125v-2c-2e-6 -0.3734 0.0625-0.6649 0.21875-0.875 0.15625-0.2124 0.38281-0.3437 0.65625-0.3437 0.1123 0 0.19336 0.045 0.28125 0.094 0.08789 0.046 0.16748 0.1025 0.21875 0.1876 0.03906 0.063 0.0791 0.1782 0.09375 0.3124 0.01713 0.1343-4e-6 0.3648 0 0.7188v1.5 0.4062h1.3438v-2.5c-5e-6 -0.5542-0.12842-0.9594-0.375-1.25-0.24414-0.2905-0.62012-0.4374-1.0938-0.4374zm-10.312 0.094v4.0937h1.3125v-4.0937h-1.3125zm-8.5 0.7813c0.23437 0 0.41845 0.065 0.5625 0.2187 0.14648 0.1514 0.21875 0.3447 0.21875 0.5937h-1.6875c0.039061-0.2685 0.12256-0.4521 0.28125-0.5937 0.15869-0.1441 0.37109-0.2187 0.625-0.2187zm5.0312 0.062c0.28076 0 0.50976 0.1075 0.65625 0.3126 0.14892 0.2051 0.21875 0.5156 0.21875 0.9062-3e-6 0.3907-0.06983 0.6699-0.21875 0.875-0.14649 0.2051-0.37549 0.3125-0.65625 0.3125-0.27832 0-0.47608-0.1074-0.625-0.3125-0.14649-0.2051-0.21875-0.4843-0.21875-0.875-2e-6 -0.3906 0.07226-0.7012 0.21875-0.9062 0.14892-0.2052 0.34668-0.3126 0.625-0.3126zm7.875 1.4063h0.6875v0.1563c-3e-6 0.266-0.08155 0.478-0.25 0.6562-0.16846 0.1757-0.37842 0.2812-0.625 0.2812-0.19776 0-0.35645-0.063-0.46875-0.1562-0.10986-0.095-0.15625-0.209-0.15625-0.375-2e-6 -0.1807 0.05078-0.3132 0.1875-0.4062 0.13916-0.093 0.35156-0.1563 0.625-0.1563zm-17.219 5.5313v1.0624h1.3125v-1.0624h-1.3125zm2.5938 0v5.6874h1.3125v-5.6874h-1.3125zm-7.6562 0.2188v5.4687h1.4062v-2.3124h2.25v-1.0626h-2.25v-1.0312h2.4062v-1.0625h-3.8125zm10.344 0.2187v1.1563h-0.65625v0.9375h0.65625v1.75c-1e-6 0.5176 0.09766 0.8764 0.3125 1.0938 0.21728 0.2148 0.60742 0.3124 1.125 0.3124h1.125v-0.9374h-0.6875c-0.22461 0-0.36182-0.028-0.4375-0.094-0.07569-0.068-0.125-0.1846-0.125-0.375v-1.75h1.3438v-0.9375h-1.3438v-1.1563h-1.3125zm5.4375 1.0626c-0.70801 0-1.251 0.1792-1.6562 0.5624-0.40283 0.3833-0.625 0.9249-0.625 1.5938 0 0.6812 0.21484 1.2153 0.625 1.5938 0.4126 0.376 0.97656 0.5624 1.7188 0.5624 0.31006 0 0.62744-0.033 0.9375-0.094 0.31006-0.059 0.62744-0.1641 0.9375-0.2813v-1c-0.30518 0.1661-0.61573 0.292-0.90625 0.375-0.28809 0.081-0.56787 0.125-0.84375 0.125-0.3418 0-0.59082-0.096-0.78125-0.25-0.19043-0.1538-0.31201-0.3797-0.34375-0.6874h3.0625v-0.375c-5e-6 -0.6494-0.20557-1.1743-0.59375-1.5626-0.38575-0.3882-0.88672-0.5624-1.5312-0.5624zm5.7812 0c-0.30518 0-0.56153 0.063-0.78125 0.1874-0.21729 0.1222-0.39404 0.3253-0.5625 0.5938v-0.6875h-1.3125v4.0937h1.3125v-1.875c-2e-6 -0.4027 0.06933-0.7227 0.25-0.9374 0.1831-0.2174 0.44433-0.3126 0.78125-0.3126 0.11474 0 0.23144 0 0.34375 0.031 0.11474 0.024 0.229 0.071 0.34375 0.125v-1.1875c-0.09766-0.012-0.16748-0.031-0.21875-0.031-0.05127-0.01-0.11231 0-0.15625 0zm-16.5 0.094v4.0937h1.3125v-4.0937h-1.3125zm10.719 0.7813c0.23437 0 0.41845 0.065 0.5625 0.2187 0.14648 0.1514 0.21875 0.3447 0.21875 0.5937h-1.7188c0.03906-0.2685 0.15381-0.4521 0.3125-0.5937 0.15869-0.1441 0.37109-0.2187 0.625-0.2187z"/>
+</g>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/next.svg b/silx/resources/gui/icons/next.svg
index 09cc561..eb455d1 100644
--- a/silx/resources/gui/icons/next.svg
+++ b/silx/resources/gui/icons/next.svg
@@ -1,23 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <linearGradient id="b" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientUnits="userSpaceOnUse">
- <stop stop-color="#002839" offset="0"/>
- <stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
- </linearGradient>
- <linearGradient id="a" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientUnits="userSpaceOnUse">
- <stop offset="0"/>
- <stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
- </linearGradient>
- </defs>
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path d="m7.055 4.9951c6.6141 3.9114 12.473 7.571 18.396 11.252l-18.307 10.806z" fill="url(#b)" stroke="url(#a)" stroke-linejoin="round" stroke-width=".4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<linearGradient id="c" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientUnits="userSpaceOnUse">
+<stop stop-color="#002839" offset="0"/>
+<stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
+</linearGradient>
+<linearGradient id="d" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientUnits="userSpaceOnUse">
+<stop offset="0"/>
+<stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
+</linearGradient>
+</defs>
+<path d="m7.055 4.9951c6.6141 3.9114 12.473 7.571 18.396 11.252l-18.307 10.806z" fill="url(#c)" stroke="url(#d)" stroke-linejoin="round" stroke-width=".4"/>
</svg>
diff --git a/silx/resources/gui/icons/normal.svg b/silx/resources/gui/icons/normal.svg
index 8bc4e66..7a3ca5e 100644
--- a/silx/resources/gui/icons/normal.svg
+++ b/silx/resources/gui/icons/normal.svg
@@ -1,33 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs8"><filter
- x="-0.18998802"
- y="-0.11593667"
- width="1.379976"
- height="1.2318733"
- color-interpolation-filters="sRGB"
- id="filter4582"><feGaussianBlur
- id="feGaussianBlur4584"
- stdDeviation="1.239375" /></filter></defs><path
- d="m 8.9854343,3.2658713 c 0,7.6682957 0,14.7273767 0,21.4687487 1.5624997,-1.562499 3.1249997,-3.124999 4.6874997,-4.687499 1.286105,2.960737 2.595998,5.911189 3.875,8.874999 1.679854,-0.586234 3.057686,-1.123669 4.5625,-1.687499 -1.355248,-2.924576 -2.785698,-5.815806 -4.1875,-8.71875 2.239583,0 4.479167,0 6.71875,0 C 19.271285,13.204637 13.579202,7.8489993 8.9854343,3.2658713 z"
- id="path3222-6"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter4582);enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /><path
- d="m 9.8419543,4.1474217 0,19.0835623 4.3693007,-4.3693 3.983775,9.124129 3.598247,-1.349344 -4.305047,-8.931362 6.296934,0 z"
- id="path3222"
- style="fill:#000000;stroke:#ffffff;stroke-width:0.80000001;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.18999" y="-.11594" width="1.38" height="1.2319" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.239375"/></filter></defs><path d="m8.9854 3.2659v21.469c1.5625-1.5625 3.125-3.125 4.6875-4.6875 1.2861 2.9607 2.596 5.9112 3.875 8.875 1.6799-0.58623 3.0577-1.1237 4.5625-1.6875-1.3552-2.9246-2.7857-5.8158-4.1875-8.7188h6.7188c-5.3704-5.3112-11.062-10.667-15.656-15.25z" color="#000000" filter="url(#a)" style="block-progression:tb;text-indent:0;text-transform:none"/><path d="m9.842 4.1474v19.084l4.3693-4.3693 3.9838 9.1241 3.5982-1.3493-4.305-8.9314h6.2969z" stroke="#fff" stroke-width=".8"/></svg>
diff --git a/silx/resources/gui/icons/pan.png b/silx/resources/gui/icons/pan.png
new file mode 100644
index 0000000..8fd0a86
--- /dev/null
+++ b/silx/resources/gui/icons/pan.png
Binary files differ
diff --git a/silx/resources/gui/icons/pan.svg b/silx/resources/gui/icons/pan.svg
new file mode 100644
index 0000000..e21ca50
--- /dev/null
+++ b/silx/resources/gui/icons/pan.svg
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect x="7.6949" y="15.085" width="16.61" height="1.8305" ry=".020888" color="#000000"/>
+<path d="m22.598 12.53c2.0808 1.2305 3.924 2.3818 5.7873 3.5398l-5.7593 3.3995z"/>
+<path d="m9.4021 12.53c-2.0808 1.2305-3.924 2.3818-5.7873 3.5398l5.7593 3.3995z"/>
+<rect transform="rotate(90)" x="7.6949" y="-16.915" width="16.61" height="1.8305" ry=".020888" color="#000000"/>
+<path d="m19.47 22.598c-1.2305 2.0808-2.3818 3.924-3.5398 5.7873l-3.3995-5.7593z"/>
+<path d="m19.47 9.4021c-1.2305-2.0808-2.3818-3.924-3.5398-5.7873l-3.3995 5.7593z"/>
+</svg>
diff --git a/silx/resources/gui/icons/pixel-intensities.svg b/silx/resources/gui/icons/pixel-intensities.svg
index 1948634..5d3cf80 100644
--- a/silx/resources/gui/icons/pixel-intensities.svg
+++ b/silx/resources/gui/icons/pixel-intensities.svg
@@ -1,26 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <defs>
- <linearGradient id="a" x1="73.425" x2="507.42" y1="868.27" y2="868.27" gradientTransform="matrix(.066589 0 0 .065952 -2.0502 -37.163)" gradientUnits="userSpaceOnUse">
- <stop stop-color="#b32222" offset="0"/>
- <stop stop-color="#2e7231" stop-opacity=".86275" offset=".5"/>
- <stop stop-color="#323aac" stop-opacity=".72549" offset="1"/>
- </linearGradient>
- </defs>
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path d="m3.1803 33.222c0.4672-17.948 5.0836-5.422 10.04-10.721 0 0 2.7506-2.9654 3.7783-4.8302 1.0278-1.8648 2.1592-12.576 8.139-10.4 5.9331 2.1586 6.2601 25.874 6.2601 25.874z" fill="none" stroke="url(#a)" stroke-width="1.679"/>
- <g transform="matrix(.084762 0 0 .051812 -1.5175 -37.163)" font-family="Sans" font-size="399.31px" line-height="125%">
- <path d="m83.123 927.19c5.7378 9e-5 10.954 1.3042 15.649 3.9122 4.6946 2.543 8.4112 5.8684 11.15 9.9761 2.8037 4.1079 4.9228 8.4439 6.3573 13.008 1.4996 4.5643 2.2494 9.0307 2.2495 13.399-9e-5 6.1292-1.3694 12.128-4.1078 17.996-2.6734 5.8031-6.1618 10.824-10.465 15.062-4.3035 4.1731-9.2264 7.531-14.769 10.074-5.4772 2.5429-10.954 3.8144-16.431 3.8144-4.5643 0-9.1285-0.7173-13.693-2.1517-0.52166 0.652-0.78247 1.4996-0.78244 2.5429v18.974c-3.2e-5 7.5636 0.32598 12.389 0.97805 14.475 0.26078 0.9128 1.8909 1.6626 4.8903 2.2495 3.0645 0.5868 5.5423 0.8802 7.4332 0.8803 0.39118 0.5216 0.58678 1.467 0.58683 2.8363 0.06516 1.3692-0.13045 2.3147-0.58683 2.8364-13.367-0.6521-20.344-0.9781-20.93-0.9781-2.2821 0-4.4991 0.033-6.6508 0.098-2.0865 0.1304-4.4991 0.2934-7.2376 0.489-2.7386 0.1956-5.0207 0.326-6.8464 0.3913-0.45643-0.5217-0.68464-1.4672-0.68464-2.8364 0.0652-1.3693 0.29341-2.3147 0.68464-2.8363 1.8909-1e-4 4.336-0.2935 7.3354-0.8803 3.0646-0.5869 4.7272-1.3367 4.9881-2.2495 0.52161-1.6301 0.84763-6.4552 0.97805-14.475v-80.005c-1.7e-5 -5.2162-0.32604-8.6068-0.97805-10.172-0.39124-0.97798-1.6301-1.7604-3.7166-2.3473-2.0865-0.58676-3.847-0.91278-5.2815-0.97805-1.3693-0.13034-2.6081-0.19554-3.7166-0.19561-0.26082-0.26074-0.42383-1.0432-0.48903-2.3473-2e-6 -1.304 0.16301-2.2168 0.48903-2.7386 11.15-1.4996 20.474-4.2381 27.972-8.2156 0.45639 9e-5 0.91282 0.39131 1.3693 1.1737 0.5216 0.78253 0.78241 1.4346 0.78244 1.9561-3.3e-5 0.0653-0.22824 1.2716-0.68464 3.6188-0.45646 2.2822-0.68467 3.7493-0.68464 4.4012-3.2e-5 0.5217 0.13038 0.78252 0.39122 0.78244 0.13038 8e-5 0.32598-0.13033 0.58683-0.39122 3.0645-2.6081 6.9115-5.1184 11.541-7.531 4.6946-2.4124 8.8024-3.6187 12.323-3.6188m-8.4113 11.541c-3.7818 8e-5 -7.4658 0.91293-11.052 2.7386-3.5862 1.7606-5.3793 3.3906-5.3793 4.8903v46.947c-3.2e-5 4.5643 1.9561 8.0853 5.8683 10.563 3.9774 2.4777 8.0852 3.7166 12.323 3.7166 5.151 0 9.7153-1.6627 13.693-4.9881 4.0426-3.3253 7.0419-7.4332 8.9981-12.323 1.956-4.9554 2.9341-10.139 2.9342-15.551-8e-5 -11.215-2.6408-20.017-7.9222-26.407-5.2163-6.3899-11.704-9.5848-19.463-9.5849"/>
- <path d="m145.62 903.81c-1.8909-1.8908-2.8364-4.2055-2.8364-6.9442-1e-5 -2.7384 0.94544-5.0532 2.8364-6.9442 1.8909-1.8908 4.2056-2.8362 6.9442-2.8364 2.7385 1.2e-4 5.0532 0.94557 6.9442 2.8364 1.8909 1.891 2.8363 4.2058 2.8364 6.9442-4e-5 2.7387-0.94549 5.0534-2.8364 6.9442-1.8909 1.891-4.2057 2.8365-6.9442 2.8364-2.7386 1.1e-4 -5.0533-0.94534-6.9442-2.8364m15.942 45.479v40.883c-4e-5 7.5636 0.32598 12.389 0.97805 14.475 0.26078 0.9129 1.8909 1.6627 4.8903 2.2496 3.0645 0.5868 5.5423 0.8802 7.4332 0.8802 0.39118 0.5216 0.58679 1.4671 0.58684 2.8364 0.0651 1.3692-0.13046 2.3147-0.58684 2.8363-13.367-0.652-20.344-0.978-20.93-0.978-2.2822 0-4.4991 0.065-6.6508 0.1956-2.0865 0.065-4.4991 0.1956-7.2376 0.3912-2.7386 0.1956-5.0207 0.326-6.8464 0.3912-0.45643-0.5216-0.68465-1.4671-0.68464-2.8363 0.0652-1.3693 0.29341-2.3148 0.68464-2.8364 1.8909 0 4.336-0.2934 7.3354-0.8802 3.0646-0.5869 4.7272-1.3367 4.9881-2.2496 0.52161-1.63 0.84763-6.4551 0.97805-14.475v-36.384c-2e-5 -5.2162-0.32603-8.6068-0.97805-10.172-0.39124-0.97798-1.6301-1.7604-3.7166-2.3473-2.0865-0.58676-3.847-0.91278-5.2815-0.97805-1.3693-0.13034-2.6082-0.19554-3.7166-0.19561-0.26082-0.26074-0.42383-1.0432-0.48903-2.3473-1e-5 -1.304 0.163-2.2168 0.48903-2.7386 11.15-1.4996 20.474-4.2381 27.972-8.2156 0.45639 9e-5 0.91282 0.39131 1.3693 1.1737 0.52159 0.78253 0.7824 1.4346 0.78244 1.9561-0.91288 6.39-1.3693 10.693-1.3693 12.91v6.4551"/>
- <path d="m202.93 929.73c5.9987 8e-5 12.584-0.32594 19.757-0.97805 0.13036 0.65211 0.19556 1.6302 0.19561 2.9342-5e-5 1.3042-0.19566 2.217-0.58684 2.7386-5.2163 8e-5 -7.8244 1.1085-7.8244 3.3254-3e-5 0.4565 0.32598 1.2389 0.97806 2.3473l12.91 20.539c1.0432-1.6952 2.9015-4.4012 5.5749-8.1178 2.7385-3.7165 4.7924-6.7485 6.1617-9.0959 1.4344-2.3473 2.1517-4.1078 2.1517-5.2815-6e-5 -0.91277-0.55429-1.63-1.6627-2.1517-1.0433-0.58676-2.1518-0.94538-3.3254-1.0759-1.1737-0.19553-2.4452-0.32594-3.8144-0.39122-1.3693-0.0651-2.0866-0.0977-2.1517-0.0978-0.19566-0.13033-0.32607-1.0106-0.39122-2.6407-5e-5 -1.63 0.13035-2.6407 0.39122-3.032 1.8908 0.0653 4.0752 0.19569 6.553 0.39122 2.4777 0.19569 4.6946 0.3587 6.6508 0.48902 2.0212 0.0653 4.2056 0.0979 6.553 0.0978 5.8682 8e-5 11.085-0.32594 15.649-0.97805 0.13032 0.52171 0.16292 1.5976 0.0978 3.2276-9e-5 1.6302-0.0979 2.4452-0.29342 2.4451-8.1505 0.4565-13.171 1.891-15.062 4.3034-1.6302 2.2822-4.1079 5.7706-7.4332 10.465-3.3254 4.6295-6.064 8.4113-8.2156 11.345-2.0866 2.9342-3.3906 4.7273-3.9122 5.3793l23.473 34.819c3.2601 4.6947 8.2808 7.042 15.062 7.042 0.13032 0 0.19552 0.4238 0.19561 1.2715 0.0651 0.8476 0.0651 1.7279 0 2.6407-0.0653 0.9129-0.1957 1.4997-0.39122 1.7605-1.6954-0.065-3.7167-0.1956-6.0639-0.3912-2.3474-0.1956-4.4665-0.326-6.3573-0.3912-1.8258-0.1304-3.8145-0.1956-5.9661-0.1956-2.4778 0-4.8251 0.065-7.042 0.1956-2.217 0.065-4.7599 0.1956-7.6288 0.3912-2.8038 0.1956-5.1511 0.326-7.042 0.3912-0.26087-0.652-0.39128-1.7605-0.39122-3.3254 0.0651-1.5648 0.26076-2.3473 0.58683-2.3473 1.8908-0.1304 3.7165-0.489 5.4771-1.0758 1.8256-0.5869 2.7385-1.4019 2.7386-2.4452-6e-5 -0.2608-0.13047-0.652-0.39122-1.1736-6.7812-11.085-11.932-19.235-15.453-24.451-0.71729 1.0433-2.7386 4.01-6.0639 8.9003-3.2602 4.8251-5.9336 8.9003-8.02 12.226-0.78248 1.2389-1.1737 2.4777-1.1737 3.7166-3e-5 0.7824 0.26079 1.4671 0.78244 2.0539 0.5216 0.5216 1.3692 0.9454 2.5429 1.2715 1.2388 0.2608 2.1843 0.4564 2.8364 0.5868 0.71721 0.065 1.8909 0.163 3.521 0.2934 0.45639 0.065 0.81501 0.098 1.0759 0.098 0.13037 0 0.22818 0.4238 0.29342 1.2715 0.0652 0.7824 0.0652 1.6301 0 2.5429-0.0652 0.9129-0.22825 1.5323-0.48903 1.8583-1.8257-0.065-3.8796-0.1956-6.1617-0.3912-2.2822-0.1956-4.3687-0.326-6.2595-0.3912-1.8257-0.1304-3.8796-0.1956-6.1617-0.1956-2.2169 0-4.2708 0.065-6.1617 0.1956-1.8257 0.065-3.8796 0.1956-6.1617 0.3912s-4.3034 0.326-6.0639 0.3912c-0.19561-0.7824-0.26082-1.7931-0.19561-3.0319 0.1304-1.3041 0.32601-2.1844 0.58683-2.6408 0.26081-0.065 1.0432-0.1956 2.3473-0.3912s2.1517-0.326 2.5429-0.3912c0.45642-0.065 1.2715-0.1956 2.4451-0.3913 1.2389-0.2608 2.1191-0.489 2.6408-0.6846 0.58682-0.2608 1.3693-0.5868 2.3473-0.978 0.97804-0.3913 1.7605-0.7825 2.3473-1.1737 0.65202-0.4564 1.3366-0.978 2.0539-1.5649 0.71722-0.652 1.3366-1.3367 1.8583-2.0539 12.128-17.475 18.518-26.668 19.17-27.581l-22.73-33.89c-0.97807-1.4996-2.8038-2.5755-5.4771-3.2276-2.6082-0.71716-5.1511-1.0758-7.6288-1.0759-0.13041 8e-5 -0.22821-0.39114-0.29341-1.1737-1e-5 -0.78236 0.0326-1.63 0.0978-2.5429 0.0652-0.91276 0.19561-1.5648 0.39122-1.9561 7.1724 0.65211 13.628 0.97813 19.365 0.97805"/>
- <path d="m319.89 820.39c2.832 2e-4 14.258-0.48808 34.277-1.4648 0.68351 0.78144 0.97648 2.1975 0.87891 4.248-8e-5 2.051-0.29305 3.467-0.87891 4.248-2.9298 1.9e-4 -6.9337 0.43964-12.012 1.3184-5.0782 0.87909-7.8126 2.0021-8.2031 3.3691-0.97663 3.1252-1.4649 10.352-1.4648 21.68v125.1c-6e-5 11.328 0.48822 18.555 1.4648 21.68 0.39056 1.3672 3.1249 2.4902 8.2031 3.3691 5.078 0.879 9.082 1.3184 12.012 1.3184 0.58586 0.7813 0.87883 2.1973 0.87891 4.248 0.0976 2.0508-0.1954 3.4668-0.87891 4.2481-20.02-0.9766-31.445-1.4649-34.277-1.4649-3.0274 0-14.551 0.4883-34.57 1.4649-0.68361-0.7813-1.0254-2.1973-1.0254-4.2481 0.0976-2.0507 0.43944-3.4667 1.0254-4.248 2.9297 0 6.9336-0.4394 12.012-1.3184 5.0781-0.8789 7.8125-2.0019 8.2031-3.3691 0.97653-3.125 1.4648-10.352 1.4648-21.68v-125.1c-3e-5 -11.328-0.48831-18.555-1.4648-21.68-0.39066-1.367-3.125-2.49-8.2031-3.3691-5.0781-0.87872-9.082-1.3182-12.012-1.3184-0.58595-0.78106-0.92775-2.1971-1.0254-4.248-2e-5 -2.0506 0.34178-3.4666 1.0254-4.248 20.019 0.97676 31.543 1.465 34.57 1.4648"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<linearGradient id="a" x1="73.425" x2="507.42" y1="868.27" y2="868.27" gradientTransform="matrix(.066589 0 0 .065952 -2.0502 -37.163)" gradientUnits="userSpaceOnUse">
+<stop stop-color="#b32222" offset="0"/>
+<stop stop-color="#2e7231" stop-opacity=".86275" offset=".5"/>
+<stop stop-color="#323aac" stop-opacity=".72549" offset="1"/>
+</linearGradient>
+</defs>
+<path d="m3.1803 33.222c0.4672-17.948 5.0836-5.422 10.04-10.721 0 0 2.7506-2.9654 3.7783-4.8302 1.0278-1.8648 2.1592-12.576 8.139-10.4 5.9331 2.1586 6.2601 25.874 6.2601 25.874z" fill="none" stroke="url(#a)" stroke-width="1.679"/>
+<g transform="matrix(.084762 0 0 .051812 -1.5175 -37.163)" font-family="Sans" font-size="399.31px" line-height="125%">
+<path d="m83.123 927.19c5.7378 9e-5 10.954 1.3042 15.649 3.9122 4.6946 2.543 8.4112 5.8684 11.15 9.9761 2.8037 4.1079 4.9228 8.4439 6.3573 13.008 1.4996 4.5643 2.2494 9.0307 2.2495 13.399-9e-5 6.1292-1.3694 12.128-4.1078 17.996-2.6734 5.8031-6.1618 10.824-10.465 15.062-4.3035 4.1731-9.2264 7.531-14.769 10.074-5.4772 2.5429-10.954 3.8144-16.431 3.8144-4.5643 0-9.1285-0.7173-13.693-2.1517-0.52166 0.652-0.78247 1.4996-0.78244 2.5429v18.974c-3.2e-5 7.5636 0.32598 12.389 0.97805 14.475 0.26078 0.9128 1.8909 1.6626 4.8903 2.2495 3.0645 0.5868 5.5423 0.8802 7.4332 0.8803 0.39118 0.5216 0.58678 1.467 0.58683 2.8363 0.06516 1.3692-0.13045 2.3147-0.58683 2.8364-13.367-0.6521-20.344-0.9781-20.93-0.9781-2.2821 0-4.4991 0.033-6.6508 0.098-2.0865 0.1304-4.4991 0.2934-7.2376 0.489-2.7386 0.1956-5.0207 0.326-6.8464 0.3913-0.45643-0.5217-0.68464-1.4672-0.68464-2.8364 0.0652-1.3693 0.29341-2.3147 0.68464-2.8363 1.8909-1e-4 4.336-0.2935 7.3354-0.8803 3.0646-0.5869 4.7272-1.3367 4.9881-2.2495 0.52161-1.6301 0.84763-6.4552 0.97805-14.475v-80.005c-1.7e-5 -5.2162-0.32604-8.6068-0.97805-10.172-0.39124-0.97798-1.6301-1.7604-3.7166-2.3473-2.0865-0.58676-3.847-0.91278-5.2815-0.97805-1.3693-0.13034-2.6081-0.19554-3.7166-0.19561-0.26082-0.26074-0.42383-1.0432-0.48903-2.3473-2e-6 -1.304 0.16301-2.2168 0.48903-2.7386 11.15-1.4996 20.474-4.2381 27.972-8.2156 0.45639 9e-5 0.91282 0.39131 1.3693 1.1737 0.5216 0.78253 0.78241 1.4346 0.78244 1.9561-3.3e-5 0.0653-0.22824 1.2716-0.68464 3.6188-0.45646 2.2822-0.68467 3.7493-0.68464 4.4012-3.2e-5 0.5217 0.13038 0.78252 0.39122 0.78244 0.13038 8e-5 0.32598-0.13033 0.58683-0.39122 3.0645-2.6081 6.9115-5.1184 11.541-7.531 4.6946-2.4124 8.8024-3.6187 12.323-3.6188m-8.4113 11.541c-3.7818 8e-5 -7.4658 0.91293-11.052 2.7386-3.5862 1.7606-5.3793 3.3906-5.3793 4.8903v46.947c-3.2e-5 4.5643 1.9561 8.0853 5.8683 10.563 3.9774 2.4777 8.0852 3.7166 12.323 3.7166 5.151 0 9.7153-1.6627 13.693-4.9881 4.0426-3.3253 7.0419-7.4332 8.9981-12.323 1.956-4.9554 2.9341-10.139 2.9342-15.551-8e-5 -11.215-2.6408-20.017-7.9222-26.407-5.2163-6.3899-11.704-9.5848-19.463-9.5849"/>
+<path d="m145.62 903.81c-1.8909-1.8908-2.8364-4.2055-2.8364-6.9442-1e-5 -2.7384 0.94544-5.0532 2.8364-6.9442 1.8909-1.8908 4.2056-2.8362 6.9442-2.8364 2.7385 1.2e-4 5.0532 0.94557 6.9442 2.8364 1.8909 1.891 2.8363 4.2058 2.8364 6.9442-4e-5 2.7387-0.94549 5.0534-2.8364 6.9442-1.8909 1.891-4.2057 2.8365-6.9442 2.8364-2.7386 1.1e-4 -5.0533-0.94534-6.9442-2.8364m15.942 45.479v40.883c-4e-5 7.5636 0.32598 12.389 0.97805 14.475 0.26078 0.9129 1.8909 1.6627 4.8903 2.2496 3.0645 0.5868 5.5423 0.8802 7.4332 0.8802 0.39118 0.5216 0.58679 1.4671 0.58684 2.8364 0.0651 1.3692-0.13046 2.3147-0.58684 2.8363-13.367-0.652-20.344-0.978-20.93-0.978-2.2822 0-4.4991 0.065-6.6508 0.1956-2.0865 0.065-4.4991 0.1956-7.2376 0.3912-2.7386 0.1956-5.0207 0.326-6.8464 0.3912-0.45643-0.5216-0.68465-1.4671-0.68464-2.8363 0.0652-1.3693 0.29341-2.3148 0.68464-2.8364 1.8909 0 4.336-0.2934 7.3354-0.8802 3.0646-0.5869 4.7272-1.3367 4.9881-2.2496 0.52161-1.63 0.84763-6.4551 0.97805-14.475v-36.384c-2e-5 -5.2162-0.32603-8.6068-0.97805-10.172-0.39124-0.97798-1.6301-1.7604-3.7166-2.3473-2.0865-0.58676-3.847-0.91278-5.2815-0.97805-1.3693-0.13034-2.6082-0.19554-3.7166-0.19561-0.26082-0.26074-0.42383-1.0432-0.48903-2.3473-1e-5 -1.304 0.163-2.2168 0.48903-2.7386 11.15-1.4996 20.474-4.2381 27.972-8.2156 0.45639 9e-5 0.91282 0.39131 1.3693 1.1737 0.52159 0.78253 0.7824 1.4346 0.78244 1.9561-0.91288 6.39-1.3693 10.693-1.3693 12.91v6.4551"/>
+<path d="m202.93 929.73c5.9987 8e-5 12.584-0.32594 19.757-0.97805 0.13036 0.65211 0.19556 1.6302 0.19561 2.9342-5e-5 1.3042-0.19566 2.217-0.58684 2.7386-5.2163 8e-5 -7.8244 1.1085-7.8244 3.3254-3e-5 0.4565 0.32598 1.2389 0.97806 2.3473l12.91 20.539c1.0432-1.6952 2.9015-4.4012 5.5749-8.1178 2.7385-3.7165 4.7924-6.7485 6.1617-9.0959 1.4344-2.3473 2.1517-4.1078 2.1517-5.2815-6e-5 -0.91277-0.55429-1.63-1.6627-2.1517-1.0433-0.58676-2.1518-0.94538-3.3254-1.0759-1.1737-0.19553-2.4452-0.32594-3.8144-0.39122-1.3693-0.0651-2.0866-0.0977-2.1517-0.0978-0.19566-0.13033-0.32607-1.0106-0.39122-2.6407-5e-5 -1.63 0.13035-2.6407 0.39122-3.032 1.8908 0.0653 4.0752 0.19569 6.553 0.39122 2.4777 0.19569 4.6946 0.3587 6.6508 0.48902 2.0212 0.0653 4.2056 0.0979 6.553 0.0978 5.8682 8e-5 11.085-0.32594 15.649-0.97805 0.13032 0.52171 0.16292 1.5976 0.0978 3.2276-9e-5 1.6302-0.0979 2.4452-0.29342 2.4451-8.1505 0.4565-13.171 1.891-15.062 4.3034-1.6302 2.2822-4.1079 5.7706-7.4332 10.465-3.3254 4.6295-6.064 8.4113-8.2156 11.345-2.0866 2.9342-3.3906 4.7273-3.9122 5.3793l23.473 34.819c3.2601 4.6947 8.2808 7.042 15.062 7.042 0.13032 0 0.19552 0.4238 0.19561 1.2715 0.0651 0.8476 0.0651 1.7279 0 2.6407-0.0653 0.9129-0.1957 1.4997-0.39122 1.7605-1.6954-0.065-3.7167-0.1956-6.0639-0.3912-2.3474-0.1956-4.4665-0.326-6.3573-0.3912-1.8258-0.1304-3.8145-0.1956-5.9661-0.1956-2.4778 0-4.8251 0.065-7.042 0.1956-2.217 0.065-4.7599 0.1956-7.6288 0.3912-2.8038 0.1956-5.1511 0.326-7.042 0.3912-0.26087-0.652-0.39128-1.7605-0.39122-3.3254 0.0651-1.5648 0.26076-2.3473 0.58683-2.3473 1.8908-0.1304 3.7165-0.489 5.4771-1.0758 1.8256-0.5869 2.7385-1.4019 2.7386-2.4452-6e-5 -0.2608-0.13047-0.652-0.39122-1.1736-6.7812-11.085-11.932-19.235-15.453-24.451-0.71729 1.0433-2.7386 4.01-6.0639 8.9003-3.2602 4.8251-5.9336 8.9003-8.02 12.226-0.78248 1.2389-1.1737 2.4777-1.1737 3.7166-3e-5 0.7824 0.26079 1.4671 0.78244 2.0539 0.5216 0.5216 1.3692 0.9454 2.5429 1.2715 1.2388 0.2608 2.1843 0.4564 2.8364 0.5868 0.71721 0.065 1.8909 0.163 3.521 0.2934 0.45639 0.065 0.81501 0.098 1.0759 0.098 0.13037 0 0.22818 0.4238 0.29342 1.2715 0.0652 0.7824 0.0652 1.6301 0 2.5429-0.0652 0.9129-0.22825 1.5323-0.48903 1.8583-1.8257-0.065-3.8796-0.1956-6.1617-0.3912-2.2822-0.1956-4.3687-0.326-6.2595-0.3912-1.8257-0.1304-3.8796-0.1956-6.1617-0.1956-2.2169 0-4.2708 0.065-6.1617 0.1956-1.8257 0.065-3.8796 0.1956-6.1617 0.3912s-4.3034 0.326-6.0639 0.3912c-0.19561-0.7824-0.26082-1.7931-0.19561-3.0319 0.1304-1.3041 0.32601-2.1844 0.58683-2.6408 0.26081-0.065 1.0432-0.1956 2.3473-0.3912s2.1517-0.326 2.5429-0.3912c0.45642-0.065 1.2715-0.1956 2.4451-0.3913 1.2389-0.2608 2.1191-0.489 2.6408-0.6846 0.58682-0.2608 1.3693-0.5868 2.3473-0.978 0.97804-0.3913 1.7605-0.7825 2.3473-1.1737 0.65202-0.4564 1.3366-0.978 2.0539-1.5649 0.71722-0.652 1.3366-1.3367 1.8583-2.0539 12.128-17.475 18.518-26.668 19.17-27.581l-22.73-33.89c-0.97807-1.4996-2.8038-2.5755-5.4771-3.2276-2.6082-0.71716-5.1511-1.0758-7.6288-1.0759-0.13041 8e-5 -0.22821-0.39114-0.29341-1.1737-1e-5 -0.78236 0.0326-1.63 0.0978-2.5429 0.0652-0.91276 0.19561-1.5648 0.39122-1.9561 7.1724 0.65211 13.628 0.97813 19.365 0.97805"/>
+<path d="m319.89 820.39c2.832 2e-4 14.258-0.48808 34.277-1.4648 0.68351 0.78144 0.97648 2.1975 0.87891 4.248-8e-5 2.051-0.29305 3.467-0.87891 4.248-2.9298 1.9e-4 -6.9337 0.43964-12.012 1.3184-5.0782 0.87909-7.8126 2.0021-8.2031 3.3691-0.97663 3.1252-1.4649 10.352-1.4648 21.68v125.1c-6e-5 11.328 0.48822 18.555 1.4648 21.68 0.39056 1.3672 3.1249 2.4902 8.2031 3.3691 5.078 0.879 9.082 1.3184 12.012 1.3184 0.58586 0.7813 0.87883 2.1973 0.87891 4.248 0.0976 2.0508-0.1954 3.4668-0.87891 4.2481-20.02-0.9766-31.445-1.4649-34.277-1.4649-3.0274 0-14.551 0.4883-34.57 1.4649-0.68361-0.7813-1.0254-2.1973-1.0254-4.2481 0.0976-2.0507 0.43944-3.4667 1.0254-4.248 2.9297 0 6.9336-0.4394 12.012-1.3184 5.0781-0.8789 7.8125-2.0019 8.2031-3.3691 0.97653-3.125 1.4648-10.352 1.4648-21.68v-125.1c-3e-5 -11.328-0.48831-18.555-1.4648-21.68-0.39066-1.367-3.125-2.49-8.2031-3.3691-5.0781-0.87872-9.082-1.3182-12.012-1.3184-0.58595-0.78106-0.92775-2.1971-1.0254-4.248-2e-5 -2.0506 0.34178-3.4666 1.0254-4.248 20.019 0.97676 31.543 1.465 34.57 1.4648"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/plot-roi-above.svg b/silx/resources/gui/icons/plot-roi-above.svg
index faf6f69..1a6fcfe 100644
--- a/silx/resources/gui/icons/plot-roi-above.svg
+++ b/silx/resources/gui/icons/plot-roi-above.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<path d="m5.27 24.857c1.462-0.169 1.631-3.713 2.25-4.838 0.45-0.787 0.787-0.619 1.519-0.844s0.9-0.506 1.125-1.294c0.281-1.181 0.169-2.362 0.225-3.6 0.112-1.744 1.744-0.731 2.7-1.969 1.069-1.35 1.294-3.656 1.913-5.231 0.281-0.675 0.675-1.8 1.35-1.237 0.337 0.337 0.675 1.519 0.899 1.969 0.619 1.575 1.125 3.318 1.576 4.95 0.393 1.631 0.787 3.263 1.35 4.837 0.225 0.731 0.338 1.406 1.125 1.182 0.675-0.169 0.899-4.063 1.574-4.063 0.899 0 1.406 5.582 1.688 6.257 0.563 1.182 1.078 4.186 1.353 2.9 0.882-4.121 2.028 1.4 2.647 1.345" fill="#a7a9ac" stroke="#000" stroke-miterlimit="10" stroke-width="1.2"/>
<path d="m1.029 25.321h21.412v-20.954h8.5303" fill-opacity="0" stroke="#f7941e" stroke-width="1px"/><rect x="22.372" y="4.4097" width="8.5303" height="21.412" fill="#f7931e" fill-opacity=".4"/></svg>
diff --git a/silx/resources/gui/icons/plot-roi-below.svg b/silx/resources/gui/icons/plot-roi-below.svg
index 363dca2..6d1edc5 100644
--- a/silx/resources/gui/icons/plot-roi-below.svg
+++ b/silx/resources/gui/icons/plot-roi-below.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<path d="m5.27 24.857c1.462-0.169 1.631-3.713 2.25-4.838 0.45-0.787 0.787-0.619 1.519-0.844s0.9-0.506 1.125-1.294c0.281-1.181 0.169-2.362 0.225-3.6 0.112-1.744 1.744-0.731 2.7-1.969 1.069-1.35 1.294-3.656 1.913-5.231 0.281-0.675 0.675-1.8 1.35-1.237 0.337 0.337 0.675 1.519 0.899 1.969 0.619 1.575 1.125 3.318 1.576 4.95 0.393 1.631 0.787 3.263 1.35 4.837 0.225 0.731 0.338 1.406 1.125 1.182 0.675-0.169 0.899-4.063 1.574-4.063 0.899 0 1.406 5.582 1.688 6.257 0.563 1.182 1.078 4.186 1.353 2.9 0.882-4.121 2.028 1.4 2.647 1.345" fill="#a7a9ac" stroke="#000" stroke-miterlimit="10" stroke-width="1.2"/>
<path d="m30.971 25.321h-21.412v-20.954h-8.5303" fill-opacity="0" stroke="#f7941e" stroke-width="1px"/><rect transform="scale(-1,1)" x="-9.6281" y="4.4097" width="8.5303" height="21.412" fill="#f7931e" fill-opacity=".4"/></svg>
diff --git a/silx/resources/gui/icons/plot-roi-between.svg b/silx/resources/gui/icons/plot-roi-between.svg
index 42d5dfe..bdd835d 100644
--- a/silx/resources/gui/icons/plot-roi-between.svg
+++ b/silx/resources/gui/icons/plot-roi-between.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<path d="m5.27 24.857c1.462-0.169 1.631-3.713 2.25-4.838 0.45-0.787 0.787-0.619 1.519-0.844s0.9-0.506 1.125-1.294c0.281-1.181 0.169-2.362 0.225-3.6 0.112-1.744 1.744-0.731 2.7-1.969 1.069-1.35 1.294-3.656 1.913-5.231 0.281-0.675 0.675-1.8 1.35-1.237 0.337 0.337 0.675 1.519 0.899 1.969 0.619 1.575 1.125 3.318 1.576 4.95 0.393 1.631 0.787 3.263 1.35 4.837 0.225 0.731 0.338 1.406 1.125 1.182 0.675-0.169 0.899-4.063 1.574-4.063 0.899 0 1.406 5.582 1.688 6.257 0.563 1.182 1.078 4.186 1.353 2.9 0.882-4.121 2.028 1.4 2.647 1.345" fill="#a7a9ac" stroke="#000" stroke-miterlimit="10" stroke-width="1.2"/>
<rect transform="scale(-1)" x="-22.5" y="-25.821" width="13" height="21.412" fill="#f7931e" fill-opacity=".4"/><path d="m30.971 25.321h-8.5303v-20.954h-12.881v20.954h-8.5303" fill-opacity="0" stroke="#f7941e" stroke-width="1px"/></svg>
diff --git a/silx/resources/gui/icons/plot-roi-reset.svg b/silx/resources/gui/icons/plot-roi-reset.svg
index 8d041c5..c398dfe 100644
--- a/silx/resources/gui/icons/plot-roi-reset.svg
+++ b/silx/resources/gui/icons/plot-roi-reset.svg
@@ -1,67 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3309"
- xml:space="preserve"><metadata
- id="metadata3331"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3329"><filter
- x="-0.14283186"
- y="-0.14518739"
- width="1.2856637"
- height="1.2903748"
- color-interpolation-filters="sRGB"
- id="filter5023"><feGaussianBlur
- id="feGaussianBlur5025"
- stdDeviation="1.2609376" /></filter></defs><path
- d="M 22.807,17.744 C 22.02,17.969 21.081,17.736 20.857,17.006 20.294,15.429 19.9,13.798 19.507,12.167 19.056,10.536 18.55,8.792 17.931,7.217 17.705,6.767 16.863,4.704 16.525,4.366 15.851,3.803 15.962,5.81 15.68,6.485 c -0.619,1.575 -1.117,3.731 -2.186,5.082 -0.957,1.237 -2.314,0.375 -2.426,2.119 -0.057,1.237 -0.758,2.17 -1.039,3.35 v 8.571 h 12.777 v -7.863 z"
- id="path3311"
- style="fill:#a7a9ac" /><path
- d="m 5.389,25.229 c 1.708,-0.537 1.918,-2.888 2.278,-4.363 0.386,-1.586 1.375,-1.263 2.348,-2.098 0.678,-0.582 0.898,-1.396 0.969,-2.284 0.063,-0.779 0.081,-1.548 0.085,-2.33 0.013,-2.141 0.784,-1.382 1.778,-1.905 0.839,-0.441 1.34,-1.112 1.686,-2.007 0.574,-1.485 0.863,-3.048 1.376,-4.552 0.617,-1.808 1.159,-0.028 1.492,0.791 0.468,1.155 0.808,2.366 1.158,3.56 0.599,2.042 1.023,4.128 1.629,6.169 0.226,0.76 0.399,1.967 1.168,2.417 1.522,0.893 1.89,-2.108 2.041,-2.796 0.111,-0.509 0.223,-1.024 0.429,-1.505 -0.134,0.312 0.268,1.145 0.358,1.515 0.271,1.118 0.422,2.269 0.601,3.404 0.247,1.579 0.629,3.881 1.618,5.138 0.134,0.171 0.374,0.144 0.545,0.07 0.898,-0.382 0.599,-2.526 1.461,-0.604 0.269,0.6 0.481,1.527 1.171,1.773 0.547,0.196 0.781,-0.674 0.238,-0.867 -0.831,-0.298 -0.735,-3.522 -2.242,-3.107 -0.778,0.214 -0.935,1.33 -1.087,1.967 0.32,-1.342 -0.453,-2.465 -0.71,-3.835 -0.275,-1.478 -0.17,-5.41 -1.672,-6.29 -1.451,-0.85 -1.849,3.332 -2.032,3.947 -0.624,-0.295 -0.964,-0.784 -1.019,-1.466 -0.179,-0.575 -0.343,-1.154 -0.494,-1.736 -0.318,-1.171 -0.565,-2.359 -0.883,-3.53 -0.537,-1.983 -1.024,-4.517 -2.137,-6.281 -1.597,-2.535 -2.773,1.821 -3.061,2.927 -0.283,1.084 -0.56,2.115 -1.059,3.128 -0.581,1.179 -1.765,0.985 -2.661,1.55 -0.985,0.621 -0.595,2.794 -0.617,3.685 -0.061,2.502 -2.243,2.114 -3.047,3.946 -0.503,1.146 -0.497,4.244 -1.949,4.701 -0.55,0.174 -0.314,1.043 0.241,0.868 z"
- id="path3313" /><line
- x1="9.3400002"
- x2="9.3400002"
- y1="5.7129998"
- y2="25.607"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line3315"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><line
- x1="23.322001"
- x2="23.322001"
- y1="5.7129998"
- y2="25.607"
- fill="none"
- stroke="#00A651"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line3317"
- style="fill:none;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /><path
- d="m 7.2674788,8.497352 -1.34375,1.34375 9.0625002,9.062502 -9.2500002,8.90625 1.34375,1.34375 9.2500002,-8.90625 9.09375,9.09375 1.34375,-1.34375 -9.0625,-9.0625 9.21875,-8.906252 -1.3125,-1.375 -9.25,8.937502 -9.0937502,-9.093752 z"
- id="line3323-5"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.89999998;marker:none;visibility:visible;display:inline;overflow:visible;filter:url(#filter5023);enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /><g
- id="g3321"
- style="fill:none;stroke:#ed1c24;stroke-width:1.89999998;stroke-miterlimit:10"><line
- x1="6.776"
- x2="26.271999"
- y1="7.994"
- y2="27.495001"
- id="line3323" /><line
- x1="26.455"
- x2="6.5929999"
- y1="8.1730003"
- y2="27.313999"
- id="line3325" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.14283" y="-.14519" width="1.2857" height="1.2904" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.2609376"/></filter></defs><path d="m22.807 17.744c-0.787 0.225-1.726-8e-3 -1.95-0.738-0.563-1.577-0.957-3.208-1.35-4.839-0.451-1.631-0.957-3.375-1.576-4.95-0.226-0.45-1.068-2.513-1.406-2.851-0.674-0.563-0.563 1.444-0.845 2.119-0.619 1.575-1.117 3.731-2.186 5.082-0.957 1.237-2.314 0.375-2.426 2.119-0.057 1.237-0.758 2.17-1.039 3.35v8.571h12.777v-7.863z" fill="#a7a9ac"/><path d="m5.389 25.229c1.708-0.537 1.918-2.888 2.278-4.363 0.386-1.586 1.375-1.263 2.348-2.098 0.678-0.582 0.898-1.396 0.969-2.284 0.063-0.779 0.081-1.548 0.085-2.33 0.013-2.141 0.784-1.382 1.778-1.905 0.839-0.441 1.34-1.112 1.686-2.007 0.574-1.485 0.863-3.048 1.376-4.552 0.617-1.808 1.159-0.028 1.492 0.791 0.468 1.155 0.808 2.366 1.158 3.56 0.599 2.042 1.023 4.128 1.629 6.169 0.226 0.76 0.399 1.967 1.168 2.417 1.522 0.893 1.89-2.108 2.041-2.796 0.111-0.509 0.223-1.024 0.429-1.505-0.134 0.312 0.268 1.145 0.358 1.515 0.271 1.118 0.422 2.269 0.601 3.404 0.247 1.579 0.629 3.881 1.618 5.138 0.134 0.171 0.374 0.144 0.545 0.07 0.898-0.382 0.599-2.526 1.461-0.604 0.269 0.6 0.481 1.527 1.171 1.773 0.547 0.196 0.781-0.674 0.238-0.867-0.831-0.298-0.735-3.522-2.242-3.107-0.778 0.214-0.935 1.33-1.087 1.967 0.32-1.342-0.453-2.465-0.71-3.835-0.275-1.478-0.17-5.41-1.672-6.29-1.451-0.85-1.849 3.332-2.032 3.947-0.624-0.295-0.964-0.784-1.019-1.466-0.179-0.575-0.343-1.154-0.494-1.736-0.318-1.171-0.565-2.359-0.883-3.53-0.537-1.983-1.024-4.517-2.137-6.281-1.597-2.535-2.773 1.821-3.061 2.927-0.283 1.084-0.56 2.115-1.059 3.128-0.581 1.179-1.765 0.985-2.661 1.55-0.985 0.621-0.595 2.794-0.617 3.685-0.061 2.502-2.243 2.114-3.047 3.946-0.503 1.146-0.497 4.244-1.949 4.701-0.55 0.174-0.314 1.043 0.241 0.868z"/><line x1="9.34" x2="9.34" y1="5.713" y2="25.607" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><line x1="23.322" x2="23.322" y1="5.713" y2="25.607" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/><path d="m7.2675 8.4974-1.3438 1.3438 9.0625 9.0625-9.25 8.9062 1.3438 1.3438 9.25-8.9062 9.0938 9.0938 1.3438-1.3438-9.0625-9.0625 9.2188-8.9063-1.3125-1.375-9.25 8.9375-9.0938-9.0938z" color="#000000" filter="url(#a)" style="block-progression:tb;text-indent:0;text-transform:none"/><g fill="none" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="1.9"><line x1="6.776" x2="26.272" y1="7.994" y2="27.495"/><line x1="26.455" x2="6.593" y1="8.173" y2="27.314"/></g></svg>
diff --git a/silx/resources/gui/icons/plot-roi.svg b/silx/resources/gui/icons/plot-roi.svg
index d73d4c5..6b8a549 100644
--- a/silx/resources/gui/icons/plot-roi.svg
+++ b/silx/resources/gui/icons/plot-roi.svg
@@ -1,52 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata18"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs16" /><path
- d="M 21.778,18.118 C 20.991,18.343 20.326,17.736 20.101,17.006 19.538,15.43 19.144,13.799 18.751,12.168 18.3,10.537 17.794,8.793 17.175,7.218 16.95,6.768 16.612,5.587 16.274,5.249 15.6,4.686 15.206,5.812 14.924,6.486 c -0.619,1.575 -0.844,3.881 -1.912,5.231 -0.957,1.237 -2.588,0.225 -2.7,1.969 -0.056,1.237 -0.273,2.386 -0.555,3.565 v 8.355 h 12.02 v -7.488 z"
- inkscape:connector-curvature="0"
- id="path4"
- style="fill:#a7a9ac" /><path
- d="m 5.27,24.857 c 1.462,-0.169 1.631,-3.713 2.25,-4.838 0.45,-0.787 0.787,-0.619 1.519,-0.844 0.732,-0.225 0.9,-0.506 1.125,-1.294 0.281,-1.181 0.169,-2.362 0.225,-3.6 0.112,-1.744 1.744,-0.731 2.7,-1.969 1.069,-1.35 1.294,-3.656 1.913,-5.231 0.281,-0.675 0.675,-1.8 1.35,-1.237 0.337,0.337 0.675,1.519 0.899,1.969 0.619,1.575 1.125,3.318 1.576,4.95 0.393,1.631 0.787,3.263 1.35,4.837 0.225,0.731 0.338,1.406 1.125,1.182 0.675,-0.169 0.899,-4.063 1.574,-4.063 0.899,0 1.406,5.582 1.688,6.257 0.563,1.182 1.078,4.186 1.353,2.9 0.882,-4.121 2.028,1.4 2.647,1.345"
- inkscape:connector-curvature="0"
- id="path6"
- style="fill:none;stroke:#000000;stroke-width:1.20000005;stroke-miterlimit:10" /><line
- x1="9.1499996"
- x2="9.1499996"
- y1="7.2129998"
- y2="25.607"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line8"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><line
- x1="22.482"
- x2="22.482"
- y1="7.2129998"
- y2="25.607"
- fill="none"
- stroke="#00A651"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line10"
- style="fill:none;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /><path
- d="M 9.758,25.607"
- inkscape:connector-curvature="0"
- id="path12"
- style="fill:none;stroke:#000000;stroke-width:1.20000005;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m21.778 18.118c-0.787 0.225-1.452-0.382-1.677-1.112-0.563-1.576-0.957-3.207-1.35-4.838-0.451-1.631-0.957-3.375-1.576-4.95-0.225-0.45-0.563-1.631-0.901-1.969-0.674-0.563-1.068 0.563-1.35 1.237-0.619 1.575-0.844 3.881-1.912 5.231-0.957 1.237-2.588 0.225-2.7 1.969-0.056 1.237-0.273 2.386-0.555 3.565v8.355h12.02v-7.488z" fill="#a7a9ac"/><path d="m5.27 24.857c1.462-0.169 1.631-3.713 2.25-4.838 0.45-0.787 0.787-0.619 1.519-0.844s0.9-0.506 1.125-1.294c0.281-1.181 0.169-2.362 0.225-3.6 0.112-1.744 1.744-0.731 2.7-1.969 1.069-1.35 1.294-3.656 1.913-5.231 0.281-0.675 0.675-1.8 1.35-1.237 0.337 0.337 0.675 1.519 0.899 1.969 0.619 1.575 1.125 3.318 1.576 4.95 0.393 1.631 0.787 3.263 1.35 4.837 0.225 0.731 0.338 1.406 1.125 1.182 0.675-0.169 0.899-4.063 1.574-4.063 0.899 0 1.406 5.582 1.688 6.257 0.563 1.182 1.078 4.186 1.353 2.9 0.882-4.121 2.028 1.4 2.647 1.345" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="1.2"/><line x1="9.15" x2="9.15" y1="7.213" y2="25.607" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><line x1="22.482" x2="22.482" y1="7.213" y2="25.607" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/><path d="m9.758 25.607" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width="1.2"/></svg>
diff --git a/silx/resources/gui/icons/plot-toggle-points.svg b/silx/resources/gui/icons/plot-toggle-points.svg
index 3f9a9b6..23fd107 100644
--- a/silx/resources/gui/icons/plot-toggle-points.svg
+++ b/silx/resources/gui/icons/plot-toggle-points.svg
@@ -1,52 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata20"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs18" /><line
- x1="8.1499996"
- x2="8.1499996"
- y1="7.2129998"
- y2="26.156"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><g
- id="g6"
- style="fill:none;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10"><line
- x1="15.651"
- x2="15.651"
- y1="7.2129998"
- y2="14.25"
- id="line8" /><rect
- width="4.5640001"
- height="4.7909999"
- x="13.369"
- y="14.542"
- id="rect10" /><line
- x1="15.651"
- x2="15.651"
- y1="19.118999"
- y2="26.156"
- id="line12" /></g><rect
- width="4.5630002"
- height="4.7909999"
- x="23.077999"
- y="14.542"
- id="rect14"
- style="fill:#00a651;stroke:#00a651;stroke-width:1.5;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="8.15" x2="8.15" y1="7.213" y2="26.156" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><g fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"><line x1="15.651" x2="15.651" y1="7.213" y2="14.25"/><rect x="13.369" y="14.542" width="4.564" height="4.791"/><line x1="15.651" x2="15.651" y1="19.119" y2="26.156"/></g><rect x="23.078" y="14.542" width="4.563" height="4.791" fill="#00a651" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.5"/></svg>
diff --git a/silx/resources/gui/icons/plot-widget.svg b/silx/resources/gui/icons/plot-widget.svg
index ab5d537..106c274 100644
--- a/silx/resources/gui/icons/plot-widget.svg
+++ b/silx/resources/gui/icons/plot-widget.svg
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'>
<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
- <path d="m19.316 30.985l-0.536-0.755c-0.222-0.291-0.361-0.509-0.528-0.749h-0.019c-0.123 0.24-0.272 0.458-0.457 0.749l-0.492 0.755h-1.532l1.716-2.11-1.655-2.062h1.541l0.519 0.761c0.176 0.255 0.309 0.458 0.449 0.694h0.018c0.142-0.267 0.255-0.452 0.404-0.694l0.502-0.761h1.531l-1.671 2.037 1.76 2.135h-1.55z"/>
+ <path d="m19.316 30.985-0.536-0.755c-0.222-0.291-0.361-0.509-0.528-0.749h-0.019c-0.123 0.24-0.272 0.458-0.457 0.749l-0.492 0.755h-1.532l1.716-2.11-1.655-2.062h1.541l0.519 0.761c0.176 0.255 0.309 0.458 0.449 0.694h0.018c0.142-0.267 0.255-0.452 0.404-0.694l0.502-0.761h1.531l-1.671 2.037 1.76 2.135h-1.55z"/>
<rect x="7.443" y="3.907" width="22.104" height="21.774" fill="#E6E7E8" stroke="#00A14B" stroke-miterlimit="10" stroke-width=".5"/>
<line x1="12.121" x2="12.121" y1="24.228" y2="25.445" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/>
<line x1="16.481" x2="16.481" y1="24.228" y2="25.445" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/>
diff --git a/silx/resources/gui/icons/plot-window-image.svg b/silx/resources/gui/icons/plot-window-image.svg
index c3dc0a8..5a42355 100644
--- a/silx/resources/gui/icons/plot-window-image.svg
+++ b/silx/resources/gui/icons/plot-window-image.svg
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g transform="translate(.27119 .40678)"><g transform="translate(-.91869 -2.2683)"><rect x="1.745" y="6.35" width="29.805" height="23.023" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".21"/><rect x="1.745" y="6.35" width="29.805" height="23.023" fill="#e6e7e8"/><rect x="1.745" y="6.466" width="29.805" height="3.083" fill="#FFF" stroke="#000" stroke-miterlimit="10" stroke-width=".2"/></g></g>
<rect x="1.7627" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><rect x="4.5008" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><rect x="7.239" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><rect x="9.9771" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><rect x="12.715" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><rect x="15.453" y="5.1525" width="2.0339" height="2.0339" fill="#c8c8c8"/><image x="7.8457" y="9.4196" width="16.309" height="17.161" overflow="visible" xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEE4wTjAAD/7AARRHVja3kAAQAEAAAAHgAA/+4AIUFkb2JlAGTAAAAAAQMA EAMCAwYAABm2AAA2EQAAW7r/2wCEABALCwsMCxAMDBAXDw0PFxsUEBAUGx8XFxcXFx8eFxoaGhoX Hh4jJSclIx4vLzMzLy9AQEBAQEBAQEBAQEBAQEABEQ8PERMRFRISFRQRFBEUGhQWFhQaJhoaHBoa JjAjHh4eHiMwKy4nJycuKzU1MDA1NUBAP0BAQEBAQEBAQEBAQP/CABEIAgkB5wMBIgACEQEDEQH/ xADVAAACAwEBAQAAAAAAAAAAAAAAAwIEBQEGBwEAAwEBAQEAAAAAAAAAAAAAAAIDBAEFBhAAAgIC AQEFCAICAgMBAAAAAQIAAxEEEiExExQFBhAgMCI1FjYHQDJBI1AVYEIzNBEAAQMCBAIEDQMDBAED BQEAAQARAiExQVESAxBhcZEiBCCB0TKSwhMzc7N0NQYwQEKhscFQUmIjNHIUBfDh8YJDFRIAAgEC BQMDAwIGAwEAAAAAAAERIQIQIDFBUWFxEjCBIkCRoTIDUGCxwVJy0UITYv/aAAwDAQACEQMRAAAA 97z5z4wPvJ8GA+8nwYD7yfBgPvJ8GA+8nwYD7yfBgPvJ8GA+8nwYD7yfBgPvJ8GA+8nwYD7yfBgP vJ8I4H3g+DAfeT4MB95PgwH3k+DAfeT4MB95PgwH3k+DAfeT4MB95PgwH3k+DAfeT4MB95PgwH3k +DAfeT4MB95PgwH3k+DAfej54Avxns/GHAAAAAAAAAAAAAAAAAAAOhyej6KcfO7GrzPkrcuxSWD5 /wB9g30+cA0bQAAAAAAAAAAAAAAAAAAAAAAAAAAAPbgHV+M9n4w4AAAAAAAAAAAAAAAAEtbi0NrZ nmyJfKcJHJCNEZA4tb1vPyGd7fye3ZUAppAAAAAAAAAAAAAAAAAAAAAAAAAA9uAdX4z2fjDgAAAA AAAAAAAAABa5rLJezVtQxWxLYDJwklZylybcGw4KW6vWKs+5m6Z57IQttoq9Fl9rRAdwm/hVOnTg wYWAoAAAAAAAAAAAAAB7cA6vxns/GHAAAAAAAAAAAAAJhqX61yOBzFPnNjoNjab+dhSLoPm64mc4 UI81kEO47o5Y6UY9TJPkuv3mXz9nVmnMlXrrMTw9b01H1M3mKuny9c7u5OkvP83KnKZx3kKAHAAA AAAD24B1fjPZ+MOAAAAAAAAAAAADVPObVlFiHnTem3J22Uzz2Z2Ep0epNPrSpMVoZi2xHT2cOuR7 wrCS2FLWvTtZLaXM6nHJr5UV6J8Yu3RU0NBF8KibfX83Pp6NHVtzKevkYvQAM4AAAAAB7cA6vxns /GHAAAAAAAAAAAAC1Vv8XWYh0fPfYrPlV7qkpWtRrr5Tq3LaimqOtJblcpHnIdrOElFuTrj027/n 9TLeziXKrYn8rddXTrWBbDOvlOjX2amnzUwqHr+dVw/RVO+hiGhRy6YgcYAAAD24B1fjPZ+MOAAA AAAAAAAAS6cvpt8ndamUcdudZ06TaqSXn2HUqcYvlEk4dfi5K7WcFIatlNeLuyM7HbR06bJ6WKUk z2Vo607mhSsRpbnX0YYhb4cxZar9Pd44yUtueGRso1P4stVcvtgC9AA9uAdX4z2fjDgAAAAAAAAD OhYlYrFb+rlJtqlcgs2qajMiMnokzpK0Irh1+wbRaq0KfaqGW7HN1O3PibTgo6xckNGHJjZ1WSXK NdVtySxcz3x8+4mUlx10d5q8pna7teLke81mNh+3pd3eUNTLz7wBW9uAdX4z2fjDgAAAAAADehaL lM51ieZ1psQhd9hTkSTFNnVra0J3tVkPLRsditoptUO2r2WVabLMld5oOV4NF7KzAFwl1HtlxdUY ssKRdNsV4ycJ47Lk25efXzdWlo86hLs9vlunQjoTUM5ulZeS9RgPuywMXp+3AOr8Z7PxhwAAAACf SVxjL5+WYNTNFE0RZb1vnebFTUnYfCN+yeudK2lT5y7ab19rxd1JpoMYmtJceovS4xT55WqLRrML EU18anh2xKpPnLIt6ZSwXI5YWWMhloI08vR5yZchq8t8ZtXtfju6Z0sL1FPXXxwxcPZ9uAdX4z2f jDgAAABZr6FEtN718PVPox5yHey0s7Biv27P0WW3nnymdnDqlfvbPUvUjYX20a7s52hXcWdlnNuG x1K3V52MWpeViL5pqpls6tZs+cnJqrU8zLlJ0c119Wcsr6LkVw0+xlr8x/a0lLE6zqDFkdkcXznu vHN6frgJb1+M9n4w4AAB0Ga2fpaMzBXZ5+p6qFeM6xLc0Y+gy2vlhfj283KE/WnywniUtLklKzr9 Q9FLvZlazgLpfjlO7dtS0pWRFi6RdZzrSabHVNTRKUZJxj6kly3xFiWKbuOTDlRv5uvy4Rdy/nQf Xedc6u6nXRlzSU/M+m8td/RgZfYX4z2fjDgABKLWLFutYplmvrM6JnOKVnfypo+13DijegRmbSCL NdA1nnGrRFypfS9KVLS7evUbF3FvS2iu1D366S2JoqMlWaL034revybOwj0YqSsqtynBth8YRZGu mSdScNXnLkttvOhCxHnYW6ca8vdqz2y54r1njG9H2wEPRX4z2fjDgAHXos05asJu8w8VZrzmqMoJ oLFd3Ox7I52y2oI87VbVle1lMfK2e5tV3darOTXSqzlVXwmzmvI1cvUZkSanlWV587OF7Mv8oxT2 TpRlbh3FxqraZOX0wnn0K0krBCJw2+T1qmkJHJK4txztPlmvujkYFmtX2PbgJZfjPZ+MOAAS0c2+ 87rKcmy3IdislLfyNVzi5XU2HVpDVrW5WZ29nRpG7n6PK9yNDP61hzay6cvTpaj0rqvVuaMzQoWa LaTY5PbVCdMyeP4RQ+11Oxs1GzS4IuShOFlK5KDI1tnnsVLtfPlKSOK+VSfO2p1npSS+9svjs70/ mNfo+3A5oX4z2fjDgAAAFqxSs35eYviYewi7NSHW843LxKVI6NS/G3aN/LVpWeqKJdT3eWMTfxEt T2sXUq7k2COvFhq0tGXlqlzt7XJ2J3qsdDmara7IzNZUuzUbPs4LbU6+aCZK0+dPhJ8iiUO8exLZ 0bGclvWTeRszUvGev8hp2e2ATevxns/GHAAAAC/T2SUe2mSxokxa9XcZJLNYmxG7FxnOhTde49nA 9JkSpR18jUrWzSvQz6PMvvZ22Gm/Mvw2xhcQrZlh1O+aDLwr9dTbPrHNnOC8/VX3LOWTf7NWZp5u rE2de5TFxkZzOKsQO07POPJjFwZrdflXYuNh2a3fY9uAtF+M9n4w4AABcOXr0ZR8tdiu85F0Iq1h qHztXv599NMHpZOtfSx9ZaaOdpIxVwJRl6C6zszUxa6mN6PKstPspX5dfjaefSJ0EqmTednWho9X YmIvxorPR4rqxyeXKe7ExMymKhaVWpza7StxVxFkrKVZiy1pSRqz9z4L9H2cRMo5be3AOL8Z7Pxh wACW5lbCZnEuJhjPnQIy5yj312zrGwjqXtyYyFcxyG0ptPzNTzbYtfZyNfE3+02bcSi9jvgS1MTZ G/Ttv4yriOSazCzyc/PasKGuOzCMZJm6OdDVm0K/J9xnZs4lDlitWauWXDRfX7NrZVajyrWa2meN VuZHqfR0wMmT24B1fjPZ+MAC0LftzjLzZ945ZJ6ufe2K1uqpJ9WzzR3vYJXTu4e1ktmc0cx3ltYz UpvY+n3DTz+jlW96xtPRJrlN1iXfN6fKGtNSSHx6m5mtZLmbaW2elZrGjOUb9Suad7H2F42UZQtG pcU067uyabJVXJURaWyqXBO6dTA3/O6vpoAZ8ftwDq/Gez8r1W6bF98+1XemMXOrvRKb+c7R6pw4 i2omaLSgVp6GY6d97Ns9ytSZUsWeW759+emhib2ScfZwtVu8sGTw1qc5k8q9nP0LdxdKi0dHmVa7 G71M1hPN0ajGfpUk1feZQs5+OiTnWv2caSWizXrJ8qVfSzayHb/drYV6jloAJn9uAdX5H13jDnpo UdOvmRbVsykl6JSZ9Z9fg5ldgqWiSjWplw5eqTWjtTPVF7lDUx+9vlW5x7L8DSmU+Xciy60aruLW v4em3LFNzuZqq70GXItJnSl6wl0JyS2KtRXbr3mm52vzugzOsza1HhOkM7QxvQWuQf6vsdVHJxbo RCOAAOe3AOr8Z7Pxhxm75688NlVqs+Flfjp9GUmy7xkVca0rk+cCEjreR7xLSVt4Wu5WmnM++lLP brW6HF1ClbWVWV/p3MhYruzrVSzyVnsZQfPp6WVobXfmaM5tjLkqKVZW86durCvLVe2xGRZoT7x2 Jepepvl0rW9rIWGHCAc4AB7cA6vxns/GHBqjp6BtLT0+YutozJZi9Ds3zutbN6L3VEafG8TitChP hOduaxxr3Fdrq8rXZZlI0q3HytDN1Ks90W5uZ2V6HGuzbNO8SsS5KDqzNVNFy79TtW0359qHHpbB HRUup0QrX8JerTq16jNOldivF/WZjcXmiATiAAAB7cA6vxns/GHAAHb/AJqdI+sPP3L4dGxj3+Iy EhUnna+YjScu/NcuLIpa5er3c8aWXt4bU0LtG8k3pdCNsHQy7ermo6tZy8jk69R+Y9+rHQ+0zPv5 5kWQXudG3maOaCZ94tvuQops51jJ19kDfS9tcm5ELrq8MeUA4gAAAAAHtwDq/Gez8YcAAAAJwOlu VLtTT0/NbXcm5TsJbzq+plaU+1qejUVrl/I1s3OYPosYeGlk3V5pc73NTLra2bpnZu4+hPltDlyp SzdvJ0qXsxve7kEtz8hQuVdMkXsRm7a+umxTVOi6iurVMZS108rhGIAswAAAAAAAPbgHV+M9n4w4 AAAAAAAAWqp3np+ZL74H6/mNtU0KNuh3P3TybkW16tiKcxoyg3dS3laeZuZenTdM6zQez7DMzTzk c+7UvPElDmn0dLV8zeln0MJ+TfTpNzW39G1ypQl2SwhnAOcAAAAAAAAAAAA9uAdX4z2fjDgAAAAA AAAAB3gBfod6vpVY5TLo3vM3V77B2Pffy6OXs+S5t9Df8h2dPeV81L46cM1vPV2tPDotH2GDmVzr 7Oac26EKQdegEQA5wAAAAAAAAAAAAAAAAAD24B1fjPZ+MOAAAAAAAAAAAAAAAAAAWHUTqNUA4Bw7 wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9uAdX4z2fjDgAAAAAAAAAAAAAAAAAAAAAAAAAAX5Bn DlBw7wAAAAAAAAAAAAAAAAAAAAAAAAAAPbgHV+M9n4w4AAAAAAAAAAAAAAAAAAAAAAAAE/UhYnUD tTYqAc8l6xQeYAOAAAAAAAAAAAAAAAAAAAAAAAAe3AO+4q7AGObAGObAGObAGObAGObAGObAGObA GObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObAGObA GObAGObAGObAFEvAf//aAAgBAgABBQD/AIp7Qoa52neHNVpJ/kswEe/MZjMnAMDSt+Q/js0cw9hP UnoDEJMTMyYrgmZHs4N/CMaMSYx6MclELFVVZmcoS3JryCdmsz/sHR6N98HjYRr5jazAfFPYYxj9 hHVK8xQAAZn2HstbkV1mIrqRAzYlFjoarOYBE2U4v8RuwxoVzOAmRDAfYJxltXWpSq8YekLzW2mR q9hGFpWxSpHw8SxeIMIhhmZmCBYFmQI4DQJOMcZjELFbrU/St8xAHDKVb4AGYMLLTmGNCYSScRes wBCwELEwCAH2Ex4yiLgFMSoZiEiWqbIylT7wGTgCMcAsTDGhGZhVBOYvU5ycTjCJ/gmFgAzmZYxi RKGIi2FSl4MRxLVDVe6Bk8QoJjnMJhMLZnImMAxHSBoCTAeohEyZgmFRDgR3xDYZSwInIg1vAxK+ 7WOrGMYTDLrwpLZXELjIMQZgwIwiZxORE5wkGMQI2TChJqUgwrEBleZYvuqOKu0JhM2LiqB3LDOG DGARV6qckDqexehjKckQ5jKxhDCFutTBgCJ1iysywDu/aoyWbozexlJndAw1okIJHQNYTlgFgGCD 1hg6gPCYTHLRrDFUMa1xD0gaVsJWAZaxA9qdh6wpMQ5hhEsbCjCqCGLdWHRc4Z+wHIEdevIicwYx IhAaVpgqOjewN1os6u3I+1cTBhHQn2GWNAeSuJWMAHkbG+RGzGBKg4M5GF1jKhh6RG+ZVBgwIMGF YymVZBPuochyBCYTGY5sbpX/AFJzLm4prmWgwNgq5MKgwsyzkDGZYwInImcMxB07J2hgYuc0jMYY 93nxjMTMwt1btAALNwr1363AkI3EqwdbExFeA8obBGUQvK3AjVEGkdG6QmKTknMVMylMRjk+0nEJ hh7GlkbGbx8lTcWOCLlKmizMJEsrKxLICHhGJgWEIQUOQMCEAhlxD0gaUEEleCe40/z/AI/ww6MM gt1YZly8WqsDIcOCprethYvIrGVWIcgnFiqnU18gFwC2CpyCxEPAwoRNX+2z/X3DD2wRhP8AFy4Z G5LdWHWp2qssXI5coC1bdLFYMC1YYVqVPFTElgxDEbELZjLiV5M16jz2D7RGXEIh9n+SJiOuQnyM y9b6eY1yZbVgrXzCqVLICK1AndYhWVnqy8gyGdRMgitcyrXJKKEFjcm9v9gVhEHtIjDMdOQr6grg vT1UchwwXQZ6rA0PY+YvSKcw4MZDMTSTkRgC2w+6h6ssK5hQzHtxMdSuCRkAdCuJzgjQ9qdVcEex TCoYBiIUzNJOKO2B7oigEFBCkKRkmIRCwE6ENkFXJZuxjK2yGhiNgkAx1i9JWMkajErqqsDhVssL H3ks4wOrTEIjCERh0fMTss7F/sw6OOtTAAjIdcEGL8yjM7ialPzGWWcVJJ+CCQRe0D8iRMdSOjrE EsSY6oSRYkWVnoy5HEg0oTF1TBShDFUZr4zE/EBxA2QCMkRlgXqyx68GtYyQ14auszw5IbWPIIKl F6xrsEnJ+ODg8xOQgQGOAIcGKqgLxLWJWIGVVFrAG1skkn+LyP8A5l//2gAIAQMAAQUA+Ln+a+wq l77GmCJRewb+S7hA97PAs4jJEZcTWv5j+PbZxFjlyogHTEIjrFqs5BbSFckzI/iXNllEUQCATEFY gSBBO7BHdPO7MKEBjYrG1QPFLlLVb4zdj/3URRAJiBYFgWKkVMnusLYcEgmFJsVHBLBtZxB2fEsP ykdVEAgEAgECxVgWIBkjpZXlu7ndZj14m1QpHdsDTsBVWxH+I7CY+ZYsUQCBYqwYEBMSi1pwKhlE K5JqCraMy0dLlwxJlNpSxWDD4BOI9kBLSwfMgiCAQCBZXWzyrSzEorrDuQbGTHGIgWWvmWAyxCZs qQWE+USjdrVK7EsX3icCyyA5Kdh6lFiiKpMVcTGFrArUOcNccK85ZdUUDumYtUsuRRLMTZUMGAhr Uw1tNElX96yzMdslFMPYqRRBEYiKMkKBFYCEHiQQa3UFq6or1JG2JZaxjjMcCbI6MckKCCCJr38L AQR7lrYVm6oMxRiBYq9MRYqwHEL4iBs0vmW8TYcCChWU6xjUsI6NHBjkiXNmN0IachHM0Liy+5ec njK0OQMxAIQPYuIDATMcR/6VS0ZU5xReoQMDGMseuWshlgE2hgEwdoIjgcdAHvPcs/sMAg5nWA4h eKYIg6VqSF+aN0SokqOszwd6VIIIJsJhKxwJYcTYbI/yROyO7A+Wr09rHAtbArbqG6PzKqThQYoi jJAxEOFTLWYBTTxGXiXIM17RwdVYW1kR4zkSx+l7dRB1hTIIwdesJX7bQxDViBVikAkkALmKPYk7 T2DVH+ywYms4DsAQVJhIB5OI17x3BlktsxLGyeyZxEYGOVM1bOdXuXIGQgEYUQYMGTFGPYvSUjLW zWYCHqCoQ134nysLFxCxWG0GO0d5sHM7fYhWEKRaoE8vBC+5dYFXvQIDyitkiAxRksJUYeoBKNXb mOJnjAWEN2Y+I5wWfpdbiO/IqIyjHQHnxhJtaqnul9rMFFjlmaJ1RexTBEh6hTgo2RYIrERLQwsE 7wrC+YXxHbpZZiWPmAIygkEYIauMpE8r0cM5y/t2G69rZ6VnovYkEUxTD0KtxnIMCeJ5TvDhzOWI 79GtyLHzFryCMHJIHIBbQZZ2o3d0e1mCguXmcOwxKzMxDAYDFaHqA05YhOQGxOUNkssj3gjmSWBD jssXMVYlgMsUSoNZZsjCexjgPaXCRoxyE/vnEVsENOUDRXhbrznONZDb0NwBtcwNCSDgsqvidGBU gt2otlh0NAVTafL+wjIsXhY4KswyK4ykEZZc9A+QHyEs6l8Rn6Ld1e3Ess6d4cljlutaYy/UAmZD QORCcipBZdTSAXtWpScn27FYZV5QAqWSY5ADi2ByHRslXtBRi/Na7PlfkCWYhckHtGMVYIxxYiMu PYBkBsTy+osQAqE5PuEZF2VZbWEFxBLqAGVxzQSxecNmYzLYmeJwRLoi9K24F+jAdMlS2GCsQXwR kgjWsMq0ATXWla22l/fuoFkbUsU2UuD140nq5IYE92vU1Ach/Zv62LlKjkWZDMA6qYwijIycKCV1 qTZZXXGVa1Z2b4WJs1DCdJd2Vt0XowPFn/t2rkgg8WsGYjYLLC3QE8vBO8XSXhVTXSouRZZabD8N lDBtchtmoiuoRwQWOQM8EboxGbFgboSeS0uy3a1itrafdxeAL2KpJJPx3QOo1SDbrEh+SHTQup0z O4tZ0oXjfo5OvppWQ5E7xoSSf4pqrMAAH/mH/9oACAEBAAEFAGtrQ+IoniKJ4iieIoniKJ4iieIo niKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4i ieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoniKJ4iieIoni KJ4iieIoniKJ4iieIoniKILK2H7N+rfyRW5hVh/wPo/8T/Zv1b+MlVjnU8i2b5r+QatQr16Flnl9 Ni7vp9TXbVZS/wDO9H/if7N+rfxACTp+S3Wjy7T1krHdklxlAEBCEsCs8/8ALy6/zvR/4n+zfq38 LGZRo33nT8rooNGv3q1V0rO7VAlLhnsYz5AOAzahdfNvLW1Lv5vo/wDE/wBm/Vv4KqWPl3lwI1qK aqqERyhDutaUE1PyFlhnIoCUsjrWV4NNmmu5N/TbWs/mej/xP9m/Vv4GtpNbKNStJVWlWuh5U669 6tXFLDSwe03WKpNSLY1hZwoCV5sHE2BidvWquFnk6A/9b5eardeytv5Po/8AE/2b9W+PqUd41STV p5WVoHsA72xcJKq+5ewbFxQ8K6q3JexVUFWWx6mjsiCzZrC37gEstseV1Wuadetl8x1DTb7K6nsa 3y7YrQgghSYKLDGosX+D6P8AxP8AZv1b4+pUESoEAIaiqd24r7k00tU7122lrsJqq+XvUTKx7FxZ vhJbt2Xl2Yh05FeYLBp5bQbX3tEEDyXvdg+S6dDiqmt6AS1/k77sT0zcg/6zaU2VlW2aEHsAJndv OJHxPR/4n+zfq3xqRmzXXKg5HM98isrhXay02WlreFWojrLbP9pdEBvXG1uFgzvZCuAQSeJxgiCs Zqt7pe9axNd3Vm8tFhPp/ZdqvK7VbU0hmwVVDdNHf7NHiE2vL9qp6fLmaJphY2uFVtZWF+nWQylT 8H0f+J/s36t8bWGbdfpXnlSxDl3a1rWdlTjVr6jnu1u7y5jWhazE2tkubHERQiOcTJyATCQJ2lzK CxNKYehmUi5glK18drzBddH277SFOUwxtoLK1PdOUOBrsZsJkFRN6nifg+j/AMT/AGb9W+NpjNus VWVkLrEBNVwi6tFiprai97OavaHCSx1rFl7OXdcJW9jsvGcCC2MlmadIzdGJMpznVrryzBGfaDGz zhljE7MZuoJaxQlavt1y24MNa5Fa6zlLVDS2t6zsKLKj2/A9H/if7N+rfG8u/wDvWqc6V5Coc01l 75aPnBt+VG/1tsokstdn5OY64ikVk2hQWtxg4JAPZHwByANZ66liE8wRtlTRQi2u9pJL1iG8VxUL RWEFZIv0lIQmtlRXltII2tfuzfWa3+B6P/E/2b9W+NqIK5WG4r0lfVUOF74KqO2GdipwSqqoA5Q9 HFebCUUXPiFsnoCMAO4jWARbJTaytXfgbOwbBzChmZoSqhWFYqQtKq1EyqgFMbNCEOttLHZvMdbr pd5TbcbfJ9lI6Mje96P/ABP9m/VvigEykEIhIRX+atgFDHC5EB+QiMQAWJUtxBUiHkrFiJxJhfrk Ze5BGszHsEFk17MxbMIXAgclrNhTBYBKQXNQ4zmFlQYnBxYgYbCFWSsMq1KJwE7tSfO9FGrIx73o /wDE/wBm/VviKhaV1BRWONVJDJnDJmJiKYGxMs8KZny4x89mS2yQIXXi1mQbQI1wJa6ZseJp2NE0 kU9yiiuw8XsMZiRzACdTVgBbAooQ22NTwCgEOol6BhTlbeBBnEzaQOm/rmm/3fR/4n+zfq3w0qLR EAi1M8qUmqhyjv1YHpV2g4OelVbBSMIhBFjjk9nJ9hnNb7QjbLGF2MTXteV6PVKEQdIWwMZD1FRg 5KmBJVViBgoqBaU28H8Ujxb65bcVPfCwWAkrZ8vMQ39W+dfMqeSn3fR/4n+zfq3wq68lEMSk4XjU ldvy05JJyZWcK6HAQIiEKLmBJuAcFrXd6aEdrWTiZXrc5XqqsCqJkQmNB1ZrOMa4sepgXMSvJawL EUsyWKIrqZWyAo4Bs16nFutZUVfM7wGwVlq+7MGu2bPLar0t9M6jTf8AJLdUe30f+J/s36t8GuvM qqJldQUOwRSjWKg+asdAOo6shXLZDLjjZcqy3ZOKENhGEBVSdmzuqqKnvlXFIXxFJIa4Amw4WwNK yFl5yKjyCrErllgWVVsxFRxVR1FAiVdUpAi14FidL6yjuA4r2rKgmzQ4NiCV2CMxE2MMvmOuKdj2 ej/xP9m/VvgVV8jXXk11gT/H97dl+IpTqoxD25ANQUnvAXe1mjMc6+jdabLe6CqOPSb5ZhqhE1yD ZZUgEsYmVvg235apw0yRLS01x1ULGZmKUgFFAiRMZLKALwWSyUkMlrAC5cwDi71ho1PU12CJdch8 XmW2qy+bjPt9H/if7N+re/VQ7iqoLKlBKiWEIlQCgku9YwB0jZVl+Z1qtuI1AIKUrVlFdj7lRqHE pbYzWrmOvKVDFfdYK4Ut0jDjY4QxURLFQENQGAoIiU4gAABEFiid/BaxIFrSqoqU13MSoqNtbAA/ JWB5A5PHM7gThDVLNcmecV2J7fSH4n+zfq3vVLzcYwtRLVKOQEduVltnSuvqsByVDM1VFevXQxa4 oc2IWiKLlNCJY7s0rpPeuoRA1bS5FEOwAUC2C6uWUKKwp4kFZXY9bLYrKb6xDsCd8TOZMVLGiVAF ABK1yauAinoB0sUY2KzUxLCcCGr6nOIygxVjJN7TXYq2KHotnpD8T/Zv1b3terJprACgytOj28Tz MweQPEA9F7NXStsHBWmrQGgKoC65z8/Axqzg2ICna9iVvs35FJAdLTlDyl1aslaQ15lRCsacw6qz uuMHIRWeK7wMpilJVVyNdFkRbli2KA5BmyMgEmV45jEDdemVmRGXr555ebEnpD8T/Zv1b3VGW1kO UHyjrLLAqAGxmYEqITFQmeW+XvtW2a9devvUIi6aNWnQtwzbrUd4bqeTuLCtdYZdizuq77BbFoZ4 +uqLUjBaWlzMUofiWOJf0FLc68TiJ3YMNAM7pgErJZaWjIVlQYSq68S3ZXC3Fhf/AFfoxIBziJYI LhlWYghoc5sAdfMNc6+16Q/E/wBm/VvdpXJ1UCqOzmFnBrpsuoCL7EQCeW6Dbdutq1alNtPKrzBc X5PEKYmsAMWLXXYwjMUnehQ/LZL91TASZef9Vf8A8KhkJ1F4C2swWWgNXpn/AFwQQQARFERTBWrK KThFIjVq6WrZQ7WMwfqCxMFQwmvXhK0EXiInYyK0vQLPP1HP0h+J/s36t7gGTSoyvY9hJChRbezR VgXArrLGrRLJ5N3dKnDTY2tfXrs202dixiAjOtdW5W4rde7e6vu0tayXjL1qvDePzUEqNo5rT/8A PURFPXZQEIoKsvCU28GXYBhcRSCBOarBsosXcbK23NE2Biviw49L0BDKUYJ0esGKxQps1Kq3VtEy SGxG6TaPyedWcn9Ifif7N+re5WOuuMvzM5LUCzNFXMAJldJY6wqrniq8jdVYPUIpK3vttwoECM1T bAd7uDPRc5Ka4rN2yBZkMKHPebY57FaYNyqVobKIcBTCvMFTW1RBNuspndgTushUuris7nw9hNeq TE1eMFFma6GWVumGsFcucEOMwtiYzHr5BahWAFAXGC2ItuZu47rdu7270h+J/s36t7iDC66MYSqD unLGtFZgJ34SFzBfkNccE2ONfXUtqtQK9huld1oTWZWXeVDTQQrbl/d62srWMUQoHIuoIe5Pna/I lTDvmRkZexDibCEhXZTWwsSynMKlYrYliqYhKivYiXDFZBgCkd3LlYOGxGPyntTqMZhEeoEh7ki7 GZynmNvHUPb6Q/E/2b9W9oGSB1RuKalAc2KRLCALHEqqFsagqadNXR6EqNaZKAheYAtvLHy6h9kF q6EDtY5HF/ML806qBavl4bKqi67kHXGBegyuBeyh1NfGKwnTF1KzTsw2I1YYNQQcMpCrmtVMXWtz TeQ9bgw2KFv+YMwIL8yCCUAEBzCMwCMsKdRYUnnO3imekPxP9m/Vvan9qhlqaS8rrJhRs7NTA9yc MhVldga77eBJYJ1At4l7CZrU8zoDhd5m5bZo1wiXa3JtwAHXMvPFdq9mmpQXqodeV6ZFy8LqzlGX IxGRljWZWscbkvBiupgAMahWjazCAEGnmsauu6MtuuUdSLW62kg8uAp4mDoQfYMYKxq5chxvO7bM 9Ifif7N+re1P7UUjCvxg2MTxkOwbC7vh0cEqAtaMSxMDLipX2b7VorV9XuqdE8Gc8/MEyKzx4Wty s1FGNniy7C4OgmNa6gMWsdBsp1qGKyOliHPPEYB53Fbw0XrA9iSvZbFW1k1bOu0NWu4FJAVMi5YH am13BjkGFwSDwQWKYD1BgMHYRLUBXzug1bc9Ifif7N+re1Thq92vAuV4nVv9cV1rgyxsqQRc2PyU BVBBRmGvV3CadQCkKtdX9TlNh2+W+zFeqhu2L9fuy5DzfA5a9fGh0M2lzW7qV1LCEBBjYloHLiAG oLiu1lKqjjwteG1kUqiMK9VJUCAADLlYtfVmHva4qM8KqjdDGVWATarivYQrEEWIAbVyHVp6h1ed E9Ifif7N+re7X1Wty1YtOKmrNdbZeyxWlfI1q/CVUWWONUJL+PHT124bueFXFa3XndW2RuWjj5Nr nF6cltZqrWAu2VACYytiZGxplDxdBTaJkMGq5Tw7KFOI9KXKnfLKbQwRg87hTErZIKAQtprZzkWk 5JzMxhkI7I9Q+ZVJgUGcFw1CGGgANlDugW6p6H0h+J/s36t7tNhVkjqDMrGQmV67YCECisvZWyJZ eNi2ynTuF1NpVrMcFORr657s2AWtWb9mhFrSwZXerOaGUPVbyAjqMOAwblSWpYRL+LV3K0UAhtcE AcJWjBrPLbHbvXpsrOYi8h/UbAAlNwdLWyQwPsAllfIITWKn+VXwVYH2ES5Mru2CvVPb6Q/E/wBm /VvdHSaczZae4USmrkH+WV1WXNZQKqdWhFRC1VjbIaXfK+wf9OhQdu+1AK9wFWorDSvsI5LtUCxb qCr0XZWm0MoAItrKl6xYlZbXts1arlam6mUbBBq2UaGuuwdyympiG2aE2aq7bdK1MEHs2UBC2tRY 1yEVKcAEzEKyyoMFFlZCFgpZYtsyDL3wPO9v/XPSH4n+zfq3u1Uva2vpLVWtQKpTWpuVVNVNtkFY rmz/APm17AEsGS+XW8cqtnLaflGv3Gu4yNqhQxXw9tFgMUZV0nmNC8O7yaLg0pfI4hgyFTsa4uSu x9dq3SxTo1OW0rUlJVDWVsHcwDE26EtSjYGvYLcizDC9A5orXkpGOkHZ/hhDAxU8gwPIFbHE37+F e+zNsT0h+J/s36t7vl2uKqnGVUyvrNlcGpvlc5UIr0654wgNWHwzlRTZaq1eW2NZrlQRvVgoireu pcM67hgy9L6hYrVmu16hKtjDU3K0asMChU7Woty1WNrvW8VyIa0clW1mS+l06GWYI3qGD697EMSQ crLtgo2rsd5AwwpgxCsZIQfZyBHeKJt3d6+03K6ekPxP9m/Vvc09M2MighDP6vV27OM67fIx6VHK kENQcoFHN6+9rasmaVkHUbFXNHVqbbdfB09gEVPyFiTeoKihl5X6oaV3Oj6u0GjVq4FfE3atewjG zSspZWCcWigY2EbTsqvS1Xfo/wA0tpQxU5KahG1w6mm3XOtso6qwimDrCIUjJiWgg3XF3vYJXY3J 56P/ABP9m/VvbWvJ614Svtzh7R81ZmwfmX5WJDGg9OJddZsoF+dlYJQw5atndtr2h1Zcr5hRxegs Vas0W62zxKkOttXKbevXS2rfyWzWquWyqzWbU2BhSlwC8ZdrV2qDZqW1FXVWE2eNiVbL61xsDBn4 hByCgTgZaCrLw5W6OSll+u1V1bBbIGBEYTY6BR18xt41+z0f+J/s36t7dCvneR1rGZeONjAFEE2h H6AHC0nBB430MUvoTmbayJsZS+3IOpeCynK7OuLq1pbXe2tLAU8O+ptjLjlNiiu2tkfXtotDovAx tKpwLGUqVccZuaTONPaNdxaF8jfFZXT3GAsvJiDCqnUqMXVkgsKq6beYdBYF0UyaLqorsItwMPWb P9F6zzG0td7PR/4n+zfq3t09fuqT/Ws9NkfLX1Soxk51/wBqqjkVgiX/ACtb0GjYAHXI3td2lDiy usmi3Su5B68zzXXdU0djrwqslupbqHW22xxLjc02uldlmtYpBCYJ2Nbv69a9lHeAgsTPMdXkurvF wWIm4oep6yqagGVGYvSZ6MOl1eH7nlE6RWBGMx6wY6cItuJtHFIGBtNy2PZ6P/E/2b9W9mlqvbZa o7mvqKxiWKbKa2zB8rq3Q/JZW3ErLMW1VWc11LTW9bCyvYq5IU7u9lDDWtsrOtsC1L6UddzXs17d XZW2uq7Iu1zS1N3Etgjf0RaKNxddlsES448yXguretlBsODaDL9NbDX3oDVM67aqiadvFk6BevsP YwgypYAhWxEsBh6ywdMibtuamOK7Tmz2ej/xP9m/Vh1lGgwFahQqh66Tg/8Ash+UfK5GRX1myvFj 2VuSFJByUsKkjQ2MzkGXdrCjWsF4evmNXeau5XWxNulLq7Km17qrVtWq0zYazWmvtJZWbOM3tSu1 NHZDFHKm097Xr7LauwL1sUtFMyBMTdrxddQ1bat4srQrMztjLGBEB6WDELlTXd0ssAW69ASTYd68 VUn2+j/xP9m/VtFFe9k51UkkUNLUNVwOQhGNqoLK25JWemyHYVuCO6YmliVu6pVZ1UtTZrXhlvqS 1WPg7+eWvq75dDzBqyzch5l3inQ3gl4tKs1qvXbdbrW13iysv8u/rGp9XaW6ougm7RW1mtsmphsg lXJirmFOm1XlLGudKrbKX19hbVV8xW65BjpOOAOkuyDXaJu7pMUOzE4HmV3N/b6P/E/2b9W1rO7t 1bAy2Kaba263J3tdLgxTg2sWrqbiwJDNkhkNbIcr3hRsh1q+V6wrDlbpvVaLa96hXSmwoa7QrbaL jR2Q6WqjrveXhJp71oCWnlvqttHl22VfvGMJVlbSZGCW4uLd1ZgDX4musZiLiGWDMsoXC1pGR9d6 NhLQrwGdDDHnmOwak7+14oidu1sLWjuXb2+j/wAT/Zv1aeW7OQ6d4iEg1uJsVmtltDBHBGwjIyPy VbOlwNgVjFbIqbiz4BRxhXDprXtVYzBh5hWyNRd3ldbhlvLal9e13lbOGF9VlNtGwlq94rBw1N6X CxA4MVgQWLR6w67KMraDEhSAQRjMbEsSOpVlC2JZqtW1e1graYrCMY88xPO1MqQs2NhaRde9p9z0 f+J/s36tKLDXZq35GxQVgbEUhgyNS1dmISHUE1vygfpYOLocHlhyWEFzUtVbk7ANb621zr2UF9Vb HXsRwZu4eny7YwweWYdW1LFNRcHc+cVFAlbFSrklRGE3K2LVWFLkw0UGdkODDLlytdprZHzLtVbQ ve0GuziQQwvcKHY2WhRh/kS+1rLPd9H/AIn+zfq3s0bXMq3qnqtVQVs4nkjqWKOlsuXvERyQj5jD mtZzLADEPIWKSKrCZezPVq391bW5m3SGmvdwmRYndpW1W0rLW6tFhAwHFuztV91cg5CrkIrEwzaT lWwYHStJFbTtAWMsZci+oiU2uJU/INWrq6mo1XMp8w2AIq9B0Hmexwo970f+J/s36t7Naw1XCut4 lSCNq1tLNa+lu6Ngs1rqol/WxDC+GSwYsJVhcCKLClw42K9ViMlgK2qVfV2QwQ1MH0qLINQLNujE UrzpVUVfmIQcdjVMtdy+uVaupMFR0jLkXUspXmrUbIuFdoysPYwj4zdVwlWwymrZDje2VzZtAKtj 2WgTZ2UpW+97n970f+J/s36t7fLbxajICgURkBSqsMhpHK6pQ1dOFuor4mtllaEqdRMtT1o2HEqc Ovg6nO1pmsqAF11ZYrExU6by5qU/7KwMovsuQshq60MENWDF7MQiX18hYhVipSU7NdkrtUzMY9Cg 5bJ+V7XrsG7dz45IQCVDFmzvV1C657W9/wBH/if7N+re3VvNFtWwliVv8psWa7/M6Ai2lDXSpKtX 02U4yoR6pcgmtUQddZXXNusyyxjZWcioQCbK5qcogpPOmo9JacJcuHYkPVcCKrFZRDMEzaTB1bQS +mlgpD1213JxFiPLGKjd2CgUZncCceJvdKqrNwgFix+B6P8AxP8AZv1b3K7bKzR5rdXE8yRxXvIr p5jQ4dhbXqkEWnA2xxmsymt1U17GOWmzGygZYdJtjNTgk0nNdJyBLeq7AK2aOwhNRwwlg+WylXS6 ooyOa5r3gFWBBh7L6Q6n/VZTs9Le4JtZsq11VzX8qmu8RYAYICs8y2hY/wAL0f8Aif7N+re8lhQr sBp3qTT2hS+pYoezsvWvFI4QfNXsqvdrlbNdsOvUWAFbk42aTHGu2YsYTb1U7161qei3ktb8g+Cp E3qspghkbidW/wCY4wTHPTYpBlNlWa0paeY7NXe62wOe9sm2vUOG7J3igbe+ioTk/C9H/if7N+rf AyYrsp1bMEOHRguXb/ZqnlXcAC6fNQ5MoPIMMTdqK3DlW9GyjMhBDLL0513DKUWMjU2AMeo49bKw VtTgQ6sFfkNXY71D0jsSb3VRZ/sdA7LwCOqgzbsSulNtKw+7c5a6xvi+j/xP9m/VvhauyVai/wCR 7Y1i50HBGyArbDDNfR9GzKHqNtAU2usSgFdG8WV5BBAm7Xwap5WWmtaLFYQ447VbMrNwdLuDa+13 brYti32d3N/c52V4ZV7bUPN9iuiu+97n+P6P/E/2b9W+EOk1tzAbaWW7Kg+V7Kuu23KXEFKnyunY FsXJFgyuwOmrcoldgpvBBBww3agay/B1t5DVvUWBgwtBUWW4W+8bNgSwxCdd6vMFAuvd5fsK9te8 laVeY1l9vzMuWdnP8D0f+J/s36t8TJ9nlm0ambYNgY5lVwD1PmU2gqSGG+nB+97uxb1sr0dwNCy5 tORv2it6dliNezrRYCXvRB5tvh1ovVWG7WDbvq617q1C/asuP8X0f+J/s36t8YEgpu3IG37mAscN reYMH1NkCLYCN7Yorpvva2xNu9B46/Oj5jWdbd89pVLbXtfV2moYeaUtW3mOzk+Y7JV3Zz/K9H/i f7N+rfw6t7YqH/cbeLti68+3JH/Bej/xP9m/Vv8Am/R/4n+zfq3/ADfo/wDE/wBm/Vv5b+SeZV61 nkHmlext6mxp7GDCrD+Z6P8AxP8AZv1b+XZt+XhE2NTXq3X17vUXd+W6NreYal+r/L9H/if7N+rf yaDULhu+gZ430BPG+gJX5j6Eqst8x9CXWeN9ATa2/RDa38r0f+J73knlXmNn2l6bn2l6bn2l6bn2 l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l 6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6 bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6b n2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bn2l6bmt5N5Xqa//ADv/2gAIAQICBj8A /hU6lKFPuRdv9W+ENS+iKNPk0pyiSHr9RCNdKjjXXsUdIqxqkL8kxQ37PDUjCJwmH9JHOrJa/S6I TamdjQ0rj5J0PldCKXpvueNlYF5qU/Zk2RU/USnP0C7wOdLX9xuKv8H983iNW/Gasovlu8EyZ9sJ X/b12SVwqaZJI5w/uUwkpqtCq9RTv6WuWN3kdr3Ha9vSoLLONMtChMFUTbimtdyGozwQsK5JZIhr ZZqY1woVNRv/ABzQUq8IxcbGop1tG2TBTJphUoaYQ8jtnXNL2yq1av8ABKwjgqTsQUzamv4Ihe2b yXo3O2rJU3XO6XyWpqsFBqNyGRtj3wnJycFdcrfpTbbV74JCSWokN9MsPCmGmXXBW++R53Gp5PW4 T4wrgnhQlY0OHxjHoVzTshplq6DbPJC6sSdTthJSvQqjddil3l3wT3IKmq9ThEWkcELY8V/2IF0x lYSisLqSjqK5Y0yLNXBDncRc1rMIck4Th1RKpcRcibGRceDra/wcohkL15EUwjZ6EkckM8rSVRop +rdYQ6XLTrgk8Iytvj0vyQf7Ekboh6kbPQh/qRDquCbaMnRo8rdVqSK5Ku53woRcUf3KC7i9LsSR wdSLthX278Hj+4lOz2ZT2PK3XdCa2FetyUSvsRkhkogQl6bTK6ErTY8rV8lqjxIjsQ1Fy/JKozyW jHa9HhXNBRYN54y9UeLJPK3c8bqwJ8E8lCqyakOjxqUUDtXOWCV6EokgkhojpOeUQ6kobe43nnPX CjIwoVy6YQhNqJKuSux0zxsU9FE5oIdSSXtg/wAFfRlFVJpGZ5YIIeEtpEboSWxQr9NTCURFRf5C qPxJf0E5aktnyohO1yQlLZCJkl/Ta/zl/9oACAEDAgY/AP4VFvyZVwuLSfJz3qKy9ynu+fqpZC+K ZMdyqfQmZfDRC/B4XfqX5+ooVZphTU1qQo9ibZT5FP7jUcHi1HX6aMaETGXQoyqNSY8rfyS2aFPW Y+6F6M5G0iI9zxmr9Zrk1n0tCcakpVKXIj9y5Sj4tP1Ehr0KVJ8YIuxkpg4wVyemorlv6XA420E1 xmoTeyiIW5Drdh5XaHTGpU1SFbfP2PKxys84SyftkoQMsardcqkv7Et+wnrgm68JE3UWyxphDqaw QqojZ540WEckLJTcRDZD2J1Go6lVT+gm7kpPjUosKvBtYTgvITW+Zjb0zSUOp5RoKaCJWwrkpkob 5GUyf+d2ttV2ywV32Je2izyTqyeUW/6o/wBToxWvYawqymDawqUORNbTlZyyizSyRW9cE+KYRseV m5q00NXNv3NcWRkvvfOVpOOok2QnHU+Lh8lXXJGFNimxfayhDUEXPR5K4QTjDElvXIvEqiltSCN3 lSPFlz4Q3aP/AOsH0Ifx6lGVNIwh5K0NS3m34v2y+S1WpT8Et+w8svYkfXCVuRcSmVKVzo0JL+Jy w3+rYoeTdOBRp6PRnjdoTa6EXIoTmqUcotstUu5xB4PVa98ksd2C6YTmklEPCHph0weEL43fhkOk Ywf+9+36V/cufLeRW9BrBdfR6Eoh4RjBLIIfy/qTDgh0F3OrtSyNvY83yJ9RofSuHbLBTCMZw7sh 4zuiGSWWazcixYt8Db22LrcFcvcRDoQR6Eld8IQqGq8rdP8AghqHg8FZbWTzurd/Qj/GmLXI09GK 5HktGOx76dzsTutTqiTsRhKIbwTWjKOCdSeHjEldeSpIrXoUUCSrdBL3yTweNyOjJROj3OjIe5DE U7o8lqtS61z0KlTxffFpjTxlFDoXfuNa0Q7nsiXljk8W2crqdOBXKk4RdseVuqIuVVuhLdfcoJi7 FRyp4HGjwk67EXYzbRMXk55NrbUQqW5+GUUroT4sc84+xLHimq74ewo1RDwdu+xDNUVXxt1Ig8ud Cvpu5bnYVxHJGHmtMImh0eDtJwoJpxOqZ4V7itT6vkomyXSNF6kMdBOBE8EkrYgROzIeqFGwm1rs Rba3Ir/3P1bIVUPx+XUl/QO17lIJVSIlDlQuRw0uDxVujFbd9ybLlXk87353bcI0WEv6aXba/YhU /nH/2gAIAQEBBj8Aac4xORIC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0 gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC 97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3 sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IL3sPSC97D0gvew 9IL3sPSC97D0gvew9IL3sPSC97D0gvew9IIyjOJiLkEEBd0+n9ef7qkSqgj/AEH8g+Fu/Imu6fT+ vP8AbtGJPQgZdiPNDUdUsytMdq2LBe7jVGezSWSMNwNIfv8A8g+Fu/Imu6fT+vP9qwDlDc3exDmm EY9m/Mo6SBEUotMWJTzublPGVBcCy7JBicF/7iAaUR2hmM/3/wCQfC3fkTXdPp/Xn+zogwYZoGch KaLyMYiy9lGuZWmIAfBajXJaRGuKYsOSZ6FGE46hbxIyjXalUH99+QfC3fkTXdPp/Xn+yaIco7m4 HOAWoxAkylMgACyO2P6Jo+dLFe0mXawWmMdXNAzDZrVpcDkqUOBCMtTtgpRnFhIMxzRasDY/vfyD 4W78ia7p9P68/wBi8qRTxFqLUD2hVCRoSHKlVojJaNsVNyhPdm7VAAWnbAIP8lZ2uy80iPNNY5IF qlPA9IWDIwmHH9k8dxo5FMN2XtWu1HRDOBj+6/IPhbvyJrun0/rz/YapWFkIgIx5OUduVoI7TtEB 3CGzCj2RnuFyck0Rph/uKYdohGe4Gew4CUgtIr0KzdKJDya5FgiIY4lUfxLIC5KZ9R6KIyjFonjp iKrW2qP/ABTEMqKgVR+x/IPhbvyJrun0/rz/AGERjcrUcaBREfO3MUdsedKrpnec8V7Xek8sBkno NsF0IxiZHlVSluAxBNAVpAJlkEJTHWiRYIiO0/MKoaAyxTC2SqERCLDMrtF00uxEYrTOsDYobUaP c8lp3JmUhnQIjbs90IyxwR9ntiLfyNHTiVRyRA0kjCxKMN0GJGBotUOrhQKyt+p+QfC3fkTXdPp/ Xn+vEc0+ChL+IKEibCi9tuG/mqO5uUhG3NDSGjmhEAyLYIy3AxOCAjdVuiSKYIxjSOLIwjbEoABW 8ap1rmnKcFGtTmh2iJ4EL2re0matJe0EIxeulCW4wMcAtc+hlVgFqidX/EIwlEEYOiDEmGElqmEw CcpyKI6KFMbj9L8g+Fu/Imu6fT+vP9cJhchDbiLVJyUIxFAXJ6FGDNCPnHPktO3FwRfBDVUsjOdB g6EduoFynYA5rVI9nAJolgmv/koAiprLpTgeNVGrlZPLqCdVsmCYWxTs5QBOCAHnSoCiJ+cDUIs0 GwFSjOZ86wOSJPBtLqo7JXYDp5ogUAXNawL3/S/IPhbvyJrun0/rz/YF8ApnGSjXt/5Wo0k1OlDW aspSn7vAFeziHiBXJadoVN1qn2pnNHUehc0CzAVCzkqjUcBkmAtdNYclbgyGCBlJzkgbrECNQmBq 9c0NydICrZlUKEY1zTyYHNNB5dAR1QLc1pNYnzU0VzTkUzUgen9L8g+Fu/Imu6fT+vP9dzYBQ6CZ KZPmxNFKZ/jZapGkbdKlqqAWRANBkqDSMURCslVNH+qEXqUYxpICpVO1LNEmhKZ73QATCp/sqlyq DxrUShpNk6MoiyO5uWBTRLR5poEyJuSjGAfcNkJd4lqP+0WTRDRwVQCE8eyVp3qHPAp4sUQRTJER 80og+L9H8g+Fu/Imu6fT+vP9eMjeQdRmLyLIx61pFsU0aRK0RDBFhQYqp7IKdHFUouzfMqQkelrL TGpwQiqYJzUomRZ6tw58AQelAmy0gtDFNEUVAUzPuH+ip5xuU8qpgua7YcosHjiF2JERNlUpqKpZ k8e1yRjMEEYHw/yD4W78ia7p9P68/wBaihmyjkKrWbnBSljIpgnOKIQGF1zTRxuUzYJ5ZuyDjSJf 1VKc1qkbpooh+kpo8aKqZnCchOaRC0w60wqcSnNkFzQkfFwaxTSqDinIsnFFZc0d2I/7I3bEeH+Q fC3fkTXdPp/Xn+s5UJshHG6Y+JPkmQyCPNU/iuSACdF6BQ0g9k1J5rniq15JiaKluDAErtUCquyE Q6NVUlskwHCl1W6D9JUW4c0QUYGxsqW4VRKNGjKo8L8g+Fu/Imu6fT+vP9SqsqCmJR2yPN4Ap0EQ f4rUKk2CfUdRuMEY4hVQAwuqWjdGUyIxFYxz6U5PiCpRZrILtF1QeATGTIueFU54ajQIHn5y7Uwi 0qdC1QkJDHg8biyc0OI4UFEQKNiiCKix8L8g+Fu/Imu6fT+vP9Nzwc05KRlc2COq5sqoZMEIonJG R86TaRmgBWRuVF7lA4Yo5YBGMPHLJGIaUs1No6nFzgmknFlXwLprsmPgVWkVKGrqTNZVF0OyFQAA 3DJwGfJaoEyjiMkJDC6NHOS1kXsEwsqSITTJfknjKQPiRntn2kBfPwPyD4W78ia7p9P68/0nPCyJ RlIsMlROzLkAEEVEn/bRaineuCr1LVORD2AuvZxGk3JQo5uSU6MmWnEcHNFpxTmgTu+Q4Eg1XMcK rTG6cqiqrKvgGUbYxTx85aJjVEdaDFjlwbgQaujp82VRx/IPhbvyJrun0/rz/RdMOHIJnZrBCDue BQAxjVN1pzSI/wAIzvEUj0Jhc4LmvaTDQ54rTCNbUTyuuRX/ABiVrzRlgnKpZSe4KawTQDAcCyqr rTC2ac18ByUNK/ytTgnJV6lROLPXhZPCXiXai4zCqCqGqEsuP5B8Ld+RNd0+n9ef6GpqBBFgwHAu VrJq1An4DmhG500QDOBfmmAYDDALSTXFlZ3xUSA9XCaPnNZOwc4r2cLCjqtWRcdlMTR6BdmgOCY8 CcDdBx2UNJ7JVK8GCr4FFQryoab5p28ZVb5iie7WKyTDHi44WXkQ1Cj34/kHwt35E13T6f15+GAh CKbBSAz4VtGi0RtinTrVlQIEVkaFdsvMhzyQALRGAxWqJqjW1QFomCJiuqyEommIzTWGSpR8V2Q5 zXaFclqjRBOmRJJMlWoVbINUZZrU7K7qnCn9Fl0qpdUYKpQHGtQjKPmy/ogTda8zZB+DjhRSgRU2 6VLbmGIPD8g+Fu/Imu6fT+vPwwetEr+5T51RGSPNdPgHcDxhG80SZHU7OcQr+NM9lqJYYDNFhRPJ OPGUAzvZkxockdVEWxsu0HOaeJsnKKMck2BXs5XFiqqnGyrF1WJBXnEeIphuhdmTqocZpiW4MiD0 LkB4DqvD28B2o36OH5B8Ld+RNd0+n9efhBAIhaR4yiyMj5oVLBOeFUBEdkVkeSG2ItGK1xpyTyuU Tc4rVKwCM5Dsiqd2iEYxj48EYyDSGSEhezpx5y7V8EZSqWQlgUyOlF7ogKMxcFA+DQpzVUCqEDCR iclfUu1FpJwKJ04xuqUoi5ZVPCgVlWiMTYhThg7hfkHwt35E13T6f15+HqN8Fy4PItAXQ29ukRds VVMnKANnR29sM1Sc1W91EEY3QjEaRnimihOZvZGMS8T4lomKGjogiwoVrkWcIC20P6phEB04Unuy j0p0ycCiB60W4t4Dq67VShJulBMQ67JOlVPAD+QTm+KdnVlRE8CyhPGy/IPhbvyJrun0/rz8FkBm tOAutMKlapmuS0xoE5XMpohytUvOwGC0zAjLNPEuCid6YjS2KnOBaGAKYF6BHs+N8EdvcJf+JRAJ 5OmNDal1pagxKD+aEwQFpBF8k6jyKZFauBo8SiBQZFVQkONSs0BAAkodqI5N/wDdNIh8hx5Ix/iV Vc0Yz8RWkvSxXZKomThEqEcl+QfC3fkzXdPp/Xn4T5IRjcpo3OKc2wTmwXZCcldpNqYp9SaBMpZY I7m6dc53FtKGh4zF3sVrJtiogUaiJ80Ylez2y5kWBOSeXakbkr2YoXZaT52KlA4IgIgqUTRSgcLL nwIKIemC0mrpwFpIbmmEiKKki3WvPbxJ9ToaiqBUTkDxhCJjoOaAd1ROcUODFNgqCuBQZOqqZ5Oi cBQL8g+Fu/Jmu6fT+vPwelUtimF0DKjoA2QAFEYgVTgqpYhPqVZdnJAm3NaYsZqVGqnc6MV2YGUv 9zUAWRswW3LJHciKsvayqTJ3RkbhEiylOVcVKWZRRGBTGidVTxTlAqiZrcHjQp75roTnizUWklx/ FEO6r4DJxQq7hNJOFuf+k8PyD4W78ia7p9P68/AAQGCYLXPCyt41XqQ0FwiXZuBkTRUDquCDxBCL XwZMTgtM6bcT5uaMYsNIspzFYEsY5hFqAGgUNoYs6gMxVF0SKYhSIwuq3NUSU+DqqcKtFSqJR2z4 uLhf4TlVC1bZcZLRMaZc01k1yui3SibGKdADx+HWyO2DWZty4fkHwt35E13T6f15+AOGqQeIsFk2 CZ7p3cZLVgniaJm6HWmwC1SRNhYJpFmXYe2CEmeRrVGA8aGzC5v41IDC5WsdSgBcBiojBk5siLBS liVpmGkKcAedUOhFVstUDTEIiQbmgRa6r4FExCBiUNcWmMbIEy1QOacEFURk97oOMETjmqeEaKYm X0lhw/IPhbvyJrun0/rz8AJ5Joqq82q06KCrowFgg+ODoGVA90Zixs60iqAAbTfJ0IigJAKj3fu4 BkaTndPC4FSjuSqVKeDOhzui4RN6kMjqoUGqyfB6oc6pxQ5rRMOMChLAlR6ODhV8aeNcwuyTCSoB IZ2K7QIVDbAqoTSLHmnEgg1lUVC0yDgiiYnsnBU60QUxdAiNTkqUPhmTMJ14fkHwt35E13T6f15+ ADkmlQoGJqg8uy9SgQKNddkasJeNSsIPggYEkjNPIdkIgeIIydg60xpEm5R3MQGHMrbka7ky/iCI nZlLTUOwQ1UMgzoAWV2WjMuhKOCcHpCiBioDILkiWqFplfBCMz1qnAHB6rVErXtlpZLRuBpc1Zea ECAQ3UmkOpOJEIQkbZpxwY+IpjUZpzQIOHBQANOSMYkaisJDN1UMnNOmyrIJky9qBWH9uH5B8Ld+ RNd0+n9efhCUS0gtUv8A8oONMAtABcvInospAUjdaY2xKOgWpVVvmVpHZjeqjWgNStAsFHdngGiM gg2S5lbZ5FGJuEY5I78h53moo5KIlZ0I5BMbpitQtgy1msM0K34MruMlkyeVDmEW7W3H+SoXITEJ wFWxTg+I4LTM0NinwR1BslbgUQfNaiJbxquCsmZWCYLI5rcif9pRX5B8Ld+RNd0+n9efhNgVpeh/ yomXZDO3QjKZ00pEUugdsHmcFXxqTMGwWuVWtkg4M5XZA4mggLBA7w824RhkbKUpZYog5ll7eQvS PQq2N0YO0Sa9CjtxsOBenNV84IPwdGJRjIdk2XtNoPE1MUBUHIrtcHCquwaH+Jshu7EgJ4gUBQ29 +Gk21YcK3TB3GIXZ/rZNjG6JdMOLIxl4e5In+JHD8g+Fu/Imu6fT+vPwxuyqxoM0SRSw6E71yRBo cAtIKMrQdulREBWRYlHGZuUZAVCBIcFnOTqMx0KR5LSKbcazP+FpiGERQItmhOJ7QxQPAi6pSQQ/ 3C4Vb5cHiiCFpmOybLUL3DIuNUcCFQuBcJjRUquScURjIdrAobW+H2yWE08TQ2ITBO/ZxXaBEJYq lSVqN1XixTXCcKoTHgckNkGsi54fkHwt35E13T6f15+FpgHKGsvL+ioWTmpRkCychgcTkg1hZEjA uFGeYQOaEIsA4c9C6MUWrKKj/ulUlHmjKQcoEUjJaeT8LLWBVao03B/VZSFwq8aedgvZ7gqLFVFF qj2TmE8Trj0VQMSYHEHFCtVSiZdqLkWR25A6DQAmyd6GyIKqCSMBgquGsFdU8HlxYmicXNgiTfh+ QfC3fkTXdPp/Xn4QlIdqSBHEPa6pbgYnJezP8TToVEI4lHVQKT2IZRMgxTozsylCYqLFaSe1FwmW aMZBEOwBQ3Nu+LYpvNkLxKaxTrknxXst4sBaTIEGhsmZxmu0BVCVZwxAwQO32syn4GcQ60yNQn1d SJBcoUY4lXfw3GCOYTkpx5sbKR4fkHwt35E13T6f15+CJy80VTZIgo8I80TlRBFRmKVMSjE+Jcwt LtkVGRrGBaQ/yhEUCoiGuqGxaSG/tUIqQMU5x4OAvaAf+pGEqDALXAtIWK0ToVoN1ROSmID4FGE3 nt/1CeNQmNCtJDOvaQH/AFk2yQlHG4V0XWoUIyQD1VFIkOcVr23McQgHriPDLURjE9kXKJ5KRzPD 8g+Fu/Imu6fT+vPwIxzKEcuIIXNRzRjgSCgRZFbkcQXHSokInNSGOantyHnI7ZvG3RxMyKHFab6V q/8A5yNsihEngYyDgo0dxQ5IdSaYHTkh/KGEsQql+ab+qpYIuO1miIVgTUZdCE4yundSF4laCWi7 KhcHFGnCgbg4saFkI+c617Z0k4BCO7WOaeJ8E9CPSVp4/kHwt35E13T6f15+BE4RqnQ5qPNAhAoE WUZDoKpwkM6hS28Lx6CnRKhLAn+hQ3BeN+hAYEIC6MCvaRLxBaQKEohwcCmqYGz4ckIGxsU4KMZC uBRLVj5ws/NOA6YhaoNGSECwnHJA45cDOBYioXstwaXNMnTEObohmzTiH/ZjJ17Hcq3my5JohyUH ueJahRiA+4blaZ0kMUAViCcQU0Zao5FVockx4E5J0Y4R4/kHwt35E13T6f15+BCZvKpXNDpQlkUR iyZSGLUTf/ThA8k2ahP/APU+NCY86N+hMSs4lNEMYmiGq4pILSD2DWJ/wmJ6U4xUpxsfOZDak7jE owlV8UZMZbL0IuEABqjmnGK1RbWEYnzSWkBgUJBULFahTcjYhaJmsaF6FBMbLVtRGsVJ6F7OYaca cCXYioUZzoDbNaoyfp8HUA6Eo0KrfjVf5THxKXPhM8+P5B8Ld+RNd0+n9efGMiGgDUpxaK6UyIyr 1Lnw6VOODuEY83TgsRZEC4t0hVxoQtGMT/Rc0JYhf8dz+60HxHIrQfOH9QgCUQbFPEGhcHMK7SFC MVo3A4K9tsh9v+UckCaRNQhKJviju7XnYjNDZ3AYiwfNagQOSBGK9sLnzgotJyFSjYou5da9s6Zj EJphyMVXxLRIvKP9lpNjY+FyTjg2PAog4IRzsiTgFI5nj+QfC3fkTXdPp/XmmUdzdDA2CAjQKQTZ UK6URgpDAFA8BMY0KcXH9kKo1oUR/GVQtcayGHJAGyzBRNsYnmnPnCkguyWlHzSht7o0yx5oSumk LWXtIR1EXiBhmhONEYmoyTiJlsmo/wCK0xDFrKgujuiLkDtI7M3Eo+a+SYU5qUZEFwjGQo61RqDi qnwIzIcG6Ex2Q9FzFwqeCE8Q6syqU+C1UWqXiRGMqDwPyD4W78ia7p9P680NVRGqYYBwmuQulcpW K5jgNyIpYpseHQq3XZkwNQE0qkLV/KNQgXoUJR8yRpyVT4kYkdCErA0kBlmhOMqFOG1Colihs71M HKcHoWuJIwLI7MnEZVAKiR5pubsiC1UHoP4yFEJx8aINdS9rtUODZpj54uEAhuuY8wjAknbwdUqr 3Tvwc3C/7JNHktcH04pwa4jw9RqE5LckNvbL5p5F+AgDa/gfkHwt35E13T6f15oHA0K8S1Cglbhz jUJjdMUYNdNLC65cHNpK9rLUBe4T4FGBsKjoXs5EEGwTjtRNwUJxNCjNu0htE0PmlNKyG7EO1+a0 ana2aImH5I7uzcV5hDame1/dPIokedGqlsyxt0qqIkHCO5sSZ8E8rhESFM0MAgGvim4kZoNfELQf EtcbYhdk9rEKvghqkp3Z8lzTZIlGRx8D8g+Fu/Imu6fT+vPhpkahMLioVbjgN2Hmm4GCB4e0wN1z HCmFuDog2NVqjeP9V7WIJ/3jJENqDUdCIPYJYjIpjZPAtpqEJ9a0my1wJa6jMFwUQ9CtQsC4Wp7Y IjBa4vqBoOSE443GKofEnKomlVGEY2Wk3CZvAcXTlMVr2rhadwMUD/E+AI5BMRROiSa4BObZeD+Q fC3fkTXdPp/XnwEh40Kr2oHZlfpV1plYr/ibHgYmqMT4k/DlL+/FjZao2lSQWAfALUMVW4oVQVVT 2TSQQY0wTtUKWyTzAV1WLo7m1Y3iu0D0MotHtIh9G4D1qpcqllbhqjlVAxoMUD4LpuD2Oa0yrA4o G8SnHCU+aCMjgESTj4X5B8Ld+RNd0+n9efHSLxt0IQnQ2IKJ2zqicFywRjKxRi/QeDjzhZNjw/sq 3F1S6a5CZNjFXstLvqoQr0yRlHHBaJ0IsiMCpE9mcagoOWOKAEnTJ0ITLQsFIRPZDFkJPgnFQrcC VQXWiVxZMeNkyfBaSaJnWmQotEvNwKYlxgtIrI04OtAPal4f5B8Ld+RNd0+n9efGMsHr0J26E1gm L9IVC8cCmmGyktQLhMb81r274oG2aqtcfNN02OaINjw1xHSiDitcLhDX41RORXkuzIsgSVo0hs8U FbgZRoRV0QSScUHFOSeEqZKvAg9CP9EJR84JpUmExvxdMauE4TxuLrIrTGpzQas2wRluVOAy4HPB GUy+Xh/kHwt35E13T6f15+Bpke1FCURXFBsboglw3A6i4yWqMWr/AETp9NcQtUS8XZMbFULJ3dlQ O1CV2g6JAZ1QvktMhU2IomJoUAnKJAsgeaA4MipFmLrTgUGNfA5jgNyFxdP5shgU3F8UQA5KIiDJ rrSOyDinJJfnwNXCIBeWQRlI/ofkHwt35E13T6f15+AJ4YhAwkCDx0806mTcCiGIIXajTFHQHi7o c0DfMJw4zCkCKu6qC66U+aECLG6APiX+eEhyVC8iahQmLtVB1RFEyLRKBjgcUJDxpxwdVRWmVUZR 7J5I7Zk4wXaLEXTRkJHILmgB50rIvcpyEDgtROCMdvG5Tkuf0fyD4W78ia7p9P68/B7MiExqE5FV qNEDqZdiVFEPZVsjprE3CiWTtVHJESOFOJIwRKhPHHiQjSoK9nYHPNaTwKIlitOSpUG4QyKfjzCu xXaNM17SM2kMkxldaoF+hCcsqoyHmig4VVQvZw82P6f5B8Ld+RNd0+n9ef6FeGl+xOhHNDJ24ZyK 0nAv1oFERuonL+yrjwMTiiMkds9ITYjiJEdmSaNMinNxQ8WQkMFWxWjDBaJ+JU4mS0TKcGMY4lDb 2e2wqyAmDBkYwpCIqc0Wx4VLBGG2XkcU/wCn+QfC3fkTXdPp/Xn+kC6FbsUE6BFjRMUzKzOKKJdi KFdPAlqSQkBarIGJY4gp1RENUVCB/kFqvE0kE2fEgovgmxwQIPaimPnDgwoEST0pwWAsQtJkWXMJ 2RBLE2CJiHKuwyVZfq/kHwt35E13T6f15/pxjK1ghVV61TN+FFGQtipNY1CbJOtTViozWuB7YqEP 9woRxNaSsEYnFNjG3Qq3F+F6omIfNEEaVq/ugY11XCdFCEfNie0c0DwEgHGKeXnYBGUvEP2H5B8L d+RNd0+n9ef6jEsVdOCol7hA0RAwXMK9CqIg2ZSibg0TFDcHmblJdKfBFixyWq8oo4IEGuCd2wkF RdipyRMjpIu9ERFgIm+aAJon3KwNjkiIF8gKoz3JaYZIkCi0sSV2wwWnZpEYp5F/2P5B8Ld+RNd0 +n9ef6+k+JO9UUYvUIEYVQ4ahXUnTWyQ2p+cBTmq3RexRETUGicB8084kajQpwaYhEkowBZ08qcN ADA4pgHVaDL9t+QfC3fkTXdPp/Xn+u4oUzumdlqBLqInZMT2TUKhUvakWo6MnYYJhKyfUgTuOQKg ox2e1PNGcy5KzGSMdyNcEdMyBgmMn5p5Fz+7/IPhbvyJrun0/rz/AGmkScDNMCB1p9yRl4FD/oX5 B8Ld+RNd0+n9ef8Arn5B8Ld+RNd0+n9ef+ufkHwt35E13T6f15/vNrvUtk+y39PsjjLX5rDmtvu0 tk+03QTBqho+c55YqXd+8QMN2LOOmoI6VZVBpf8AefkHwt35E13T6f15/vO69773/wC1fY3O7Duu 5sP7TRHzxME2iv8A/P3O87c9/vEe+Hb3BJ4x9sYmDyw1aSv/AI7ZgY70dk912N2Q7UJyjpjLpGC3 I757sdwb/epiLRk0TD/rBBjnYI7W8dgjc/8AjzKbbcBI94jICPaEQdQH7z8g+Fu/Imu6fT+vP91t neBO0JR9oBcxftN4lXufeeseVf8Ah956x5V/4feeseVQ3dvuveY7m3IShIEUILg3Ut3d7r3qW5Mm UpEipPjX/h956x5Vux7t3XvEd8wI2pSIYSaj1/d/kHwt35E1Hd793WG/uQjpjKYLiLuy+37XUfKv t+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ft dR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUf Kvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7 ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37X UfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hy r7ftdR8q+37XUfKvt+11Hyr7ftdR8q+37XUfKvt+11Hyre7r3bu0NrY7wDHe24u0wRpL+L/Xv//Z"/></svg>
diff --git a/silx/resources/gui/icons/plot-window.svg b/silx/resources/gui/icons/plot-window.svg
index 61ee6f6..f7a3329 100644
--- a/silx/resources/gui/icons/plot-window.svg
+++ b/silx/resources/gui/icons/plot-window.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 32 32" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g transform="translate(.27119 .40678)"><g transform="translate(-.91869 -2.2683)"><rect x="1.745" y="6.35" width="29.805" height="23.023" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".21"/><rect x="1.745" y="6.35" width="29.805" height="23.023" fill="#e6e7e8"/><rect x="1.745" y="6.466" width="29.805" height="3.083" fill="#FFF" stroke="#000" stroke-miterlimit="10" stroke-width=".2"/></g><g transform="matrix(.77205 0 0 .77205 2.9938 4.6274)"><rect x="5.443" y="5.907" width="22.104" height="21.774" fill="#FFF" stroke="#00a14b" stroke-miterlimit="10" stroke-width=".5"/><line x1="10.121" x2="10.121" y1="26.228" y2="27.445" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/><line x1="14.481" x2="14.481" y1="26.228" y2="27.445" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/><line x1="18.675" x2="18.675" y1="26.226" y2="27.443" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/><line x1="23.106" x2="23.106" y1="26.229" y2="27.446" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5"/><g transform="translate(-2,2)" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".5">
<line x1="8.689" x2="7.513" y1="8.26" y2="8.264"/>
<line x1="8.705" x2="7.529" y1="12.62" y2="12.624"/>
diff --git a/silx/resources/gui/icons/plot-xauto.svg b/silx/resources/gui/icons/plot-xauto.svg
index 3debd34..0baa9a9 100644
--- a/silx/resources/gui/icons/plot-xauto.svg
+++ b/silx/resources/gui/icons/plot-xauto.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><line
- x1="25.941999"
- x2="7"
- y1="22.684999"
- y2="22.684999"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="25.47,24.417 25.463,20.953 28.467,22.68 "
- id="polygon6"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="6.988,24.417 3.993,22.676 7,20.953 "
- id="polygon8"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><path
- d="m 18.474,19.135 -1.3,-1.83 C 16.642,16.6 16.301,16.075 15.897,15.49 h -0.043 c -0.298,0.585 -0.66,1.11 -1.107,1.815 l -1.193,1.83 H 9.847 L 14,14.02 9.996,9.025 h 3.728 l 1.257,1.845 c 0.426,0.615 0.745,1.11 1.086,1.68 h 0.043 c 0.341,-0.645 0.618,-1.095 0.979,-1.68 l 1.215,-1.845 h 3.706 l -4.047,4.935 4.26,5.175 h -3.749 z"
- inkscape:connector-curvature="0"
- id="path10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="25.942" x2="7" y1="22.685" y2="22.685" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="25.47 24.417 25.463 20.953 28.467 22.68" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="6.988 24.417 3.993 22.676 7 20.953" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><path d="m18.474 19.135-1.3-1.83c-0.532-0.705-0.873-1.23-1.277-1.815h-0.043c-0.298 0.585-0.66 1.11-1.107 1.815l-1.193 1.83h-3.707l4.153-5.115-4.004-4.995h3.728l1.257 1.845c0.426 0.615 0.745 1.11 1.086 1.68h0.043c0.341-0.645 0.618-1.095 0.979-1.68l1.215-1.845h3.706l-4.047 4.935 4.26 5.175h-3.749z"/></svg>
diff --git a/silx/resources/gui/icons/plot-xlog.svg b/silx/resources/gui/icons/plot-xlog.svg
index 692062f..172ef84 100644
--- a/silx/resources/gui/icons/plot-xlog.svg
+++ b/silx/resources/gui/icons/plot-xlog.svg
@@ -1,45 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata20"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs18" /><line
- x1="25.941999"
- x2="7"
- y1="22.684999"
- y2="22.684999"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="1.5"
- id="line4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="25.47,24.417 25.463,20.953 28.467,22.68 "
- id="polygon6"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><polygon
- points="6.988,24.417 3.993,22.676 7,20.953 "
- id="polygon8"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10" /><path
- d="M 7.395,7.535 H 9.36 v 8.444 h 2.595 v 1.666 H 7.395 V 7.535 z"
- inkscape:connector-curvature="0"
- id="path10" /><path
- d="m 18.195,13.954 c 0,3.06 -1.696,3.81 -2.805,3.81 -1.755,0 -2.805,-1.379 -2.805,-3.765 0,-2.64 1.38,-3.81 2.834,-3.81 1.726,0 2.776,1.455 2.776,3.765 z m -3.66,0 c 0,1.26 0.195,2.31 0.9,2.31 0.63,0 0.795,-1.23 0.795,-2.31 0,-1.005 -0.165,-2.28 -0.825,-2.28 -0.72,0 -0.87,1.275 -0.87,2.28 z"
- inkscape:connector-curvature="0"
- id="path12" /><path
- d="m 24.719,10.31 c -0.029,0.66 -0.074,1.44 -0.074,2.325 v 4.185 c 0,1.576 -0.285,2.445 -0.885,3.015 -0.541,0.51 -1.305,0.811 -2.385,0.811 -0.676,0 -1.305,-0.121 -1.83,-0.346 l 0.359,-1.515 c 0.375,0.165 0.84,0.315 1.41,0.315 0.99,0 1.381,-0.66 1.381,-1.785 v -0.45 H 22.664 C 22.41,17.329 21.9,17.6 21.344,17.6 c -1.648,0 -2.295,-1.8 -2.295,-3.555 0,-2.445 1.111,-3.855 2.477,-3.855 0.584,0 1.064,0.3 1.35,0.855 h 0.029 L 23.01,10.31 h 1.709 z m -2.024,2.669 c 0,-0.195 -0.031,-0.39 -0.076,-0.54 -0.09,-0.315 -0.299,-0.6 -0.629,-0.6 -0.705,0 -0.99,0.96 -0.99,2.16 0,1.365 0.389,2.055 0.945,2.055 0.254,0 0.51,-0.135 0.66,-0.525 0.059,-0.165 0.09,-0.39 0.09,-0.585 v -1.965 z"
- inkscape:connector-curvature="0"
- id="path14" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="25.942" x2="7" y1="22.685" y2="22.685" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="25.47 24.417 25.463 20.953 28.467 22.68" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><polygon points="6.988 24.417 3.993 22.676 7 20.953" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"/><path d="m7.395 7.535h1.965v8.444h2.595v1.666h-4.56v-10.11z"/><path d="m18.195 13.954c0 3.06-1.696 3.81-2.805 3.81-1.755 0-2.805-1.379-2.805-3.765 0-2.64 1.38-3.81 2.834-3.81 1.726 0 2.776 1.455 2.776 3.765zm-3.66 0c0 1.26 0.195 2.31 0.9 2.31 0.63 0 0.795-1.23 0.795-2.31 0-1.005-0.165-2.28-0.825-2.28-0.72 0-0.87 1.275-0.87 2.28z"/><path d="m24.719 10.31c-0.029 0.66-0.074 1.44-0.074 2.325v4.185c0 1.576-0.285 2.445-0.885 3.015-0.541 0.51-1.305 0.811-2.385 0.811-0.676 0-1.305-0.121-1.83-0.346l0.359-1.515c0.375 0.165 0.84 0.315 1.41 0.315 0.99 0 1.381-0.66 1.381-1.785v-0.45h-0.031c-0.254 0.464-0.764 0.735-1.32 0.735-1.648 0-2.295-1.8-2.295-3.555 0-2.445 1.111-3.855 2.477-3.855 0.584 0 1.064 0.3 1.35 0.855h0.029l0.105-0.735h1.709zm-2.024 2.669c0-0.195-0.031-0.39-0.076-0.54-0.09-0.315-0.299-0.6-0.629-0.6-0.705 0-0.99 0.96-0.99 2.16 0 1.365 0.389 2.055 0.945 2.055 0.254 0 0.51-0.135 0.66-0.525 0.059-0.165 0.09-0.39 0.09-0.585v-1.965z"/></svg>
diff --git a/silx/resources/gui/icons/plot-yauto.svg b/silx/resources/gui/icons/plot-yauto.svg
index 34ab240..7bc7e29 100644
--- a/silx/resources/gui/icons/plot-yauto.svg
+++ b/silx/resources/gui/icons/plot-yauto.svg
@@ -1,34 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata18"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs16" /><g
- id="g4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10"><line
- x1="8.7320004"
- x2="8.7320004"
- y1="6.0489998"
- y2="24.990999"
- id="line6" /><polygon
- points="10.464,6.521 7,6.528 8.727,3.524 "
- id="polygon8" /><polygon
- points="10.464,25.003 8.723,27.998 7,24.991 "
- id="polygon10" /></g><path
- d="m 17.778,21.167 v -4.14 l -4.537,-5.97 h 3.706 l 1.471,2.43 c 0.447,0.735 0.744,1.275 1.107,1.935 h 0.042 c 0.319,-0.63 0.661,-1.215 1.087,-1.935 l 1.447,-2.43 h 3.643 l -4.729,5.895 v 4.215 h -3.237 z"
- inkscape:connector-curvature="0"
- id="path12" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"><line x1="8.732" x2="8.732" y1="6.049" y2="24.991"/><polygon points="10.464 6.521 7 6.528 8.727 3.524"/><polygon points="10.464 25.003 8.723 27.998 7 24.991"/></g><path d="m17.778 21.167v-4.14l-4.537-5.97h3.706l1.471 2.43c0.447 0.735 0.744 1.275 1.107 1.935h0.042c0.319-0.63 0.661-1.215 1.087-1.935l1.447-2.43h3.643l-4.729 5.895v4.215h-3.237z"/></svg>
diff --git a/silx/resources/gui/icons/plot-ydown.svg b/silx/resources/gui/icons/plot-ydown.svg
index 276021c..ea35cea 100644
--- a/silx/resources/gui/icons/plot-ydown.svg
+++ b/silx/resources/gui/icons/plot-ydown.svg
@@ -1,30 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata14"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs12" /><path
- d="M 9.872,22.665 V 9.224 m 1.732,13.939 -3.464,0.007 1.737,2.997 1.727,-3.004 z"
- inkscape:connector-curvature="0"
- id="path4"
- style="fill:none;stroke:#00a14b;stroke-width:2;stroke-miterlimit:10" /><path
- d="M 20.232,22.168 V 16.829 L 14.486,9.363 h 3.777 l 2.186,3.287 c 0.62,0.95 1.078,1.672 1.564,2.545 h 0.054 c 0.458,-0.817 0.972,-1.615 1.591,-2.545 l 2.186,-3.287 h 3.75 l -6.043,7.409 v 5.396 h -3.319 z"
- inkscape:connector-curvature="0"
- id="path6" /><path
- d="m 7.638,12.205 c 0,1.882 -0.738,3.061 -2.134,3.061 -1.351,0 -2.071,-1.224 -2.08,-3.006 0,-1.819 0.774,-3.043 2.143,-3.043 1.414,-0.001 2.071,1.26 2.071,2.988 z m -3.097,0.054 c -0.009,1.422 0.387,2.161 1,2.161 0.648,0 0.99,-0.792 0.99,-2.197 0,-1.359 -0.324,-2.161 -0.99,-2.161 -0.595,0.001 -1.009,0.73 -1,2.197 z"
- inkscape:connector-curvature="0"
- id="path8" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m9.872 22.665v-13.441m1.732 13.939-3.464 7e-3 1.737 2.997 1.727-3.004z" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="2"/><path d="m20.232 22.168v-5.339l-5.746-7.466h3.777l2.186 3.287c0.62 0.95 1.078 1.672 1.564 2.545h0.054c0.458-0.817 0.972-1.615 1.591-2.545l2.186-3.287h3.75l-6.043 7.409v5.396h-3.319z"/><path d="m7.638 12.205c0 1.882-0.738 3.061-2.134 3.061-1.351 0-2.071-1.224-2.08-3.006 0-1.819 0.774-3.043 2.143-3.043 1.414-1e-3 2.071 1.26 2.071 2.988zm-3.097 0.054c-9e-3 1.422 0.387 2.161 1 2.161 0.648 0 0.99-0.792 0.99-2.197 0-1.359-0.324-2.161-0.99-2.161-0.595 1e-3 -1.009 0.73-1 2.197z"/></svg>
diff --git a/silx/resources/gui/icons/plot-ylog.svg b/silx/resources/gui/icons/plot-ylog.svg
index 8380464..b0d6e58 100644
--- a/silx/resources/gui/icons/plot-ylog.svg
+++ b/silx/resources/gui/icons/plot-ylog.svg
@@ -1,40 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata22"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs20" /><g
- id="g4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10"><line
- x1="7.3540001"
- x2="7.3109999"
- y1="26.356001"
- y2="7.414"
- id="line6" /><polygon
- points="5.621,25.888 9.085,25.873 7.365,28.881 "
- id="polygon8" /><polygon
- points="5.579,7.406 7.313,4.407 9.042,7.41 "
- id="polygon10" /></g><path
- d="m 10.882,11.535 h 1.965 v 8.444 h 2.595 v 1.665 h -4.56 V 11.535 z"
- inkscape:connector-curvature="0"
- id="path12" /><path
- d="m 21.682,17.955 c 0,3.06 -1.695,3.81 -2.805,3.81 -1.756,0 -2.805,-1.38 -2.805,-3.765 0,-2.64 1.379,-3.81 2.834,-3.81 1.726,0 2.776,1.455 2.776,3.765 z m -3.661,0 c 0,1.26 0.195,2.31 0.9,2.31 0.63,0 0.795,-1.229 0.795,-2.31 0,-1.005 -0.165,-2.28 -0.825,-2.28 -0.719,0 -0.87,1.275 -0.87,2.28 z"
- inkscape:connector-curvature="0"
- id="path14" /><path
- d="m 28.206,14.31 c -0.029,0.66 -0.075,1.44 -0.075,2.325 v 4.185 c 0,1.575 -0.284,2.445 -0.885,3.015 -0.54,0.51 -1.305,0.811 -2.385,0.811 -0.675,0 -1.305,-0.12 -1.83,-0.346 l 0.36,-1.514 c 0.375,0.164 0.84,0.314 1.41,0.314 0.989,0 1.38,-0.66 1.38,-1.785 v -0.449 h -0.03 c -0.255,0.465 -0.765,0.734 -1.32,0.734 -1.649,0 -2.295,-1.8 -2.295,-3.555 0,-2.445 1.11,-3.855 2.476,-3.855 0.585,0 1.064,0.3 1.35,0.855 h 0.03 l 0.104,-0.735 h 1.71 z m -2.024,2.669 c 0,-0.195 -0.03,-0.39 -0.075,-0.54 -0.09,-0.315 -0.3,-0.6 -0.63,-0.6 -0.705,0 -0.99,0.96 -0.99,2.16 0,1.365 0.39,2.055 0.945,2.055 0.255,0 0.51,-0.135 0.66,-0.525 0.06,-0.164 0.09,-0.39 0.09,-0.584 v -1.966 z"
- inkscape:connector-curvature="0"
- id="path16" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"><line x1="7.354" x2="7.311" y1="26.356" y2="7.414"/><polygon points="5.621 25.888 9.085 25.873 7.365 28.881"/><polygon points="5.579 7.406 7.313 4.407 9.042 7.41"/></g><path d="m10.882 11.535h1.965v8.444h2.595v1.665h-4.56v-10.109z"/><path d="m21.682 17.955c0 3.06-1.695 3.81-2.805 3.81-1.756 0-2.805-1.38-2.805-3.765 0-2.64 1.379-3.81 2.834-3.81 1.726 0 2.776 1.455 2.776 3.765zm-3.661 0c0 1.26 0.195 2.31 0.9 2.31 0.63 0 0.795-1.229 0.795-2.31 0-1.005-0.165-2.28-0.825-2.28-0.719 0-0.87 1.275-0.87 2.28z"/><path d="m28.206 14.31c-0.029 0.66-0.075 1.44-0.075 2.325v4.185c0 1.575-0.284 2.445-0.885 3.015-0.54 0.51-1.305 0.811-2.385 0.811-0.675 0-1.305-0.12-1.83-0.346l0.36-1.514c0.375 0.164 0.84 0.314 1.41 0.314 0.989 0 1.38-0.66 1.38-1.785v-0.449h-0.03c-0.255 0.465-0.765 0.734-1.32 0.734-1.649 0-2.295-1.8-2.295-3.555 0-2.445 1.11-3.855 2.476-3.855 0.585 0 1.064 0.3 1.35 0.855h0.03l0.104-0.735h1.71zm-2.024 2.669c0-0.195-0.03-0.39-0.075-0.54-0.09-0.315-0.3-0.6-0.63-0.6-0.705 0-0.99 0.96-0.99 2.16 0 1.365 0.39 2.055 0.945 2.055 0.255 0 0.51-0.135 0.66-0.525 0.06-0.164 0.09-0.39 0.09-0.584v-1.966z"/></svg>
diff --git a/silx/resources/gui/icons/plot-yup.svg b/silx/resources/gui/icons/plot-yup.svg
index 402afec..dfdc19f 100644
--- a/silx/resources/gui/icons/plot-yup.svg
+++ b/silx/resources/gui/icons/plot-yup.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><line
- x1="10.669"
- x2="10.669"
- y1="9.7259998"
- y2="23.167"
- fill="none"
- stroke="#00A14B"
- stroke-miterlimit="10"
- stroke-width="2"
- id="line4"
- style="fill:none;stroke:#00a14b;stroke-width:2;stroke-miterlimit:10" /><polygon
- points="12.401,9.221 8.938,9.228 10.664,6.224 "
- id="polygon6"
- style="fill:none;stroke:#00a14b;stroke-width:2;stroke-miterlimit:10" /><path
- d="m 21.029,23.168 v -5.339 l -5.746,-7.466 h 3.777 l 2.186,3.287 c 0.62,0.95 1.078,1.672 1.564,2.545 h 0.054 c 0.458,-0.817 0.972,-1.615 1.591,-2.545 l 2.186,-3.287 h 3.75 l -6.043,7.409 v 5.396 h -3.319 z"
- inkscape:connector-curvature="0"
- id="path8" /><path
- d="m 8.435,20.205 c 0,1.883 -0.738,3.061 -2.134,3.061 -1.351,0 -2.071,-1.223 -2.08,-3.006 0,-1.818 0.774,-3.043 2.143,-3.043 1.414,0 2.071,1.26 2.071,2.988 z M 5.338,20.26 c -0.009,1.422 0.387,2.16 1,2.16 0.648,0 0.99,-0.791 0.99,-2.196 0,-1.359 -0.324,-2.161 -0.99,-2.161 -0.595,0 -1.009,0.729 -1,2.197 z"
- inkscape:connector-curvature="0"
- id="path10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="10.669" x2="10.669" y1="9.726" y2="23.167" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="2"/><polygon points="12.401 9.221 8.938 9.228 10.664 6.224" fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="2"/><path d="m21.029 23.168v-5.339l-5.746-7.466h3.777l2.186 3.287c0.62 0.95 1.078 1.672 1.564 2.545h0.054c0.458-0.817 0.972-1.615 1.591-2.545l2.186-3.287h3.75l-6.043 7.409v5.396h-3.319z"/><path d="m8.435 20.205c0 1.883-0.738 3.061-2.134 3.061-1.351 0-2.071-1.223-2.08-3.006 0-1.818 0.774-3.043 2.143-3.043 1.414 0 2.071 1.26 2.071 2.988zm-3.097 0.055c-9e-3 1.422 0.387 2.16 1 2.16 0.648 0 0.99-0.791 0.99-2.196 0-1.359-0.324-2.161-0.99-2.161-0.595 0-1.009 0.729-1 2.197z"/></svg>
diff --git a/silx/resources/gui/icons/previous.svg b/silx/resources/gui/icons/previous.svg
index 75372e2..6b11053 100644
--- a/silx/resources/gui/icons/previous.svg
+++ b/silx/resources/gui/icons/previous.svg
@@ -1,23 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <linearGradient id="b" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
- <stop stop-color="#002839" offset="0"/>
- <stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
- </linearGradient>
- <linearGradient id="a" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
- <stop offset="0"/>
- <stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
- </linearGradient>
- </defs>
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path d="m25.451 4.9951c-6.6141 3.9114-12.473 7.571-18.396 11.252l18.307 10.806z" fill="url(#b)" stroke="url(#a)" stroke-linejoin="round" stroke-width=".4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<linearGradient id="c" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
+<stop stop-color="#002839" offset="0"/>
+<stop stop-color="#00f" stop-opacity=".2585" offset="1"/>
+</linearGradient>
+<linearGradient id="d" x1="11.913" x2="27.737" y1="10.398" y2="16.471" gradientTransform="matrix(-1 0 0 1 32.506 0)" gradientUnits="userSpaceOnUse">
+<stop offset="0"/>
+<stop stop-color="#00f" stop-opacity=".30612" offset="1"/>
+</linearGradient>
+</defs>
+<path d="m25.451 4.9951c-6.6141 3.9114-12.473 7.571-18.396 11.252l18.307 10.806z" fill="url(#c)" stroke="url(#d)" stroke-linejoin="round" stroke-width=".4"/>
</svg>
diff --git a/silx/resources/gui/icons/animated/process-working-00.png b/silx/resources/gui/icons/process-working/00.png
index a787ab7..a787ab7 100644
--- a/silx/resources/gui/icons/animated/process-working-00.png
+++ b/silx/resources/gui/icons/process-working/00.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-01.png b/silx/resources/gui/icons/process-working/01.png
index 297ed4e..297ed4e 100644
--- a/silx/resources/gui/icons/animated/process-working-01.png
+++ b/silx/resources/gui/icons/process-working/01.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-02.png b/silx/resources/gui/icons/process-working/02.png
index f2c3a59..f2c3a59 100644
--- a/silx/resources/gui/icons/animated/process-working-02.png
+++ b/silx/resources/gui/icons/process-working/02.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-03.png b/silx/resources/gui/icons/process-working/03.png
index 75a4b85..75a4b85 100644
--- a/silx/resources/gui/icons/animated/process-working-03.png
+++ b/silx/resources/gui/icons/process-working/03.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-04.png b/silx/resources/gui/icons/process-working/04.png
index 12fe098..12fe098 100644
--- a/silx/resources/gui/icons/animated/process-working-04.png
+++ b/silx/resources/gui/icons/process-working/04.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-05.png b/silx/resources/gui/icons/process-working/05.png
index ec0b2bf..ec0b2bf 100644
--- a/silx/resources/gui/icons/animated/process-working-05.png
+++ b/silx/resources/gui/icons/process-working/05.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-06.png b/silx/resources/gui/icons/process-working/06.png
index 9dca9eb..9dca9eb 100644
--- a/silx/resources/gui/icons/animated/process-working-06.png
+++ b/silx/resources/gui/icons/process-working/06.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-07.png b/silx/resources/gui/icons/process-working/07.png
index ca8a18c..ca8a18c 100644
--- a/silx/resources/gui/icons/animated/process-working-07.png
+++ b/silx/resources/gui/icons/process-working/07.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-08.png b/silx/resources/gui/icons/process-working/08.png
index abd1210..abd1210 100644
--- a/silx/resources/gui/icons/animated/process-working-08.png
+++ b/silx/resources/gui/icons/process-working/08.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-09.png b/silx/resources/gui/icons/process-working/09.png
index a0f362f..a0f362f 100644
--- a/silx/resources/gui/icons/animated/process-working-09.png
+++ b/silx/resources/gui/icons/process-working/09.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-10.png b/silx/resources/gui/icons/process-working/10.png
index cc8b968..cc8b968 100644
--- a/silx/resources/gui/icons/animated/process-working-10.png
+++ b/silx/resources/gui/icons/process-working/10.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-11.png b/silx/resources/gui/icons/process-working/11.png
index f5da609..f5da609 100644
--- a/silx/resources/gui/icons/animated/process-working-11.png
+++ b/silx/resources/gui/icons/process-working/11.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-12.png b/silx/resources/gui/icons/process-working/12.png
index 92e2159..92e2159 100644
--- a/silx/resources/gui/icons/animated/process-working-12.png
+++ b/silx/resources/gui/icons/process-working/12.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-13.png b/silx/resources/gui/icons/process-working/13.png
index 6e9e8d7..6e9e8d7 100644
--- a/silx/resources/gui/icons/animated/process-working-13.png
+++ b/silx/resources/gui/icons/process-working/13.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-14.png b/silx/resources/gui/icons/process-working/14.png
index 3f2141b..3f2141b 100644
--- a/silx/resources/gui/icons/animated/process-working-14.png
+++ b/silx/resources/gui/icons/process-working/14.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-15.png b/silx/resources/gui/icons/process-working/15.png
index 1043659..1043659 100644
--- a/silx/resources/gui/icons/animated/process-working-15.png
+++ b/silx/resources/gui/icons/process-working/15.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-16.png b/silx/resources/gui/icons/process-working/16.png
index a8d89fc..a8d89fc 100644
--- a/silx/resources/gui/icons/animated/process-working-16.png
+++ b/silx/resources/gui/icons/process-working/16.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-17.png b/silx/resources/gui/icons/process-working/17.png
index 5b68f03..5b68f03 100644
--- a/silx/resources/gui/icons/animated/process-working-17.png
+++ b/silx/resources/gui/icons/process-working/17.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-18.png b/silx/resources/gui/icons/process-working/18.png
index cf0ff96..cf0ff96 100644
--- a/silx/resources/gui/icons/animated/process-working-18.png
+++ b/silx/resources/gui/icons/process-working/18.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-19.png b/silx/resources/gui/icons/process-working/19.png
index 661effd..661effd 100644
--- a/silx/resources/gui/icons/animated/process-working-19.png
+++ b/silx/resources/gui/icons/process-working/19.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-20.png b/silx/resources/gui/icons/process-working/20.png
index e1c77aa..e1c77aa 100644
--- a/silx/resources/gui/icons/animated/process-working-20.png
+++ b/silx/resources/gui/icons/process-working/20.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-21.png b/silx/resources/gui/icons/process-working/21.png
index 10861e7..10861e7 100644
--- a/silx/resources/gui/icons/animated/process-working-21.png
+++ b/silx/resources/gui/icons/process-working/21.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-22.png b/silx/resources/gui/icons/process-working/22.png
index 38907dc..38907dc 100644
--- a/silx/resources/gui/icons/animated/process-working-22.png
+++ b/silx/resources/gui/icons/process-working/22.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-23.png b/silx/resources/gui/icons/process-working/23.png
index 7ec4915..7ec4915 100644
--- a/silx/resources/gui/icons/animated/process-working-23.png
+++ b/silx/resources/gui/icons/process-working/23.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-24.png b/silx/resources/gui/icons/process-working/24.png
index 2e90357..2e90357 100644
--- a/silx/resources/gui/icons/animated/process-working-24.png
+++ b/silx/resources/gui/icons/process-working/24.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-25.png b/silx/resources/gui/icons/process-working/25.png
index 6ffa1a7..6ffa1a7 100644
--- a/silx/resources/gui/icons/animated/process-working-25.png
+++ b/silx/resources/gui/icons/process-working/25.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-26.png b/silx/resources/gui/icons/process-working/26.png
index b8ae153..b8ae153 100644
--- a/silx/resources/gui/icons/animated/process-working-26.png
+++ b/silx/resources/gui/icons/process-working/26.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-27.png b/silx/resources/gui/icons/process-working/27.png
index 4d3c716..4d3c716 100644
--- a/silx/resources/gui/icons/animated/process-working-27.png
+++ b/silx/resources/gui/icons/process-working/27.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-28.png b/silx/resources/gui/icons/process-working/28.png
index dd88b9c..dd88b9c 100644
--- a/silx/resources/gui/icons/animated/process-working-28.png
+++ b/silx/resources/gui/icons/process-working/28.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-29.png b/silx/resources/gui/icons/process-working/29.png
index 985e115..985e115 100644
--- a/silx/resources/gui/icons/animated/process-working-29.png
+++ b/silx/resources/gui/icons/process-working/29.png
Binary files differ
diff --git a/silx/resources/gui/icons/animated/process-working-30.png b/silx/resources/gui/icons/process-working/30.png
index f2c6d3d..f2c6d3d 100644
--- a/silx/resources/gui/icons/animated/process-working-30.png
+++ b/silx/resources/gui/icons/process-working/30.png
Binary files differ
diff --git a/silx/resources/gui/icons/profile-clear.svg b/silx/resources/gui/icons/profile-clear.svg
index 09f1f94..b1593d2 100644
--- a/silx/resources/gui/icons/profile-clear.svg
+++ b/silx/resources/gui/icons/profile-clear.svg
@@ -1,43 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3423"
- xml:space="preserve"><metadata
- id="metadata3431"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3429"><filter
- x="-0.14179821"
- y="-0.14627124"
- width="1.2835964"
- height="1.2925425"
- color-interpolation-filters="sRGB"
- id="filter7174"><feGaussianBlur
- stdDeviation="0.9522046"
- id="feGaussianBlur7176" /></filter></defs><line
- x1="4.1233144"
- x2="27.305519"
- y1="17.429787"
- y2="15.176897"
- stroke-miterlimit="10"
- id="line3425"
- style="fill:#f7941e;stroke:#f7941e;stroke-width:3;stroke-miterlimit:10" /><g
- transform="translate(-0.28742515,-0.28742515)"
- id="g4379"><path
- d="m 26.957244,11.637296 c -0.39375,0.002 -0.79775,0.17675 -1.09375,0.46875 l -5.375,5.250001 -5.437499,-5.218751 c -0.602,-0.58 -1.55925,-0.583 -2.15625,0 -0.598,0.584001 -0.602,1.547001 0,2.125001 l 5.4375,5.218748 -5.375,5.25 c -0.599,0.583 -0.605,1.51675 0,2.09375 0.601,0.577 1.5905,0.586 2.1875,0 l 5.374999,-5.25 5.4375,5.1875 c 0.605,0.578 1.55825,0.584 2.15625,0 0.596,-0.58 0.598,-1.51475 0,-2.09375 l -5.4375,-5.21875 5.375,-5.249998 c 0.594,-0.584 0.602,-1.547999 0,-2.125001 -0.301,-0.29 -0.7,-0.4395 -1.09375,-0.4375 z"
- transform="matrix(0.68043931,0,0,0.68043931,2.0968612,3.5974984)"
- id="path3107-3"
- style="filter:url(#filter7174)" /><path
- d="m 20.137161,10.881026 c -0.267923,0.0014 -0.54282,0.099 -0.744231,0.297692 l -3.657361,3.572306 -3.699889,-3.529778 c -0.409624,-0.394655 -1.060975,-0.396697 -1.467197,0 -0.406902,0.397376 -0.409624,1.031375 0,1.424669 l 3.699889,3.551043 -3.657361,3.572306 c -0.407583,0.396696 -0.411666,1.05332 0,1.445934 0.408944,0.392613 1.082238,0.377474 1.488461,-0.02126 l 3.657361,-3.572306 3.699889,3.551042 c 0.411665,0.393294 1.060294,0.397377 1.467197,0 0.405542,-0.394654 0.406903,-1.051959 0,-1.445933 l -3.699889,-3.551043 3.657361,-3.572306 c 0.404181,-0.397377 0.409625,-1.032056 0,-1.42467 -0.204812,-0.197327 -0.476307,-0.299053 -0.74423,-0.297692 z"
- id="path3107"
- style="fill:#ff0000;stroke:#ff4042;stroke-width:0.2041318;stroke-miterlimit:10;stroke-opacity:1" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.1418" y="-.14627" width="1.2836" height="1.2925" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="0.9522046"/></filter></defs><line x1="4.1233" x2="27.306" y1="17.43" y2="15.177" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10" stroke-width="3"/><g transform="translate(-.28743 -.28743)"><path transform="matrix(.68044 0 0 .68044 2.0969 3.5975)" d="m26.957 11.637c-0.39375 2e-3 -0.79775 0.17675-1.0938 0.46875l-5.375 5.25-5.4375-5.2188c-0.602-0.58-1.5592-0.583-2.1562 0-0.598 0.584-0.602 1.547 0 2.125l5.4375 5.2187-5.375 5.25c-0.599 0.583-0.605 1.5168 0 2.0938 0.601 0.577 1.5905 0.586 2.1875 0l5.375-5.25 5.4375 5.1875c0.605 0.578 1.5582 0.584 2.1562 0 0.596-0.58 0.598-1.5148 0-2.0938l-5.4375-5.2188 5.375-5.25c0.594-0.584 0.602-1.548 0-2.125-0.301-0.29-0.7-0.4395-1.0938-0.4375z" filter="url(#a)"/><path d="m20.137 10.881c-0.26792 0.0014-0.54282 0.099-0.74423 0.29769l-3.6574 3.5723-3.6999-3.5298c-0.40962-0.39466-1.061-0.3967-1.4672 0-0.4069 0.39738-0.40962 1.0314 0 1.4247l3.6999 3.551-3.6574 3.5723c-0.40758 0.3967-0.41167 1.0533 0 1.4459 0.40894 0.39261 1.0822 0.37747 1.4885-0.02126l3.6574-3.5723 3.6999 3.551c0.41166 0.39329 1.0603 0.39738 1.4672 0 0.40554-0.39465 0.4069-1.052 0-1.4459l-3.6999-3.551 3.6574-3.5723c0.40418-0.39738 0.40962-1.0321 0-1.4247-0.20481-0.19733-0.47631-0.29905-0.74423-0.29769z" fill="#f00" stroke="#ff4042" stroke-miterlimit="10" stroke-width=".20413"/></g></svg>
diff --git a/silx/resources/gui/icons/profile1D.svg b/silx/resources/gui/icons/profile1D.svg
index 4465df5..67e932a 100644
--- a/silx/resources/gui/icons/profile1D.svg
+++ b/silx/resources/gui/icons/profile1D.svg
@@ -1,18 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(-35.201 -492.37)">
- <flowRoot fill="#000000" font-family="Sans" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><flowRegion><rect x="299.51" y="378.09" width="73.741" height="62.629"/></flowRegion><flowPara/></flowRoot>
- <rect x="38.265" y="494.84" width="27.563" height="26.906" ry="0" color="#000000" fill="#fff" stroke="#000" stroke-miterlimit="2" stroke-width="1.0776"/>
- <path d="m64.793 513.73-25.771-0.0252" fill="none" stroke="#f7941e" stroke-linecap="round" stroke-miterlimit="0" stroke-opacity=".81569" stroke-width="1.3908"/>
- <rect x="38.145" y="494.84" width="27.563" height="26.906" ry="0" color="#000000" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.0776"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(-35.201 -492.37)">
+<flowRoot fill="#000000" font-family="Sans" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><flowRegion><rect x="299.51" y="378.09" width="73.741" height="62.629"/></flowRegion><flowPara/></flowRoot>
+<rect x="38.265" y="494.84" width="27.563" height="26.906" ry="0" color="#000000" fill="#fff" stroke="#000" stroke-miterlimit="2" stroke-width="1.0776"/>
+<path d="m64.793 513.73-25.771-0.0252" fill="none" stroke="#f7941e" stroke-linecap="round" stroke-miterlimit="0" stroke-opacity=".81569" stroke-width="1.3908"/>
+<rect x="38.145" y="494.84" width="27.563" height="26.906" ry="0" color="#000000" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.0776"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/profile2D.svg b/silx/resources/gui/icons/profile2D.svg
index 089108f..51e8ece 100644
--- a/silx/resources/gui/icons/profile2D.svg
+++ b/silx/resources/gui/icons/profile2D.svg
@@ -1,21 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(-35.201 -492.37)">
- <path d="m36.808 505.45v17.66h17.686v-0.0531h0.58775l10.366-10.692-0.05335-0.0265-0.05335-17.633h-0.26716l0.05335-0.0531h-17.739l8.7e-5 -1.7e-4 -10.633 10.692z" fill="#fff"/>
- <rect transform="matrix(1 0 -.69678 .71728 0 0)" x="545.71" y="714.56" width="17.72" height="14.863" fill="#fff" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1598"/>
- <rect x="47.726" y="494.85" width="17.72" height="17.64" ry="0" fill="#fff" stroke="#000" stroke-miterlimit="2" stroke-width=".98223"/>
- <rect transform="matrix(1 0 -.70784 .70637 0 0)" x="543.37" y="700.5" width="17.72" height="15.092" fill="none" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1687"/>
- <rect transform="matrix(1 0 -.69678 .71728 0 0)" x="540.83" y="707.56" width="17.72" height="14.863" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1598"/>
- <rect x="36.897" y="505.63" width="17.72" height="17.64" ry="0" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width=".98223"/>
- <flowRoot fill="#000000" font-family="Sans" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><flowRegion><rect x="299.51" y="378.09" width="73.741" height="62.629"/></flowRegion><flowPara/></flowRoot>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(-35.201 -492.37)">
+<path d="m36.808 505.45v17.66h17.686v-0.0531h0.58775l10.366-10.692-0.05335-0.0265-0.05335-17.633h-0.26716l0.05335-0.0531h-17.739l8.7e-5 -1.7e-4 -10.633 10.692z" fill="#fff"/>
+<rect transform="matrix(1 0 -.69678 .71728 0 0)" x="545.71" y="714.56" width="17.72" height="14.863" fill="#fff" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1598"/>
+<rect x="47.726" y="494.85" width="17.72" height="17.64" ry="0" fill="#fff" stroke="#000" stroke-miterlimit="2" stroke-width=".98223"/>
+<rect transform="matrix(1 0 -.70784 .70637 0 0)" x="543.37" y="700.5" width="17.72" height="15.092" fill="none" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1687"/>
+<rect transform="matrix(1 0 -.69678 .71728 0 0)" x="540.83" y="707.56" width="17.72" height="14.863" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.1598"/>
+<rect x="36.897" y="505.63" width="17.72" height="17.64" ry="0" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width=".98223"/>
+<flowRoot fill="#000000" font-family="Sans" font-size="40px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><flowRegion><rect x="299.51" y="378.09" width="73.741" height="62.629"/></flowRegion><flowPara/></flowRoot>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/remove.svg b/silx/resources/gui/icons/remove.svg
index 3ce7ff8..4ac0f67 100644
--- a/silx/resources/gui/icons/remove.svg
+++ b/silx/resources/gui/icons/remove.svg
@@ -1,62 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata28"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs26" /><radialGradient
- cx="22.443001"
- cy="21.502001"
- r="0"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#517180;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop9"
- style="stop-color:#414042;stop-opacity:0.5"
- offset="1" /></radialGradient><path
- d="M 22.443,21.502"
- inkscape:connector-curvature="0"
- id="path11"
- style="fill:url(#b)" /><linearGradient
- x1="22.414"
- y1="21.502001"
- x2="22.473"
- y2="21.502001"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop14"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop16"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 22.443,24.002 c 0.038,0 0.038,-5 0,-5 -0.038,0 -0.038,5 0,5 z"
- inkscape:connector-curvature="0"
- id="path18"
- style="fill:url(#a)" /><path
- d="m 8.293,10.899 c 5.462,5.68 10.925,11.36 16.387,17.04 -0.814,-0.847 0.851,-4.115 0,-5 -5.462,-5.68 -10.924,-11.36 -16.387,-17.04 0.814,0.847 -0.851,4.116 0,5 z"
- inkscape:connector-curvature="0"
- id="path20"
- style="fill:#ed1c24" /><path
- d="M 24.452,5.675 C 19.018,11.333 13.583,16.992 8.148,22.65 c -0.851,0.886 0.814,4.152 0,5 5.435,-5.658 10.869,-11.317 16.304,-16.976 0.851,-0.884 -0.814,-4.152 0,-4.999 z"
- inkscape:connector-curvature="0"
- id="path22"
- style="fill:#ed1c24" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><radialGradient id="c" cx="22.443" cy="21.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><path d="m22.443 21.502" fill="url(#c)"/><linearGradient id="d" x1="22.414" x2="22.473" y1="21.502" y2="21.502" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><path d="m22.443 24.002c0.038 0 0.038-5 0-5s-0.038 5 0 5z" fill="url(#d)"/><path d="m8.293 10.899c5.462 5.68 10.925 11.36 16.387 17.04-0.814-0.847 0.851-4.115 0-5-5.462-5.68-10.924-11.36-16.387-17.04 0.814 0.847-0.851 4.116 0 5z" fill="#ed1c24"/><path d="m24.452 5.675c-5.434 5.658-10.869 11.317-16.304 16.975-0.851 0.886 0.814 4.152 0 5 5.435-5.658 10.869-11.317 16.304-16.976 0.851-0.884-0.814-4.152 0-4.999z" fill="#ed1c24"/></svg>
diff --git a/silx/resources/gui/icons/rotate-3d.png b/silx/resources/gui/icons/rotate-3d.png
new file mode 100644
index 0000000..4cf8403
--- /dev/null
+++ b/silx/resources/gui/icons/rotate-3d.png
Binary files differ
diff --git a/silx/resources/gui/icons/rotate-3d.svg b/silx/resources/gui/icons/rotate-3d.svg
new file mode 100644
index 0000000..7ae0e34
--- /dev/null
+++ b/silx/resources/gui/icons/rotate-3d.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<path d="m18.125 24.869c-0.30058 1.1349-0.6585 2.0533-1.0559 2.6879-0.39744 0.63468-0.83441 0.98564-1.2931 0.98564-1.8347 0-3.322-5.6154-3.322-12.542s1.4873-12.542 3.322-12.542c0.45868 0 0.89564 0.35096 1.2931 0.98564 0.39744 0.63468 0.75536 1.5531 1.0559 2.6879" fill="none" stroke="#000" stroke-linecap="round" stroke-width="2"/>
+<path d="m20.337 11.025c2.0047-0.09094 3.8084-0.12892 5.6292-0.1714l-2.4557 4.9793z"/>
+<path d="m24.361 13.367c1.1349 0.30058 2.0533 0.6585 2.6879 1.0559 0.63468 0.39744 0.98564 0.83441 0.98564 1.2931 0 1.8347-5.6154 3.322-12.542 3.322-6.927 0-12.542-1.4873-12.542-3.322 0-0.45868 0.35096-0.89564 0.98564-1.2931 0.63468-0.39744 1.5531-0.75536 2.6879-1.0559" fill="none" stroke="#000" stroke-linecap="round" stroke-width="2"/>
+<path d="m19.008 11.678c-1.3149-1.516-2.4635-2.9072-3.6262-4.309l5.4288-1.1625z"/>
+</svg>
diff --git a/silx/resources/gui/icons/rudder.svg b/silx/resources/gui/icons/rudder.svg
index 83cf9a9..6c8c742 100644
--- a/silx/resources/gui/icons/rudder.svg
+++ b/silx/resources/gui/icons/rudder.svg
@@ -1,24 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs8" /><path
- d="M 16.398,2.854 V 29.337 M 29.642,16.096 H 3.158 M 7.021,25.443 25.779,6.749 M 25.747,25.476 7.052,6.717 m 9.332,0.678 c -4.804,0 -8.701,3.895 -8.701,8.701 0,4.806 3.896,8.703 8.701,8.703 4.807,0 8.702,-3.897 8.702,-8.703 0,-4.806 -3.895,-8.701 -8.702,-8.701 z"
- inkscape:connector-curvature="0"
- id="path4"
- style="fill:none;stroke:#00a651;stroke-width:1.89999998;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m16.398 2.854v26.483m13.244-13.241h-26.484m3.863 9.347 18.758-18.694m-0.032 18.727-18.695-18.759m9.332 0.678c-4.804 0-8.701 3.895-8.701 8.701s3.896 8.703 8.701 8.703c4.807 0 8.702-3.897 8.702-8.703s-3.895-8.701-8.702-8.701z" fill="none" stroke="#00a651" stroke-miterlimit="10" stroke-width="1.9"/></svg>
diff --git a/silx/resources/gui/icons/selected.svg b/silx/resources/gui/icons/selected.svg
index 7f12860..d73d849 100644
--- a/silx/resources/gui/icons/selected.svg
+++ b/silx/resources/gui/icons/selected.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3255"
- xml:space="preserve"><metadata
- id="metadata3267"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3265"><filter
- x="-0.1568312"
- y="-0.13310958"
- width="1.3136624"
- height="1.2662193"
- color-interpolation-filters="sRGB"
- id="filter4492"><feGaussianBlur
- id="feGaussianBlur4494"
- stdDeviation="1.292605" /></filter></defs><rect
- width="19.802"
- height="19.799999"
- x="6.5999999"
- y="6.5019999"
- id="rect3257"
- style="fill:none;stroke:#000000;stroke-miterlimit:10" /><path
- d="m 8.1240038,17.76283 c 4.1369992,0.876 6.7039992,5.926 8.5199992,9.279 -0.6,-1.106 0.144,-3.692 0,-5 -0.036,-0.327 -0.072,-0.654 -0.108,-0.982 v 5 c 0.322,-4.015 2.883,-7.747 5.092,-10.997 1.146,-1.687999 3.936,-5.9909991 6.068,-6.3259991 0.292,-0.046 -0.219,-4.966 0,-5.0000004 -1.679,0.2640004 -3.304,2.9040004 -4.336,4.1140004 -2.09,2.4490001 -3.723,5.2160001 -5.227,8.0529991 -1.823,3.438 -1.907,7.337 -1.49,11.139 v -5 c -1.815,-3.353 -4.382,-8.402999 -8.5199992,-9.278999 0.303,0.063 -0.373,4.918999 0.001,4.998999 z"
- id="path3261-9"
- style="fill:#000000;filter:url(#filter4492)" /><path
- d="m 7.489,16.747 c 4.137,0.876 6.704,5.926 8.52,9.279 -0.6,-1.106 0.144,-3.692 0,-5 -0.036,-0.327 -0.072,-0.654 -0.108,-0.982 v 5 c 0.322,-4.015 2.883,-7.747 5.092,-10.997 1.146,-1.688 3.936,-5.991 6.068,-6.326 0.292,-0.046 -0.219,-4.966 0,-5 -1.679,0.264 -3.304,2.904 -4.336,4.114 -2.09,2.449 -3.723,5.216 -5.227,8.053 -1.823,3.438 -1.907,7.337 -1.49,11.139 v -5 c -1.815,-3.353 -4.382,-8.403 -8.52,-9.279 0.303,0.063 -0.373,4.919 10e-4,4.999 z"
- id="path3261"
- style="fill:#00a651" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.15683" y="-.13311" width="1.3137" height="1.2662" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.292605"/></filter></defs><rect x="6.6" y="6.502" width="19.802" height="19.8" fill="none" stroke="#000" stroke-miterlimit="10"/><path d="m8.124 17.763c4.137 0.876 6.704 5.926 8.52 9.279-0.6-1.106 0.144-3.692 0-5-0.036-0.327-0.072-0.654-0.108-0.982v5c0.322-4.015 2.883-7.747 5.092-10.997 1.146-1.688 3.936-5.991 6.068-6.326 0.292-0.046-0.219-4.966 0-5-1.679 0.264-3.304 2.904-4.336 4.114-2.09 2.449-3.723 5.216-5.227 8.053-1.823 3.438-1.907 7.337-1.49 11.139v-5c-1.815-3.353-4.382-8.403-8.52-9.279 0.303 0.063-0.373 4.919 1e-3 4.999z" filter="url(#a)"/><path d="m7.489 16.747c4.137 0.876 6.704 5.926 8.52 9.279-0.6-1.106 0.144-3.692 0-5-0.036-0.327-0.072-0.654-0.108-0.982v5c0.322-4.015 2.883-7.747 5.092-10.997 1.146-1.688 3.936-5.991 6.068-6.326 0.292-0.046-0.219-4.966 0-5-1.679 0.264-3.304 2.904-4.336 4.114-2.09 2.449-3.723 5.216-5.227 8.053-1.823 3.438-1.907 7.337-1.49 11.139v-5c-1.815-3.353-4.382-8.403-8.52-9.279 0.303 0.063-0.373 4.919 1e-3 4.999z" fill="#00a651"/></svg>
diff --git a/silx/resources/gui/icons/shape-polygon.svg b/silx/resources/gui/icons/shape-polygon.svg
index 0aa07a1..b30503c 100644
--- a/silx/resources/gui/icons/shape-polygon.svg
+++ b/silx/resources/gui/icons/shape-polygon.svg
@@ -1,22 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs8" /><polygon
- points="17.425,14.594 26.908,19.767 20.964,27.766 8.163,26.214 11.774,22.113 5.596,13.013 14.631,4.408 "
- id="polygon4"
- style="fill:none;stroke:#f7941e;stroke-width:2.5;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><polygon points="17.425 14.594 26.908 19.767 20.964 27.766 8.163 26.214 11.774 22.113 5.596 13.013 14.631 4.408" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.5"/></svg>
diff --git a/silx/resources/gui/icons/shape-rectangle.svg b/silx/resources/gui/icons/shape-rectangle.svg
index 1405c9f..caade30 100644
--- a/silx/resources/gui/icons/shape-rectangle.svg
+++ b/silx/resources/gui/icons/shape-rectangle.svg
@@ -1,25 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs8" /><rect
- width="21.139999"
- height="12.56"
- x="6.3400002"
- y="11.485"
- id="rect4"
- style="fill:none;stroke:#f7941e;stroke-width:3;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="6.34" y="11.485" width="21.14" height="12.56" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="3"/></svg>
diff --git a/silx/resources/gui/icons/shape-square.svg b/silx/resources/gui/icons/shape-square.svg
index 469f0fb..de6eda8 100644
--- a/silx/resources/gui/icons/shape-square.svg
+++ b/silx/resources/gui/icons/shape-square.svg
@@ -1,25 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs8" /><rect
- width="18.5"
- height="18.5"
- x="7.099"
- y="7.0830002"
- id="rect4"
- style="fill:none;stroke:#f7941e;stroke-width:2.5;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><rect x="7.099" y="7.083" width="18.5" height="18.5" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="2.5"/></svg>
diff --git a/silx/resources/gui/icons/shape-vertical.svg b/silx/resources/gui/icons/shape-vertical.svg
index 5fbce1e..8cf3b97 100644
--- a/silx/resources/gui/icons/shape-vertical.svg
+++ b/silx/resources/gui/icons/shape-vertical.svg
@@ -1,29 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata10"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs8" /><line
- x1="16.261"
- x2="16.261"
- y1="7.6680002"
- y2="27.667999"
- fill="none"
- stroke="#F7941E"
- stroke-miterlimit="10"
- stroke-width="3"
- id="line4"
- style="fill:none;stroke:#f7941e;stroke-width:3;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><line x1="16.261" x2="16.261" y1="7.668" y2="27.668" fill="none" stroke="#f7941e" stroke-miterlimit="10" stroke-width="3"/></svg>
diff --git a/silx/resources/gui/icons/silx.svg b/silx/resources/gui/icons/silx.svg
index 25381ce..e666b73 100644
--- a/silx/resources/gui/icons/silx.svg
+++ b/silx/resources/gui/icons/silx.svg
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg width="32" height="32" enable-background="new 0 0 46.401 46.401" version="1.1" viewBox="0 0 31.999999 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata>
+<svg enable-background="new 0 0 46.401 46.401" version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
<g transform="matrix(.6896 0 0 .6896 -.020788 -.30571)">
<polygon points="29.495 28.237 38.689 29.693 39.026 32.153 33.188 36.185 32.301 35.732 31.56 35.929" fill="#5a5b5d"/>
<path d="m29.222 26.766c0.057-0.121-2.232-0.209-2.232-0.209l-4.19 3.048 4.559 7.404 4.322-1.051-2.459-9.192z" fill="#808285"/>
diff --git a/silx/resources/gui/icons/sliders-off.svg b/silx/resources/gui/icons/sliders-off.svg
index 2799274..1ed69ce 100644
--- a/silx/resources/gui/icons/sliders-off.svg
+++ b/silx/resources/gui/icons/sliders-off.svg
@@ -1,118 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata52"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs50" /><g
- id="g4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10"><line
- x1="5.098"
- x2="9.5120001"
- y1="9.0349998"
- y2="9.0349998"
- id="line6" /><line
- x1="13.449"
- x2="19.752001"
- y1="9.0349998"
- y2="9.0349998"
- id="line8" /><rect
- width="3.5639999"
- height="2.7550001"
- x="9.5179996"
- y="7.658"
- id="rect10" /><rect
- width="3.563"
- height="2.7550001"
- x="20.006001"
- y="7.658"
- id="rect12" /><line
- x1="23.246"
- x2="27.66"
- y1="9.0349998"
- y2="9.0349998"
- id="line14" /><line
- x1="5.098"
- x2="7.6560001"
- y1="15.613"
- y2="15.644"
- id="line16" /><rect
- width="3.5639999"
- height="2.7539999"
- x="7.0879998"
- y="14.236"
- id="rect18" /><rect
- width="3.5639999"
- height="2.7539999"
- x="21.625"
- y="14.236"
- id="rect20" /><line
- x1="11.092"
- x2="21.625"
- y1="15.612"
- y2="15.639"
- id="line22" /><path
- d="M 24.611,15.639"
- inkscape:connector-curvature="0"
- id="path24" /><line
- x1="5.098"
- x2="8.4490004"
- y1="22.191"
- y2="22.191"
- id="line26" /><line
- x1="11.829"
- x2="18.131001"
- y1="22.191"
- y2="22.191"
- id="line28" /><rect
- width="3.5639999"
- height="2.7550001"
- x="7.8979998"
- y="20.813"
- id="rect30" /><rect
- width="3.5639999"
- height="2.7550001"
- x="18.385"
- y="20.813"
- id="rect32" /><line
- x1="22.437"
- x2="27.66"
- y1="22.191"
- y2="22.191"
- id="line34" /><path
- d="M 25.416,15.639"
- inkscape:connector-curvature="0"
- id="path36" /><path
- d="M 23.208,15.639"
- inkscape:connector-curvature="0"
- id="path38" /><line
- x1="24.611"
- x2="27.542999"
- y1="15.639"
- y2="15.649"
- id="line40" /></g><g
- id="g42"
- style="fill:none;stroke:#ed1c24;stroke-width:1.79999995;stroke-miterlimit:10"><line
- x1="8.1260004"
- x2="24.591999"
- y1="7.2610002"
- y2="24.037001"
- id="line44" /><line
- x1="24.746"
- x2="7.9720001"
- y1="7.4159999"
- y2="23.882999"
- id="line46" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"><line x1="5.098" x2="9.512" y1="9.035" y2="9.035"/><line x1="13.449" x2="19.752" y1="9.035" y2="9.035"/><rect x="9.518" y="7.658" width="3.564" height="2.755"/><rect x="20.006" y="7.658" width="3.563" height="2.755"/><line x1="23.246" x2="27.66" y1="9.035" y2="9.035"/><line x1="5.098" x2="7.656" y1="15.613" y2="15.644"/><rect x="7.088" y="14.236" width="3.564" height="2.754"/><rect x="21.625" y="14.236" width="3.564" height="2.754"/><line x1="11.092" x2="21.625" y1="15.612" y2="15.639"/><path d="m24.611 15.639"/><line x1="5.098" x2="8.449" y1="22.191" y2="22.191"/><line x1="11.829" x2="18.131" y1="22.191" y2="22.191"/><rect x="7.898" y="20.813" width="3.564" height="2.755"/><rect x="18.385" y="20.813" width="3.564" height="2.755"/><line x1="22.437" x2="27.66" y1="22.191" y2="22.191"/><path d="m25.416 15.639"/><path d="m23.208 15.639"/><line x1="24.611" x2="27.543" y1="15.639" y2="15.649"/></g><g fill="none" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="1.8"><line x1="8.126" x2="24.592" y1="7.261" y2="24.037"/><line x1="24.746" x2="7.972" y1="7.416" y2="23.883"/></g></svg>
diff --git a/silx/resources/gui/icons/sliders-on.svg b/silx/resources/gui/icons/sliders-on.svg
index ba31951..b70d36c 100644
--- a/silx/resources/gui/icons/sliders-on.svg
+++ b/silx/resources/gui/icons/sliders-on.svg
@@ -1,106 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata46"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs44" /><g
- id="g4"
- style="fill:none;stroke:#00a14b;stroke-width:1.5;stroke-miterlimit:10"><line
- x1="4.7480001"
- x2="9.5120001"
- y1="9.0349998"
- y2="9.0349998"
- id="line6" /><line
- x1="13.449"
- x2="19.752001"
- y1="9.0349998"
- y2="9.0349998"
- id="line8" /><rect
- width="3.5639999"
- height="2.7550001"
- x="9.5179996"
- y="7.658"
- id="rect10" /><rect
- width="3.563"
- height="2.7550001"
- x="20.006001"
- y="7.658"
- id="rect12" /><line
- x1="23.246"
- x2="27.66"
- y1="9.0349998"
- y2="9.0349998"
- id="line14" /><line
- x1="5.098"
- x2="8.4490004"
- y1="22.191"
- y2="22.191"
- id="line16" /><line
- x1="11.829"
- x2="18.131001"
- y1="22.191"
- y2="22.191"
- id="line18" /><rect
- width="3.5639999"
- height="2.7550001"
- x="7.8979998"
- y="20.813"
- id="rect20" /><rect
- width="3.5639999"
- height="2.7550001"
- x="18.385"
- y="20.813"
- id="rect22" /><line
- x1="22.437"
- x2="27.66"
- y1="22.191"
- y2="22.191"
- id="line24" /><line
- x1="4.7480001"
- x2="7.6560001"
- y1="15.659"
- y2="15.644"
- id="line26" /><rect
- width="3.5639999"
- height="2.7539999"
- x="7.0879998"
- y="14.236"
- id="rect28" /><rect
- width="3.5639999"
- height="2.7539999"
- x="21.625"
- y="14.236"
- id="rect30" /><line
- x1="11.092"
- x2="21.625"
- y1="15.612"
- y2="15.639"
- id="line32" /><path
- d="M 24.611,15.639"
- inkscape:connector-curvature="0"
- id="path34" /><path
- d="M 25.416,15.639"
- inkscape:connector-curvature="0"
- id="path36" /><path
- d="M 23.208,15.639"
- inkscape:connector-curvature="0"
- id="path38" /><line
- x1="24.729"
- x2="27.66"
- y1="15.649"
- y2="15.659"
- id="line40" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><g fill="none" stroke="#00a14b" stroke-miterlimit="10" stroke-width="1.5"><line x1="4.748" x2="9.512" y1="9.035" y2="9.035"/><line x1="13.449" x2="19.752" y1="9.035" y2="9.035"/><rect x="9.518" y="7.658" width="3.564" height="2.755"/><rect x="20.006" y="7.658" width="3.563" height="2.755"/><line x1="23.246" x2="27.66" y1="9.035" y2="9.035"/><line x1="5.098" x2="8.449" y1="22.191" y2="22.191"/><line x1="11.829" x2="18.131" y1="22.191" y2="22.191"/><rect x="7.898" y="20.813" width="3.564" height="2.755"/><rect x="18.385" y="20.813" width="3.564" height="2.755"/><line x1="22.437" x2="27.66" y1="22.191" y2="22.191"/><line x1="4.748" x2="7.656" y1="15.659" y2="15.644"/><rect x="7.088" y="14.236" width="3.564" height="2.754"/><rect x="21.625" y="14.236" width="3.564" height="2.754"/><line x1="11.092" x2="21.625" y1="15.612" y2="15.639"/><path d="m24.611 15.639"/><path d="m25.416 15.639"/><path d="m23.208 15.639"/><line x1="24.729" x2="27.66" y1="15.649" y2="15.659"/></g></svg>
diff --git a/silx/resources/gui/icons/spec.svg b/silx/resources/gui/icons/spec.svg
index cc17c67..26d9d5f 100644
--- a/silx/resources/gui/icons/spec.svg
+++ b/silx/resources/gui/icons/spec.svg
@@ -1,56 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata26"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs24" /><path
- d="M 18.462,31.115"
- inkscape:connector-curvature="0"
- id="path4"
- style="stroke:#ffffff;stroke-width:0.50999999;stroke-miterlimit:10" /><rect
- width="28.273001"
- height="21.511999"
- x="2.3959999"
- y="4.5700002"
- id="rect6"
- style="fill:none;stroke:#000000;stroke-width:0.20999999;stroke-miterlimit:10" /><rect
- width="28.273001"
- height="21.511999"
- x="2.3959999"
- y="4.5700002"
- id="rect8"
- style="fill:#e6e7e8" /><g
- id="g10"
- style="stroke:#000000;stroke-width:0.2;stroke-miterlimit:10"><path
- d="m 3.264,19.466 c 0.511,0.324 1.277,0.606 2.082,0.606 1.009,0 1.571,-0.521 1.571,-1.296 0,-0.719 -0.434,-1.141 -1.532,-1.577 C 3.967,16.635 3.06,15.804 3.06,14.438 c 0,-1.549 1.175,-2.732 3.04,-2.732 0.933,0 1.622,0.226 2.069,0.479 L 7.786,13.579 C 7.479,13.396 6.879,13.128 6.075,13.128 c -0.996,0 -1.43,0.592 -1.43,1.141 0,0.732 0.498,1.07 1.647,1.563 1.494,0.62 2.222,1.451 2.222,2.817 0,1.521 -1.047,2.845 -3.27,2.845 -0.907,0 -1.852,-0.281 -2.325,-0.592 l 0.345,-1.436 z"
- inkscape:connector-curvature="0"
- id="path12" /><path
- d="m 9.929,11.988 c 0.562,-0.113 1.341,-0.197 2.401,-0.197 1.15,0 1.993,0.268 2.542,0.775 0.511,0.464 0.843,1.211 0.843,2.098 0,0.901 -0.255,1.648 -0.741,2.155 -0.626,0.69 -1.609,1.015 -2.72,1.015 -0.294,0 -0.562,-0.015 -0.767,-0.057 v 3.577 H 9.929 v -9.366 z m 1.558,4.422 c 0.191,0.056 0.447,0.07 0.767,0.07 1.175,0 1.89,-0.634 1.89,-1.747 0,-1.056 -0.664,-1.62 -1.75,-1.62 -0.434,0 -0.741,0.042 -0.907,0.084 v 3.213 z"
- inkscape:connector-curvature="0"
- id="path14" /><path
- d="m 21.881,17.143 h -3.243 v 2.788 h 3.627 v 1.423 h -5.198 v -9.493 h 5.007 v 1.423 h -3.436 v 2.45 h 3.243 v 1.409 z"
- inkscape:connector-curvature="0"
- id="path16" /><path
- d="m 29.811,21.072 c -0.37,0.211 -1.188,0.422 -2.222,0.422 -2.733,0 -4.394,-1.887 -4.394,-4.774 0,-3.126 1.967,-5.014 4.598,-5.014 1.034,0 1.775,0.239 2.095,0.422 l -0.345,1.38 c -0.409,-0.197 -0.971,-0.366 -1.687,-0.366 -1.749,0 -3.014,1.211 -3.014,3.493 0,2.084 1.111,3.422 3.001,3.422 0.639,0 1.303,-0.141 1.712,-0.352 l 0.256,1.367 z"
- inkscape:connector-curvature="0"
- id="path18" /></g><rect
- width="28.273001"
- height="2.881"
- x="2.3959999"
- y="4.678"
- id="rect20"
- style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m18.462 31.115" stroke="#fff" stroke-miterlimit="10" stroke-width=".51"/><rect x="2.396" y="4.57" width="28.273" height="21.512" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".21"/><rect x="2.396" y="4.57" width="28.273" height="21.512" fill="#e6e7e8"/><g stroke="#000" stroke-miterlimit="10" stroke-width=".2"><path d="m3.264 19.466c0.511 0.324 1.277 0.606 2.082 0.606 1.009 0 1.571-0.521 1.571-1.296 0-0.719-0.434-1.141-1.532-1.577-1.418-0.564-2.325-1.395-2.325-2.761 0-1.549 1.175-2.732 3.04-2.732 0.933 0 1.622 0.226 2.069 0.479l-0.383 1.394c-0.307-0.183-0.907-0.451-1.711-0.451-0.996 0-1.43 0.592-1.43 1.141 0 0.732 0.498 1.07 1.647 1.563 1.494 0.62 2.222 1.451 2.222 2.817 0 1.521-1.047 2.845-3.27 2.845-0.907 0-1.852-0.281-2.325-0.592l0.345-1.436z"/><path d="m9.929 11.988c0.562-0.113 1.341-0.197 2.401-0.197 1.15 0 1.993 0.268 2.542 0.775 0.511 0.464 0.843 1.211 0.843 2.098 0 0.901-0.255 1.648-0.741 2.155-0.626 0.69-1.609 1.015-2.72 1.015-0.294 0-0.562-0.015-0.767-0.057v3.577h-1.558v-9.366zm1.558 4.422c0.191 0.056 0.447 0.07 0.767 0.07 1.175 0 1.89-0.634 1.89-1.747 0-1.056-0.664-1.62-1.75-1.62-0.434 0-0.741 0.042-0.907 0.084v3.213z"/><path d="m21.881 17.143h-3.243v2.788h3.627v1.423h-5.198v-9.493h5.007v1.423h-3.436v2.45h3.243v1.409z"/><path d="m29.811 21.072c-0.37 0.211-1.188 0.422-2.222 0.422-2.733 0-4.394-1.887-4.394-4.774 0-3.126 1.967-5.014 4.598-5.014 1.034 0 1.775 0.239 2.095 0.422l-0.345 1.38c-0.409-0.197-0.971-0.366-1.687-0.366-1.749 0-3.014 1.211-3.014 3.493 0 2.084 1.111 3.422 3.001 3.422 0.639 0 1.303-0.141 1.712-0.352l0.256 1.367z"/></g><rect x="2.396" y="4.678" width="28.273" height="2.881" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width=".2"/></svg>
diff --git a/silx/resources/gui/icons/test-png.png b/silx/resources/gui/icons/test-png.png
deleted file mode 100644
index 7aa66d6..0000000
--- a/silx/resources/gui/icons/test-png.png
+++ /dev/null
Binary files differ
diff --git a/silx/resources/gui/icons/test-svg.svg b/silx/resources/gui/icons/test-svg.svg
deleted file mode 100644
index 417d0ce..0000000
--- a/silx/resources/gui/icons/test-svg.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(0 -1036.4)">
- <path transform="translate(-1.5964 1036.4)" d="m14.268 7.9188c0 2.5803-2.0917 4.672-4.672 4.672-2.5802 0-4.672-2.0917-4.672-4.672 0-2.5802 2.0917-4.672 4.672-4.672s4.672 2.0917 4.672 4.672z" color="#000000" fill="#F00"/>
- </g>
-</svg>
diff --git a/silx/resources/gui/icons/view-1d.svg b/silx/resources/gui/icons/view-1d.svg
index 3632f45..1c6780d 100644
--- a/silx/resources/gui/icons/view-1d.svg
+++ b/silx/resources/gui/icons/view-1d.svg
@@ -1,17 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g transform="translate(1.1932 -1.149)">
- <path d="m28.765 3.4301v26.581h-26.863v-26.581" fill="#f7941e" fill-opacity=".81569"/>
- <path d="m28.76 30.013h-26.951v-26.583" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.3"/>
- </g>
- <path d="m29.956 16.168c-2.7537-0.0701-5.2366 4.4566-7.5238 3.9365-7.6475-1.7392-8.9368-19.912-19.399-3.7641-0.048098 0.07424-0.33967-0.06041-0.52072-0.05101" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.5627"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<g transform="translate(1.1932 -1.149)">
+<path d="m28.765 3.4301v26.581h-26.863v-26.581" fill="#f7941e" fill-opacity=".81569"/>
+<path d="m28.76 30.013h-26.951v-26.583" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.3"/>
+</g>
+<path d="m29.956 16.168c-2.7537-0.0701-5.2366 4.4566-7.5238 3.9365-7.6475-1.7392-8.9368-19.912-19.399-3.7641-0.048098 0.07424-0.33967-0.06041-0.52072-0.05101" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.5627"/>
</svg>
diff --git a/silx/resources/gui/icons/view-2d-stack.svg b/silx/resources/gui/icons/view-2d-stack.svg
index ca81b16..8d6d355 100644
--- a/silx/resources/gui/icons/view-2d-stack.svg
+++ b/silx/resources/gui/icons/view-2d-stack.svg
@@ -1,15 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect x="10.867" y="2.9322" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="6.9153" y="6.8983" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="2.9631" y="10.864" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect x="10.867" y="2.9322" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="6.9153" y="6.8983" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="2.9631" y="10.864" width="18" height="18" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
</svg>
diff --git a/silx/resources/gui/icons/view-2d.svg b/silx/resources/gui/icons/view-2d.svg
index aba32c7..a571895 100644
--- a/silx/resources/gui/icons/view-2d.svg
+++ b/silx/resources/gui/icons/view-2d.svg
@@ -1,13 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect x="2.8314" y="2.8314" width="26.026" height="26.026" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect x="2.8314" y="2.8314" width="26.026" height="26.026" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
</svg>
diff --git a/silx/resources/gui/icons/view-3d.svg b/silx/resources/gui/icons/view-3d.svg
index 3a00254..90e4686 100644
--- a/silx/resources/gui/icons/view-3d.svg
+++ b/silx/resources/gui/icons/view-3d.svg
@@ -1,17 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect transform="matrix(1 0 -.69517 .71885 0 0)" x="31.3" y="26.522" width="16.142" height="13.571" fill="none" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.6512"/>
- <rect x="12.767" y="2.935" width="15.819" height="16.09" ry="0" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.3837"/>
- <rect transform="matrix(1 0 -.70625 .70796 0 0)" x="15.432" y="4.0219" width="16.142" height="13.779" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.6639"/>
- <rect x="2.9112" y="12.74" width="16.142" height="16.142" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <path d="m28.899 18.96 0.0111-15.906-9.4388 9.4342-0.0111 16.222z" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linejoin="bevel" stroke-miterlimit="0" stroke-width="1.4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect transform="matrix(1 0 -.69517 .71885 0 0)" x="31.3" y="26.522" width="16.142" height="13.571" fill="none" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.6512"/>
+<rect x="12.767" y="2.935" width="15.819" height="16.09" ry="0" fill="none" stroke="#000" stroke-miterlimit="2" stroke-width="1.3837"/>
+<rect transform="matrix(1 0 -.70625 .70796 0 0)" x="15.432" y="4.0219" width="16.142" height="13.779" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linecap="square" stroke-miterlimit="0" stroke-width="1.6639"/>
+<rect x="2.9112" y="12.74" width="16.142" height="16.142" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<path d="m28.899 18.96 0.0111-15.906-9.4388 9.4342-0.0111 16.222z" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-linejoin="bevel" stroke-miterlimit="0" stroke-width="1.4"/>
</svg>
diff --git a/silx/resources/gui/icons/view-fullscreen.svg b/silx/resources/gui/icons/view-fullscreen.svg
index 3164a0c..cc389ce 100644
--- a/silx/resources/gui/icons/view-fullscreen.svg
+++ b/silx/resources/gui/icons/view-fullscreen.svg
@@ -1,70 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg3005"
- xml:space="preserve"><metadata
- id="metadata3035"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs3033"><filter
- x="-0.11942703"
- y="-0.18130475"
- width="1.2388541"
- height="1.3626095"
- color-interpolation-filters="sRGB"
- id="filter3804"><feGaussianBlur
- id="feGaussianBlur3806"
- stdDeviation="1.05051" /></filter></defs><rect
- width="27.627001"
- height="20.344"
- x="2.688"
- y="5.8280001"
- id="rect3011"
- style="fill:#ffffff;stroke:#000000;stroke-width:0.69999999;stroke-miterlimit:10" /><rect
- width="26.986"
- height="2.681"
- x="3.0090001"
- y="5.8280001"
- id="rect3013"
- style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-miterlimit:10" /><g
- transform="translate(0.04793944,-3.4995793)"
- id="g6066"
- style="fill:#000000;filter:url(#filter3804)"><polygon
- points="10.365,24.588 9.183,23.109 13.122,19.823 12.04,18.469 8.102,21.758 6.92,20.279 6.145,24.518 "
- transform="translate(-0.06551334,4.603172)"
- id="polygon3017-1"
- style="fill:#000000" /><polygon
- points="22.924,10.866 24.206,12.38 20.324,15.808 21.498,17.193 25.38,13.763 26.657,15.271 27.256,10.894 "
- transform="translate(-0.06551334,4.603172)"
- id="polygon3021-2"
- style="fill:#000000" /><polygon
- points="6.718,15.227 8.002,13.709 11.862,17.123 13.036,15.735 9.178,12.323 10.463,10.808 6.145,10.85 "
- transform="translate(-0.06551334,4.603172)"
- id="polygon3025-7"
- style="fill:#000000" /><polygon
- points="26.391,20.21 25.248,21.758 21.257,18.677 20.215,20.09 24.206,23.168 23.063,24.714 27.256,24.415 "
- transform="translate(-0.06551334,4.603172)"
- id="polygon3029-0"
- style="fill:#000000" /></g><polygon
- points="9.183,23.109 13.122,19.823 12.04,18.469 8.102,21.758 6.92,20.279 6.145,24.518 10.365,24.588 "
- id="polygon3017"
- style="fill:#ed1c24" /><polygon
- points="24.206,12.38 20.324,15.808 21.498,17.193 25.38,13.763 26.657,15.271 27.256,10.894 22.924,10.866 "
- id="polygon3021"
- style="fill:#ed1c24" /><polygon
- points="8.002,13.709 11.862,17.123 13.036,15.735 9.178,12.323 10.463,10.808 6.145,10.85 6.718,15.227 "
- id="polygon3025"
- style="fill:#ed1c24" /><polygon
- points="25.248,21.758 21.257,18.677 20.215,20.09 24.206,23.168 23.063,24.714 27.256,24.415 26.391,20.21 "
- id="polygon3029"
- style="fill:#ed1c24" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="a" x="-.11943" y="-.1813" width="1.2389" height="1.3626" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.05051"/></filter></defs><rect x="2.688" y="5.828" width="27.627" height="20.344" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width=".7"/><rect x="3.009" y="5.828" width="26.986" height="2.681" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width=".2"/><g transform="translate(.047939 -3.4996)" filter="url(#a)"><polygon transform="translate(-.065513 4.6032)" points="10.365 24.588 9.183 23.109 13.122 19.823 12.04 18.469 8.102 21.758 6.92 20.279 6.145 24.518"/><polygon transform="translate(-.065513 4.6032)" points="22.924 10.866 24.206 12.38 20.324 15.808 21.498 17.193 25.38 13.763 26.657 15.271 27.256 10.894"/><polygon transform="translate(-.065513 4.6032)" points="6.718 15.227 8.002 13.709 11.862 17.123 13.036 15.735 9.178 12.323 10.463 10.808 6.145 10.85"/><polygon transform="translate(-.065513 4.6032)" points="26.391 20.21 25.248 21.758 21.257 18.677 20.215 20.09 24.206 23.168 23.063 24.714 27.256 24.415"/></g><polygon points="9.183 23.109 13.122 19.823 12.04 18.469 8.102 21.758 6.92 20.279 6.145 24.518 10.365 24.588" fill="#ed1c24"/><polygon points="24.206 12.38 20.324 15.808 21.498 17.193 25.38 13.763 26.657 15.271 27.256 10.894 22.924 10.866" fill="#ed1c24"/><polygon points="8.002 13.709 11.862 17.123 13.036 15.735 9.178 12.323 10.463 10.808 6.145 10.85 6.718 15.227" fill="#ed1c24"/><polygon points="25.248 21.758 21.257 18.677 20.215 20.09 24.206 23.168 23.063 24.714 27.256 24.415 26.391 20.21" fill="#ed1c24"/></svg>
diff --git a/silx/resources/gui/icons/view-hdf5.svg b/silx/resources/gui/icons/view-hdf5.svg
index e542ef0..591bc4a 100644
--- a/silx/resources/gui/icons/view-hdf5.svg
+++ b/silx/resources/gui/icons/view-hdf5.svg
@@ -1,14 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path transform="translate(9.9117 -.3238)" d="m18.888 16.324a12.8 12.8 0 1 1 -25.6 0 12.8 12.8 0 1 1 25.6 0z" color="#000000" fill="#f6941d" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <text x="6.1552963" y="21.15884" fill="#000000" font-family="Sans" font-size="13.838px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><tspan x="6.1552963" y="21.15884" font-weight="bold">h5</tspan></text>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<path transform="translate(9.9117 -.3238)" d="m18.888 16.324a12.8 12.8 0 1 1-25.6 0 12.8 12.8 0 1 1 25.6 0z" color="#000000" fill="#f6941d" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<text x="6.1552963" y="21.15884" fill="#000000" font-family="Sans" font-size="13.838px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><tspan x="6.1552963" y="21.15884" font-weight="bold">h5</tspan></text>
</svg>
diff --git a/silx/resources/gui/icons/view-nexus.svg b/silx/resources/gui/icons/view-nexus.svg
index 6a1aa09..eef5e54 100644
--- a/silx/resources/gui/icons/view-nexus.svg
+++ b/silx/resources/gui/icons/view-nexus.svg
@@ -1,69 +1,5 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="32"
- height="32"
- id="svg3001"
- inkscape:version="0.48.5 r10040"
- sodipodi:docname="view-hdf5.svg">
- <sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1920"
- inkscape:window-height="1161"
- id="namedview8"
- showgrid="false"
- inkscape:zoom="20.85965"
- inkscape:cx="18.004605"
- inkscape:cy="9.8354269"
- inkscape:window-x="0"
- inkscape:window-y="0"
- inkscape:window-maximized="1"
- inkscape:current-layer="svg3001" />
- <defs
- id="defs3019" />
- <metadata
- id="metadata3003">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <path
- d="m 18.888141,16.323803 a 12.799831,12.799831 0 1 1 -25.5996631,0 12.799831,12.799831 0 1 1 25.5996631,0 z"
- transform="translate(9.9116907,-0.32380295)"
- id="path2987"
- style="color:#000000;fill:#f6941d;fill-opacity:0.81568627;fill-rule:nonzero;stroke:#000000;stroke-width:1.39999998;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <text
- x="6.0864153"
- y="20.080931"
- id="text3757"
- xml:space="preserve"
- style="font-size:13.09981823px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
- sodipodi:linespacing="125%"
- transform="scale(0.95955357,1.0421513)"><tspan
- x="6.0864153"
- y="20.080931"
- id="tspan3759"
- style="font-weight:bold;-inkscape-font-specification:Sans Bold">NX</tspan></text>
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<path transform="translate(9.9117 -.3238)" d="m18.888 16.324a12.8 12.8 0 1 1-25.6 0 12.8 12.8 0 1 1 25.6 0z" color="#000000" fill="#f6941d" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<text transform="scale(.95955 1.0422)" x="6.0864153" y="20.080931" fill="#000000" font-family="Sans" font-size="13.1px" letter-spacing="0px" word-spacing="0px" style="line-height:125%" xml:space="preserve"><tspan x="6.0864153" y="20.080931" font-weight="bold">NX</tspan></text>
</svg>
diff --git a/silx/resources/gui/icons/view-nofullscreen.svg b/silx/resources/gui/icons/view-nofullscreen.svg
index c5b2c24..ee0bd9f 100644
--- a/silx/resources/gui/icons/view-nofullscreen.svg
+++ b/silx/resources/gui/icons/view-nofullscreen.svg
@@ -1,95 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg4275"
- xml:space="preserve"><metadata
- id="metadata4303"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
- id="defs4301"><filter
- x="-0.33807367"
- y="-0.42624661"
- width="1.6761473"
- height="1.8524932"
- color-interpolation-filters="sRGB"
- id="filter3943"><feGaussianBlur
- id="feGaussianBlur3945"
- stdDeviation="1.16241" /></filter><filter
- x="-0.3533161"
- y="-0.42546651"
- width="1.7066323"
- height="1.850933"
- color-interpolation-filters="sRGB"
- id="filter3947"><feGaussianBlur
- id="feGaussianBlur3949"
- stdDeviation="1.16241" /></filter><filter
- x="-0.34981617"
- y="-0.42520714"
- width="1.6996324"
- height="1.8504143"
- color-interpolation-filters="sRGB"
- id="filter3951"><feGaussianBlur
- id="feGaussianBlur3953"
- stdDeviation="1.16241" /></filter><filter
- x="-0.34548408"
- y="-0.41976887"
- width="1.6909682"
- height="1.8395379"
- color-interpolation-filters="sRGB"
- id="filter3955"><feGaussianBlur
- id="feGaussianBlur3957"
- stdDeviation="1.16241" /></filter></defs><g
- id="g3959"><polygon
- points="28.095,10.325 26.996,8.802 22.393,12.264 21.201,10.608 20.02,15.224 24.684,15.448 23.488,13.785 "
- transform="translate(0.11748671,0.92428829)"
- id="polygon4281-7"
- style="fill:#000000;filter:url(#filter3955)" /><polygon
- points="26.968,24.394 28.044,22.933 23.491,19.431 24.671,17.833 20.069,17.94 21.237,22.488 22.416,20.892 "
- transform="translate(0.11748671,0.92428829)"
- id="polygon4287-5"
- style="fill:#000000;filter:url(#filter3951)" /><polygon
- points="5.118,22.968 6.202,24.392 10.702,20.813 11.887,22.369 13.014,17.835 8.434,17.838 9.618,19.391 "
- transform="translate(0.11748671,0.92428829)"
- id="polygon4291-3"
- style="fill:#000000;filter:url(#filter3947)" /><polygon
- points="5.971,8.852 4.94,10.418 9.675,13.685 8.543,15.397 13.192,14.976 11.837,10.404 10.709,12.119 "
- transform="translate(0.11748671,0.92428829)"
- id="polygon4295-5"
- style="fill:#000000;filter:url(#filter3943)" /></g><path
- d="M 18.462,31.115"
- id="path4277"
- style="stroke:#ffffff;stroke-width:0.50999999;stroke-miterlimit:10" /><polygon
- points="24.684,15.448 23.488,13.785 28.095,10.325 26.996,8.802 22.393,12.264 21.201,10.608 20.02,15.224 "
- id="polygon4281"
- style="fill:#ed1c24" /><rect
- width="26.216"
- height="2.7049999"
- x="3.4130001"
- y="5.1230001"
- id="rect4283"
- style="fill:#ffffff;stroke:#000000;stroke-width:0.2;stroke-miterlimit:10" /><polygon
- points="21.237,22.488 22.416,20.892 26.968,24.394 28.044,22.933 23.491,19.431 24.671,17.833 20.069,17.94 "
- id="polygon4287"
- style="fill:#ed1c24" /><polygon
- points="8.434,17.838 9.618,19.391 5.118,22.968 6.202,24.392 10.702,20.813 11.887,22.369 13.014,17.835 "
- id="polygon4291"
- style="fill:#ed1c24" /><polygon
- points="11.837,10.404 10.709,12.119 5.971,8.852 4.94,10.418 9.675,13.685 8.543,15.397 13.192,14.976 "
- id="polygon4295"
- style="fill:#ed1c24" /><rect
- width="26.580999"
- height="19.924999"
- x="3.0480001"
- y="5.1230001"
- id="rect4297"
- style="fill:none;stroke:#000000;stroke-width:0.89999998;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><defs><filter id="d" x="-.33807" y="-.42625" width="1.6761" height="1.8525" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.16241"/></filter><filter id="c" x="-.35332" y="-.42547" width="1.7066" height="1.8509" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.16241"/></filter><filter id="b" x="-.34982" y="-.42521" width="1.6996" height="1.8504" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.16241"/></filter><filter id="a" x="-.34548" y="-.41977" width="1.691" height="1.8395" color-interpolation-filters="sRGB"><feGaussianBlur stdDeviation="1.16241"/></filter></defs><g><polygon transform="translate(.11749 .92429)" points="28.095 10.325 26.996 8.802 22.393 12.264 21.201 10.608 20.02 15.224 24.684 15.448 23.488 13.785" filter="url(#a)"/><polygon transform="translate(.11749 .92429)" points="26.968 24.394 28.044 22.933 23.491 19.431 24.671 17.833 20.069 17.94 21.237 22.488 22.416 20.892" filter="url(#b)"/><polygon transform="translate(.11749 .92429)" points="5.118 22.968 6.202 24.392 10.702 20.813 11.887 22.369 13.014 17.835 8.434 17.838 9.618 19.391" filter="url(#c)"/><polygon transform="translate(.11749 .92429)" points="5.971 8.852 4.94 10.418 9.675 13.685 8.543 15.397 13.192 14.976 11.837 10.404 10.709 12.119" filter="url(#d)"/></g><path d="m18.462 31.115" stroke="#fff" stroke-miterlimit="10" stroke-width=".51"/><polygon points="24.684 15.448 23.488 13.785 28.095 10.325 26.996 8.802 22.393 12.264 21.201 10.608 20.02 15.224" fill="#ed1c24"/><rect x="3.413" y="5.123" width="26.216" height="2.705" fill="#fff" stroke="#000" stroke-miterlimit="10" stroke-width=".2"/><polygon points="21.237 22.488 22.416 20.892 26.968 24.394 28.044 22.933 23.491 19.431 24.671 17.833 20.069 17.94" fill="#ed1c24"/><polygon points="8.434 17.838 9.618 19.391 5.118 22.968 6.202 24.392 10.702 20.813 11.887 22.369 13.014 17.835" fill="#ed1c24"/><polygon points="11.837 10.404 10.709 12.119 5.971 8.852 4.94 10.418 9.675 13.685 8.543 15.397 13.192 14.976" fill="#ed1c24"/><rect x="3.048" y="5.123" width="26.581" height="19.925" fill="none" stroke="#000" stroke-miterlimit="10" stroke-width=".9"/></svg>
diff --git a/silx/resources/gui/icons/view-raw.svg b/silx/resources/gui/icons/view-raw.svg
index b7ddb98..869e037 100644
--- a/silx/resources/gui/icons/view-raw.svg
+++ b/silx/resources/gui/icons/view-raw.svg
@@ -1,21 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect x="3.2544" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="3.2544" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="3.2544" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="11.017" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="11.017" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="11.017" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="19.22" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="19.22" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <rect x="19.22" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect x="3.2544" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="3.2544" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="3.2544" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="11.017" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="11.017" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="11.017" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="19.22" y="21.322" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="19.22" y="13.051" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<rect x="19.22" y="4.9832" width="7.7285" height="7.7285" ry="0" color="#000000" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
</svg>
diff --git a/silx/resources/gui/icons/view-refresh.svg b/silx/resources/gui/icons/view-refresh.svg
index f426a03..9593dd8 100644
--- a/silx/resources/gui/icons/view-refresh.svg
+++ b/silx/resources/gui/icons/view-refresh.svg
@@ -1,34 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata16"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs14" /><path
- d="M 27.433,12.199 C 22.826,3.239 11.787,3.033 8.074,12.794 5.616,12.082 4.388,11.727 1.93,11.014 c 5.262,-12.507 22.627,-12.86 26.917,0.597 -0.567,0.234 -0.85,0.353 -1.414,0.588 z"
- inkscape:connector-curvature="0"
- id="path4"
- style="fill:#00a651;stroke:#00a651;stroke-miterlimit:10" /><path
- d="m 5.083,19.917 c 4.676,8.426 15.219,8.544 18.909,-0.728 2.47,0.721 3.708,1.075 6.2,1.762 C 25.04,33.107 8.285,33.617 3.602,20.786 4.196,20.425 4.493,20.25 5.083,19.917 z"
- inkscape:connector-curvature="0"
- id="path6"
- style="fill:#f7941e;stroke:#f7941e;stroke-miterlimit:10" /><polygon
- points="5.909,21.146 1.634,23.639 2.355,13.137 5.812,16.029 9.457,19.078 "
- id="polygon8"
- style="fill:#f7941e;stroke:#f7941e;stroke-miterlimit:10" /><polygon
- points="26.533,9.5 30.686,6.475 29.58,18.389 25.758,14.432 21.852,10.77 "
- id="polygon10"
- style="fill:#00a651;stroke:#00a651;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><path d="m27.433 12.199c-4.607-8.96-15.646-9.166-19.359 0.595-2.458-0.712-3.686-1.067-6.144-1.78 5.262-12.507 22.627-12.86 26.917 0.597-0.567 0.234-0.85 0.353-1.414 0.588z" fill="#00a651" stroke="#00a651" stroke-miterlimit="10"/><path d="m5.083 19.917c4.676 8.426 15.219 8.544 18.909-0.728 2.47 0.721 3.708 1.075 6.2 1.762-5.152 12.156-21.907 12.666-26.59-0.165 0.594-0.361 0.891-0.536 1.481-0.869z" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10"/><polygon points="5.909 21.146 1.634 23.639 2.355 13.137 5.812 16.029 9.457 19.078" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10"/><polygon points="26.533 9.5 30.686 6.475 29.58 18.389 25.758 14.432 21.852 10.77" fill="#00a651" stroke="#00a651" stroke-miterlimit="10"/></svg>
diff --git a/silx/resources/gui/icons/view-text.svg b/silx/resources/gui/icons/view-text.svg
index 24b8662..4d924ba 100644
--- a/silx/resources/gui/icons/view-text.svg
+++ b/silx/resources/gui/icons/view-text.svg
@@ -1,19 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
-<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <metadata>
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <rect x="3.4068" y="7.339" width="25.219" height="16.007" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
- <g transform="matrix(.89445 0 0 .89445 1.3024 .77355)">
- <path d="m8.9353 15.017v-3.1925h0.96935v8.1973h-0.96935v-0.88506c-0.20371 0.35121-0.46185 0.61287-0.77443 0.78496-0.30907 0.16858-0.68136 0.25287-1.1169 0.25287-0.71297 0-1.2942-0.28448-1.7438-0.85345-0.44604-0.56896-0.66906-1.317-0.66906-2.2443-6e-7 -0.9272 0.22302-1.6753 0.66906-2.2443 0.44955-0.56896 1.0308-0.85344 1.7438-0.85345 0.4355 7e-6 0.80779 0.08605 1.1169 0.25814 0.31258 0.16859 0.57072 0.42849 0.77443 0.77969m-3.3032 2.0599c-1.6e-6 0.71297 0.14575 1.2732 0.43726 1.6806 0.29502 0.4039 0.69891 0.60584 1.2117 0.60584 0.51277 1e-6 0.91666-0.20195 1.2117-0.60584 0.29501-0.40741 0.44252-0.96759 0.44253-1.6806-4.9e-6 -0.71296-0.14751-1.2714-0.44253-1.6753-0.29502-0.4074-0.69892-0.61111-1.2117-0.61111-0.51277 6e-6 -0.91667 0.20371-1.2117 0.61111-0.29151 0.4039-0.43726 0.96233-0.43726 1.6753"/>
- <path d="m14.583 17.056c-0.78321 3e-6 -1.3258 0.08956-1.6279 0.26868-0.30204 0.17912-0.45307 0.48468-0.45306 0.91667-1e-6 0.34419 0.11239 0.61814 0.33716 0.82184 0.22829 0.20019 0.53735 0.30029 0.9272 0.30029 0.53735 1e-6 0.96759-0.18965 1.2907-0.56896 0.32662-0.38282 0.48994-0.89032 0.48994-1.5225v-0.216h-0.96408m1.9334-0.40038v3.3664h-0.96935v-0.89559c-0.22127 0.35824-0.49697 0.6234-0.82711 0.7955-0.33014 0.16858-0.73404 0.25287-1.2117 0.25287-0.60409 0-1.0853-0.16858-1.4435-0.50575-0.35473-0.34068-0.53209-0.7955-0.53209-1.3645 0-0.66379 0.22126-1.1643 0.66379-1.5014 0.44604-0.33716 1.1098-0.50574 1.9914-0.50575h1.3592v-0.09483c-5e-6 -0.44604-0.14751-0.79022-0.44253-1.0326-0.29151-0.24584-0.70243-0.36877-1.2328-0.36877-0.33717 5e-6 -0.66555 0.04039-0.98515 0.12117-0.31961 0.08078-0.62692 0.20195-0.92194 0.36351v-0.89559c0.35472-0.13697 0.69891-0.23882 1.0326-0.30556 0.33365-0.07024 0.65852-0.10536 0.97462-0.10536 0.85344 7e-6 1.4909 0.22127 1.9124 0.66379 0.42145 0.44253 0.63218 1.1134 0.63218 2.0125"/>
- <path d="m19.477 12.447v1.6753h1.9966v0.75335h-1.9966v3.2031c-2e-6 0.48116 0.06497 0.79023 0.19492 0.9272 0.13346 0.13697 0.40214 0.20546 0.80603 0.20546h0.99569v0.8113h-0.99569c-0.74809 0-1.2644-0.13873-1.5489-0.41619-0.28448-0.28097-0.42672-0.79023-0.42672-1.5278v-3.2031h-0.71121v-0.75335h0.71121v-1.6753h0.97462"/>
- <path d="m25.435 17.056c-0.78321 3e-6 -1.3258 0.08956-1.6279 0.26868-0.30204 0.17912-0.45307 0.48468-0.45306 0.91667-2e-6 0.34419 0.11239 0.61814 0.33716 0.82184 0.22829 0.20019 0.53735 0.30029 0.9272 0.30029 0.53735 1e-6 0.96759-0.18965 1.2907-0.56896 0.32662-0.38282 0.48994-0.89032 0.48994-1.5225v-0.216h-0.96408m1.9334-0.40038v3.3664h-0.96935v-0.89559c-0.22127 0.35824-0.49697 0.6234-0.82711 0.7955-0.33014 0.16858-0.73404 0.25287-1.2117 0.25287-0.60409 0-1.0853-0.16858-1.4435-0.50575-0.35473-0.34068-0.53209-0.7955-0.53209-1.3645-1e-6 -0.66379 0.22126-1.1643 0.66379-1.5014 0.44604-0.33716 1.1098-0.50574 1.9914-0.50575h1.3592v-0.09483c-4e-6 -0.44604-0.14751-0.79022-0.44253-1.0326-0.29151-0.24584-0.70243-0.36877-1.2328-0.36877-0.33717 5e-6 -0.66555 0.04039-0.98515 0.12117-0.31961 0.08078-0.62692 0.20195-0.92194 0.36351v-0.89559c0.35472-0.13697 0.69891-0.23882 1.0326-0.30556 0.33365-0.07024 0.65852-0.10536 0.97462-0.10536 0.85344 7e-6 1.4909 0.22127 1.9124 0.66379 0.42145 0.44253 0.63218 1.1134 0.63218 2.0125"/>
- </g>
+<svg version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
+<rect x="3.4068" y="7.339" width="25.219" height="16.007" ry="0" fill="#f7941e" fill-opacity=".81569" stroke="#000" stroke-miterlimit="2" stroke-width="1.4"/>
+<g transform="matrix(.89445 0 0 .89445 1.3024 .77355)">
+<path d="m8.9353 15.017v-3.1925h0.96935v8.1973h-0.96935v-0.88506c-0.20371 0.35121-0.46185 0.61287-0.77443 0.78496-0.30907 0.16858-0.68136 0.25287-1.1169 0.25287-0.71297 0-1.2942-0.28448-1.7438-0.85345-0.44604-0.56896-0.66906-1.317-0.66906-2.2443-6e-7 -0.9272 0.22302-1.6753 0.66906-2.2443 0.44955-0.56896 1.0308-0.85344 1.7438-0.85345 0.4355 7e-6 0.80779 0.08605 1.1169 0.25814 0.31258 0.16859 0.57072 0.42849 0.77443 0.77969m-3.3032 2.0599c-1.6e-6 0.71297 0.14575 1.2732 0.43726 1.6806 0.29502 0.4039 0.69891 0.60584 1.2117 0.60584 0.51277 1e-6 0.91666-0.20195 1.2117-0.60584 0.29501-0.40741 0.44252-0.96759 0.44253-1.6806-4.9e-6 -0.71296-0.14751-1.2714-0.44253-1.6753-0.29502-0.4074-0.69892-0.61111-1.2117-0.61111-0.51277 6e-6 -0.91667 0.20371-1.2117 0.61111-0.29151 0.4039-0.43726 0.96233-0.43726 1.6753"/>
+<path d="m14.583 17.056c-0.78321 3e-6 -1.3258 0.08956-1.6279 0.26868-0.30204 0.17912-0.45307 0.48468-0.45306 0.91667-1e-6 0.34419 0.11239 0.61814 0.33716 0.82184 0.22829 0.20019 0.53735 0.30029 0.9272 0.30029 0.53735 1e-6 0.96759-0.18965 1.2907-0.56896 0.32662-0.38282 0.48994-0.89032 0.48994-1.5225v-0.216h-0.96408m1.9334-0.40038v3.3664h-0.96935v-0.89559c-0.22127 0.35824-0.49697 0.6234-0.82711 0.7955-0.33014 0.16858-0.73404 0.25287-1.2117 0.25287-0.60409 0-1.0853-0.16858-1.4435-0.50575-0.35473-0.34068-0.53209-0.7955-0.53209-1.3645 0-0.66379 0.22126-1.1643 0.66379-1.5014 0.44604-0.33716 1.1098-0.50574 1.9914-0.50575h1.3592v-0.09483c-5e-6 -0.44604-0.14751-0.79022-0.44253-1.0326-0.29151-0.24584-0.70243-0.36877-1.2328-0.36877-0.33717 5e-6 -0.66555 0.04039-0.98515 0.12117-0.31961 0.08078-0.62692 0.20195-0.92194 0.36351v-0.89559c0.35472-0.13697 0.69891-0.23882 1.0326-0.30556 0.33365-0.07024 0.65852-0.10536 0.97462-0.10536 0.85344 7e-6 1.4909 0.22127 1.9124 0.66379 0.42145 0.44253 0.63218 1.1134 0.63218 2.0125"/>
+<path d="m19.477 12.447v1.6753h1.9966v0.75335h-1.9966v3.2031c-2e-6 0.48116 0.06497 0.79023 0.19492 0.9272 0.13346 0.13697 0.40214 0.20546 0.80603 0.20546h0.99569v0.8113h-0.99569c-0.74809 0-1.2644-0.13873-1.5489-0.41619-0.28448-0.28097-0.42672-0.79023-0.42672-1.5278v-3.2031h-0.71121v-0.75335h0.71121v-1.6753h0.97462"/>
+<path d="m25.435 17.056c-0.78321 3e-6 -1.3258 0.08956-1.6279 0.26868-0.30204 0.17912-0.45307 0.48468-0.45306 0.91667-2e-6 0.34419 0.11239 0.61814 0.33716 0.82184 0.22829 0.20019 0.53735 0.30029 0.9272 0.30029 0.53735 1e-6 0.96759-0.18965 1.2907-0.56896 0.32662-0.38282 0.48994-0.89032 0.48994-1.5225v-0.216h-0.96408m1.9334-0.40038v3.3664h-0.96935v-0.89559c-0.22127 0.35824-0.49697 0.6234-0.82711 0.7955-0.33014 0.16858-0.73404 0.25287-1.2117 0.25287-0.60409 0-1.0853-0.16858-1.4435-0.50575-0.35473-0.34068-0.53209-0.7955-0.53209-1.3645-1e-6 -0.66379 0.22126-1.1643 0.66379-1.5014 0.44604-0.33716 1.1098-0.50574 1.9914-0.50575h1.3592v-0.09483c-4e-6 -0.44604-0.14751-0.79022-0.44253-1.0326-0.29151-0.24584-0.70243-0.36877-1.2328-0.36877-0.33717 5e-6 -0.66555 0.04039-0.98515 0.12117-0.31961 0.08078-0.62692 0.20195-0.92194 0.36351v-0.89559c0.35472-0.13697 0.69891-0.23882 1.0326-0.30556 0.33365-0.07024 0.65852-0.10536 0.97462-0.10536 0.85344 7e-6 1.4909 0.22127 1.9124 0.66379 0.42145 0.44253 0.63218 1.1134 0.63218 2.0125"/>
+</g>
</svg>
diff --git a/silx/resources/gui/icons/window-new.svg b/silx/resources/gui/icons/window-new.svg
index cdcf9f1..0a232ed 100644
--- a/silx/resources/gui/icons/window-new.svg
+++ b/silx/resources/gui/icons/window-new.svg
@@ -1,39 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata24"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><path
- d="M 24.653,7.496 C 13.689,7.389 14.58,18.149 14.387,18.47 c 0,0 0.193,-7.139 10.267,-6.713 V 7.496 z"
- id="path6"
- style="fill:#f7941e;stroke:#f7941e;stroke-width:0.1;stroke-miterlimit:10" /><path
- d="m 24.653,5.819 c 0,-0.17 0.122,-0.243 0.271,-0.16 l 6.169,3.403 c 0.149,0.083 0.157,0.23 0.018,0.328 l -6.204,4.348 c -0.14,0.098 -0.254,0.038 -0.254,-0.132 V 5.819 z"
- id="path10"
- style="fill:#f7941e;fill-opacity:1;stroke:#f7941e;stroke-miterlimit:10" /><defs
- id="defs12"><polygon
- points="2.505,29.804 0.69,7.484 16.967,6.267 12.083,13.194 23.478,18.148 29.488,13.594 29.488,28.585 "
- id="b" /><clipPath
- id="a-3"><use
- id="use16-6"
- style="overflow:visible"
- x="0"
- y="0"
- width="32"
- height="32"
- xlink:href="#b" /></clipPath></defs><path
- d="M 6.21875,8.75 C 5.2556622,8.75 4.4375,9.5384524 4.4375,10.5 l 0,14.125 c 0,0.963088 0.8197024,1.75 1.78125,1.75 l 19.5625,0 c 0.456817,0 0.872767,-0.208524 1.1875,-0.5 0.394494,-0.391361 0.545811,-0.733107 0.59375,-1.25 l 0,-9.625 -2.5,2.03125 c -0.0096,2.28115 0.03017,4.564259 -0.03125,6.84375 l -18.09375,0 0,-12.625 6.5625,0 1.6875,-2.5 z"
- id="path20-5"
- style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#f7941e;fill-opacity:1;stroke:none;stroke-width:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="m24.653 7.496c-10.964-0.107-10.073 10.653-10.266 10.974 0 0 0.193-7.139 10.267-6.713v-4.261z" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10" stroke-width=".1"/><path d="m24.653 5.819c0-0.17 0.122-0.243 0.271-0.16l6.169 3.403c0.149 0.083 0.157 0.23 0.018 0.328l-6.204 4.348c-0.14 0.098-0.254 0.038-0.254-0.132v-7.787z" fill="#f7941e" stroke="#f7941e" stroke-miterlimit="10"/><path d="m6.2188 8.75c-0.96309 0-1.7812 0.78845-1.7812 1.75v14.125c0 0.96309 0.8197 1.75 1.7812 1.75h19.562c0.45682 0 0.87277-0.20852 1.1875-0.5 0.39449-0.39136 0.54581-0.73311 0.59375-1.25v-9.625l-2.5 2.0312c-0.0096 2.2812 0.03017 4.5643-0.03125 6.8438h-18.094v-12.625h6.5625l1.6875-2.5z" color="#000000" fill="#f7941e" style="block-progression:tb;text-indent:0;text-transform:none"/></svg>
diff --git a/silx/resources/gui/icons/zoom-back.png b/silx/resources/gui/icons/zoom-back.png
new file mode 100644
index 0000000..14d7951
--- /dev/null
+++ b/silx/resources/gui/icons/zoom-back.png
Binary files differ
diff --git a/silx/resources/gui/icons/zoom-back.svg b/silx/resources/gui/icons/zoom-back.svg
new file mode 100644
index 0000000..cf47b8f
--- /dev/null
+++ b/silx/resources/gui/icons/zoom-back.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="d" x1="20.887" x2="23.374" y1="21.759" y2="18.443" gradientUnits="userSpaceOnUse"><stop stop-color="#280e19" offset="0"/><stop stop-color="#382229" offset=".1053"/><stop stop-color="#f9edf5" offset=".9839"/></linearGradient><radialGradient id="c" cx="13.206" cy="8.4126" r="9.1344" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#9bd1ea" stop-opacity=".5317" offset=".6832"/><stop stop-color="#e6e7e8" stop-opacity=".5" offset="1"/></radialGradient><linearGradient id="b" x1="4.605" x2="18.267" y1="12.302" y2="12.302" gradientUnits="userSpaceOnUse"><stop stop-color="#FFF" offset="0"/><stop offset="1"/></linearGradient><radialGradient id="a" cx="22.443" cy="21.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><polygon points="28.606 22.356 26.103 25.571 15.723 17.758 18.174 14.502" fill="url(#d)" stroke="#808285" stroke-miterlimit="10" stroke-width=".2"/><circle cx="11.483" cy="12.302" r="7" fill="none" stroke="#776569" stroke-miterlimit="10"/><path d="m17.967 12.302c0 3.594-3.039 6.507-6.518 6.507s-6.544-2.913-6.544-6.507 3.065-6.507 6.544-6.507 6.518 2.913 6.518 6.507z" fill="url(#c)" stroke="url(#b)" stroke-miterlimit="10" stroke-width=".6"/><path d="m22.443 21.502" fill="url(#a)"/><path d="m10.992 6.764s4.839-0.584 5.992 4.366" fill="none" stroke="#FFF" stroke-miterlimit="10" stroke-width="1.2"/><g transform="matrix(-1 0 0 1 23.132 -18.833)" fill="#F00" stroke="#F00" stroke-miterlimit="10"><path d="m4.7543 24.006c-10.964-0.107-10.073 10.653-10.266 10.974 0 0 0.193-7.139 10.267-6.713v-4.261z" stroke-width=".1"/><path d="m4.7543 22.329c0-0.17 0.122-0.243 0.271-0.16l6.169 3.403c0.149 0.083 0.157 0.23 0.018 0.328l-6.204 4.348c-0.14 0.098-0.254 0.038-0.254-0.132v-7.787z"/></g></svg>
diff --git a/silx/resources/gui/icons/zoom-in.svg b/silx/resources/gui/icons/zoom-in.svg
index 11e9487..f062a7d 100644
--- a/silx/resources/gui/icons/zoom-in.svg
+++ b/silx/resources/gui/icons/zoom-in.svg
@@ -1,107 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata50"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs48" /><linearGradient
- x1="19.886999"
- y1="23.759001"
- x2="22.374001"
- y2="20.443001"
- id="d"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#280e19;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#382229;stop-opacity:1"
- offset="0.1053" /><stop
- id="stop9"
- style="stop-color:#f9edf5;stop-opacity:1"
- offset="0.98390001" /></linearGradient><polygon
- points="27.606,24.356 25.103,27.571 14.723,19.758 17.174,16.502 "
- id="polygon11"
- style="fill:url(#d);stroke:#808285;stroke-width:0.1;stroke-miterlimit:10" /><circle
- cx="10.483"
- cy="14.302"
- r="7"
- id="circle13"
- style="fill:none;stroke:#776569;stroke-miterlimit:10" /><radialGradient
- cx="12.253"
- cy="10.413"
- r="9.1342001"
- id="c"
- gradientUnits="userSpaceOnUse"><stop
- id="stop16"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop18"
- style="stop-color:#9bd1ea;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop20"
- style="stop-color:#e6e7e8;stop-opacity:0.5"
- offset="1" /></radialGradient><linearGradient
- x1="3.4521"
- y1="14.302"
- x2="17.514"
- y2="14.302"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop23"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop25"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 17.014,14.301 c 0,3.594 -3.038,6.507 -6.517,6.507 -3.479,0 -6.544,-2.913 -6.544,-6.507 0,-3.594 3.065,-6.507 6.544,-6.507 3.479,0 6.517,2.914 6.517,6.507 z"
- inkscape:connector-curvature="0"
- id="path27"
- style="fill:url(#c);stroke:url(#b);stroke-miterlimit:10" /><radialGradient
- cx="21.443001"
- cy="23.502001"
- r="0"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop30"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop32"
- style="stop-color:#517180;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop34"
- style="stop-color:#414042;stop-opacity:0.5"
- offset="1" /></radialGradient><path
- d="M 21.443,23.502"
- inkscape:connector-curvature="0"
- id="path36"
- style="fill:url(#a)" /><path
- d="m 9.177,9.151 c 0,0 4.405,-1.127 6.307,3.42"
- inkscape:connector-curvature="0"
- id="path38"
- style="fill:none;stroke:#ffffff;stroke-miterlimit:10" /><g
- id="g40"
- style="fill:#00a651;stroke:#00a651;stroke-miterlimit:10"><rect
- width="1.239"
- height="8.3789997"
- x="24.483"
- y="7.2249999"
- id="rect42" /><rect
- width="8.3800001"
- height="1.237"
- x="20.913"
- y="10.796"
- id="rect44" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="e" x1="19.887" x2="22.374" y1="23.759" y2="20.443" gradientUnits="userSpaceOnUse"><stop stop-color="#280e19" offset="0"/><stop stop-color="#382229" offset=".1053"/><stop stop-color="#f9edf5" offset=".9839"/></linearGradient><polygon points="27.606 24.356 25.103 27.571 14.723 19.758 17.174 16.502" fill="url(#e)" stroke="#808285" stroke-miterlimit="10" stroke-width=".1"/><circle cx="10.483" cy="14.302" r="7" fill="none" stroke="#776569" stroke-miterlimit="10"/><radialGradient id="f" cx="12.253" cy="10.413" r="9.1342" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#9bd1ea" stop-opacity=".5317" offset=".6832"/><stop stop-color="#e6e7e8" stop-opacity=".5" offset="1"/></radialGradient><linearGradient id="g" x1="3.4521" x2="17.514" y1="14.302" y2="14.302" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><path d="m17.014 14.301c0 3.594-3.038 6.507-6.517 6.507s-6.544-2.913-6.544-6.507 3.065-6.507 6.544-6.507 6.517 2.914 6.517 6.507z" fill="url(#f)" stroke="url(#g)" stroke-miterlimit="10"/><radialGradient id="h" cx="21.443" cy="23.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><path d="m21.443 23.502" fill="url(#h)"/><path d="m9.177 9.151s4.405-1.127 6.307 3.42" fill="none" stroke="#fff" stroke-miterlimit="10"/><g fill="#00a651" stroke="#00a651" stroke-miterlimit="10"><rect x="24.483" y="7.225" width="1.239" height="8.379"/><rect x="20.913" y="10.796" width="8.38" height="1.237"/></g></svg>
diff --git a/silx/resources/gui/icons/zoom-original.svg b/silx/resources/gui/icons/zoom-original.svg
index da0eb75..f20556b 100644
--- a/silx/resources/gui/icons/zoom-original.svg
+++ b/silx/resources/gui/icons/zoom-original.svg
@@ -1,107 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata50"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs48" /><linearGradient
- x1="20.888"
- y1="23.759001"
- x2="23.375"
- y2="20.443001"
- id="d"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#280e19;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#382229;stop-opacity:1"
- offset="0.1053" /><stop
- id="stop9"
- style="stop-color:#f9edf5;stop-opacity:1"
- offset="0.98390001" /></linearGradient><polygon
- points="28.606,24.356 26.103,27.571 15.723,19.758 18.174,16.502 "
- id="polygon11"
- style="fill:url(#d);stroke:#808285;stroke-width:0.1;stroke-miterlimit:10" /><circle
- cx="11.483"
- cy="14.302"
- r="7"
- id="circle13"
- style="fill:none;stroke:#776569;stroke-miterlimit:10" /><radialGradient
- cx="13.253"
- cy="10.413"
- r="9.1342001"
- id="c"
- gradientUnits="userSpaceOnUse"><stop
- id="stop16"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop18"
- style="stop-color:#9bd1ea;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop20"
- style="stop-color:#e6e7e8;stop-opacity:0.5"
- offset="1" /></radialGradient><linearGradient
- x1="4.4520998"
- y1="14.302"
- x2="18.514"
- y2="14.302"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop23"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop25"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 18.014,14.301 c 0,3.594 -3.038,6.507 -6.517,6.507 -3.479,0 -6.544,-2.913 -6.544,-6.507 0,-3.594 3.065,-6.507 6.544,-6.507 3.479,0 6.517,2.914 6.517,6.507 z"
- inkscape:connector-curvature="0"
- id="path27"
- style="fill:url(#c);stroke:url(#b);stroke-miterlimit:10" /><radialGradient
- cx="22.443001"
- cy="23.502001"
- r="0"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop30"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop32"
- style="stop-color:#517180;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop34"
- style="stop-color:#414042;stop-opacity:0.5"
- offset="1" /></radialGradient><path
- d="M 22.443,23.502"
- inkscape:connector-curvature="0"
- id="path36"
- style="fill:url(#a)" /><path
- d="m 10.177,9.151 c 0,0 4.405,-1.127 6.307,3.42"
- inkscape:connector-curvature="0"
- id="path38"
- style="fill:none;stroke:#ffffff;stroke-miterlimit:10" /><g
- id="g40"
- style="fill:#ed1c24;stroke:#ed1c24;stroke-width:2.5;stroke-miterlimit:10"><line
- x1="7.257"
- x2="25.712"
- y1="24.906"
- y2="6.5180001"
- id="line42" /><line
- x1="7.3920002"
- x2="25.575001"
- y1="6.3709998"
- y2="25.052999"
- id="line44" /></g></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="e" x1="20.888" x2="23.375" y1="23.759" y2="20.443" gradientUnits="userSpaceOnUse"><stop stop-color="#280e19" offset="0"/><stop stop-color="#382229" offset=".1053"/><stop stop-color="#f9edf5" offset=".9839"/></linearGradient><polygon points="28.606 24.356 26.103 27.571 15.723 19.758 18.174 16.502" fill="url(#e)" stroke="#808285" stroke-miterlimit="10" stroke-width=".1"/><circle cx="11.483" cy="14.302" r="7" fill="none" stroke="#776569" stroke-miterlimit="10"/><radialGradient id="f" cx="13.253" cy="10.413" r="9.1342" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#9bd1ea" stop-opacity=".5317" offset=".6832"/><stop stop-color="#e6e7e8" stop-opacity=".5" offset="1"/></radialGradient><linearGradient id="g" x1="4.4521" x2="18.514" y1="14.302" y2="14.302" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><path d="m18.014 14.301c0 3.594-3.038 6.507-6.517 6.507s-6.544-2.913-6.544-6.507 3.065-6.507 6.544-6.507 6.517 2.914 6.517 6.507z" fill="url(#f)" stroke="url(#g)" stroke-miterlimit="10"/><radialGradient id="h" cx="22.443" cy="23.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><path d="m22.443 23.502" fill="url(#h)"/><path d="m10.177 9.151s4.405-1.127 6.307 3.42" fill="none" stroke="#fff" stroke-miterlimit="10"/><g fill="#ed1c24" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="2.5"><line x1="7.257" x2="25.712" y1="24.906" y2="6.518"/><line x1="7.392" x2="25.575" y1="6.371" y2="25.053"/></g></svg>
diff --git a/silx/resources/gui/icons/zoom-out.svg b/silx/resources/gui/icons/zoom-out.svg
index d2f82e2..fe3b8dd 100644
--- a/silx/resources/gui/icons/zoom-out.svg
+++ b/silx/resources/gui/icons/zoom-out.svg
@@ -1,101 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata46"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs44" /><linearGradient
- x1="19.886999"
- y1="22.759001"
- x2="22.374001"
- y2="19.443001"
- id="d"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#280e19;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#382229;stop-opacity:1"
- offset="0.1053" /><stop
- id="stop9"
- style="stop-color:#f9edf5;stop-opacity:1"
- offset="0.98390001" /></linearGradient><polygon
- points="27.606,23.356 25.103,26.571 14.723,18.758 17.174,15.502 "
- id="polygon11"
- style="fill:url(#d);stroke:#808285;stroke-width:0.1;stroke-miterlimit:10" /><circle
- cx="10.483"
- cy="13.302"
- r="7"
- id="circle13"
- style="fill:none;stroke:#776569;stroke-miterlimit:10" /><radialGradient
- cx="12.253"
- cy="9.4125996"
- r="9.1342001"
- id="c"
- gradientUnits="userSpaceOnUse"><stop
- id="stop16"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop18"
- style="stop-color:#9bd1ea;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop20"
- style="stop-color:#e6e7e8;stop-opacity:0.5"
- offset="1" /></radialGradient><linearGradient
- x1="3.4521"
- y1="13.302"
- x2="17.514"
- y2="13.302"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop23"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop25"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 17.014,13.301 c 0,3.594 -3.038,6.507 -6.517,6.507 -3.479,0 -6.544,-2.914 -6.544,-6.507 0,-3.593 3.065,-6.507 6.544,-6.507 3.479,0 6.517,2.914 6.517,6.507 z"
- inkscape:connector-curvature="0"
- id="path27"
- style="fill:url(#c);stroke:url(#b);stroke-miterlimit:10" /><radialGradient
- cx="21.443001"
- cy="22.502001"
- r="0"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop30"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop32"
- style="stop-color:#517180;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop34"
- style="stop-color:#414042;stop-opacity:0.5"
- offset="1" /></radialGradient><path
- d="M 21.443,22.502"
- inkscape:connector-curvature="0"
- id="path36"
- style="fill:url(#a)" /><path
- d="m 9.177,8.151 c 0,0 4.405,-1.127 6.307,3.42"
- inkscape:connector-curvature="0"
- id="path38"
- style="fill:none;stroke:#ffffff;stroke-miterlimit:10" /><rect
- width="7.3769999"
- height="0.98799998"
- x="20.304001"
- y="7.802"
- id="rect40"
- style="fill:#ed1c24;stroke:#ed1c24;stroke-width:2;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="e" x1="19.887" x2="22.374" y1="22.759" y2="19.443" gradientUnits="userSpaceOnUse"><stop stop-color="#280e19" offset="0"/><stop stop-color="#382229" offset=".1053"/><stop stop-color="#f9edf5" offset=".9839"/></linearGradient><polygon points="27.606 23.356 25.103 26.571 14.723 18.758 17.174 15.502" fill="url(#e)" stroke="#808285" stroke-miterlimit="10" stroke-width=".1"/><circle cx="10.483" cy="13.302" r="7" fill="none" stroke="#776569" stroke-miterlimit="10"/><radialGradient id="f" cx="12.253" cy="9.4126" r="9.1342" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#9bd1ea" stop-opacity=".5317" offset=".6832"/><stop stop-color="#e6e7e8" stop-opacity=".5" offset="1"/></radialGradient><linearGradient id="g" x1="3.4521" x2="17.514" y1="13.302" y2="13.302" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><path d="m17.014 13.301c0 3.594-3.038 6.507-6.517 6.507s-6.544-2.914-6.544-6.507 3.065-6.507 6.544-6.507 6.517 2.914 6.517 6.507z" fill="url(#f)" stroke="url(#g)" stroke-miterlimit="10"/><radialGradient id="h" cx="21.443" cy="22.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><path d="m21.443 22.502" fill="url(#h)"/><path d="m9.177 8.151s4.405-1.127 6.307 3.42" fill="none" stroke="#fff" stroke-miterlimit="10"/><rect x="20.304" y="7.802" width="7.377" height=".988" fill="#ed1c24" stroke="#ed1c24" stroke-miterlimit="10" stroke-width="2"/></svg>
diff --git a/silx/resources/gui/icons/zoom.svg b/silx/resources/gui/icons/zoom.svg
index 87f72a7..448f3b9 100644
--- a/silx/resources/gui/icons/zoom.svg
+++ b/silx/resources/gui/icons/zoom.svg
@@ -1,95 +1,2 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- width="100%"
- height="100%"
- viewBox="0 0 32 32"
- id="svg2"
- xml:space="preserve"><metadata
- id="metadata44"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
- id="defs42" /><linearGradient
- x1="20.886999"
- y1="21.759001"
- x2="23.374001"
- y2="18.443001"
- id="d"
- gradientUnits="userSpaceOnUse"><stop
- id="stop5"
- style="stop-color:#280e19;stop-opacity:1"
- offset="0" /><stop
- id="stop7"
- style="stop-color:#382229;stop-opacity:1"
- offset="0.1053" /><stop
- id="stop9"
- style="stop-color:#f9edf5;stop-opacity:1"
- offset="0.98390001" /></linearGradient><polygon
- points="28.606,22.356 26.103,25.571 15.723,17.758 18.174,14.502 "
- id="polygon11"
- style="fill:url(#d);stroke:#808285;stroke-width:0.2;stroke-miterlimit:10" /><circle
- cx="11.483"
- cy="12.302"
- r="7"
- id="circle13"
- style="fill:none;stroke:#776569;stroke-miterlimit:10" /><radialGradient
- cx="13.206"
- cy="8.4125996"
- r="9.1344004"
- id="c"
- gradientUnits="userSpaceOnUse"><stop
- id="stop16"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop18"
- style="stop-color:#9bd1ea;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop20"
- style="stop-color:#e6e7e8;stop-opacity:0.5"
- offset="1" /></radialGradient><linearGradient
- x1="4.605"
- y1="12.302"
- x2="18.267"
- y2="12.302"
- id="b"
- gradientUnits="userSpaceOnUse"><stop
- id="stop23"
- style="stop-color:#ffffff;stop-opacity:1"
- offset="0" /><stop
- id="stop25"
- style="stop-color:#000000;stop-opacity:1"
- offset="1" /></linearGradient><path
- d="m 17.967,12.302 c 0,3.594 -3.039,6.507 -6.518,6.507 -3.479,0 -6.544,-2.913 -6.544,-6.507 0,-3.594 3.065,-6.507 6.544,-6.507 3.479,0 6.518,2.913 6.518,6.507 z"
- inkscape:connector-curvature="0"
- id="path27"
- style="fill:url(#c);stroke:url(#b);stroke-width:0.60000002;stroke-miterlimit:10" /><radialGradient
- cx="22.443001"
- cy="21.502001"
- r="0"
- id="a"
- gradientUnits="userSpaceOnUse"><stop
- id="stop30"
- style="stop-color:#00aeef;stop-opacity:0.60000002"
- offset="0" /><stop
- id="stop32"
- style="stop-color:#517180;stop-opacity:0.53170002"
- offset="0.6832" /><stop
- id="stop34"
- style="stop-color:#414042;stop-opacity:0.5"
- offset="1" /></radialGradient><path
- d="M 22.443,21.502"
- inkscape:connector-curvature="0"
- id="path36"
- style="fill:url(#a)" /><path
- d="m 10.992,6.764 c 0,0 4.839,-0.584 5.992,4.366"
- inkscape:connector-curvature="0"
- id="path38"
- style="fill:none;stroke:#ffffff;stroke-width:1.20000005;stroke-miterlimit:10" /></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?>
+<svg version="1.1" viewBox="0 0 32 32" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"><linearGradient id="e" x1="20.887" x2="23.374" y1="21.759" y2="18.443" gradientUnits="userSpaceOnUse"><stop stop-color="#280e19" offset="0"/><stop stop-color="#382229" offset=".1053"/><stop stop-color="#f9edf5" offset=".9839"/></linearGradient><polygon points="28.606 22.356 26.103 25.571 15.723 17.758 18.174 14.502" fill="url(#e)" stroke="#808285" stroke-miterlimit="10" stroke-width=".2"/><circle cx="11.483" cy="12.302" r="7" fill="none" stroke="#776569" stroke-miterlimit="10"/><radialGradient id="f" cx="13.206" cy="8.4126" r="9.1344" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#9bd1ea" stop-opacity=".5317" offset=".6832"/><stop stop-color="#e6e7e8" stop-opacity=".5" offset="1"/></radialGradient><linearGradient id="g" x1="4.605" x2="18.267" y1="12.302" y2="12.302" gradientUnits="userSpaceOnUse"><stop stop-color="#fff" offset="0"/><stop offset="1"/></linearGradient><path d="m17.967 12.302c0 3.594-3.039 6.507-6.518 6.507s-6.544-2.913-6.544-6.507 3.065-6.507 6.544-6.507 6.518 2.913 6.518 6.507z" fill="url(#f)" stroke="url(#g)" stroke-miterlimit="10" stroke-width=".6"/><radialGradient id="h" cx="22.443" cy="21.502" r="0" gradientUnits="userSpaceOnUse"><stop stop-color="#00aeef" stop-opacity=".6" offset="0"/><stop stop-color="#517180" stop-opacity=".5317" offset=".6832"/><stop stop-color="#414042" stop-opacity=".5" offset="1"/></radialGradient><path d="m22.443 21.502" fill="url(#h)"/><path d="m10.992 6.764s4.839-0.584 5.992 4.366" fill="none" stroke="#fff" stroke-miterlimit="10" stroke-width="1.2"/></svg>
diff --git a/silx/resources/gui/logo/silx.png b/silx/resources/gui/logo/silx.png
new file mode 100644
index 0000000..d6f9733
--- /dev/null
+++ b/silx/resources/gui/logo/silx.png
Binary files differ
diff --git a/silx/resources/gui/logo/silx.svg b/silx/resources/gui/logo/silx.svg
new file mode 100644
index 0000000..f7eb6cb
--- /dev/null
+++ b/silx/resources/gui/logo/silx.svg
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.1"
+ width="200"
+ height="265.95523"
+ viewBox="0 0 199.99999 265.95523"
+ id="svg2"
+ xml:space="preserve"><defs
+ id="defs74" /><metadata
+ id="metadata4"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><g
+ transform="matrix(6.1124607,0,0,6.1124607,-42.004688,-11.552551)"
+ id="g6"><polygon
+ points="38.689,29.693 39.026,32.153 33.188,36.185 32.301,35.732 31.56,35.929 29.495,28.237 "
+ id="polygon8"
+ style="fill:#5a5b5d" /><path
+ d="M 29.222,26.766 C 29.279,26.645 26.99,26.557 26.99,26.557 l -4.19,3.048 4.559,7.404 4.322,-1.051 -2.459,-9.192 z"
+ id="path10"
+ style="fill:#808285" /><path
+ d="m 24.472,1.89 c 0,0 -4.283,2.305 -4.828,2.497 -0.546,0.189 -4.033,3.568 -3.404,3.791 0.628,0.223 3.772,1.429 3.772,1.429 L 26.414,5.893 25.73,3.523 24.472,1.89"
+ id="path12"
+ style="fill:#dcddde" /><path
+ d="m 16.067,8.177 -1.303,1.925 c 0,0 -0.701,2.221 -1.167,3.446 -0.452,1.187 -1.11,2.632 -1.11,2.632 l 3.899,3.088 c 0,0 6.086,-2.344 5.914,-2.23 -0.171,0.114 -2.287,-7.432 -2.287,-7.432 L 16.067,8.177 z"
+ id="path14"
+ style="fill:#f8f8f9" /><path
+ d="M 13.61,15.472"
+ id="path16"
+ style="fill:#939598" /><polygon
+ points="8.219,24.074 7.666,28 12.923,33.159 15.439,27.157 11.453,23.67 9.931,19.558 "
+ id="polygon18"
+ style="fill:#dcddde" /><path
+ d="m 7.666,28 c 0,0 -0.799,1.539 -0.794,2.701 0,1.164 0.396,3.087 0.396,3.087 L 8.185,36.429 15.531,34.437 13.155,33.159 7.666,28 z"
+ id="path20"
+ style="fill:#d1d3d4" /><path
+ d="m 18.127,39.503 2.523,0.67 5.38,4.701 c 0,0 -8.99,0.824 -9.364,0.41 -0.371,-0.41 0.659,-2.008 0.088,-2.408 -0.571,-0.402 1.373,-3.373 1.373,-3.373 z"
+ id="path22"
+ style="fill:#58595b" /><path
+ d="m 15.439,27.157 c 0,0 -2.625,5.788 -2.516,6.001 0.218,0.431 2.607,1.278 2.607,1.278 l 8.371,-5.678 -2.844,-11.251 -3.067,1.22 c 0,0 -3.294,5.58 -3.122,5.347 0.171,-0.234 0.571,3.083 0.571,3.083 z"
+ id="path24"
+ style="fill:#d1d3d4" /><path
+ d="m 21.058,17.507 0.35,-0.081 1.83,-0.731 c 0,0 1.176,1.715 1.119,1.887 -0.059,0.171 2.766,1.713 2.766,1.713 0,0 -0.021,6.005 -0.251,6.261 -0.228,0.258 -2.969,2.203 -2.969,2.203 L 21.058,17.507 z"
+ id="path26"
+ style="fill:#808285" /><path
+ d="m 20.299,40.275 c 0,0 6.674,-1.889 6.847,-2.002 0.171,-0.119 8.016,2.002 8.016,2.002 l -1.33,0.883 h -1.07 l -2.747,2.402 -3.984,1.314 -5.732,-4.599 z"
+ id="path28"
+ style="fill:#333334" /><polygon
+ points="32.301,35.732 38.019,37.826 35.162,40.275 27.35,38.281 27.239,37.009 "
+ id="polygon30"
+ style="fill:#515254" /><path
+ d="m 32.647,35.91 6.379,-3.757 c 0,0 0.555,2.034 0.566,2.376 0.007,0.348 -1.573,3.297 -1.573,3.297 L 32.647,35.91 z"
+ id="path32"
+ style="fill:#464547" /><polygon
+ points="30.071,21.783 32.189,28.826 29.575,28.531 29.104,26.766 26.871,26.556 26.871,21.247 "
+ id="polygon34"
+ style="fill:#9fa1a4" /><path
+ d="m 30.071,21.783 0.207,-0.131 5.299,-3.419 2.685,5.348 c 0,0 -0.294,4.035 -0.01,3.918 0.282,-0.112 0.437,2.194 0.437,2.194 l -6.5,-0.867 -2.118,-7.043 z"
+ id="path36"
+ style="fill:#464547" /><path
+ d="M 26.031,5.748"
+ id="path38"
+ style="fill:#939598" /><polygon
+ points="30.887,8.967 31.56,10.979 32.49,12.237 32.989,14.524 26.241,12.581 26.241,5.893 27.498,6.494 29.285,8.156 30.071,8.177 "
+ id="polygon40"
+ style="fill:#6d6e71" /><polygon
+ points="26.974,21.783 30.071,21.783 35.578,18.233 32.989,14.524 29.575,15.381 24.156,18.583 26.708,21.247 "
+ id="polygon42"
+ style="fill:#5a5b5d" /><path
+ d="m 26.241,5.893 c 0,0 -6.516,4 -6.229,3.714 0.025,-0.022 1.757,7.32 2.287,7.432 0.458,0.096 0.458,0.096 0.458,0.096 l 1.599,1.448 1.436,-4.059 0.449,-1.943 V 5.893 z"
+ id="path44"
+ style="fill:#939598" /><path
+ d="m 8.185,36.429 7.579,-2.156 2.364,5.23 -1.465,2.957 0.264,0.75 -0.259,2.074 -2.654,-1.322 -1.545,-1.313 -1.486,-1.943 c 0,0 -1.011,-0.891 -1.028,-1.203 -0.022,-0.31 -1.77,-3.074 -1.77,-3.074 z"
+ id="path46"
+ style="fill:#808285" /><polygon
+ points="16.386,19.268 12.487,16.18 10.696,17.753 9.931,19.558 11.453,23.67 15.439,27.157 14.869,24.074 17.991,18.727 "
+ id="polygon48"
+ style="fill:#ededee" /><polygon
+ points="25.792,14.524 24.356,18.583 29.575,15.381 32.989,14.524 26.241,12.581 "
+ id="polygon50"
+ style="fill:#464547" /><path
+ d="M 22.303,28.826"
+ id="path52"
+ style="fill:#a7a9ac" /><polygon
+ points="32.148,39.503 39.094,35.732 38.019,37.826 33.832,41.158 31.022,42.675 "
+ id="polygon54" /><polygon
+ points="27.35,38.281 27.35,38.281 20.649,40.173 18.127,39.503 15.763,34.273 22.682,29.605 27.757,37.009 "
+ id="polygon56"
+ style="fill:#515254" /><path
+ d="M 11.114,33.878"
+ id="path58"
+ style="fill:#939598" /><path
+ d="m 18.264,25.999 c 0,0.965 -0.465,1.451 -1.394,1.457 l -4.407,-0.009 c -0.978,0.012 -1.469,0.259 -1.475,0.742 0.012,0.458 0.507,0.685 1.484,0.678 h 1.421 c 2.914,0.013 4.377,1.237 4.389,3.674 0,2.371 -1.46,3.563 -4.38,3.574 H 9.549 C 8.59,36.11 8.11,35.637 8.11,34.696 8.116,33.737 8.592,33.262 9.54,33.276 l 4.362,-0.027 c 0.977,-0.006 1.466,-0.254 1.466,-0.742 0,-0.496 -0.495,-0.74 -1.484,-0.734 h -1.42 C 9.562,31.767 8.111,30.573 8.111,28.19 v -0.045 c 0,-2.389 1.451,-3.587 4.353,-3.593 h 4.353 c 0.958,0.005 1.441,0.488 1.447,1.447 z"
+ id="path60"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 20.37,24.288 c 0.923,0.006 1.394,0.497 1.411,1.471 v 8.955 c -0.011,0.986 -0.476,1.488 -1.394,1.508 -0.923,-0.025 -1.385,-0.527 -1.385,-1.508 v -8.946 c -0.006,-0.987 0.45,-1.48 1.368,-1.48 z"
+ id="path62"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><circle
+ cx="20.290001"
+ cy="20.566999"
+ r="1.689"
+ id="circle64"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 27.838,24.594 c 0.559,-0.001 0.979,0.115 1.263,0.351 0.283,0.236 1.279,1.245 2.986,3.026 1.727,-1.82 2.731,-2.847 3.014,-3.081 0.282,-0.233 0.702,-0.352 1.261,-0.353 0.545,-10e-4 0.964,0.119 1.257,0.36 0.28,0.229 0.421,0.574 0.422,1.035 v 0.063 c 0.001,0.515 -0.295,0.997 -0.887,1.445 l -2.841,2.923 2.865,2.88 c 0.587,0.477 0.882,0.938 0.883,1.379 0,0.031 -0.004,0.064 -0.011,0.1 v 0.119 c 0.001,0.43 -0.134,0.756 -0.405,0.98 -0.307,0.25 -0.732,0.369 -1.277,0.357 -0.572,0.008 -1.003,-0.117 -1.293,-0.373 -0.291,-0.258 -1.269,-1.258 -2.935,-3.004 -1.692,1.783 -2.681,2.801 -2.966,3.053 -0.285,0.252 -0.715,0.379 -1.287,0.381 h -0.042 c -0.523,0.002 -0.932,-0.117 -1.226,-0.352 -0.28,-0.223 -0.42,-0.551 -0.421,-0.98 v -0.117 c -0.007,-0.037 -0.01,-0.07 -0.01,-0.1 -10e-4,-0.443 0.291,-0.9 0.876,-1.375 L 30.042,30.408 27.062,27.5 C 26.467,27.053 26.17,26.572 26.168,26.058 v -0.063 c -10e-4,-0.46 0.138,-0.806 0.417,-1.036 0.29,-0.242 0.709,-0.364 1.253,-0.365 z"
+ id="path66"
+ style="fill:#f7941e;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /><path
+ d="m 25.549,35.16 c 0,0.551 -0.45,1 -1,1 h -0.845 c -0.55,0 -1,-0.449 -1,-1 V 15.277 c 0,-0.55 0.45,-1 1,-1 h 0.845 c 0.55,0 1,0.45 1,1 V 35.16 z"
+ id="path68"
+ style="fill:#f7941e" /><path
+ d="m 25.549,35.16 c 0,0.551 -0.45,1 -1,1 h -0.845 c -0.55,0 -1,-0.449 -1,-1 V 15.277 c 0,-0.55 0.45,-1 1,-1 h 0.845 c 0.55,0 1,0.45 1,1 V 35.16 z"
+ id="path70"
+ style="fill:none;stroke:#ffffff;stroke-width:0.30000001;stroke-miterlimit:10" /></g></svg> \ No newline at end of file
diff --git a/silx/resources/opencl/addition.cl b/silx/resources/opencl/addition.cl
index 8ecfd4e..35d7996 100644
--- a/silx/resources/opencl/addition.cl
+++ b/silx/resources/opencl/addition.cl
@@ -27,10 +27,16 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
-__kernel void addition(__global float* a, __global float* b, __global float* res, int N)
+
+
+// "Hello_world" kernel to test if OpenCL is actually working
+kernel void addition(global float* a,
+ global float* b,
+ global float* res,
+ int N)
{
- unsigned int i = get_global_id(0);
+ int i = get_global_id(0);
if( i<N ){
res[i] = a[i] + b[i];
}
-} \ No newline at end of file
+}
diff --git a/silx/resources/opencl/array_utils.cl b/silx/resources/opencl/array_utils.cl
new file mode 100644
index 0000000..60677dc
--- /dev/null
+++ b/silx/resources/opencl/array_utils.cl
@@ -0,0 +1,33 @@
+/**
+ * 2D Memcpy for float* arrays,
+ * replacing pyopencl "enqueue_copy" which does not return the expected result
+ * when dealing with rectangular buffers.
+ * ALL THE SIZES/OFFSETS ARE SPECIFIED IN PIXELS, NOT IN BYTES.
+ * In the (x, y) convention, x is the fast index (as in CUDA).
+ *
+ * :param dst: destination array
+ * :param src: source array
+ * :param dst_width: width of the dst array
+ * :param src_width: width of the src array
+ * :param dst_offset: tuple with the offset (x, y) in the dst array
+ * :param src_offset: tuple with the offset (x, y) in the src array
+ * :param transfer_shape: shape of the transfer array in the form (x, y)
+ *
+ */
+kernel void cpy2d(
+ global float* dst,
+ global float* src,
+ int dst_width,
+ int src_width,
+ int2 dst_offset,
+ int2 src_offset,
+ int2 transfer_shape)
+{
+ int gidx = get_global_id(0),
+ gidy = get_global_id(1);
+ if (gidx < transfer_shape.x && gidy < transfer_shape.y)
+ {
+ dst[(dst_offset.y + gidy)*dst_width + (dst_offset.x + gidx)] = src[(src_offset.y + gidy)*src_width + (src_offset.x + gidx)];
+ }
+}
+
diff --git a/silx/resources/opencl/backproj.cl b/silx/resources/opencl/backproj.cl
new file mode 100644
index 0000000..6fadc2c
--- /dev/null
+++ b/silx/resources/opencl/backproj.cl
@@ -0,0 +1,485 @@
+/*
+ * Project: silx: filtered backprojection
+ *
+ * Copyright (C) 2016-2017 European Synchrotron Radiation Facility
+ * Grenoble, France
+ *
+ * Principal authors: A. Mirone
+ * P. Paleo
+ *
+ *
+ * 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.
+ */
+
+
+/*******************************************************************************/
+/************************ GPU VERSION (with textures) **************************/
+/*******************************************************************************/
+
+
+kernel void backproj_kernel(
+ int num_proj,
+ int num_bins,
+ float axis_position,
+ global float *d_SLICE,
+ read_only image2d_t d_sino,
+ float gpu_offset_x,
+ float gpu_offset_y,
+ global float * d_cos_s, // precalculated cos(theta[i])
+ global float* d_sin_s, // precalculated sin(theta[i])
+ global float* d_axis_s, // array of axis positions (n_projs)
+ local float* shared2) // 768B of local mem
+{
+ const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
+ const int tidx = get_local_id(0); //threadIdx.x;
+ const int bidx = get_group_id(0); //blockIdx.x;
+ const int tidy = get_local_id(1); //threadIdx.y;
+ const int bidy = get_group_id(1); //blockIdx.y;
+
+ //~ local float shared[768];
+ //~ float * sh_sin = shared;
+ //~ float * sh_cos = shared+256;
+ //~ float * sh_axis = sh_cos+256;
+
+ local float sh_cos[256];
+ local float sh_sin[256];
+ local float sh_axis[256];
+
+ float pcos, psin;
+ float h0, h1, h2, h3;
+ const float apos_off_x= gpu_offset_x - axis_position ;
+ const float apos_off_y= gpu_offset_y - axis_position ;
+ float acorr05;
+ float res0 = 0, res1 = 0, res2 = 0, res3 = 0;
+
+ const float bx00 = (32 * bidx + 2 * tidx + 0 + apos_off_x ) ;
+ const float by00 = (32 * bidy + 2 * tidy + 0 + apos_off_y ) ;
+
+ int read=0;
+ for(int proj=0; proj<num_proj; proj++) {
+ if(proj>=read) {
+ barrier(CLK_LOCAL_MEM_FENCE);
+ int ip = tidy*16+tidx;
+ if( read+ip < num_proj) {
+ sh_cos [ip] = d_cos_s[read+ip] ;
+ sh_sin [ip] = d_sin_s[read+ip] ;
+ sh_axis[ip] = d_axis_s[read+ip] ;
+ }
+ read=read+256; // 256=16*16 block size
+ barrier(CLK_LOCAL_MEM_FENCE);
+ }
+ pcos = sh_cos[256-read + proj] ;
+ psin = sh_sin[256-read + proj] ;
+
+ acorr05 = sh_axis[256 - read + proj] ;
+
+ h0 = (acorr05 + bx00*pcos - by00*psin);
+ h1 = (acorr05 + (bx00+0)*pcos - (by00+1)*psin);
+ h2 = (acorr05 + (bx00+1)*pcos - (by00+0)*psin);
+ h3 = (acorr05 + (bx00+1)*pcos - (by00+1)*psin);
+
+ if(h0>=0 && h0<num_bins) res0 += read_imagef(d_sino, sampler, (float2) (h0 +0.5f,proj +0.5f)).x; // tex2D(texprojs,h0 +0.5f,proj +0.5f);
+ if(h1>=0 && h1<num_bins) res1 += read_imagef(d_sino, sampler, (float2) (h1 +0.5f,proj +0.5f)).x; // tex2D(texprojs,h1 +0.5f,proj +0.5f);
+ if(h2>=0 && h2<num_bins) res2 += read_imagef(d_sino, sampler, (float2) (h2 +0.5f,proj +0.5f)).x; // tex2D(texprojs,h2 +0.5f,proj +0.5f);
+ if(h3>=0 && h3<num_bins) res3 += read_imagef(d_sino, sampler, (float2) (h3 +0.5f,proj +0.5f)).x; // tex2D(texprojs,h3 +0.5f,proj +0.5f);
+ }
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 0] = res0;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 0] = res1;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 1] = res2;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 1] = res3;
+}
+
+
+
+
+
+/*******************************************************************************/
+/********************* CPU VERSION (without textures) **************************/
+/*******************************************************************************/
+
+
+#define CLIP_MAX(x, N) (fmin(fmax(x, 0.0f), (N - 1.0f)))
+
+#define FLOORCEIL_x(x) {\
+ xm = (int) floor(x);\
+ xp = (int) ceil(x);\
+}
+
+#define ADJACENT_PIXELS_VALS(arr, Nx, y, xm, xp) ((float2) (arr[y*Nx+xm], arr[y*Nx+xp]))
+
+//Simple linear interpolator for working on the GPU
+static float linear_interpolation(float2 vals,
+ float x,
+ int xm,
+ int xp)
+{
+ if (xm == xp)
+ return vals.s0;
+ else
+ return (vals.s0 * (xp - x)) + (vals.s1 * (x - xm));
+}
+
+/**
+ *
+ * Same kernel as backproj_kernel, but targets the CPU (no texture)
+ *
+**/
+kernel void backproj_cpu_kernel(
+ int num_proj,
+ int num_bins,
+ float axis_position,
+ global float *d_SLICE,
+ global float* d_sino,
+ float gpu_offset_x,
+ float gpu_offset_y,
+ global float * d_cos_s, // precalculated cos(theta[i])
+ global float * d_sin_s, // precalculated sin(theta[i])
+ global float * d_axis_s, // array of axis positions (n_projs)
+ local float* shared2) // 768B of local mem
+{
+ const int tidx = get_local_id(0); //threadIdx.x;
+ const int bidx = get_group_id(0); //blockIdx.x;
+ const int tidy = get_local_id(1); //threadIdx.y;
+ const int bidy = get_group_id(1); //blockIdx.y;
+
+ local float sh_cos[256];
+ local float sh_sin[256];
+ local float sh_axis[256];
+
+ float pcos, psin;
+ float h0, h1, h2, h3;
+ const float apos_off_x= gpu_offset_x - axis_position ;
+ const float apos_off_y= gpu_offset_y - axis_position ;
+ float acorr05;
+ float res0 = 0, res1 = 0, res2 = 0, res3 = 0;
+
+ const float bx00 = (32 * bidx + 2 * tidx + 0 + apos_off_x ) ;
+ const float by00 = (32 * bidy + 2 * tidy + 0 + apos_off_y ) ;
+
+ int read=0;
+ for(int proj=0; proj<num_proj; proj++) {
+ if(proj>=read) {
+ barrier(CLK_LOCAL_MEM_FENCE);
+ int ip = tidy*16+tidx;
+ if( read+ip < num_proj) {
+ sh_cos [ip] = d_cos_s[read+ip] ;
+ sh_sin [ip] = d_sin_s[read+ip] ;
+ sh_axis[ip] = d_axis_s[read+ip] ;
+ }
+ read=read+256; // 256=16*16 block size
+ barrier(CLK_LOCAL_MEM_FENCE);
+ }
+ pcos = sh_cos[256-read + proj] ;
+ psin = sh_sin[256-read + proj] ;
+
+ acorr05 = sh_axis[256 - read + proj] ;
+
+ h0 = (acorr05 + bx00*pcos - by00*psin);
+ h1 = (acorr05 + (bx00+0)*pcos - (by00+1)*psin);
+ h2 = (acorr05 + (bx00+1)*pcos - (by00+0)*psin);
+ h3 = (acorr05 + (bx00+1)*pcos - (by00+1)*psin);
+
+
+ float x;
+ int ym, xm, xp;
+ ym = proj;
+ float2 vals;
+
+ if(h0>=0 && h0<num_bins) {
+ x = CLIP_MAX(h0, num_bins);
+ FLOORCEIL_x(x);
+ vals = ADJACENT_PIXELS_VALS(d_sino, num_bins, ym, xm, xp);
+ res0 += linear_interpolation(vals, x, xm, xp);
+ }
+ if(h1>=0 && h1<num_bins) {
+ x = CLIP_MAX(h1, num_bins);
+ FLOORCEIL_x(x);
+ vals = ADJACENT_PIXELS_VALS(d_sino, num_bins, ym, xm, xp);
+ res1 += linear_interpolation(vals, x, xm, xp);
+ }
+ if(h2>=0 && h2<num_bins) {
+ x = CLIP_MAX(h2, num_bins);
+ FLOORCEIL_x(x);
+ vals = ADJACENT_PIXELS_VALS(d_sino, num_bins, ym, xm, xp);
+ res2 += linear_interpolation(vals, x, xm, xp);
+ }
+ if(h3>=0 && h3<num_bins) {
+ x = CLIP_MAX(h3, num_bins);
+ FLOORCEIL_x(x);
+ vals = ADJACENT_PIXELS_VALS(d_sino, num_bins, ym, xm, xp);
+ res3 += linear_interpolation(vals, x, xm, xp);
+ }
+ }
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 0] = res0;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 0] = res1;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 1] = res2;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 1] = res3;
+}
+
+
+
+
+
+
+
+/*******************************************************************************/
+/************************** OLD STUFF, for tinkering **************************/
+/*******************************************************************************/
+
+
+
+
+/// arr(xm, ym), arr(xm, yp), arr(xp, yp), arr(xp, ym)
+//~ #define ADJACENT_PIXELS_VALS2(arr, Nx, xm, xp, ym, yp) ((float4) (arr[ym*Nx + xm], arr[yp*Nx + xm], arr[yp*Nx + xp], arr[ym*Nx + xp]))
+
+
+/** xm, xp, ym, yp **/
+//~ #define ADJACENT_PIXELS_COORDS(x, y) ((int4)((int) floor(x), (int) ceil(x), (int) floor(y), (int) ceil(y)))
+
+/**
+ (xm, ym) (xp, ym)
+ (x, y)
+ (xm, yp) (xp, yp)
+**/
+/// arr(xm, ym), arr(xm, yp), arr(xp, yp), arr(xp, ym)
+//~ #define ADJACENT_PIXELS_VALS(arr, Nx, coords) ((float4) (arr[coords.s2*Nx + coords.s0], arr[coords.s3*Nx + coords.s0], arr[coords.s3*Nx + coords.s1], arr[coords.s2*Nx + coords.s1]))
+
+
+/** xm, xp **/
+//~ #define ADJACENT_PIXELS_COORDS2(x) ((int2)((int) floor(x), (int) ceil(x)))
+
+
+
+/*
+float bilinear_interpolation(
+ float x, // x position in the image
+ float y, // y position in the image
+ int Nx, // image width
+ int Ny, // image height
+ int4 adj_coords,
+ float4 adj_vals
+) {
+ float val;
+ float tol = 0.001f; // CHECKME
+ val = y - adj_coords.s2;
+ if ((x - adj_coords.s0) < tol && (y - adj_coords.s2) < tol) val = adj_vals.s0;
+ else if ((adj_coords.s1 - x) < tol && (adj_coords.s3 - y) < tol) val = adj_vals.s2;
+ else {
+ // Mirror - TODO: clamp ?
+ if (adj_coords.s0 < 0) adj_coords.s0 = 0;
+ if (adj_coords.s1 >= Nx) adj_coords.s1 = Nx - 1;
+ if (adj_coords.s2 < 0) adj_coords.s2 = 0;
+ if (adj_coords.s3 >= Ny) adj_coords.s3 = Ny -1;
+ if (adj_coords.s0 >= Nx) adj_coords.s0 = Nx - 1;
+ if (adj_coords.s2 >= Ny) adj_coords.s2 = Ny -1;
+ // Interp
+ val = adj_vals.s1*(adj_coords.s1-x)*(y-adj_coords.s2)
+ + adj_vals.s2 *(x-adj_coords.s0)*(y-adj_coords.s2)
+ + adj_vals.s0 *(adj_coords.s1-x)*(adj_coords.s3-y)
+ + adj_vals.s3 *(x-adj_coords.s0)*(adj_coords.s3-y);
+
+ }
+ return val;
+}
+*/
+
+
+/*
+__kernel void backproj_cpu_kernel_good(
+ int num_proj,
+ int num_bins,
+ float axis_position,
+ __global float *d_SLICE,
+ __global float* d_sino,
+ float gpu_offset_x,
+ float gpu_offset_y,
+ __global float * d_cos_s, // precalculated cos(theta[i])
+ __global float * d_sin_s, // precalculated sin(theta[i])
+ __global float * d_axis_s, // array of axis positions (n_projs)
+ __local float* shared2) // 768B of local mem
+{
+ const int tidx = get_local_id(0); //threadIdx.x;
+ const int bidx = get_group_id(0); //blockIdx.x;
+ const int tidy = get_local_id(1); //threadIdx.y;
+ const int bidy = get_group_id(1); //blockIdx.y;
+
+ //~ __local float shared[768];
+ //~ float * sh_sin = shared;
+ //~ float * sh_cos = shared+256;
+ //~ float * sh_axis = sh_cos+256;
+
+ __local float sh_cos[256];
+ __local float sh_sin[256];
+ __local float sh_axis[256];
+
+ float pcos, psin;
+ float h0, h1, h2, h3;
+ const float apos_off_x= gpu_offset_x - axis_position ;
+ const float apos_off_y= gpu_offset_y - axis_position ;
+ float acorr05;
+ float res0 = 0, res1 = 0, res2 = 0, res3 = 0;
+
+ const float bx00 = (32 * bidx + 2 * tidx + 0 + apos_off_x ) ;
+ const float by00 = (32 * bidy + 2 * tidy + 0 + apos_off_y ) ;
+
+ int read=0;
+ for(int proj=0; proj<num_proj; proj++) {
+ if(proj>=read) {
+ barrier(CLK_LOCAL_MEM_FENCE);
+ int ip = tidy*16+tidx;
+ if( read+ip < num_proj) {
+ sh_cos [ip] = d_cos_s[read+ip] ;
+ sh_sin [ip] = d_sin_s[read+ip] ;
+ sh_axis[ip] = d_axis_s[read+ip] ;
+ }
+ read=read+256; // 256=16*16 block size
+ barrier(CLK_LOCAL_MEM_FENCE);
+ }
+ pcos = sh_cos[256-read + proj] ;
+ psin = sh_sin[256-read + proj] ;
+
+ acorr05 = sh_axis[256 - read + proj] ;
+
+ h0 = (acorr05 + bx00*pcos - by00*psin);
+ h1 = (acorr05 + (bx00+0)*pcos - (by00+1)*psin);
+ h2 = (acorr05 + (bx00+1)*pcos - (by00+0)*psin);
+ h3 = (acorr05 + (bx00+1)*pcos - (by00+1)*psin);
+
+
+ float x, val;
+ float tol = 0.001f; // CHECKME
+ float y = proj + 0.5f;
+ int ym = (int) floor(y);
+ int yp = (int) ceil(y);
+ int xm, xp;
+
+ //
+ int i0, i1, j0, j1;
+ float d0, d1, x0, x1, y0, y1;
+ d0 = fmin(fmax(proj+0*0.5f, 0.0f), (num_proj - 1.0f));
+ x0 = floor(d0);
+ x1 = ceil(d0);
+ i0 = (int) x0;
+ i1 = (int) x1;
+
+ if(h0>=0 && h0<num_bins) {
+ d1 = fmin(fmax(h0+0*0.5f, 0.0f), (num_bins - 1.0f));
+ y0 = floor(d1);
+ y1 = ceil(d1);
+ j0 = (int) y0;
+ j1 = (int) y1;
+
+ if ((i0 == i1) && (j0 == j1))
+ val = d_sino[i0*num_bins + j0]; //self.data[i0, j0]
+ else if (i0 == i1)
+ val = (d_sino[i0*num_bins + j0] * (y1 - d1)) + (d_sino[i0*num_bins + j1] * (d1 - y0)); // self.data[i0, j0], self.data[i0, j1]
+ else if (j0 == j1)
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0)) + (d_sino[i1*num_bins + j0] * (d0 - x0)); // i0, j0 ; i1, j0
+ else
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0) * (y1 - d1)) // i0, j0
+ + (d_sino[i1*num_bins + j0] * (d0 - x0) * (y1 - d1)) // i1, j0
+ + (d_sino[i0*num_bins + j1] * (x1 - d0) * (d1 - y0)) // i0, j1
+ + (d_sino[i1*num_bins + j1] * (d0 - x0) * (d1 - y0)); // i1, j1
+
+ res0 += val;
+ }
+ if(h1>=0 && h1<num_bins) {
+ //~ int4 coords = ADJACENT_PIXELS_COORDS(h1 +0.5f, proj +0.5f);
+ //~ res1 += bilinear_interpolation(h1 +0.5f, proj +0.5f, num_bins, num_proj, coords, ADJACENT_PIXELS_VALS(d_sino, num_bins, coords)); //tex2D(texProjes,h1 +0.5f,proj +0.5f);
+ d1 = fmin(fmax(h1+0*0.5f, 0.0f), (num_bins - 1.0f));
+ y0 = floor(d1);
+ y1 = ceil(d1);
+ j0 = (int) y0;
+ j1 = (int) y1;
+
+ if ((i0 == i1) && (j0 == j1))
+ val = d_sino[i0*num_bins + j0]; //self.data[i0, j0]
+ else if (i0 == i1)
+ val = (d_sino[i0*num_bins + j0] * (y1 - d1)) + (d_sino[i0*num_bins + j1] * (d1 - y0)); // self.data[i0, j0], self.data[i0, j1]
+ else if (j0 == j1)
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0)) + (d_sino[i1*num_bins + j0] * (d0 - x0)); // i0, j0 ; i1, j0
+ else
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0) * (y1 - d1)) // i0, j0
+ + (d_sino[i1*num_bins + j0] * (d0 - x0) * (y1 - d1)) // i1, j0
+ + (d_sino[i0*num_bins + j1] * (x1 - d0) * (d1 - y0)) // i0, j1
+ + (d_sino[i1*num_bins + j1] * (d0 - x0) * (d1 - y0)); // i1, j1
+
+
+ res1 += val;
+ }
+ if(h2>=0 && h2<num_bins) {
+ //~ int4 coords = ADJACENT_PIXELS_COORDS(h2 +0.5f, proj +0.5f);
+ //~ res2 += 0; //bilinear_interpolation(h2 +0.5f, proj +0.5f, num_bins, num_proj, coords, ADJACENT_PIXELS_VALS(d_sino, num_bins, coords)); //tex2D(texProjes,h2 +0.5f,proj +0.5f);
+ d1 = fmin(fmax(h2+0*0.5f, 0.0f), (num_bins - 1.0f));
+ y0 = floor(d1);
+ y1 = ceil(d1);
+ j0 = (int) y0;
+ j1 = (int) y1;
+
+ if ((i0 == i1) && (j0 == j1))
+ val = d_sino[i0*num_bins + j0]; //self.data[i0, j0]
+ else if (i0 == i1)
+ val = (d_sino[i0*num_bins + j0] * (y1 - d1)) + (d_sino[i0*num_bins + j1] * (d1 - y0)); // self.data[i0, j0], self.data[i0, j1]
+ else if (j0 == j1)
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0)) + (d_sino[i1*num_bins + j0] * (d0 - x0)); // i0, j0 ; i1, j0
+ else
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0) * (y1 - d1)) // i0, j0
+ + (d_sino[i1*num_bins + j0] * (d0 - x0) * (y1 - d1)) // i1, j0
+ + (d_sino[i0*num_bins + j1] * (x1 - d0) * (d1 - y0)) // i0, j1
+ + (d_sino[i1*num_bins + j1] * (d0 - x0) * (d1 - y0)); // i1, j1
+
+ res2+= val;
+ }
+ if(h3>=0 && h3<num_bins) {
+ //~ int4 coords = ADJACENT_PIXELS_COORDS(h3 +0.5f, proj +0.5f);
+ //~ res3 += 0; //bilinear_interpolation(h3 +0.5f, proj +0.5f, num_bins, num_proj, coords, ADJACENT_PIXELS_VALS(d_sino, num_bins, coords)); //tex2D(texProjes,h3 +0.5f,proj +0.5f);
+ d1 = fmin(fmax(h3+0*0.5f, 0.0f), (num_bins - 1.0f));
+ y0 = floor(d1);
+ y1 = ceil(d1);
+ j0 = (int) y0;
+ j1 = (int) y1;
+
+ if ((i0 == i1) && (j0 == j1))
+ val = d_sino[i0*num_bins + j0]; //self.data[i0, j0]
+ else if (i0 == i1)
+ val = (d_sino[i0*num_bins + j0] * (y1 - d1)) + (d_sino[i0*num_bins + j1] * (d1 - y0)); // self.data[i0, j0], self.data[i0, j1]
+ else if (j0 == j1)
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0)) + (d_sino[i1*num_bins + j0] * (d0 - x0)); // i0, j0 ; i1, j0
+ else
+ val = (d_sino[i0*num_bins + j0] * (x1 - d0) * (y1 - d1)) // i0, j0
+ + (d_sino[i1*num_bins + j0] * (d0 - x0) * (y1 - d1)) // i1, j0
+ + (d_sino[i0*num_bins + j1] * (x1 - d0) * (d1 - y0)) // i0, j1
+ + (d_sino[i1*num_bins + j1] * (d0 - x0) * (d1 - y0)); // i1, j1
+
+ res3 += val;
+ }
+ }
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 0] = res0;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 0] = res1;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+0) + bidx*32 + tidx*2 + 1] = res2;
+ d_SLICE[ 32*get_num_groups(0)*(bidy*32+tidy*2+1) + bidx*32 + tidx*2 + 1] = res3;
+}
+*/
+
+
+
+
diff --git a/silx/resources/opencl/backproj_helper.cl b/silx/resources/opencl/backproj_helper.cl
new file mode 100644
index 0000000..b1590f8
--- /dev/null
+++ b/silx/resources/opencl/backproj_helper.cl
@@ -0,0 +1,68 @@
+/*
+ * Project: silx: backprojection helper functions
+ *
+ * Copyright (C) 2016-2017 European Synchrotron Radiation Facility
+ * Grenoble, France
+ *
+ * Principal authors: P. Paleo
+ * J. Kieffer (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.
+ */
+
+
+kernel void mult( global float2* d_sino,
+ global float2* d_filter,
+ int num_bins,
+ int num_projs)
+{
+ int gid0 = get_global_id(0);
+ int gid1 = get_global_id(1);
+ if (gid0 < num_bins && gid1 < num_projs)
+ {
+ // d_sino[gid1*num_bins+gid0] *= d_filter[gid0];
+ d_sino[gid1*num_bins+gid0].x *= d_filter[gid0].x;
+ d_sino[gid1*num_bins+gid0].y *= d_filter[gid0].x;
+ }
+}
+
+// copy only the real part of the valid data to the real array
+kernel void cpy2d_c2r(
+ global float* d_sino,
+ global float2* d_sino_complex,
+ int num_bins,
+ int num_projs,
+ int fft_size)
+{
+ int gid0 = get_global_id(0);
+ int gid1 = get_global_id(1);
+ if (gid0 < num_bins && gid1 < num_projs) {
+ d_sino[gid1*num_bins+gid0] = d_sino_complex[gid1*fft_size+gid0].x;
+ }
+}
+
+
+
+
+
+
+
diff --git a/silx/resources/opencl/linalg.cl b/silx/resources/opencl/linalg.cl
new file mode 100644
index 0000000..82a76eb
--- /dev/null
+++ b/silx/resources/opencl/linalg.cl
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2017 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.
+ *
+ */
+
+/**
+ *
+ * Compute the spatial gradient of an image.
+ *
+ * slice: input image
+ * slice_grad: output gradient
+ * sizeX: number of columns of the image
+ * sizeY: number of rows of the image
+ *
+ **/
+__kernel void kern_gradient2D(
+ __global float* slice,
+ __global float2* slice_grad,
+ int sizeX,
+ int sizeY)
+{
+
+ uint gidx = get_global_id(0);
+ uint gidy = get_global_id(1);
+ float val_x = 0, val_y = 0;
+
+ if (gidx < sizeX && gidy < sizeY) {
+ if (gidx == sizeX-1) val_y = 0;
+ else val_y = slice[(gidy)*sizeX+gidx+1] - slice[(gidy)*sizeX+gidx];
+ if (gidy == sizeY-1) val_x = 0;
+ else val_x = slice[(gidy+1)*sizeX+gidx] - slice[(gidy)*sizeX+gidx];
+
+ slice_grad[(gidy)*sizeX+gidx].x = val_x;
+ slice_grad[(gidy)*sizeX+gidx].y = val_y;
+ }
+}
+
+/**
+ *
+ * Compute the spatial divergence of an image gradient.
+ *
+ * slice_grad: input gradient-like image
+ * slice: output image
+ * sizeX: number of columns of the input
+ * sizeY: number of rows of the input
+ *
+ **/
+__kernel void kern_divergence2D(
+ __global float2* slice_grad,
+ __global float* slice,
+ int sizeX,
+ int sizeY)
+{
+ uint gidx = get_global_id(0);
+ uint gidy = get_global_id(1);
+ float val_x = 0, val_y = 0;
+
+ if (gidx < sizeX && gidy < sizeY) {
+ if (gidx == 0) val_y = slice_grad[(gidy)*sizeX+gidx].y;
+ else val_y = slice_grad[(gidy)*sizeX+gidx].y - slice_grad[(gidy)*sizeX+gidx-1].y;
+ if (gidy == 0) val_x = slice_grad[(gidy)*sizeX+gidx].x;
+ else val_x = slice_grad[(gidy)*sizeX+gidx].x - slice_grad[(gidy-1)*sizeX+gidx].x;
+ slice[(gidy)*sizeX+gidx] = val_x + val_y;
+ }
+}
+
+
+
+
diff --git a/silx/resources/opencl/proj.cl b/silx/resources/opencl/proj.cl
new file mode 100644
index 0000000..afc58ff
--- /dev/null
+++ b/silx/resources/opencl/proj.cl
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) 2017-2017 European Synchrotron Radiation Facility
+ * Grenoble, France
+ *
+ * Based on the projector of PyHST2 - https://forge.epn-campus.eu/projects/pyhst2
+ *
+ * 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.
+ *
+ */
+
+/*******************************************************************************/
+/************************ GPU VERSION (with textures) **************************/
+/*******************************************************************************/
+
+
+kernel void forward_kernel(
+ global float *d_Sino,
+ read_only image2d_t d_slice,
+ int dimslice,
+ int num_bins,
+ global float* angles_per_project ,
+ float axis_position,
+ global float *d_axis_corrections,
+ global int* d_beginPos ,
+ global int* d_strideJoseph,
+ global int* d_strideLine ,
+ int num_projections,
+ int dimrecx,
+ int dimrecy,
+ float cpu_offset_x,
+ float cpu_offset_y,
+ int josephnoclip,
+ int normalize)
+{
+ const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR;
+ const int tidx = get_local_id(0);
+ const int bidx = get_group_id(0);
+ const int tidy = get_local_id(1);
+ const int bidy = get_group_id(1);
+ float angle;
+ float cos_angle,sin_angle ;
+
+ local float corrections[16];
+ local int beginPos[16*2];
+ local int strideJoseph[16*2];
+ local int strideLine[16*2];
+
+ // thread will use corrections[tidy]
+ // All are read by first warp
+ int offset, OFFSET;
+ switch(tidy) {
+ case 0:
+ corrections[ tidx ]= d_axis_corrections[ bidy*16+tidx];
+ break;
+ case 1:
+ case 2:
+ offset = 16*(tidy-1);
+ OFFSET = dimrecy*(tidy-1);
+ beginPos [offset + tidx ]= d_beginPos[ OFFSET+ bidy*16+tidx] ;
+ break;
+ case 3:
+ case 4:
+ offset = 16*(tidy-3);
+ OFFSET = dimrecy*(tidy-3);
+ strideJoseph[offset + tidx ]= d_strideJoseph[OFFSET + bidy*16+tidx] ;
+ break;
+ case 5:
+ case 6:
+ offset = 16*(tidy-5);
+ OFFSET = dimrecy*(tidy-5);
+ strideLine[offset + tidx ]= d_strideLine[OFFSET + bidy*16+tidx] ;
+ break;
+ }
+ barrier(CLK_LOCAL_MEM_FENCE);
+
+ angle = angles_per_project[ bidy*16+tidy ] ;
+ cos_angle = cos(angle);
+ sin_angle = sin(angle);
+
+ if(fabs(cos_angle) > 0.70710678f ) {
+ if( cos_angle>0) {
+ cos_angle = cos(angle);
+ sin_angle = sin(angle);
+ }
+ else {
+ cos_angle = -cos(angle);
+ sin_angle = -sin(angle);
+ }
+ }
+ else {
+ if( sin_angle>0) {
+ cos_angle = sin(angle);
+ sin_angle = -cos(angle);
+ }
+ else {
+ cos_angle = -sin(angle);
+ sin_angle = cos(angle);
+ }
+ }
+ float res=0.0f;
+ float axis_corr = axis_position + corrections[ tidy ];
+ float axis = axis_position ;
+ float xpix = ( bidx*16+tidx )-cpu_offset_x;
+ float posx = axis*(1.0f-sin_angle/cos_angle ) +(xpix-(axis_corr) )/cos_angle ;
+
+ float shiftJ = sin_angle/cos_angle;
+ float x1 = min(-sin_angle/cos_angle ,0.f);
+ float x2 = max(-sin_angle/cos_angle ,0.f);
+
+ float Area;
+ Area=1.0f/cos_angle;
+ int stlA, stlB , stlAJ, stlBJ ;
+ stlA=strideLine[16+tidy];
+ stlB=strideLine[tidy];
+ stlAJ=strideJoseph[16+tidy];
+ stlBJ=strideJoseph[tidy];
+
+ int beginA = beginPos[16+tidy ];
+ int beginB = beginPos[tidy ];
+ float add;
+ int l;
+
+ if(josephnoclip) {
+ for(int j=0; j<dimslice; j++) { // j: Joseph
+ x1 = beginA +(posx)*stlA + (j)*stlAJ+1.5f;
+ x2 = beginB +(posx)*stlB + (j)*stlBJ+1.5f;
+ add = read_imagef(d_slice, sampler, (float2) (x1, x2)).x; // add = tex2D(texSlice, x1,x2);
+ res += add;
+ posx += shiftJ;
+ }
+ }
+ else {
+ for(int j=0; j<dimslice; j++) { // j: Joseph
+ x1 = beginA +(posx)*stlA + (j)*stlAJ+1.5f;
+ x2 = beginB +(posx)*stlB + (j)*stlBJ+1.5f;
+ l = (x1>=0.0f )*(x1<(dimslice+2))*( x2>=0.0f)*( x2<(dimslice+2) ) ;
+ add = read_imagef(d_slice, sampler, (float2) (x1, x2)).x; // add = tex2D(texSlice, x1,x2);
+ res += add*l;
+ posx += shiftJ;
+ }
+ }
+
+ if((bidy*16 + tidy) < num_projections && (bidx*16 + tidx) < num_bins) {
+ res *= Area;
+ if (normalize)
+ res *= M_PI_F * 0.5f / num_projections;
+ d_Sino[dimrecx*(bidy*16 + tidy) + (bidx*16 + tidx)] = res;
+ }
+}
+
+
+
+/*******************************************************************************/
+/********************* CPU VERSION (without textures) **************************/
+/*******************************************************************************/
+
+
+kernel void forward_kernel_cpu(
+ global float *d_Sino,
+ global float* d_slice,
+ int dimslice,
+ int num_bins,
+ global float* angles_per_project ,
+ float axis_position,
+ global float *d_axis_corrections,
+ global int* d_beginPos ,
+ global int* d_strideJoseph,
+ global int* d_strideLine ,
+ int num_projections,
+ int dimrecx,
+ int dimrecy,
+ float cpu_offset_x,
+ float cpu_offset_y,
+ int josephnoclip,
+ int normalize)
+{
+
+ const int tidx = get_local_id(0);
+ const int bidx = get_group_id(0);
+ const int tidy = get_local_id(1);
+ const int bidy = get_group_id(1);
+ float angle;
+ float cos_angle,sin_angle ;
+
+ local float corrections[16];
+ local int beginPos[16*2];
+ local int strideJoseph[16*2];
+ local int strideLine[16*2];
+
+ // thread will use corrections[tidy]
+ // All are read by first warp
+ int offset, OFFSET;
+ switch(tidy) {
+ case 0:
+ corrections[ tidx ]= d_axis_corrections[ bidy*16+tidx];
+ break;
+ case 1:
+ case 2:
+ offset = 16*(tidy-1);
+ OFFSET = dimrecy*(tidy-1);
+ beginPos [offset + tidx ]= d_beginPos[ OFFSET+ bidy*16+tidx] ;
+ break;
+ case 3:
+ case 4:
+ offset = 16*(tidy-3);
+ OFFSET = dimrecy*(tidy-3);
+ strideJoseph[offset + tidx ]= d_strideJoseph[OFFSET + bidy*16+tidx] ;
+ break;
+ case 5:
+ case 6:
+ offset = 16*(tidy-5);
+ OFFSET = dimrecy*(tidy-5);
+ strideLine[offset + tidx ]= d_strideLine[OFFSET + bidy*16+tidx] ;
+ break;
+ }
+ barrier(CLK_LOCAL_MEM_FENCE);
+
+ angle = angles_per_project[ bidy*16+tidy ] ;
+ cos_angle = cos(angle);
+ sin_angle = sin(angle);
+
+ if(fabs(cos_angle) > 0.70710678f ) {
+ if( cos_angle>0) {
+ cos_angle = cos(angle);
+ sin_angle = sin(angle);
+ }
+ else {
+ cos_angle = -cos(angle);
+ sin_angle = -sin(angle);
+ }
+ }
+ else {
+ if( sin_angle>0) {
+ cos_angle = sin(angle);
+ sin_angle = -cos(angle);
+ }
+ else {
+ cos_angle = -sin(angle);
+ sin_angle = cos(angle);
+ }
+ }
+ float res=0.0f;
+ float axis_corr = axis_position + corrections[ tidy ];
+ float axis = axis_position ;
+ float xpix = ( bidx*16+tidx )-cpu_offset_x;
+ float posx = axis*(1.0f-sin_angle/cos_angle ) +(xpix-(axis_corr) )/cos_angle ;
+
+ float shiftJ = sin_angle/cos_angle;
+ float x1 = min(-sin_angle/cos_angle ,0.f);
+ float x2 = max(-sin_angle/cos_angle ,0.f);
+
+ float Area;
+ Area=1.0f/cos_angle;
+ int stlA, stlB , stlAJ, stlBJ ;
+ stlA=strideLine[16+tidy];
+ stlB=strideLine[tidy];
+ stlAJ=strideJoseph[16+tidy];
+ stlBJ=strideJoseph[tidy];
+
+ int beginA = beginPos[16+tidy ];
+ int beginB = beginPos[tidy ];
+ int l;
+
+ int ym, yp, xm, xp;
+ float yc, xc;
+ float val;
+ if(josephnoclip) {
+ for(int j=0; j<dimslice; j++) { // j: Joseph
+ x1 = beginA +(posx)*stlA + (j)*stlAJ+1.0f;
+ x2 = beginB +(posx)*stlB + (j)*stlBJ+1.0f;
+ /*
+ Bilinear interpolation
+ */
+ yc = fmin(fmax(x2, 0.0f), ((dimslice+2) - 1.0f)); // y_clipped
+ ym = (int) floor(yc); // y_minus
+ yp = (int) ceil(yc); // y_plus
+
+ xc = fmin(fmax(x1, 0.0f), ((dimslice+2) - 1.0f)); // x_clipped
+ xm = (int) floor(xc); // x_minus
+ xp = (int) ceil(xc); // x_plus
+
+ if ((ym == yp) && (xm == xp)) val = d_slice[ym*(dimslice+2) + xm];
+ else if (ym == yp) val = (d_slice[ym*(dimslice+2) + xm] * (xp - xc)) + (d_slice[ym*(dimslice+2) + xp] * (xc - xm));
+ else if (xm == xp) val = (d_slice[ym*(dimslice+2) + xm] * (yp - yc)) + (d_slice[yp*(dimslice+2) + xm] * (yc - ym));
+ else val = (d_slice[ym*(dimslice+2) + xm] * (yp - yc) * (xp - xc))
+ + (d_slice[yp*(dimslice+2) + xm] * (yc - ym) * (xp - xc))
+ + (d_slice[ym*(dimslice+2) + xp] * (yp - yc) * (xc - xm))
+ + (d_slice[yp*(dimslice+2) + xp] * (yc - ym) * (xc - xm));
+ // ----------
+ res += val;
+ posx += shiftJ;
+ }
+ }
+ else {
+ for(int j=0; j<dimslice; j++) { // j: Joseph
+ x1 = beginA +(posx)*stlA + (j)*stlAJ+1.5f;
+ x2 = beginB +(posx)*stlB + (j)*stlBJ+1.5f;
+ l = (x1>=0.0f )*(x1<(dimslice+2))*( x2>=0.0f)*( x2<(dimslice+2) ) ;
+ /*
+ Bilinear interpolation
+ */
+ yc = fmin(fmax(x2, 0.0f), ((dimslice+2) - 1.0f)); // y_clipped
+ ym = (int) floor(yc); // y_minus
+ yp = (int) ceil(yc); // y_plus
+
+ xc = fmin(fmax(x1, 0.0f), ((dimslice+2) - 1.0f)); // x_clipped
+ xm = (int) floor(xc); // x_minus
+ xp = (int) ceil(xc); // x_plus
+
+ if ((ym == yp) && (xm == xp)) val = d_slice[ym*(dimslice+2) + xm];
+ else if (ym == yp) val = (d_slice[ym*(dimslice+2) + xm] * (xp - xc)) + (d_slice[ym*(dimslice+2) + xp] * (xc - xm));
+ else if (xm == xp) val = (d_slice[ym*(dimslice+2) + xm] * (yp - yc)) + (d_slice[yp*(dimslice+2) + xm] * (yc - ym));
+ else val = (d_slice[ym*(dimslice+2) + xm] * (yp - yc) * (xp - xc))
+ + (d_slice[yp*(dimslice+2) + xm] * (yc - ym) * (xp - xc))
+ + (d_slice[ym*(dimslice+2) + xp] * (yp - yc) * (xc - xm))
+ + (d_slice[yp*(dimslice+2) + xp] * (yc - ym) * (xc - xm));
+ // ----------
+ res += val*l;
+ posx += shiftJ;
+ }
+ }
+
+ if((bidy*16 + tidy) < num_projections && (bidx*16 + tidx) < num_bins) {
+ res *= Area;
+ if (normalize)
+ res *= M_PI_F * 0.5f / num_projections;
+ d_Sino[dimrecx*(bidy*16 + tidy) + (bidx*16 + tidx)] = res;
+ }
+}
diff --git a/silx/sx/__init__.py b/silx/sx/__init__.py
index 55fa40e..87bfb9e 100644
--- a/silx/sx/__init__.py
+++ b/silx/sx/__init__.py
@@ -44,6 +44,10 @@ import sys as _sys
_logger = logging.getLogger(__name__)
+# Init logging when used from the console
+if hasattr(_sys, 'ps1'):
+ logging.basicConfig()
+
# Probe ipython
try:
from IPython import get_ipython as _get_ipython
diff --git a/silx/sx/_plot.py b/silx/sx/_plot.py
index e672b1a..e81e57e 100644
--- a/silx/sx/_plot.py
+++ b/silx/sx/_plot.py
@@ -27,7 +27,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "26/04/2017"
+__date__ = "27/06/2017"
import logging
@@ -35,6 +35,7 @@ import numpy
from ..gui.plot import Plot1D, Plot2D
from ..gui.plot.Colors import COLORDICT
+from ..gui.plot.Colormap import Colormap
from silx.third_party import six
@@ -114,9 +115,9 @@ def plot(*args, **kwargs):
if 'title' in kwargs:
plt.setGraphTitle(kwargs['title'])
if 'xlabel' in kwargs:
- plt.setGraphXLabel(kwargs['xlabel'])
+ plt.getXAxis().setLabel(kwargs['xlabel'])
if 'ylabel' in kwargs:
- plt.setGraphYLabel(kwargs['ylabel'])
+ plt.getYAxis().setLabel(kwargs['ylabel'])
color = kwargs.get('color')
linestyle = kwargs.get('linestyle')
@@ -196,7 +197,7 @@ def plot(*args, **kwargs):
return plt
-def imshow(data=None, cmap=None, norm='linear',
+def imshow(data=None, cmap=None, norm=Colormap.LINEAR,
vmin=None, vmax=None,
aspect=False,
origin=(0., 0.), scale=(1., 1.),
@@ -235,21 +236,17 @@ def imshow(data=None, cmap=None, norm='linear',
"""
plt = Plot2D()
plt.setGraphTitle(title)
- plt.setGraphXLabel(xlabel)
- plt.setGraphYLabel(ylabel)
+ plt.getXAxis().setLabel(xlabel)
+ plt.getYAxis().setLabel(ylabel)
# Update default colormap with input parameters
colormap = plt.getDefaultColormap()
if cmap is not None:
- colormap['name'] = cmap
- assert norm in ('linear', 'log')
- colormap['normalization'] = norm
- if vmin is not None:
- colormap['vmin'] = vmin
- if vmax is not None:
- colormap['vmax'] = vmax
- if vmin is not None and vmax is not None:
- colormap['autoscale'] = False
+ colormap.setName(cmap)
+ assert norm in Colormap.NORMALIZATIONS
+ colormap.setNormalization(norm)
+ colormap.setVMin(vmin)
+ colormap.setVMax(vmax)
plt.setDefaultColormap(colormap)
# Handle aspect
diff --git a/silx/test/__init__.py b/silx/test/__init__.py
index 01ee8d1..0a85fe2 100644
--- a/silx/test/__init__.py
+++ b/silx/test/__init__.py
@@ -32,7 +32,7 @@ It will skip all tests from :mod:`silx.test.gui`.
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "20/04/2017"
+__date__ = "22/06/2017"
import logging
@@ -53,6 +53,7 @@ def suite():
from ..gui import test as test_gui
from ..utils import test as test_utils
from ..opencl import test as test_ocl
+ from ..app import test as test_app
test_suite = unittest.TestSuite()
# test sx first cause qui tests load ipython module
test_suite.addTest(test_sx.suite())
@@ -61,11 +62,12 @@ def suite():
test_suite.addTest(test_utils.suite())
test_suite.addTest(test_version.suite())
test_suite.addTest(test_resources.suite())
- test_suite.addTest(test_utils.suite())
test_suite.addTest(test_io.suite())
test_suite.addTest(test_math.suite())
test_suite.addTest(test_image.suite())
test_suite.addTest(test_ocl.suite())
+ test_suite.addTest(test_app.suite())
+
return test_suite
diff --git a/silx/test/test_resources.py b/silx/test/test_resources.py
index 9d3e277..eaf65c1 100644
--- a/silx/test/test_resources.py
+++ b/silx/test/test_resources.py
@@ -26,17 +26,52 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "20/04/2017"
+__date__ = "06/09/2017"
import os
import unittest
+import shutil
+import tempfile
+from silx.third_party import six
import silx.resources
from .utils import utilstest
+import socket
class TestResources(unittest.TestCase):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestResources, cls).setUpClass()
+
+ cls.tmpDirectory = tempfile.mkdtemp(prefix="resource_")
+ os.mkdir(os.path.join(cls.tmpDirectory, "gui"))
+ destination_dir = os.path.join(cls.tmpDirectory, "gui", "icons")
+ os.mkdir(destination_dir)
+ source = silx.resources.resource_filename("gui/icons/zoom-in.png")
+ destination = os.path.join(destination_dir, "foo.png")
+ shutil.copy(source, destination)
+ source = silx.resources.resource_filename("gui/icons/zoom-out.svg")
+ destination = os.path.join(destination_dir, "close.png")
+ shutil.copy(source, destination)
+
+ @classmethod
+ def tearDownClass(cls):
+ super(TestResources, cls).tearDownClass()
+ shutil.rmtree(cls.tmpDirectory)
+
+ def setUp(self):
+ # Store the original configuration
+ self._oldResources = dict(silx.resources._RESOURCE_DIRECTORIES)
+ unittest.TestCase.setUp(self)
+
+ def tearDown(self):
+ unittest.TestCase.tearDown(self)
+ # Restiture the original configuration
+ silx.resources._RESOURCE_DIRECTORIES = self._oldResources
+
def test_resource_dir(self):
"""Get a resource directory"""
icons_dirname = silx.resources.resource_filename('gui/icons/')
@@ -52,44 +87,179 @@ class TestResources(unittest.TestCase):
filename = silx.resources.resource_filename('non_existent_file.txt')
self.assertFalse(os.path.exists(filename))
+ def test_isdir(self):
+ self.assertTrue(silx.resources.is_dir('gui/icons'))
+
+ def test_not_isdir(self):
+ self.assertFalse(silx.resources.is_dir('gui/icons/colormap.png'))
+
+ def test_list_dir(self):
+ result = silx.resources.list_dir('gui/icons')
+ self.assertTrue(len(result) > 10)
+
+ # With prefixed resources
+
+ def test_resource_dir_with_prefix(self):
+ """Get a resource directory"""
+ icons_dirname = silx.resources.resource_filename('silx:gui/icons/')
+ self.assertTrue(os.path.isdir(icons_dirname))
+
+ def test_resource_file_with_prefix(self):
+ """Get a resource file name"""
+ filename = silx.resources.resource_filename('silx:gui/icons/colormap.png')
+ self.assertTrue(os.path.isfile(filename))
+
+ def test_resource_nonexistent_with_prefix(self):
+ """Get a non existent resource"""
+ filename = silx.resources.resource_filename('silx:non_existent_file.txt')
+ self.assertFalse(os.path.exists(filename))
+
+ def test_isdir_with_prefix(self):
+ self.assertTrue(silx.resources.is_dir('silx:gui/icons'))
+
+ def test_not_isdir_with_prefix(self):
+ self.assertFalse(silx.resources.is_dir('silx:gui/icons/colormap.png'))
+
+ def test_list_dir_with_prefix(self):
+ result = silx.resources.list_dir('silx:gui/icons')
+ self.assertTrue(len(result) > 10)
+
+ # Test new repository
+
+ def test_repository_not_exists(self):
+ """The resource from 'test' is available"""
+ self.assertRaises(ValueError, silx.resources.resource_filename, 'test:foo.png')
+
+ def test_adding_test_directory(self):
+ """The resource from 'test' is available"""
+ silx.resources.register_resource_directory("test", "silx.test.resources", forced_path=self.tmpDirectory)
+ path = silx.resources.resource_filename('test:gui/icons/foo.png')
+ self.assertTrue(os.path.exists(path))
+
+ def test_adding_test_directory_no_override(self):
+ """The resource from 'silx' is still available"""
+ silx.resources.register_resource_directory("test", "silx.test.resources", forced_path=self.tmpDirectory)
+ filename1 = silx.resources.resource_filename('gui/icons/close.png')
+ filename2 = silx.resources.resource_filename('silx:gui/icons/close.png')
+ filename3 = silx.resources.resource_filename('test:gui/icons/close.png')
+ self.assertTrue(os.path.isfile(filename1))
+ self.assertTrue(os.path.isfile(filename2))
+ self.assertTrue(os.path.isfile(filename3))
+ self.assertEqual(filename1, filename2)
+ self.assertNotEqual(filename1, filename3)
+
+ def test_adding_test_directory_non_existing(self):
+ """A resource while not exists in test is not available anyway it exists
+ in silx"""
+ silx.resources.register_resource_directory("test", "silx.test.resources", forced_path=self.tmpDirectory)
+ resource_name = "gui/icons/colormap.png"
+ path = silx.resources.resource_filename('test:' + resource_name)
+ path2 = silx.resources.resource_filename('silx:' + resource_name)
+ self.assertFalse(os.path.exists(path))
+ self.assertTrue(os.path.exists(path2))
+
+
+class TestResourcesWithoutPkgResources(TestResources):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestResourcesWithoutPkgResources, cls).setUpClass()
+ cls._old = silx.resources.pkg_resources
+ silx.resources.pkg_resources = None
+
+ @classmethod
+ def tearDownClass(cls):
+ silx.resources.pkg_resources = cls._old
+ del cls._old
+ super(TestResourcesWithoutPkgResources, cls).tearDownClass()
+
+
+class TestResourcesWithCustomDirectory(TestResources):
+
+ @classmethod
+ def setUpClass(cls):
+ super(TestResourcesWithCustomDirectory, cls).setUpClass()
+ cls._old = silx.resources._RESOURCES_DIR
+ base = os.path.dirname(silx.resources.__file__)
+ silx.resources._RESOURCES_DIR = base
+
+ @classmethod
+ def tearDownClass(cls):
+ silx.resources._RESOURCES_DIR = cls._old
+ del cls._old
+ super(TestResourcesWithCustomDirectory, cls).tearDownClass()
+
+
+def isSilxWebsiteAvailable():
+ try:
+ six.moves.urllib.request.urlopen('http://www.silx.org', timeout=1)
+ return True
+ except six.moves.urllib.error.URLError:
+ return False
+ except socket.timeout:
+ # This exception is still received in Python 2.7
+ return False
+
class TestExternalResources(unittest.TestCase):
- "This is a test for the TestResources"
+ """This is a test for the ExternalResources"""
+
+ @classmethod
+ def setUpClass(cls):
+ if not isSilxWebsiteAvailable():
+ raise unittest.SkipTest("Network or silx website not available")
+
+ def setUp(self):
+ self.utilstest = silx.resources.ExternalResources("toto", "http://www.silx.org/pub/silx/")
+
+ def tearDown(self):
+ if self.utilstest.data_home:
+ shutil.rmtree(self.utilstest.data_home)
+ self.utilstest = None
+
def test_tempdir(self):
"test the temporary directory creation"
- myutilstest = silx.resources.ExternalResources("toto", "http://www.silx.org")
- d = myutilstest.tempdir
+ d = self.utilstest.tempdir
self.assertTrue(os.path.isdir(d))
- self.assertEqual(d, myutilstest.tempdir, 'tmpdir is stable')
- myutilstest.clean_up()
+ self.assertEqual(d, self.utilstest.tempdir, 'tmpdir is stable')
+ self.utilstest.clean_up()
self.assertFalse(os.path.isdir(d))
- e = myutilstest.tempdir
+ e = self.utilstest.tempdir
self.assertTrue(os.path.isdir(e))
- self.assertEqual(e, myutilstest.tempdir, 'tmpdir is stable')
+ self.assertEqual(e, self.utilstest.tempdir, 'tmpdir is stable')
self.assertNotEqual(d, e, "tempdir changed")
- myutilstest.clean_up()
+ self.utilstest.clean_up()
def test_download(self):
"test the download from silx.org"
- f = utilstest.getfile("lena.png")
+ f = self.utilstest.getfile("lena.png")
self.assertTrue(os.path.exists(f))
- f = utilstest.getdir("source.tar.gz")
- self.assertTrue(os.path.isfile(f))
- self.assertTrue(os.path.isdir(f[:-7]))
+ di = utilstest.getdir("source.tar.gz")
+ for fi in di:
+ self.assertTrue(os.path.exists(fi))
- def test_dowload_all(self):
+ def test_download_all(self):
"test the download of all files from silx.org"
- l = utilstest.download_all()
- self.assertGreater(len(l), 1, "At least 2 items were downloaded")
+ filename = self.utilstest.getfile("lena.png")
+ directory = "source.tar.gz"
+ _filelist = self.utilstest.getdir(directory)
+ # download file and remove it to create a json mapping file
+ os.remove(filename)
+ directory_path = os.path.join(self.utilstest.data_home, "source")
+ shutil.rmtree(directory_path)
+ directory_path = os.path.join(self.utilstest.data_home, directory)
+ os.remove(directory_path)
+ filelist = self.utilstest.download_all()
+ self.assertGreater(len(filelist), 1, "At least 2 items were downloaded")
def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
test_suite = unittest.TestSuite()
- test_suite.addTest(
- unittest.defaultTestLoader.loadTestsFromTestCase(TestResources))
- test_suite.addTest(TestExternalResources("test_tempdir"))
- test_suite.addTest(TestExternalResources("test_download")) # order matters !
- test_suite.addTest(TestExternalResources("test_dowload_all"))
+ test_suite.addTest(loadTests(TestResources))
+ test_suite.addTest(loadTests(TestResourcesWithoutPkgResources))
+ test_suite.addTest(loadTests(TestResourcesWithCustomDirectory))
+ test_suite.addTest(loadTests(TestExternalResources))
return test_suite
diff --git a/silx/test/utils.py b/silx/test/utils.py
index ec86a2a..44eb899 100644
--- a/silx/test/utils.py
+++ b/silx/test/utils.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2016 European Synchrotron Radiation Facility
+# Copyright (c) 2016-2017 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
@@ -34,7 +34,7 @@
__authors__ = ["T. Vincent"]
__license__ = "MIT"
-__date__ = "20/04/2017"
+__date__ = "03/08/2017"
import os
@@ -48,7 +48,7 @@ import tempfile
import unittest
from ..resources import ExternalResources
-logger = logging.getLogger(__name__)
+_logger = logging.getLogger(__name__)
utilstest = ExternalResources(project="silx",
url_base="http://www.silx.org/pub/silx/",
@@ -149,11 +149,15 @@ class TestLogging(logging.Handler):
self.records = [] # Reset recorded LogRecords
self.logger.addHandler(self)
self.logger.propagate = False
+ # ensure no log message is ignored
+ self.entry_level = self.logger.level * 1
+ self.logger.setLevel(logging.DEBUG)
def __exit__(self, exc_type, exc_value, traceback):
"""Context (i.e., with) support"""
self.logger.removeHandler(self)
self.logger.propagate = True
+ self.logger.setLevel(self.entry_level)
for level, expected_count in self.count_by_level.items():
if expected_count is None:
diff --git a/silx/third_party/_local/enum.py b/silx/third_party/_local/enum.py
new file mode 100644
index 0000000..e15724f
--- /dev/null
+++ b/silx/third_party/_local/enum.py
@@ -0,0 +1,877 @@
+# coding: utf-8
+
+# enum34 is the new Python stdlib enum module available in Python 3.4
+# backported for previous versions of Python from 2.4 to 3.3.
+# tested on 2.6, 2.7, and 3.3+
+#
+# Downloaded from: https://pypi.python.org/pypi/enum34
+#
+# Copyright (c) 2013, Ethan Furman.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# Redistributions of source code must retain the above
+# copyright notice, this list of conditions and the
+# following disclaimer.
+#
+# Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials
+# provided with the distribution.
+#
+# Neither the name Ethan Furman nor the names of any
+# contributors may be used to endorse or promote products
+# derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+"""Python Enumerations"""
+
+import sys as _sys
+
+__all__ = ['Enum', 'IntEnum', 'unique']
+
+version = 1, 1, 6
+
+pyver = float('%s.%s' % _sys.version_info[:2])
+
+try:
+ any
+except NameError:
+ def any(iterable):
+ for element in iterable:
+ if element:
+ return True
+ return False
+
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None
+
+try:
+ basestring
+except NameError:
+ # In Python 2 basestring is the ancestor of both str and unicode
+ # in Python 3 it's just str, but was missing in 3.1
+ basestring = str
+
+try:
+ unicode
+except NameError:
+ # In Python 3 unicode no longer exists (it's just str)
+ unicode = str
+
+class _RouteClassAttributeToGetattr(object):
+ """Route attribute access on a class to __getattr__.
+
+ This is a descriptor, used to define attributes that act differently when
+ accessed through an instance and through a class. Instance access remains
+ normal, but access to an attribute through a class will be routed to the
+ class's __getattr__ method; this is done by raising AttributeError.
+
+ """
+ def __init__(self, fget=None):
+ self.fget = fget
+
+ def __get__(self, instance, ownerclass=None):
+ if instance is None:
+ raise AttributeError()
+ return self.fget(instance)
+
+ def __set__(self, instance, value):
+ raise AttributeError("can't set attribute")
+
+ def __delete__(self, instance):
+ raise AttributeError("can't delete attribute")
+
+
+def _is_descriptor(obj):
+ """Returns True if obj is a descriptor, False otherwise."""
+ return (
+ hasattr(obj, '__get__') or
+ hasattr(obj, '__set__') or
+ hasattr(obj, '__delete__'))
+
+
+def _is_dunder(name):
+ """Returns True if a __dunder__ name, False otherwise."""
+ return (name[:2] == name[-2:] == '__' and
+ name[2:3] != '_' and
+ name[-3:-2] != '_' and
+ len(name) > 4)
+
+
+def _is_sunder(name):
+ """Returns True if a _sunder_ name, False otherwise."""
+ return (name[0] == name[-1] == '_' and
+ name[1:2] != '_' and
+ name[-2:-1] != '_' and
+ len(name) > 2)
+
+
+def _make_class_unpicklable(cls):
+ """Make the given class un-picklable."""
+ def _break_on_call_reduce(self, protocol=None):
+ raise TypeError('%r cannot be pickled' % self)
+ cls.__reduce_ex__ = _break_on_call_reduce
+ cls.__module__ = '<unknown>'
+
+
+class _EnumDict(dict):
+ """Track enum member order and ensure member names are not reused.
+
+ EnumMeta will use the names found in self._member_names as the
+ enumeration member names.
+
+ """
+ def __init__(self):
+ super(_EnumDict, self).__init__()
+ self._member_names = []
+
+ def __setitem__(self, key, value):
+ """Changes anything not dundered or not a descriptor.
+
+ If a descriptor is added with the same name as an enum member, the name
+ is removed from _member_names (this may leave a hole in the numerical
+ sequence of values).
+
+ If an enum member name is used twice, an error is raised; duplicate
+ values are not checked for.
+
+ Single underscore (sunder) names are reserved.
+
+ Note: in 3.x __order__ is simply discarded as a not necessary piece
+ leftover from 2.x
+
+ """
+ if pyver >= 3.0 and key in ('_order_', '__order__'):
+ return
+ elif key == '__order__':
+ key = '_order_'
+ if _is_sunder(key):
+ if key != '_order_':
+ raise ValueError('_names_ are reserved for future Enum use')
+ elif _is_dunder(key):
+ pass
+ elif key in self._member_names:
+ # descriptor overwriting an enum?
+ raise TypeError('Attempted to reuse key: %r' % key)
+ elif not _is_descriptor(value):
+ if key in self:
+ # enum overwriting a descriptor?
+ raise TypeError('Key already defined as: %r' % self[key])
+ self._member_names.append(key)
+ super(_EnumDict, self).__setitem__(key, value)
+
+
+# Dummy value for Enum as EnumMeta explicity checks for it, but of course until
+# EnumMeta finishes running the first time the Enum class doesn't exist. This
+# is also why there are checks in EnumMeta like `if Enum is not None`
+Enum = None
+
+
+class EnumMeta(type):
+ """Metaclass for Enum"""
+ @classmethod
+ def __prepare__(metacls, cls, bases):
+ return _EnumDict()
+
+ def __new__(metacls, cls, bases, classdict):
+ # an Enum class is final once enumeration items have been defined; it
+ # cannot be mixed with other types (int, float, etc.) if it has an
+ # inherited __new__ unless a new __new__ is defined (or the resulting
+ # class will fail).
+ if type(classdict) is dict:
+ original_dict = classdict
+ classdict = _EnumDict()
+ for k, v in original_dict.items():
+ classdict[k] = v
+
+ member_type, first_enum = metacls._get_mixins_(bases)
+ __new__, save_new, use_args = metacls._find_new_(classdict, member_type,
+ first_enum)
+ # save enum items into separate mapping so they don't get baked into
+ # the new class
+ members = dict((k, classdict[k]) for k in classdict._member_names)
+ for name in classdict._member_names:
+ del classdict[name]
+
+ # py2 support for definition order
+ _order_ = classdict.get('_order_')
+ if _order_ is None:
+ if pyver < 3.0:
+ try:
+ _order_ = [name for (name, value) in sorted(members.items(), key=lambda item: item[1])]
+ except TypeError:
+ _order_ = [name for name in sorted(members.keys())]
+ else:
+ _order_ = classdict._member_names
+ else:
+ del classdict['_order_']
+ if pyver < 3.0:
+ _order_ = _order_.replace(',', ' ').split()
+ aliases = [name for name in members if name not in _order_]
+ _order_ += aliases
+
+ # check for illegal enum names (any others?)
+ invalid_names = set(members) & set(['mro'])
+ if invalid_names:
+ raise ValueError('Invalid enum member name(s): %s' % (
+ ', '.join(invalid_names), ))
+
+ # save attributes from super classes so we know if we can take
+ # the shortcut of storing members in the class dict
+ base_attributes = set([a for b in bases for a in b.__dict__])
+ # create our new Enum type
+ enum_class = super(EnumMeta, metacls).__new__(metacls, cls, bases, classdict)
+ enum_class._member_names_ = [] # names in random order
+ if OrderedDict is not None:
+ enum_class._member_map_ = OrderedDict()
+ else:
+ enum_class._member_map_ = {} # name->value map
+ enum_class._member_type_ = member_type
+
+ # Reverse value->name map for hashable values.
+ enum_class._value2member_map_ = {}
+
+ # instantiate them, checking for duplicates as we go
+ # we instantiate first instead of checking for duplicates first in case
+ # a custom __new__ is doing something funky with the values -- such as
+ # auto-numbering ;)
+ if __new__ is None:
+ __new__ = enum_class.__new__
+ for member_name in _order_:
+ value = members[member_name]
+ if not isinstance(value, tuple):
+ args = (value, )
+ else:
+ args = value
+ if member_type is tuple: # special case for tuple enums
+ args = (args, ) # wrap it one more time
+ if not use_args or not args:
+ enum_member = __new__(enum_class)
+ if not hasattr(enum_member, '_value_'):
+ enum_member._value_ = value
+ else:
+ enum_member = __new__(enum_class, *args)
+ if not hasattr(enum_member, '_value_'):
+ enum_member._value_ = member_type(*args)
+ value = enum_member._value_
+ enum_member._name_ = member_name
+ enum_member.__objclass__ = enum_class
+ enum_member.__init__(*args)
+ # If another member with the same value was already defined, the
+ # new member becomes an alias to the existing one.
+ for name, canonical_member in enum_class._member_map_.items():
+ if canonical_member.value == enum_member._value_:
+ enum_member = canonical_member
+ break
+ else:
+ # Aliases don't appear in member names (only in __members__).
+ enum_class._member_names_.append(member_name)
+ # performance boost for any member that would not shadow
+ # a DynamicClassAttribute (aka _RouteClassAttributeToGetattr)
+ if member_name not in base_attributes:
+ setattr(enum_class, member_name, enum_member)
+ # now add to _member_map_
+ enum_class._member_map_[member_name] = enum_member
+ try:
+ # This may fail if value is not hashable. We can't add the value
+ # to the map, and by-value lookups for this value will be
+ # linear.
+ enum_class._value2member_map_[value] = enum_member
+ except TypeError:
+ pass
+
+
+ # If a custom type is mixed into the Enum, and it does not know how
+ # to pickle itself, pickle.dumps will succeed but pickle.loads will
+ # fail. Rather than have the error show up later and possibly far
+ # from the source, sabotage the pickle protocol for this class so
+ # that pickle.dumps also fails.
+ #
+ # However, if the new class implements its own __reduce_ex__, do not
+ # sabotage -- it's on them to make sure it works correctly. We use
+ # __reduce_ex__ instead of any of the others as it is preferred by
+ # pickle over __reduce__, and it handles all pickle protocols.
+ unpicklable = False
+ if '__reduce_ex__' not in classdict:
+ if member_type is not object:
+ methods = ('__getnewargs_ex__', '__getnewargs__',
+ '__reduce_ex__', '__reduce__')
+ if not any(m in member_type.__dict__ for m in methods):
+ _make_class_unpicklable(enum_class)
+ unpicklable = True
+
+
+ # double check that repr and friends are not the mixin's or various
+ # things break (such as pickle)
+ for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
+ class_method = getattr(enum_class, name)
+ obj_method = getattr(member_type, name, None)
+ enum_method = getattr(first_enum, name, None)
+ if name not in classdict and class_method is not enum_method:
+ if name == '__reduce_ex__' and unpicklable:
+ continue
+ setattr(enum_class, name, enum_method)
+
+ # method resolution and int's are not playing nice
+ # Python's less than 2.6 use __cmp__
+
+ if pyver < 2.6:
+
+ if issubclass(enum_class, int):
+ setattr(enum_class, '__cmp__', getattr(int, '__cmp__'))
+
+ elif pyver < 3.0:
+
+ if issubclass(enum_class, int):
+ for method in (
+ '__le__',
+ '__lt__',
+ '__gt__',
+ '__ge__',
+ '__eq__',
+ '__ne__',
+ '__hash__',
+ ):
+ setattr(enum_class, method, getattr(int, method))
+
+ # replace any other __new__ with our own (as long as Enum is not None,
+ # anyway) -- again, this is to support pickle
+ if Enum is not None:
+ # if the user defined their own __new__, save it before it gets
+ # clobbered in case they subclass later
+ if save_new:
+ setattr(enum_class, '__member_new__', enum_class.__dict__['__new__'])
+ setattr(enum_class, '__new__', Enum.__dict__['__new__'])
+ return enum_class
+
+ def __bool__(cls):
+ """
+ classes/types should always be True.
+ """
+ return True
+
+ def __call__(cls, value, names=None, module=None, type=None, start=1):
+ """Either returns an existing member, or creates a new enum class.
+
+ This method is used both when an enum class is given a value to match
+ to an enumeration member (i.e. Color(3)) and for the functional API
+ (i.e. Color = Enum('Color', names='red green blue')).
+
+ When used for the functional API: `module`, if set, will be stored in
+ the new class' __module__ attribute; `type`, if set, will be mixed in
+ as the first base class.
+
+ Note: if `module` is not set this routine will attempt to discover the
+ calling module by walking the frame stack; if this is unsuccessful
+ the resulting class will not be pickleable.
+
+ """
+ if names is None: # simple value lookup
+ return cls.__new__(cls, value)
+ # otherwise, functional API: we're creating a new Enum type
+ return cls._create_(value, names, module=module, type=type, start=start)
+
+ def __contains__(cls, member):
+ return isinstance(member, cls) and member.name in cls._member_map_
+
+ def __delattr__(cls, attr):
+ # nicer error message when someone tries to delete an attribute
+ # (see issue19025).
+ if attr in cls._member_map_:
+ raise AttributeError(
+ "%s: cannot delete Enum member." % cls.__name__)
+ super(EnumMeta, cls).__delattr__(attr)
+
+ def __dir__(self):
+ return (['__class__', '__doc__', '__members__', '__module__'] +
+ self._member_names_)
+
+ @property
+ def __members__(cls):
+ """Returns a mapping of member name->value.
+
+ This mapping lists all enum members, including aliases. Note that this
+ is a copy of the internal mapping.
+
+ """
+ return cls._member_map_.copy()
+
+ def __getattr__(cls, name):
+ """Return the enum member matching `name`
+
+ We use __getattr__ instead of descriptors or inserting into the enum
+ class' __dict__ in order to support `name` and `value` being both
+ properties for enum members (which live in the class' __dict__) and
+ enum members themselves.
+
+ """
+ if _is_dunder(name):
+ raise AttributeError(name)
+ try:
+ return cls._member_map_[name]
+ except KeyError:
+ raise AttributeError(name)
+
+ def __getitem__(cls, name):
+ return cls._member_map_[name]
+
+ def __iter__(cls):
+ return (cls._member_map_[name] for name in cls._member_names_)
+
+ def __reversed__(cls):
+ return (cls._member_map_[name] for name in reversed(cls._member_names_))
+
+ def __len__(cls):
+ return len(cls._member_names_)
+
+ __nonzero__ = __bool__
+
+ def __repr__(cls):
+ return "<enum %r>" % cls.__name__
+
+ def __setattr__(cls, name, value):
+ """Block attempts to reassign Enum members.
+
+ A simple assignment to the class namespace only changes one of the
+ several possible ways to get an Enum member from the Enum class,
+ resulting in an inconsistent Enumeration.
+
+ """
+ member_map = cls.__dict__.get('_member_map_', {})
+ if name in member_map:
+ raise AttributeError('Cannot reassign members.')
+ super(EnumMeta, cls).__setattr__(name, value)
+
+ def _create_(cls, class_name, names=None, module=None, type=None, start=1):
+ """Convenience method to create a new Enum class.
+
+ `names` can be:
+
+ * A string containing member names, separated either with spaces or
+ commas. Values are auto-numbered from 1.
+ * An iterable of member names. Values are auto-numbered from 1.
+ * An iterable of (member name, value) pairs.
+ * A mapping of member name -> value.
+
+ """
+ if pyver < 3.0:
+ # if class_name is unicode, attempt a conversion to ASCII
+ if isinstance(class_name, unicode):
+ try:
+ class_name = class_name.encode('ascii')
+ except UnicodeEncodeError:
+ raise TypeError('%r is not representable in ASCII' % class_name)
+ metacls = cls.__class__
+ if type is None:
+ bases = (cls, )
+ else:
+ bases = (type, cls)
+ classdict = metacls.__prepare__(class_name, bases)
+ _order_ = []
+
+ # special processing needed for names?
+ if isinstance(names, basestring):
+ names = names.replace(',', ' ').split()
+ if isinstance(names, (tuple, list)) and isinstance(names[0], basestring):
+ names = [(e, i+start) for (i, e) in enumerate(names)]
+
+ # Here, names is either an iterable of (name, value) or a mapping.
+ item = None # in case names is empty
+ for item in names:
+ if isinstance(item, basestring):
+ member_name, member_value = item, names[item]
+ else:
+ member_name, member_value = item
+ classdict[member_name] = member_value
+ _order_.append(member_name)
+ # only set _order_ in classdict if name/value was not from a mapping
+ if not isinstance(item, basestring):
+ classdict['_order_'] = ' '.join(_order_)
+ enum_class = metacls.__new__(metacls, class_name, bases, classdict)
+
+ # TODO: replace the frame hack if a blessed way to know the calling
+ # module is ever developed
+ if module is None:
+ try:
+ module = _sys._getframe(2).f_globals['__name__']
+ except (AttributeError, ValueError):
+ pass
+ if module is None:
+ _make_class_unpicklable(enum_class)
+ else:
+ enum_class.__module__ = module
+
+ return enum_class
+
+ @staticmethod
+ def _get_mixins_(bases):
+ """Returns the type for creating enum members, and the first inherited
+ enum class.
+
+ bases: the tuple of bases that was given to __new__
+
+ """
+ if not bases or Enum is None:
+ return object, Enum
+
+
+ # double check that we are not subclassing a class with existing
+ # enumeration members; while we're at it, see if any other data
+ # type has been mixed in so we can use the correct __new__
+ member_type = first_enum = None
+ for base in bases:
+ if (base is not Enum and
+ issubclass(base, Enum) and
+ base._member_names_):
+ raise TypeError("Cannot extend enumerations")
+ # base is now the last base in bases
+ if not issubclass(base, Enum):
+ raise TypeError("new enumerations must be created as "
+ "`ClassName([mixin_type,] enum_type)`")
+
+ # get correct mix-in type (either mix-in type of Enum subclass, or
+ # first base if last base is Enum)
+ if not issubclass(bases[0], Enum):
+ member_type = bases[0] # first data type
+ first_enum = bases[-1] # enum type
+ else:
+ for base in bases[0].__mro__:
+ # most common: (IntEnum, int, Enum, object)
+ # possible: (<Enum 'AutoIntEnum'>, <Enum 'IntEnum'>,
+ # <class 'int'>, <Enum 'Enum'>,
+ # <class 'object'>)
+ if issubclass(base, Enum):
+ if first_enum is None:
+ first_enum = base
+ else:
+ if member_type is None:
+ member_type = base
+
+ return member_type, first_enum
+
+ if pyver < 3.0:
+ @staticmethod
+ def _find_new_(classdict, member_type, first_enum):
+ """Returns the __new__ to be used for creating the enum members.
+
+ classdict: the class dictionary given to __new__
+ member_type: the data type whose __new__ will be used by default
+ first_enum: enumeration to check for an overriding __new__
+
+ """
+ # now find the correct __new__, checking to see of one was defined
+ # by the user; also check earlier enum classes in case a __new__ was
+ # saved as __member_new__
+ __new__ = classdict.get('__new__', None)
+ if __new__:
+ return None, True, True # __new__, save_new, use_args
+
+ N__new__ = getattr(None, '__new__')
+ O__new__ = getattr(object, '__new__')
+ if Enum is None:
+ E__new__ = N__new__
+ else:
+ E__new__ = Enum.__dict__['__new__']
+ # check all possibles for __member_new__ before falling back to
+ # __new__
+ for method in ('__member_new__', '__new__'):
+ for possible in (member_type, first_enum):
+ try:
+ target = possible.__dict__[method]
+ except (AttributeError, KeyError):
+ target = getattr(possible, method, None)
+ if target not in [
+ None,
+ N__new__,
+ O__new__,
+ E__new__,
+ ]:
+ if method == '__member_new__':
+ classdict['__new__'] = target
+ return None, False, True
+ if isinstance(target, staticmethod):
+ target = target.__get__(member_type)
+ __new__ = target
+ break
+ if __new__ is not None:
+ break
+ else:
+ __new__ = object.__new__
+
+ # if a non-object.__new__ is used then whatever value/tuple was
+ # assigned to the enum member name will be passed to __new__ and to the
+ # new enum member's __init__
+ if __new__ is object.__new__:
+ use_args = False
+ else:
+ use_args = True
+
+ return __new__, False, use_args
+ else:
+ @staticmethod
+ def _find_new_(classdict, member_type, first_enum):
+ """Returns the __new__ to be used for creating the enum members.
+
+ classdict: the class dictionary given to __new__
+ member_type: the data type whose __new__ will be used by default
+ first_enum: enumeration to check for an overriding __new__
+
+ """
+ # now find the correct __new__, checking to see of one was defined
+ # by the user; also check earlier enum classes in case a __new__ was
+ # saved as __member_new__
+ __new__ = classdict.get('__new__', None)
+
+ # should __new__ be saved as __member_new__ later?
+ save_new = __new__ is not None
+
+ if __new__ is None:
+ # check all possibles for __member_new__ before falling back to
+ # __new__
+ for method in ('__member_new__', '__new__'):
+ for possible in (member_type, first_enum):
+ target = getattr(possible, method, None)
+ if target not in (
+ None,
+ None.__new__,
+ object.__new__,
+ Enum.__new__,
+ ):
+ __new__ = target
+ break
+ if __new__ is not None:
+ break
+ else:
+ __new__ = object.__new__
+
+ # if a non-object.__new__ is used then whatever value/tuple was
+ # assigned to the enum member name will be passed to __new__ and to the
+ # new enum member's __init__
+ if __new__ is object.__new__:
+ use_args = False
+ else:
+ use_args = True
+
+ return __new__, save_new, use_args
+
+
+########################################################
+# In order to support Python 2 and 3 with a single
+# codebase we have to create the Enum methods separately
+# and then use the `type(name, bases, dict)` method to
+# create the class.
+########################################################
+temp_enum_dict = {}
+temp_enum_dict['__doc__'] = "Generic enumeration.\n\n Derive from this class to define new enumerations.\n\n"
+
+def __new__(cls, value):
+ # all enum instances are actually created during class construction
+ # without calling this method; this method is called by the metaclass'
+ # __call__ (i.e. Color(3) ), and by pickle
+ if type(value) is cls:
+ # For lookups like Color(Color.red)
+ value = value.value
+ #return value
+ # by-value search for a matching enum member
+ # see if it's in the reverse mapping (for hashable values)
+ try:
+ if value in cls._value2member_map_:
+ return cls._value2member_map_[value]
+ except TypeError:
+ # not there, now do long search -- O(n) behavior
+ for member in cls._member_map_.values():
+ if member.value == value:
+ return member
+ raise ValueError("%s is not a valid %s" % (value, cls.__name__))
+temp_enum_dict['__new__'] = __new__
+del __new__
+
+def __repr__(self):
+ return "<%s.%s: %r>" % (
+ self.__class__.__name__, self._name_, self._value_)
+temp_enum_dict['__repr__'] = __repr__
+del __repr__
+
+def __str__(self):
+ return "%s.%s" % (self.__class__.__name__, self._name_)
+temp_enum_dict['__str__'] = __str__
+del __str__
+
+if pyver >= 3.0:
+ def __dir__(self):
+ added_behavior = [
+ m
+ for cls in self.__class__.mro()
+ for m in cls.__dict__
+ if m[0] != '_' and m not in self._member_map_
+ ]
+ return (['__class__', '__doc__', '__module__', ] + added_behavior)
+ temp_enum_dict['__dir__'] = __dir__
+ del __dir__
+
+def __format__(self, format_spec):
+ # mixed-in Enums should use the mixed-in type's __format__, otherwise
+ # we can get strange results with the Enum name showing up instead of
+ # the value
+
+ # pure Enum branch
+ if self._member_type_ is object:
+ cls = str
+ val = str(self)
+ # mix-in branch
+ else:
+ cls = self._member_type_
+ val = self.value
+ return cls.__format__(val, format_spec)
+temp_enum_dict['__format__'] = __format__
+del __format__
+
+
+####################################
+# Python's less than 2.6 use __cmp__
+
+if pyver < 2.6:
+
+ def __cmp__(self, other):
+ if type(other) is self.__class__:
+ if self is other:
+ return 0
+ return -1
+ return NotImplemented
+ raise TypeError("unorderable types: %s() and %s()" % (self.__class__.__name__, other.__class__.__name__))
+ temp_enum_dict['__cmp__'] = __cmp__
+ del __cmp__
+
+else:
+
+ def __le__(self, other):
+ raise TypeError("unorderable types: %s() <= %s()" % (self.__class__.__name__, other.__class__.__name__))
+ temp_enum_dict['__le__'] = __le__
+ del __le__
+
+ def __lt__(self, other):
+ raise TypeError("unorderable types: %s() < %s()" % (self.__class__.__name__, other.__class__.__name__))
+ temp_enum_dict['__lt__'] = __lt__
+ del __lt__
+
+ def __ge__(self, other):
+ raise TypeError("unorderable types: %s() >= %s()" % (self.__class__.__name__, other.__class__.__name__))
+ temp_enum_dict['__ge__'] = __ge__
+ del __ge__
+
+ def __gt__(self, other):
+ raise TypeError("unorderable types: %s() > %s()" % (self.__class__.__name__, other.__class__.__name__))
+ temp_enum_dict['__gt__'] = __gt__
+ del __gt__
+
+
+def __eq__(self, other):
+ if type(other) is self.__class__:
+ return self is other
+ return NotImplemented
+temp_enum_dict['__eq__'] = __eq__
+del __eq__
+
+def __ne__(self, other):
+ if type(other) is self.__class__:
+ return self is not other
+ return NotImplemented
+temp_enum_dict['__ne__'] = __ne__
+del __ne__
+
+def __hash__(self):
+ return hash(self._name_)
+temp_enum_dict['__hash__'] = __hash__
+del __hash__
+
+def __reduce_ex__(self, proto):
+ return self.__class__, (self._value_, )
+temp_enum_dict['__reduce_ex__'] = __reduce_ex__
+del __reduce_ex__
+
+# _RouteClassAttributeToGetattr is used to provide access to the `name`
+# and `value` properties of enum members while keeping some measure of
+# protection from modification, while still allowing for an enumeration
+# to have members named `name` and `value`. This works because enumeration
+# members are not set directly on the enum class -- __getattr__ is
+# used to look them up.
+
+@_RouteClassAttributeToGetattr
+def name(self):
+ return self._name_
+temp_enum_dict['name'] = name
+del name
+
+@_RouteClassAttributeToGetattr
+def value(self):
+ return self._value_
+temp_enum_dict['value'] = value
+del value
+
+@classmethod
+def _convert(cls, name, module, filter, source=None):
+ """
+ Create a new Enum subclass that replaces a collection of global constants
+ """
+ # convert all constants from source (or module) that pass filter() to
+ # a new Enum called name, and export the enum and its members back to
+ # module;
+ # also, replace the __reduce_ex__ method so unpickling works in
+ # previous Python versions
+ module_globals = vars(_sys.modules[module])
+ if source:
+ source = vars(source)
+ else:
+ source = module_globals
+ members = dict((name, value) for name, value in source.items() if filter(name))
+ cls = cls(name, members, module=module)
+ cls.__reduce_ex__ = _reduce_ex_by_name
+ module_globals.update(cls.__members__)
+ module_globals[name] = cls
+ return cls
+temp_enum_dict['_convert'] = _convert
+del _convert
+
+Enum = EnumMeta('Enum', (object, ), temp_enum_dict)
+del temp_enum_dict
+
+# Enum has now been created
+###########################
+
+class IntEnum(int, Enum):
+ """Enum where members are also (and must be) ints"""
+
+def _reduce_ex_by_name(self, proto):
+ return self.name
+
+def unique(enumeration):
+ """Class decorator that ensures only unique members exist in an enumeration."""
+ duplicates = []
+ for name, member in enumeration.__members__.items():
+ if name != member.name:
+ duplicates.append((name, member.name))
+ if duplicates:
+ duplicate_names = ', '.join(
+ ["%s -> %s" % (alias, name) for (alias, name) in duplicates]
+ )
+ raise ValueError('duplicate names found in %r: %s' %
+ (enumeration, duplicate_names)
+ )
+ return enumeration
diff --git a/silx/third_party/enum.py b/silx/third_party/enum.py
new file mode 100644
index 0000000..adc5e68
--- /dev/null
+++ b/silx/third_party/enum.py
@@ -0,0 +1,51 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2017 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 `enum` package.
+
+The `enum` package is available in python>=3.4.
+
+Try to fill this module with the local copy of `enum` if it exists.
+Otherwise it expects to have the `enum` packaged installed in the Python path.
+
+It should be used like that:
+
+.. code-block::
+
+ from silx.third_party import enum
+
+"""
+
+from __future__ import absolute_import
+
+__authors__ = ["T. Vincent"]
+__license__ = "MIT"
+__date__ = "22/05/2017"
+
+try:
+ # try to import the local version
+ from ._local.enum import * # noqa
+except ImportError:
+ # else try to import it from the python path
+ from enum import * # noqa
diff --git a/silx/utils/decorators.py b/silx/utils/decorators.py
deleted file mode 100644
index ff70e38..0000000
--- a/silx/utils/decorators.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# coding: utf-8
-# /*##########################################################################
-#
-# Copyright (c) 2016-2017 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.
-#
-# ###########################################################################*/
-"""Bunch of useful decorators"""
-
-from __future__ import absolute_import, print_function, division
-
-__authors__ = ["Jerome Kieffer"]
-__license__ = "MIT"
-__date__ = "01/03/2017"
-
-import os
-import sys
-import traceback
-import logging
-import functools
-
-
-depreclog = logging.getLogger("DEPRECATION")
-
-
-def deprecated(func=None, reason=None, replacement=None, since_version=None):
- """
- Decorator that deprecates the use of a function
-
- :param str reason: Reason for deprecating this function
- (e.g. "feature no longer provided",
- :param str replacement: Name of replacement function (if the reason for
- deprecating was to rename the function)
- :param str since_version: First *silx* version for which the function was
- deprecated (e.g. "0.5.0").
- """
- def decorator(func):
- @functools.wraps(func)
- def wrapper(*args, **kwargs):
- name = func.func_name if sys.version_info[0] < 3 else func.__name__
- msg = "%s is deprecated"
- if since_version is not None:
- msg += " since silx version %s" % since_version
- msg += "!"
- if reason is not None:
- msg += " Reason: %s." % reason
- if replacement is not None:
- msg += " Use '%s' instead." % replacement
- depreclog.warning(msg + " %s", name, os.linesep.join([""] + traceback.format_stack()[:-1]))
- return func(*args, **kwargs)
- return wrapper
- if func is not None:
- return decorator(func)
- return decorator
diff --git a/silx/utils/deprecation.py b/silx/utils/deprecation.py
new file mode 100644
index 0000000..f1d2a79
--- /dev/null
+++ b/silx/utils/deprecation.py
@@ -0,0 +1,117 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Bunch of useful decorators"""
+
+from __future__ import absolute_import, print_function, division
+
+__authors__ = ["Jerome Kieffer", "H. Payno", "P. Knobel"]
+__license__ = "MIT"
+__date__ = "11/09/2017"
+
+import sys
+import logging
+import functools
+import traceback
+
+depreclog = logging.getLogger("silx.DEPRECATION")
+
+deprecache = set([])
+
+
+def deprecated(func=None, reason=None, replacement=None, since_version=None, only_once=True):
+ """
+ Decorator that deprecates the use of a function
+
+ :param str reason: Reason for deprecating this function
+ (e.g. "feature no longer provided",
+ :param str replacement: Name of replacement function (if the reason for
+ deprecating was to rename the function)
+ :param str since_version: First *silx* version for which the function was
+ deprecated (e.g. "0.5.0").
+ :param bool only_once: If true, the deprecation warning will only be
+ generated one time. Default is true.
+ """
+ def decorator(func):
+ @functools.wraps(func)
+ def wrapper(*args, **kwargs):
+ name = func.func_name if sys.version_info[0] < 3 else func.__name__
+
+ deprecated_warning(type_='Function',
+ name=name,
+ reason=reason,
+ replacement=replacement,
+ since_version=since_version,
+ only_once=only_once,
+ skip_backtrace_count=1)
+ return func(*args, **kwargs)
+ return wrapper
+ if func is not None:
+ return decorator(func)
+ return decorator
+
+
+def deprecated_warning(type_, name, reason=None, replacement=None,
+ since_version=None, only_once=True,
+ skip_backtrace_count=0):
+ """
+ Function to log a deprecation warning
+
+ :param str type_: Nature of the object to be deprecated:
+ "Module", "Function", "Class" ...
+ :param name: Object name.
+ :param str reason: Reason for deprecating this function
+ (e.g. "feature no longer provided",
+ :param str replacement: Name of replacement function (if the reason for
+ deprecating was to rename the function)
+ :param str since_version: First *silx* version for which the function was
+ deprecated (e.g. "0.5.0").
+ :param bool only_once: If true, the deprecation warning will only be
+ generated one time for each different call locations. Default is true.
+ :param int skip_backtrace_count: Amount of last backtrace to ignore when
+ logging the backtrace
+ """
+ if not depreclog.isEnabledFor(logging.WARNING):
+ # Avoid computation when it is not logged
+ return
+
+ msg = "%s %s is deprecated"
+ if since_version is not None:
+ msg += " since silx version %s" % since_version
+ msg += "."
+ if reason is not None:
+ msg += " Reason: %s." % reason
+ if replacement is not None:
+ msg += " Use '%s' instead." % replacement
+ msg += "\n%s"
+ limit = 2 + skip_backtrace_count
+ backtrace = "".join(traceback.format_stack(limit=limit)[0])
+ backtrace = backtrace.rstrip()
+ if only_once:
+ data = (msg, type_, name, backtrace)
+ if data in deprecache:
+ return
+ else:
+ deprecache.add(data)
+ depreclog.warning(msg, type_, name, backtrace)
diff --git a/silx/utils/proxy.py b/silx/utils/proxy.py
new file mode 100644
index 0000000..2633703
--- /dev/null
+++ b/silx/utils/proxy.py
@@ -0,0 +1,204 @@
+# coding: utf-8
+# /*##########################################################################
+#
+# Copyright (c) 2016-2017 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.
+#
+# ###########################################################################*/
+"""Module containing proxy objects"""
+
+from __future__ import absolute_import, print_function, division
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "02/10/2017"
+
+from silx.third_party import six
+
+
+class Proxy(object):
+ """Create a proxy of an object.
+
+ Provides default methods and property using :meth:`__getattr__` and special
+ method by redefining them one by one.
+ Special methods are defined as properties, as a result if the `obj` method
+ is not defined, the property code fail and the special method will not be
+ visible.
+ """
+
+ __slots__ = ["__obj", "__weakref__"]
+
+ def __init__(self, obj):
+ object.__setattr__(self, "_Proxy__obj", obj)
+
+ __class__ = property(lambda self: self.__obj.__class__)
+
+ def __getattr__(self, name):
+ return getattr(self.__obj, name)
+
+ __setattr__ = property(lambda self: self.__obj.__setattr__)
+ __delattr__ = property(lambda self: self.__obj.__delattr__)
+
+ # binary comparator methods
+
+ __lt__ = property(lambda self: self.__obj.__lt__)
+ __le__ = property(lambda self: self.__obj.__le__)
+ __eq__ = property(lambda self: self.__obj.__eq__)
+ __ne__ = property(lambda self: self.__obj.__ne__)
+ __gt__ = property(lambda self: self.__obj.__gt__)
+ __ge__ = property(lambda self: self.__obj.__ge__)
+
+ if six.PY2:
+ __cmp__ = property(lambda self: self.__obj.__cmp__)
+
+ # binary numeric methods
+
+ __add__ = property(lambda self: self.__obj.__add__)
+ __radd__ = property(lambda self: self.__obj.__radd__)
+ __iadd__ = property(lambda self: self.__obj.__iadd__)
+ __sub__ = property(lambda self: self.__obj.__sub__)
+ __rsub__ = property(lambda self: self.__obj.__rsub__)
+ __isub__ = property(lambda self: self.__obj.__isub__)
+ __mul__ = property(lambda self: self.__obj.__mul__)
+ __rmul__ = property(lambda self: self.__obj.__rmul__)
+ __imul__ = property(lambda self: self.__obj.__imul__)
+
+ if six.PY2:
+ # Only part of Python 2
+ # Python 3 uses __truediv__ and __floordiv__
+ __div__ = property(lambda self: self.__obj.__div__)
+ __rdiv__ = property(lambda self: self.__obj.__rdiv__)
+ __idiv__ = property(lambda self: self.__obj.__idiv__)
+
+ __truediv__ = property(lambda self: self.__obj.__truediv__)
+ __rtruediv__ = property(lambda self: self.__obj.__rtruediv__)
+ __itruediv__ = property(lambda self: self.__obj.__itruediv__)
+ __floordiv__ = property(lambda self: self.__obj.__floordiv__)
+ __rfloordiv__ = property(lambda self: self.__obj.__rfloordiv__)
+ __ifloordiv__ = property(lambda self: self.__obj.__ifloordiv__)
+ __mod__ = property(lambda self: self.__obj.__mod__)
+ __rmod__ = property(lambda self: self.__obj.__rmod__)
+ __imod__ = property(lambda self: self.__obj.__imod__)
+ __divmod__ = property(lambda self: self.__obj.__divmod__)
+ __rdivmod__ = property(lambda self: self.__obj.__rdivmod__)
+ __pow__ = property(lambda self: self.__obj.__pow__)
+ __rpow__ = property(lambda self: self.__obj.__rpow__)
+ __ipow__ = property(lambda self: self.__obj.__ipow__)
+ __lshift__ = property(lambda self: self.__obj.__lshift__)
+ __rlshift__ = property(lambda self: self.__obj.__rlshift__)
+ __ilshift__ = property(lambda self: self.__obj.__ilshift__)
+ __rshift__ = property(lambda self: self.__obj.__rshift__)
+ __rrshift__ = property(lambda self: self.__obj.__rrshift__)
+ __irshift__ = property(lambda self: self.__obj.__irshift__)
+
+ # binary logical methods
+
+ __and__ = property(lambda self: self.__obj.__and__)
+ __rand__ = property(lambda self: self.__obj.__rand__)
+ __iand__ = property(lambda self: self.__obj.__iand__)
+ __xor__ = property(lambda self: self.__obj.__xor__)
+ __rxor__ = property(lambda self: self.__obj.__rxor__)
+ __ixor__ = property(lambda self: self.__obj.__ixor__)
+ __or__ = property(lambda self: self.__obj.__or__)
+ __ror__ = property(lambda self: self.__obj.__ror__)
+ __ior__ = property(lambda self: self.__obj.__ior__)
+
+ # unary methods
+
+ __neg__ = property(lambda self: self.__obj.__neg__)
+ __pos__ = property(lambda self: self.__obj.__pos__)
+ __abs__ = property(lambda self: self.__obj.__abs__)
+ __invert__ = property(lambda self: self.__obj.__invert__)
+ if six.PY3:
+ __floor__ = property(lambda self: self.__obj.__floor__)
+ __ceil__ = property(lambda self: self.__obj.__ceil__)
+ __round__ = property(lambda self: self.__obj.__round__)
+
+ # cast
+
+ __repr__ = property(lambda self: self.__obj.__repr__)
+ __str__ = property(lambda self: self.__obj.__str__)
+ __complex__ = property(lambda self: self.__obj.__complex__)
+ __int__ = property(lambda self: self.__obj.__int__)
+ __float__ = property(lambda self: self.__obj.__float__)
+ __hash__ = property(lambda self: self.__obj.__hash__)
+ if six.PY2:
+ __long__ = property(lambda self: self.__obj.__long__)
+ __oct__ = property(lambda self: self.__obj.__oct__)
+ __hex__ = property(lambda self: self.__obj.__hex__)
+ __unicode__ = property(lambda self: self.__obj.__unicode__)
+ __nonzero__ = property(lambda self: lambda: bool(self.__obj))
+ if six.PY3:
+ __bytes__ = property(lambda self: self.__obj.__bytes__)
+ __bool__ = property(lambda self: lambda: bool(self.__obj))
+ __format__ = property(lambda self: self.__obj.__format__)
+
+ # container
+
+ __len__ = property(lambda self: self.__obj.__len__)
+ if six.PY3:
+ __length_hint__ = property(lambda self: self.__obj.__length_hint__)
+ __getitem__ = property(lambda self: self.__obj.__getitem__)
+ __missing__ = property(lambda self: self.__obj.__missing__)
+ __setitem__ = property(lambda self: self.__obj.__setitem__)
+ __delitem__ = property(lambda self: self.__obj.__delitem__)
+ __iter__ = property(lambda self: self.__obj.__iter__)
+ __reversed__ = property(lambda self: self.__obj.__reversed__)
+ __contains__ = property(lambda self: self.__obj.__contains__)
+
+ if six.PY2:
+ __getslice__ = property(lambda self: self.__obj.__getslice__)
+ __setslice__ = property(lambda self: self.__obj.__setslice__)
+ __delslice__ = property(lambda self: self.__obj.__delslice__)
+
+ # pickle
+
+ __reduce__ = property(lambda self: self.__obj.__reduce__)
+ __reduce_ex__ = property(lambda self: self.__obj.__reduce_ex__)
+
+ # async
+
+ if six.PY3:
+ __await__ = property(lambda self: self.__obj.__await__)
+ __aiter__ = property(lambda self: self.__obj.__aiter__)
+ __anext__ = property(lambda self: self.__obj.__anext__)
+ __aenter__ = property(lambda self: self.__obj.__aenter__)
+ __aexit__ = property(lambda self: self.__obj.__aexit__)
+
+ # other
+
+ __index__ = property(lambda self: self.__obj.__index__)
+ if six.PY2:
+ __coerce__ = property(lambda self: self.__obj.__coerce__)
+
+ if six.PY3:
+ __next__ = property(lambda self: self.__obj.__next__)
+
+ __enter__ = property(lambda self: self.__obj.__enter__)
+ __exit__ = property(lambda self: self.__obj.__exit__)
+
+ __concat__ = property(lambda self: self.__obj.__concat__)
+ __iconcat__ = property(lambda self: self.__obj.__iconcat__)
+
+ if six.PY2:
+ __repeat__ = property(lambda self: self.__obj.__repeat__)
+ __irepeat__ = property(lambda self: self.__obj.__irepeat__)
+
+ __call__ = property(lambda self: self.__obj.__call__)
diff --git a/silx/utils/test/__init__.py b/silx/utils/test/__init__.py
index 68e7412..14ce38d 100644
--- a/silx/utils/test/__init__.py
+++ b/silx/utils/test/__init__.py
@@ -24,20 +24,24 @@
# ###########################################################################*/
__authors__ = ["T. Vincent", "P. Knobel"]
__license__ = "MIT"
-__date__ = "03/04/2017"
+__date__ = "02/10/2017"
import unittest
-from .test_weakref import suite as test_weakref_suite
-from .test_html import suite as test_html_suite
-from .test_array_like import suite as test_array_like_suite
-from .test_launcher import suite as test_launcher_suite
+from . import test_weakref
+from . import test_html
+from . import test_array_like
+from . import test_launcher
+from . import test_deprecation
+from . import test_proxy
def suite():
test_suite = unittest.TestSuite()
- test_suite.addTest(test_weakref_suite())
- test_suite.addTest(test_html_suite())
- test_suite.addTest(test_array_like_suite())
- test_suite.addTest(test_launcher_suite())
+ test_suite.addTest(test_weakref.suite())
+ test_suite.addTest(test_html.suite())
+ test_suite.addTest(test_array_like.suite())
+ test_suite.addTest(test_launcher.suite())
+ test_suite.addTest(test_deprecation.suite())
+ test_suite.addTest(test_proxy.suite())
return test_suite
diff --git a/silx/utils/test/test_deprecation.py b/silx/utils/test/test_deprecation.py
new file mode 100644
index 0000000..b5c5de4
--- /dev/null
+++ b/silx/utils/test/test_deprecation.py
@@ -0,0 +1,107 @@
+# 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.
+#
+# ###########################################################################*/
+"""Tests for html module"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "11/09/2017"
+
+
+import unittest
+from .. import deprecation
+from silx.test import utils
+
+
+class TestDeprecation(unittest.TestCase):
+ """Tests for deprecation module."""
+
+ @deprecation.deprecated
+ def deprecatedWithoutParam(self):
+ pass
+
+ @deprecation.deprecated(reason="r", replacement="r", since_version="v")
+ def deprecatedWithParams(self):
+ pass
+
+ @deprecation.deprecated(reason="r", replacement="r", since_version="v", only_once=True)
+ def deprecatedOnlyOnce(self):
+ pass
+
+ @deprecation.deprecated(reason="r", replacement="r", since_version="v", only_once=False)
+ def deprecatedEveryTime(self):
+ pass
+
+ @utils.test_logging(deprecation.depreclog.name, warning=1)
+ def testAnnotationWithoutParam(self):
+ self.deprecatedWithoutParam()
+
+ @utils.test_logging(deprecation.depreclog.name, warning=1)
+ def testAnnotationWithParams(self):
+ self.deprecatedWithParams()
+
+ @utils.test_logging(deprecation.depreclog.name, warning=3)
+ def testLoggedEveryTime(self):
+ """Logged everytime cause it is 3 different locations"""
+ self.deprecatedOnlyOnce()
+ self.deprecatedOnlyOnce()
+ self.deprecatedOnlyOnce()
+
+ @utils.test_logging(deprecation.depreclog.name, warning=1)
+ def testLoggedSingleTime(self):
+ def log():
+ self.deprecatedOnlyOnce()
+ log()
+ log()
+ log()
+
+ @utils.test_logging(deprecation.depreclog.name, warning=3)
+ def testLoggedEveryTime2(self):
+ self.deprecatedEveryTime()
+ self.deprecatedEveryTime()
+ self.deprecatedEveryTime()
+
+ @utils.test_logging(deprecation.depreclog.name, warning=1)
+ def testWarning(self):
+ deprecation.deprecated_warning(type_="t", name="n")
+
+ def testBacktrace(self):
+ testLogging = utils.TestLogging(deprecation.depreclog.name)
+ with testLogging:
+ self.deprecatedEveryTime()
+ message = testLogging.records[0].getMessage()
+ filename = __file__.replace(".pyc", ".py")
+ self.assertTrue(filename in message)
+ self.assertTrue("testBacktrace" in message)
+
+
+def suite():
+ test_suite = unittest.TestSuite()
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite.addTest(loadTests(TestDeprecation))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/silx/utils/test/test_proxy.py b/silx/utils/test/test_proxy.py
new file mode 100644
index 0000000..081d3d4
--- /dev/null
+++ b/silx/utils/test/test_proxy.py
@@ -0,0 +1,295 @@
+# 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.
+#
+# ###########################################################################*/
+"""Tests for weakref module"""
+
+__authors__ = ["V. Valls"]
+__license__ = "MIT"
+__date__ = "02/10/2017"
+
+
+import unittest
+import pickle
+import numpy
+from ..proxy import Proxy
+
+
+class Thing(object):
+
+ def __init__(self, value):
+ self.value = value
+
+ def __getitem__(self, selection):
+ return selection + 1
+
+ def method(self, value):
+ return value + 2
+
+
+class InheritedProxy(Proxy):
+ """Inheriting the proxy allow to specialisze methods"""
+
+ def __init__(self, obj, value):
+ Proxy.__init__(self, obj)
+ self.value = value + 2
+
+ def __getitem__(self, selection):
+ return selection + 3
+
+ def method(self, value):
+ return value + 4
+
+
+class TestProxy(unittest.TestCase):
+ """Test that the proxy behave as expected"""
+
+ def text_init(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertTrue(isinstance(p, Thing))
+ self.assertTrue(isinstance(p, Proxy))
+
+ # methods and properties
+
+ def test_has_special_method(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertTrue(hasattr(p, "__getitem__"))
+
+ def test_missing_special_method(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertFalse(hasattr(p, "__and__"))
+
+ def test_method(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertEqual(p.method(10), obj.method(10))
+
+ def test_property(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertEqual(p.value, obj.value)
+
+ # special functions
+
+ def test_getitem(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ self.assertEqual(p[10], obj[10])
+
+ def test_setitem(self):
+ obj = numpy.array([10, 20, 30])
+ p = Proxy(obj)
+ p[0] = 20
+ self.assertEqual(obj[0], 20)
+
+ def test_slice(self):
+ obj = numpy.arange(20)
+ p = Proxy(obj)
+ expected = obj[0:10:2]
+ result = p[0:10:2]
+ self.assertEqual(list(result), list(expected))
+
+ # binary comparator methods
+
+ def test_lt(self):
+ obj = numpy.array([20])
+ p = Proxy(obj)
+ expected = obj < obj
+ result = p < p
+ self.assertEqual(result, expected)
+
+ # binary numeric methods
+
+ def test_add(self):
+ obj = numpy.array([20])
+ proxy = Proxy(obj)
+ expected = obj + obj
+ result = proxy + proxy
+ self.assertEqual(result, expected)
+
+ def test_iadd(self):
+ expected = numpy.array([20])
+ expected += 10
+ obj = numpy.array([20])
+ result = Proxy(obj)
+ result += 10
+ self.assertEqual(result, expected)
+
+ def test_radd(self):
+ obj = numpy.array([20])
+ p = Proxy(obj)
+ expected = 10 + obj
+ result = 10 + p
+ self.assertEqual(result, expected)
+
+ # binary logical methods
+
+ def test_and(self):
+ obj = numpy.array([20])
+ p = Proxy(obj)
+ expected = obj & obj
+ result = p & p
+ self.assertEqual(result, expected)
+
+ def test_iand(self):
+ expected = numpy.array([20])
+ expected &= 10
+ obj = numpy.array([20])
+ result = Proxy(obj)
+ result &= 10
+ self.assertEqual(result, expected)
+
+ def test_rand(self):
+ obj = numpy.array([20])
+ p = Proxy(obj)
+ expected = 10 & obj
+ result = 10 & p
+ self.assertEqual(result, expected)
+
+ # unary methods
+
+ def test_neg(self):
+ obj = numpy.array([20])
+ p = Proxy(obj)
+ expected = -obj
+ result = -p
+ self.assertEqual(result, expected)
+
+ def test_round(self):
+ obj = 20.5
+ p = Proxy(obj)
+ expected = round(obj)
+ result = round(p)
+ self.assertEqual(result, expected)
+
+ # cast
+
+ def test_bool(self):
+ obj = True
+ p = Proxy(obj)
+ if p:
+ pass
+ else:
+ self.fail()
+
+ def test_str(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ expected = str(obj)
+ result = str(p)
+ self.assertEqual(result, expected)
+
+ def test_repr(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ expected = repr(obj)
+ result = repr(p)
+ self.assertEqual(result, expected)
+
+ def test_text_bool(self):
+ obj = ""
+ p = Proxy(obj)
+ if p:
+ self.fail()
+ else:
+ pass
+
+ def test_text_str(self):
+ obj = "a"
+ p = Proxy(obj)
+ expected = str(obj)
+ result = str(p)
+ self.assertEqual(result, expected)
+
+ def test_text_repr(self):
+ obj = "a"
+ p = Proxy(obj)
+ expected = repr(obj)
+ result = repr(p)
+ self.assertEqual(result, expected)
+
+ def test_hash(self):
+ obj = [0, 1, 2]
+ p = Proxy(obj)
+ with self.assertRaises(TypeError):
+ hash(p)
+ obj = (0, 1, 2)
+ p = Proxy(obj)
+ hash(p)
+
+
+class TestInheritedProxy(unittest.TestCase):
+ """Test that inheriting the Proxy class behave as expected"""
+
+ # methods and properties
+
+ def test_method(self):
+ obj = Thing(10)
+ p = InheritedProxy(obj, 11)
+ self.assertEqual(p.method(10), 11 + 3)
+
+ def test_property(self):
+ obj = Thing(10)
+ p = InheritedProxy(obj, 11)
+ self.assertEqual(p.value, 11 + 2)
+
+ # special functions
+
+ def test_getitem(self):
+ obj = Thing(10)
+ p = InheritedProxy(obj, 11)
+ self.assertEqual(p[12], 12 + 3)
+
+
+class TestPickle(unittest.TestCase):
+
+ def test_dumps(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ expected = pickle.dumps(obj)
+ result = pickle.dumps(p)
+ self.assertEqual(result, expected)
+
+ def test_loads(self):
+ obj = Thing(10)
+ p = Proxy(obj)
+ obj2 = pickle.loads(pickle.dumps(p))
+ self.assertTrue(isinstance(obj2, Thing))
+ self.assertFalse(isinstance(obj2, Proxy))
+ self.assertEqual(obj.value, obj2.value)
+
+
+def suite():
+ loadTests = unittest.defaultTestLoader.loadTestsFromTestCase
+ test_suite = unittest.TestSuite()
+ test_suite.addTest(loadTests(TestProxy))
+ test_suite.addTest(loadTests(TestPickle))
+ test_suite.addTest(loadTests(TestInheritedProxy))
+ return test_suite
+
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='suite')
diff --git a/version.py b/version.py
index 10dbff1..db981cc 100644
--- a/version.py
+++ b/version.py
@@ -53,21 +53,21 @@ from __future__ import absolute_import, print_function, division
__authors__ = ["Jérôme Kieffer"]
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-__date__ = "15/09/2016"
+__date__ = "01/10/2017"
__status__ = "production"
__docformat__ = 'restructuredtext'
-__all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion", "calc_hexversion"]
-
+__all__ = ["date", "version_info", "strictversion", "hexversion", "debianversion",
+ "calc_hexversion", "citation"]
RELEASE_LEVEL_VALUE = {"dev": 0,
"alpha": 10,
"beta": 11,
- "gamma": 11,
- "rc": 12,
+ "gamma": 12,
+ "rc": 13,
"final": 15}
MAJOR = 0
-MINOR = 5
+MINOR = 6
MICRO = 0
RELEV = "final" # <16
SERIAL = 0 # <16
@@ -97,7 +97,7 @@ def calc_hexversion(major=0, minor=0, micro=0, releaselevel="dev", serial=0):
:param micro: integer
:param relev: integer or string
:param serial: integer
- :return: integerm always increasing with revision numbers
+ :return: integer always increasing with revision numbers
"""
try:
releaselevel = int(releaselevel)
@@ -114,5 +114,7 @@ def calc_hexversion(major=0, minor=0, micro=0, releaselevel="dev", serial=0):
hexversion = calc_hexversion(*version_info)
+citation = "doi:10.5281/zenodo.1000472"
+
if __name__ == "__main__":
print(version)